Commit 8041355a6de5b894850b050924b93a86ebd91c96

Authored by zhangzzzz
1 parent 14278650

印刷新增额外参数;

src/components/QuickQuote/index.jsx
@@ -274,7 +274,7 @@ const QuickQuoteEvent = props => { @@ -274,7 +274,7 @@ const QuickQuoteEvent = props => {
274 dProductQty: changeValue.dProductQty, 274 dProductQty: changeValue.dProductQty,
275 })); 275 }));
276 } 276 }
277 - 277 +
278 if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") { 278 if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") {
279 if (props.currentBoxModel) { 279 if (props.currentBoxModel) {
280 const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", ""); 280 const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", "");
@@ -1144,7 +1144,6 @@ const QuickQuoteEvent = props => { @@ -1144,7 +1144,6 @@ const QuickQuoteEvent = props => {
1144 // 入口 1144 // 入口
1145 const QuickQuote = baseProps => { 1145 const QuickQuote = baseProps => {
1146 const props = QuickQuoteEvent(baseProps); 1146 const props = QuickQuoteEvent(baseProps);
1147 - console.log("🚀 ~ QuickQuote:", props);  
1148 const [treeClassName, setTreeClassName] = useState(""); 1147 const [treeClassName, setTreeClassName] = useState("");
1149 1148
1150 // 监听页面滚动事件 1149 // 监听页面滚动事件
@@ -1303,6 +1302,7 @@ const TreeComponent = props => { @@ -1303,6 +1302,7 @@ const TreeComponent = props => {
1303 return { 1302 return {
1304 ...pre, 1303 ...pre,
1305 ...addState, 1304 ...addState,
  1305 + sPrintConfig: downAbleConfigs.find(item => item.sType === "1" && item.sName === "胶印"),
1306 downAbleConfigs: downAbleConfigs 1306 downAbleConfigs: downAbleConfigs
1307 .filter(item => item.sType === "2") 1307 .filter(item => item.sType === "2")
1308 .map((item, index) => ({ 1308 .map((item, index) => ({
@@ -1498,7 +1498,7 @@ const MasterComponent = props => { @@ -1498,7 +1498,7 @@ const MasterComponent = props => {
1498 item.iColValue = 4; 1498 item.iColValue = 4;
1499 } 1499 }
1500 }); 1500 });
1501 - } 1501 + }
1502 const lengthData = viewConfigs.find(x => x.sName === "dLength"); 1502 const lengthData = viewConfigs.find(x => x.sName === "dLength");
1503 1503
1504 if (selectedNode && selectedNode.sTypeKey && selectedNode.sTypeKey !== "danye") { 1504 if (selectedNode && selectedNode.sTypeKey && selectedNode.sTypeKey !== "danye") {
@@ -1554,7 +1554,6 @@ const BoxComponent = props => { @@ -1554,7 +1554,6 @@ const BoxComponent = props => {
1554 const { bBox } = selectedNode; 1554 const { bBox } = selectedNode;
1555 const [boxTypeList, setBoxTypeList] = useState([]); 1555 const [boxTypeList, setBoxTypeList] = useState([]);
1556 // 卡牌类卷筒类默认使用矩形 当是核价保存过的需要在主表数据加载完后在赋值 1556 // 卡牌类卷筒类默认使用矩形 当是核价保存过的需要在主表数据加载完后在赋值
1557 - console.log(props, "asdadasd");  
1558 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; 1557 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {};
1559 const { sBillNo } = slaveRowData; 1558 const { sBillNo } = slaveRowData;
1560 useEffect(() => { 1559 useEffect(() => {
@@ -2398,14 +2397,19 @@ const PrintParamsComponent = props => { @@ -2398,14 +2397,19 @@ const PrintParamsComponent = props => {
2398 const printParamsItem = printParams[i - 1]; 2397 const printParamsItem = printParams[i - 1];
2399 const viewRow = { ...(i === 0 ? slaveRowData : printParamsItem), sProductClassifyId: selectedNode.sId }; 2398 const viewRow = { ...(i === 0 ? slaveRowData : printParamsItem), sProductClassifyId: selectedNode.sId };
2400 2399
  2400 + const viewTableId = "viewTableId_" + viewRow.sId;
2401 const viewProps = { 2401 const viewProps = {
2402 ...props, 2402 ...props,
2403 - viewConfigs: printParamsConfig, 2403 + viewConfigs: printParamsConfig.map(item => ({ ...item, costomStyle: `xlyPrintParams${i}` })),
2404 tableConfig: { ...slaveConfig, gdsconfigformslave: printParamsConfig }, 2404 tableConfig: { ...slaveConfig, gdsconfigformslave: printParamsConfig },
2405 iColValueView: 24, 2405 iColValueView: 24,
2406 viewRow, 2406 viewRow,
2407 tableName: `${i === 0 ? "slaveUp" : "slaveDown"}${boxModel}`, 2407 tableName: `${i === 0 ? "slaveUp" : "slaveDown"}${boxModel}`,
2408 onDataChange: (...args) => { 2408 onDataChange: (...args) => {
  2409 + setTimeout(() => {
  2410 + const oLabel = document.querySelector(`#${viewTableId}`)?.querySelector(`.xlyPrintParams${i}`)?.querySelector(".ant-form-item-label");
  2411 + oLabel?.click();
  2412 + }, 200);
2409 if (i === 0) { 2413 if (i === 0) {
2410 props.onDataChange(...args); 2414 props.onDataChange(...args);
2411 return; 2415 return;
@@ -2418,11 +2422,37 @@ const PrintParamsComponent = props => { @@ -2418,11 +2422,37 @@ const PrintParamsComponent = props => {
2418 return { ...pre, slaveData }; 2422 return { ...pre, slaveData };
2419 }); 2423 });
2420 }, 2424 },
  2425 + onCostomClick: (showConfig, { target }) => {
  2426 + if (showConfig.sName !== "sPrint") return;
  2427 + const className = target.getAttribute("class");
  2428 + const nodeName = target.nodeName;
  2429 + if (className?.includes("select") && nodeName === "DIV") return;
  2430 +
  2431 + const { sPrintConfig } = state;
  2432 +
  2433 + if (!sPrintConfig) return;
  2434 + const backendConfigNew = {
  2435 + sParentFieldsName: "sPrint",
  2436 + sBoxModel: boxModel,
  2437 + printParamsId: viewRow.sId,
  2438 + };
  2439 +
  2440 + const dropDownData = commonUtils.convertStrToObj(sPrintConfig.sChineseDropDown, []);
  2441 + const dropDownDataSelected = dropDownData.find(item => item.sId === viewRow.sProcessId);
  2442 + if (!dropDownDataSelected) return;
  2443 + const backendParamsConfigNew = commonUtils.convertStrToObj(dropDownDataSelected.sParamConfig, []);
  2444 +
  2445 + props.setState(pre => ({
  2446 + ...pre,
  2447 + backendParamsConfig: backendParamsConfigNew,
  2448 + backendConfig: backendConfigNew,
  2449 + }));
  2450 + },
2421 }; 2451 };
2422 2452
2423 result.push( 2453 result.push(
2424 <div className={styles.materialsLine}> 2454 <div className={styles.materialsLine}>
2425 - <div className={styles.materialsViewTable}> 2455 + <div className={styles.materialsViewTable} id={viewTableId}>
2426 <CommonViewTable {...viewProps} /> 2456 <CommonViewTable {...viewProps} />
2427 </div> 2457 </div>
2428 <div className={styles.materialsBtns} style={{ width: "10%" }}> 2458 <div className={styles.materialsBtns} style={{ width: "10%" }}>
@@ -3034,11 +3064,11 @@ const BoxModelSelectedModal = props =&gt; { @@ -3034,11 +3064,11 @@ const BoxModelSelectedModal = props =&gt; {
3034 3064
3035 // 后道参数额外配置 3065 // 后道参数额外配置
3036 const BackendParamsExtraComponent = props => { 3066 const BackendParamsExtraComponent = props => {
3037 - const { state, slaveConfig, boxModel } = props; 3067 + const { state, slaveConfig } = props;
3038 const { backendParamsConfig = [], backendConfig = {}, slaveData, selectedNode } = state; 3068 const { backendParamsConfig = [], backendConfig = {}, slaveData, selectedNode } = state;
3039 if (!backendParamsConfig.length) return ""; 3069 if (!backendParamsConfig.length) return "";
3040 3070
3041 - const { sParentFieldsName, sBoxModel } = backendConfig; 3071 + const { sParentFieldsName, sBoxModel, printParamsId } = backendConfig;
3042 3072
3043 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === sBoxModel) || {}; 3073 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === sBoxModel) || {};
3044 const { sBackProcessData = [] } = slaveRowData; 3074 const { sBackProcessData = [] } = slaveRowData;
@@ -3060,9 +3090,12 @@ const BackendParamsExtraComponent = props =&gt; { @@ -3060,9 +3090,12 @@ const BackendParamsExtraComponent = props =&gt; {
3060 tableConfig: { ...slaveConfig, gdsconfigformslave: viewConfigs }, 3090 tableConfig: { ...slaveConfig, gdsconfigformslave: viewConfigs },
3061 iColValueView: 24, 3091 iColValueView: 24,
3062 getViewRow: config => { 3092 getViewRow: config => {
  3093 + if (sParentFieldsName === "sPrint") {
  3094 + return [slaveRowData, ...sBackProcessData].find(item => item.sId === printParamsId);
  3095 + }
3063 return sBackProcessData.find(item => item[sParentFieldsName])?.sBackendParams?.find(item => item.sParam === config.showName) || {}; 3096 return sBackProcessData.find(item => item[sParentFieldsName])?.sBackendParams?.find(item => item.sParam === config.showName) || {};
3064 }, 3097 },
3065 - tableName: `sBackendParams${boxModel}`, 3098 + tableName: `sBackendParams${sBoxModel}`,
3066 getSqlDropDownData: (...args) => { 3099 getSqlDropDownData: (...args) => {
3067 const showConfig = args[2]; 3100 const showConfig = args[2];
3068 const { sParamDropDown = "", sName } = showConfig; 3101 const { sParamDropDown = "", sName } = showConfig;
@@ -3086,6 +3119,22 @@ const BackendParamsExtraComponent = props =&gt; { @@ -3086,6 +3119,22 @@ const BackendParamsExtraComponent = props =&gt; {
3086 }, 3119 },
3087 onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => { 3120 onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => {
3088 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); 3121 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
  3122 +
  3123 + if (sParentFieldsName === "sPrint") {
  3124 + if (slaveData[iIndex].sId === printParamsId) {
  3125 + let slaveDataNew = [...slaveData];
  3126 + slaveDataNew[iIndex] = { ...slaveDataNew[iIndex], ...changeValue };
  3127 + props.setState(pre => ({ ...pre, slaveData: slaveDataNew }));
  3128 + } else {
  3129 + const iIndex1 = sBackProcessData.findIndex(item => item.sId === printParamsId);
  3130 + let sBackProcessDataNew = [...sBackProcessData];
  3131 + sBackProcessDataNew[iIndex1] = { ...sBackProcessDataNew[iIndex1], ...changeValue };
  3132 + slaveData[iIndex].sBackProcessData = sBackProcessDataNew;
  3133 + props.setState(pre => ({ ...pre, slaveData }));
  3134 + }
  3135 + return;
  3136 + }
  3137 +
3089 const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[sParentFieldsName]); 3138 const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[sParentFieldsName]);
3090 const showConfig = viewConfigs.find(item => item.sName === sFieldName); 3139 const showConfig = viewConfigs.find(item => item.sName === sFieldName);
3091 const dropDownDataSelected = dropDownData?.length 3140 const dropDownDataSelected = dropDownData?.length