Commit 7bc4b753ec25150e5e70f74023fa73bcc65a48c1

Authored by chenxt
1 parent e2294523

放大镜弹窗

Too many changes to show.

To preserve performance only 4 of 8 files are displayed.

src/components/Common/CommonBillEvent.js
... ... @@ -76,7 +76,7 @@ export default (ChildComponent) => {
76 76 const masterConfig = formData.filter(item => !item.bGrd)[0];
77 77 const BtnDesignFunctionConfig = commonUtils.isNotEmptyObject(masterConfig) ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'BtnBsOperation.BtnDesignFunction') : {};
78 78 const reportDesign = commonFunc.showMessage(app.commonConst, 'reportDesign');/* 报表设计 */
79   - const sReasonTitle = commonUtils.isNotEmptyObject(commonFunc.showMessage(app.commonConst, 'sReason'))?
  79 + const sReasonTitle = commonUtils.isNotEmptyObject(commonFunc.showMessage(app.commonConst, 'sReason')) ?
80 80 commonFunc.showMessage(app.commonConst, 'sReason') : '报错原因';/* 导入报错原因 */
81 81 if (commonUtils.isEmptyObject(BtnDesignFunctionConfig)) {
82 82 masterConfig.gdsconfigformslave.push({
... ... @@ -148,11 +148,11 @@ export default (ChildComponent) => {
148 148  
149 149 /* 导入错误配置 */
150 150 let importConfig = {};
151   - let importFilterData = formData.filter(item => item.bReportData && item.sGrd === 'importTemplate');
152   - if(commonUtils.isNotEmptyArr(importFilterData)) {
  151 + let importFilterData = formData.filter(item => item.bReportData && item.sGrd === 'importTemplate');
  152 + if (commonUtils.isNotEmptyArr(importFilterData)) {
153 153 importConfig = formData.filter(item => item.bReportData && item.sGrd === 'importTemplate')[0];
154 154 const iIndex = importConfig.gdsconfigformslave.findIndex(item => item.sName === 'sReason');
155   - if(iIndex === -1) {
  155 + if (iIndex === -1) {
156 156 importConfig.gdsconfigformslave.push({
157 157 bCanInput: false,
158 158 bEntireLine: false,
... ... @@ -282,9 +282,9 @@ export default (ChildComponent) => {
282 282 packColumn,
283 283 };
284 284 } else if (sModelsType === 'purchase/purchaseOrder') {
285   - let orderDetailConfig = commonUtils.isNotEmptyArr(formData.filter(item => item.sTbName.toUpperCase() === 'purpurchaseorderDetail'.toUpperCase())) ?
  285 + let orderDetailConfig = commonUtils.isNotEmptyArr(formData.filter(item => item.sTbName.toUpperCase() === 'purpurchaseorderDetail'.toUpperCase())) ?
286 286 formData.filter(item => item.sTbName.toUpperCase() === 'purpurchaseorderDetail'.toUpperCase())[0] : {};
287   - if(commonUtils.isNotEmptyObject(orderDetailConfig)) {
  287 + if (commonUtils.isNotEmptyObject(orderDetailConfig)) {
288 288 const orderDetailColumn = commonFunc.getHeaderConfig(orderDetailConfig);
289 289 config.orderDetailConfig = orderDetailConfig;
290 290 this.handleGetOneMemoData('orderDetail', orderDetailConfig);
... ... @@ -293,14 +293,14 @@ export default (ChildComponent) => {
293 293 orderDetailColumn,
294 294 };
295 295 }
296   - }else if (sModelsType === 'purchase/purchasecheck') {
  296 + } else if (sModelsType === 'purchase/purchasecheck') {
297 297 let orderDetailConfig = {};
298   - let orderDetailColumn = [];
  298 + let orderDetailColumn = [];
299 299 const filterData = formData.filter(item => item.sTbName.toUpperCase() === 'purpurchasecheckingDetail'.toUpperCase());
300   - if(commonUtils.isNotEmptyArr(filterData)) {
301   - orderDetailConfig = filterData[0];
  300 + if (commonUtils.isNotEmptyArr(filterData)) {
  301 + orderDetailConfig = filterData[0];
302 302 }
303   - if(commonUtils.isNotEmptyObject(orderDetailConfig)) {
  303 + if (commonUtils.isNotEmptyObject(orderDetailConfig)) {
304 304 orderDetailColumn = commonFunc.getHeaderConfig(orderDetailConfig);
305 305 config.orderDetailConfig = orderDetailConfig;
306 306 this.handleGetOneMemoData('orderDetail', orderDetailConfig);
... ... @@ -311,12 +311,12 @@ export default (ChildComponent) => {
311 311 }
312 312 } else if (sModelsType === 'purchase/purchaseApply') {
313 313 let orderDetailConfig = {};
314   - let orderDetailColumn = [];
  314 + let orderDetailColumn = [];
315 315 const filterData = formData.filter(item => item.sTbName.toUpperCase().indexOf('DETAIL') !== -1);
316   - if(commonUtils.isNotEmptyArr(filterData)) {
317   - orderDetailConfig = filterData[0];
  316 + if (commonUtils.isNotEmptyArr(filterData)) {
  317 + orderDetailConfig = filterData[0];
318 318 }
319   - if(commonUtils.isNotEmptyObject(orderDetailConfig)) {
  319 + if (commonUtils.isNotEmptyObject(orderDetailConfig)) {
320 320 orderDetailColumn = commonFunc.getHeaderConfig(orderDetailConfig);
321 321 config.orderDetailConfig = orderDetailConfig;
322 322 this.handleGetOneMemoData('orderDetail', orderDetailConfig);
... ... @@ -389,14 +389,14 @@ export default (ChildComponent) => {
389 389 orderDetailConfig,
390 390 orderDetailColumn,
391 391 });
392   - }else if (sModelsType === 'purchase/purchasecheck') {
  392 + } else if (sModelsType === 'purchase/purchasecheck') {
393 393 let orderDetailConfig = {};
394   - let orderDetailColumn = [];
  394 + let orderDetailColumn = [];
395 395 const filterData = formData.filter(item => item.sTbName.toUpperCase() === 'purpurchasecheckingDetail'.toUpperCase());
396   - if(commonUtils.isNotEmptyArr(filterData)) {
397   - orderDetailConfig = filterData[0];
  396 + if (commonUtils.isNotEmptyArr(filterData)) {
  397 + orderDetailConfig = filterData[0];
398 398 }
399   - if(commonUtils.isNotEmptyObject(orderDetailConfig)) {
  399 + if (commonUtils.isNotEmptyObject(orderDetailConfig)) {
400 400 const orderDetailColumn = commonFunc.getHeaderConfig(orderDetailConfig);
401 401 this.handleGetOneMemoData('orderDetail', orderDetailConfig);
402 402 this.props.onSaveState({
... ... @@ -493,7 +493,7 @@ export default (ChildComponent) => {
493 493 slaveInfoList.push(item.showName);
494 494 });
495 495 if (slaveInfoList.length) {
496   - addState = {...addState, ...await this.handleGetDataOne('slave0', addState.slave0Config, null, null, null, null, nextProps, true)};
  496 + addState = { ...addState, ...await this.handleGetDataOne('slave0', addState.slave0Config, null, null, null, null, nextProps, true) };
497 497 }
498 498 this.props.onSaveState({
499 499 slaveInfoList,
... ... @@ -620,7 +620,7 @@ export default (ChildComponent) => {
620 620 }
621 621 }
622 622 };
623   - handlePackDataAdd= (item, index, sControlId) => {
  623 + handlePackDataAdd = (item, index, sControlId) => {
624 624 const tableDataRow = {};
625 625 tableDataRow.sId = commonUtils.createSid();
626 626 tableDataRow.handleType = 'add';
... ... @@ -756,7 +756,7 @@ export default (ChildComponent) => {
756 756 }
757 757 };
758 758 /** 获取部件树 */
759   - handleGetControlTreeDataBak= (controlDataOld, isWait, sSlaveId) => {
  759 + handleGetControlTreeDataBak = (controlDataOld, isWait, sSlaveId) => {
760 760 /* 生成部件树结构 */
761 761 let treeData = [];
762 762 const expandedKeys = [];
... ... @@ -863,7 +863,7 @@ export default (ChildComponent) => {
863 863 };
864 864  
865 865 /** 获取子节点数据 */
866   - handleGetControlTreeChildData= (sParentId, controlData) => {
  866 + handleGetControlTreeChildData = (sParentId, controlData) => {
867 867 if (commonUtils.isNotEmptyObject(sParentId) && commonUtils.isNotEmptyArr(controlData)) {
868 868 const childTree = commonUtils.isNotEmptyArr(controlData) ? controlData.filter(item => item.sControlParentId === sParentId) : [];
869 869 const children = [];
... ... @@ -896,17 +896,17 @@ export default (ChildComponent) => {
896 896 };
897 897  
898 898 handleGetTableConfig = async (name, sModelsId, oldConfig, configName) => {
899   - if(commonUtils.isNotEmptyObject(sModelsId)) {
  899 + if (commonUtils.isNotEmptyObject(sModelsId)) {
900 900 const newConfig = await this.props.onGetTableConfig(name, sModelsId, oldConfig);
901   - if(commonUtils.isNotEmptyObject(newConfig)) {
  901 + if (commonUtils.isNotEmptyObject(newConfig)) {
902 902 const newColumn = commonFunc.getHeaderConfig(newConfig);
903   - this.props.onSaveState({[`${[configName || name]}Config`]: newConfig, [`${[configName || name]}Column`]: newColumn })
  903 + this.props.onSaveState({ [`${[configName || name]}Config`]: newConfig, [`${[configName || name]}Column`]: newColumn })
904 904 }
905 905 }
906 906 }
907 907  
908 908 /** 根据key查找树节点并改变属性 */
909   - handleSearchNodes= (key, data, showNameNew) => {
  909 + handleSearchNodes = (key, data, showNameNew) => {
910 910 if (commonUtils.isNotEmptyObject(showNameNew)) {
911 911 data.forEach((item) => {
912 912 if (item.key === key) {
... ... @@ -1114,7 +1114,7 @@ export default (ChildComponent) => {
1114 1114 }
1115 1115 if (sModelsType === 'purchase/purchaseInstore') {
1116 1116 let iIndex = app.systemData.findIndex(item => item.sName === 'CbxMaterialsDefine');
1117   - if(commonUtils.isNotEmptyObject(masterData.sMinusSrcId) || commonUtils.isNotEmptyObject(masterData.sMinusUsed) ){
  1117 + if (commonUtils.isNotEmptyObject(masterData.sMinusSrcId) || commonUtils.isNotEmptyObject(masterData.sMinusUsed)) {
1118 1118 console.log('红冲', masterData);
1119 1119 iIndex = -1;
1120 1120 }
... ... @@ -1138,7 +1138,7 @@ export default (ChildComponent) => {
1138 1138 }
1139 1139 } else if (sModelsType === 'productStock/productInStore' || sModelsType === 'outside/outsideinstoreAll') { /* 成品入库、整单发外入库 */
1140 1140 let iIndex = app.systemData.findIndex(item => item.sName === 'CbxProductDefine');
1141   - if(commonUtils.isNotEmptyObject(masterData.sMinusSrcId) || commonUtils.isNotEmptyObject(masterData.sMinusUsed) ){
  1141 + if (commonUtils.isNotEmptyObject(masterData.sMinusSrcId) || commonUtils.isNotEmptyObject(masterData.sMinusUsed)) {
1142 1142 console.log('红111冲', masterData);
1143 1143 iIndex = -1;
1144 1144 }
... ... @@ -1187,8 +1187,8 @@ export default (ChildComponent) => {
1187 1187 }
1188 1188 /* 通用报价单:101251240115016244276286330 */
1189 1189 const dataUrl = slaveItem.sFormId === '19211681019715780306452560' || slaveItem.sFormId === '101251240115016076506222050'
1190   - || slaveItem.sFormId === '101251240115016036175782700' || slaveItem.sFormId === '101251240115016002356125200' || slaveItem.sFormId === '101251240115016244276286330' ||
1191   - slaveItem.sFormId === '101251240115016197744514350' ?
  1190 + || slaveItem.sFormId === '101251240115016036175782700' || slaveItem.sFormId === '101251240115016002356125200' || slaveItem.sFormId === '101251240115016244276286330' ||
  1191 + slaveItem.sFormId === '101251240115016197744514350' ?
1192 1192 `${commonConfig.server_host}salesorder/getQuotationPartsInfo?sModelsId=${sModelsId}` :
1193 1193 `${commonConfig.server_host}salesorder/getPartsInfo?sModelsId=${sModelsId}`;
1194 1194 const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data;
... ... @@ -1385,7 +1385,7 @@ export default (ChildComponent) => {
1385 1385 const copyToPackConfig = copyTo.config.filter(item => item.sControlName.toLowerCase() === `${copyTo.name}.pack`.toLowerCase());
1386 1386 const packAssignField = commonUtils.isNotEmptyArr(copyToPackConfig) ? copyToPackConfig[0].sAssignField : '';
1387 1387 if (commonUtils.isNotEmptyObject(packAssignField)) {
1388   - /* 复制到时增加合版表 */
  1388 + /* 复制到时增加合版表 */
1389 1389 if (commonUtils.isNotEmptyArr(copyTo.packData)) {
1390 1390 await copyTo.packData.filter(item => item.sControlId === controlItem.sId).forEach(async (packItem) => {
1391 1391 newCopyTo.pack = packItem;
... ... @@ -1632,10 +1632,10 @@ export default (ChildComponent) => {
1632 1632 }
1633 1633 }
1634 1634 }
1635   - if(location.pathname && location.pathname.includes('commonOeeBill')) {
1636   - if(commonUtils.isNotEmptyObject(app) && app.currentPane && app.currentPane.copyTo){
1637   - const masterCopyToData = app.currentPane.copyTo.masterData;
1638   - if(commonUtils.isNotEmptyObject(masterCopyToData)) {
  1635 + if (location.pathname && location.pathname.includes('commonOeeBill')) {
  1636 + if (commonUtils.isNotEmptyObject(app) && app.currentPane && app.currentPane.copyTo) {
  1637 + const masterCopyToData = app.currentPane.copyTo.masterData;
  1638 + if (commonUtils.isNotEmptyObject(masterCopyToData)) {
1639 1639 tableDataRow.sReportPanel = masterCopyToData.sReportPanel;
1640 1640 tableDataRow.sReportParam = masterCopyToData.sReportParam;
1641 1641 tableDataRow.sProcessParam = masterCopyToData.sProcessParam;
... ... @@ -1645,7 +1645,7 @@ export default (ChildComponent) => {
1645 1645 }
1646 1646 }
1647 1647  
1648   - slaveData.push(tableDataRow);
  1648 + slaveData.push(tableDataRow);
1649 1649 });
1650 1650 }
1651 1651 }
... ... @@ -1656,7 +1656,7 @@ export default (ChildComponent) => {
1656 1656 if (detailAssignField !== '') {
1657 1657 const copyDetail = copyTo.copyOtherData.filter(item => item.name === 'detail')[0];
1658 1658 const detail = copyDetail.data;
1659   - if(commonUtils.isNotEmptyArr(detail)) {
  1659 + if (commonUtils.isNotEmptyArr(detail)) {
1660 1660 detail.forEach((detailItem) => {
1661 1661 const newCopyTo = {};
1662 1662 newCopyTo.master = copyTo.masterData;
... ... @@ -1691,7 +1691,7 @@ export default (ChildComponent) => {
1691 1691 /* 新增时生成采购批号 */
1692 1692 if (sModelsType === 'purchase/purchaseInstore') {
1693 1693 let iIndex = app.systemData.findIndex(item => item.sName === 'CbxMaterialsDefine');
1694   - if(commonUtils.isNotEmptyObject(masterData.sMinusSrcId) || commonUtils.isNotEmptyObject(masterData.sMinusUsed) ){
  1694 + if (commonUtils.isNotEmptyObject(masterData.sMinusSrcId) || commonUtils.isNotEmptyObject(masterData.sMinusUsed)) {
1695 1695 console.log('红冲', masterData);
1696 1696 iIndex = -1;
1697 1697 }
... ... @@ -1715,7 +1715,7 @@ export default (ChildComponent) => {
1715 1715 }
1716 1716 } else if (sModelsType === 'productStock/productInStore' || sModelsType === 'outside/outsideinstoreAll') { /* 成品入库、整单发外入库 */
1717 1717 let iIndex = app.systemData.findIndex(item => item.sName === 'CbxProductDefine');
1718   - if(commonUtils.isNotEmptyObject(masterData.sMinusSrcId) || commonUtils.isNotEmptyObject(masterData.sMinusUsed) ){
  1718 + if (commonUtils.isNotEmptyObject(masterData.sMinusSrcId) || commonUtils.isNotEmptyObject(masterData.sMinusUsed)) {
1719 1719 console.log('红冲', masterData);
1720 1720 iIndex = -1;
1721 1721 }
... ... @@ -1884,7 +1884,7 @@ export default (ChildComponent) => {
1884 1884 dispatch({ type: 'app/throwError', payload: { code: -2, msg: rtmsg.msg } });
1885 1885 }
1886 1886 } else if (rtmsg.action === 'update') {
1887   - await this.handleGetData(masterConfig, slaveConfig, checkConfig,'update');
  1887 + await this.handleGetData(masterConfig, slaveConfig, checkConfig, 'update');
1888 1888 if (cb && typeof cb === 'function') {
1889 1889 this.props.onSaveState({ enabled: false, calculated: false }, () => { cb(); });
1890 1890 } else {
... ... @@ -2169,7 +2169,7 @@ export default (ChildComponent) => {
2169 2169 if (iIndex > -1) {
2170 2170 bCheck = true;
2171 2171 }
2172   - if(bCheck) {
  2172 + if (bCheck) {
2173 2173 message.error(commonFunc.showMessage(app.commonConst, 'slaveNotNull')); // 从表不能为空!
2174 2174 this.props.onSaveState({
2175 2175 loading: false,
... ... @@ -2677,7 +2677,7 @@ export default (ChildComponent) => {
2677 2677 }
2678 2678 const sId = sIdArray.toString();
2679 2679 onSendSocketMessage('copyfinish', 'noAction', sId, userinfo.sId, null, null);
2680   - } else if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sSrcSlaveId)) {
  2680 + } else if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sSrcSlaveId)) {
2681 2681 const sIdArray = [];
2682 2682 /* 处理只有单主表解锁问题 */
2683 2683 sIdArray.push(masterData.sSrcSlaveId);
... ... @@ -3746,8 +3746,8 @@ export default (ChildComponent) => {
3746 3746 tableDataRow.dProductTaxMoney = dProductTaxMoney; /* 税额 */
3747 3747 tableDataRow.dProductTaxForeignMoney = dProductTaxForeignMoney; /* 外币税额 */
3748 3748 /* 报损金额改变后 反算单价 */
3749   - tableDataRow.dProductForeignPrice = tableDataRow.dProductQty !==0 ? commonUtils.convertFixNum( dProductForeignMoney/tableDataRow.dProductQty, dNetPrice) : 0; /* 外币税额 */
3750   - tableDataRow.dProductPrice = tableDataRow.dProductQty !==0 ? commonUtils.convertFixNum( dProductMoney/tableDataRow.dProductQty, dNetPrice) : 0; /* 外币税额 */
  3749 + tableDataRow.dProductForeignPrice = tableDataRow.dProductQty !== 0 ? commonUtils.convertFixNum(dProductForeignMoney / tableDataRow.dProductQty, dNetPrice) : 0; /* 外币税额 */
  3750 + tableDataRow.dProductPrice = tableDataRow.dProductQty !== 0 ? commonUtils.convertFixNum(dProductMoney / tableDataRow.dProductQty, dNetPrice) : 0; /* 外币税额 */
3751 3751 } else if (commonUtils.isNotEmptyNumber(tableDataRow.dSrcNoCheckMoney) && commonUtils.isEmptyNumber(tableDataRow.dLossMoney)) {
3752 3752 const dProductForeignMoney = commonUtils.isNull(tableDataRow.dSrcNoCheckMoney, 0);
3753 3753 const dProductMoney = commonUtils.convertFixNum(dCurrencyRate !== 0 ? dProductForeignMoney * dCurrencyRate : 0, dPmoney); /* 本位币金额 */
... ... @@ -3763,7 +3763,7 @@ export default (ChildComponent) => {
3763 3763 tableDataRow.dProductTaxMoney = dProductTaxMoney; /* 税额 */
3764 3764 tableDataRow.dProductTaxForeignMoney = dProductTaxForeignMoney; /* 外币税额 */
3765 3765 }
3766   - } else if (sModelsType && (sModelsType === 'purchase/purchasecheck' || sModelsType.includes('outside/outsideChecking') ) && sFieldName === 'dLossMoney' && name === 'slave') {
  3766 + } else if (sModelsType && (sModelsType === 'purchase/purchasecheck' || sModelsType.includes('outside/outsideChecking')) && sFieldName === 'dLossMoney' && name === 'slave') {
3767 3767 const dPmoney = this.props.getFloatNum('dMaterialsMoney');
3768 3768 const { dNetPrice } = app.decimals;
3769 3769 const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */
... ... @@ -3779,7 +3779,7 @@ export default (ChildComponent) => {
3779 3779 tableDataRow[`d${type}NoTaxPrice`] = dProductNoTaxPrice; /* 不含税价 */
3780 3780 tableDataRow[`d${type}TaxMoney`] = dProductTaxMoney; /* 税额 */
3781 3781 /* 报损金额改变后 反算单价 */
3782   - tableDataRow[`d${type}Price`] = dProductQty !==0 ? commonUtils.convertFixNum( dMoney/dProductQty, dNetPrice) : 0; /* 外币税额 */
  3782 + tableDataRow[`d${type}Price`] = dProductQty !== 0 ? commonUtils.convertFixNum(dMoney / dProductQty, dNetPrice) : 0; /* 外币税额 */
3783 3783 } else if (commonUtils.isNotEmptyNumber(tableDataRow.dSrcNoCheckMoney) && commonUtils.isEmptyNumber(tableDataRow.dLossMoney)) {
3784 3784 tableDataRow.dMaterialsMoney = commonUtils.isNull(tableDataRow.dSrcNoCheckMoney, 0);
3785 3785 tableDataRow.dLossMoney = 0;
... ... @@ -3900,11 +3900,11 @@ export default (ChildComponent) => {
3900 3900 if (this.inputChange) {
3901 3901 clearTimeout(this.inputChange);
3902 3902 }
3903   - this.inputChange = setTimeout(async() => {
  3903 + this.inputChange = setTimeout(async () => {
3904 3904 // /* 调用父组件的回带函数 */
3905 3905 tableDataRow = await this.handleMaterialsChangeWait(tableDataRow, sModelsId, masterData, changeValue, sFieldName, app, token, models);
3906 3906 }, 10);
3907   - return tableDataRow;
  3907 + return tableDataRow;
3908 3908 }
3909 3909  
3910 3910 handleMaterialsChange = async (tableDataRow, sModelsId, masterData, changeValue, sFieldName, app, token, models) => {
... ... @@ -3968,15 +3968,15 @@ export default (ChildComponent) => {
3968 3968 });
3969 3969 }
3970 3970 } else if (sFieldName === 'dAuxiliaryLossQty') {
3971   - const tableDataRowNew ={ ...tableDataRow ,dAuxiliaryQty:tableDataRow.dAuxiliaryLossQty };
  3971 + const tableDataRowNew = { ...tableDataRow, dAuxiliaryQty: tableDataRow.dAuxiliaryLossQty };
3972 3972 if (commonUtils.isEmpty(sComputeId)) {
3973 3973 // tableDataRow = commonBusiness.getMaterialsQty(app, tableDataRow, sFieldName, 'dLossQty');
3974 3974 tableDataRow.dLossQty = await commonBusiness.getFormulaValue({
3975   - token, sModelsId, masterData, tableDataRow:tableDataRowNew, sComputeId, sFormulaIdType,
  3975 + token, sModelsId, masterData, tableDataRow: tableDataRowNew, sComputeId, sFormulaIdType,
3976 3976 });
3977 3977 } else {
3978 3978 tableDataRow.dLossQty = await commonBusiness.getFormulaValue({
3979   - token, sModelsId, masterData, tableDataRow:tableDataRowNew, sComputeId,
  3979 + token, sModelsId, masterData, tableDataRow: tableDataRowNew, sComputeId,
3980 3980 });
3981 3981 }
3982 3982 if (!commonUtils.isEmpty(tableDataRow.dSrcSurplusAuxiliaryQty)) {
... ... @@ -3985,15 +3985,15 @@ export default (ChildComponent) => {
3985 3985 }
3986 3986 } else if (sFieldName === 'dLossQty') {
3987 3987 const { sReComputeId } = tableDataRow;
3988   - const tableDataRowNew ={ ...tableDataRow ,dMaterialsQty:tableDataRow.dLossQty };
  3988 + const tableDataRowNew = { ...tableDataRow, dMaterialsQty: tableDataRow.dLossQty };
3989 3989 if (commonUtils.isEmpty(sReComputeId) && tableDataRow.bInverse) {
3990 3990 // tableDataRow = commonBusiness.getAuxiliaryQty(app, tableDataRow, sFieldName, 'dAuxiliaryLossQty');
3991 3991 tableDataRow.dAuxiliaryLossQty = await commonBusiness.getFormulaValue({
3992   - token, sModelsId, masterData, tableDataRow:tableDataRowNew, sReComputeId, sFormulaIdType,
  3992 + token, sModelsId, masterData, tableDataRow: tableDataRowNew, sReComputeId, sFormulaIdType,
3993 3993 });
3994 3994 } else {
3995 3995 tableDataRow.dAuxiliaryLossQty = await commonBusiness.getFormulaValue({
3996   - token, sModelsId, masterData, tableDataRow:tableDataRowNew, sComputeId: sReComputeId,
  3996 + token, sModelsId, masterData, tableDataRow: tableDataRowNew, sComputeId: sReComputeId,
3997 3997 });
3998 3998 }
3999 3999 if (!commonUtils.isEmpty(tableDataRow.dSrcSurplusAuxiliaryQty)) {
... ... @@ -4275,7 +4275,7 @@ export default (ChildComponent) => {
4275 4275 const slaveDelData = commonUtils.isEmptyArr(slaveDelDataOld) ? [] : slaveDelDataOld;
4276 4276 if (dataReturn.code === 1) {
4277 4277 const returnSlaveData = dataReturn.dataset.rows;
4278   - if(commonUtils.isNotEmptyArr(slaveData)) {
  4278 + if (commonUtils.isNotEmptyArr(slaveData)) {
4279 4279 slaveData.forEach((item) => {
4280 4280 item.handleType = 'del';
4281 4281 slaveDelData.push(item);
... ... @@ -4342,7 +4342,7 @@ export default (ChildComponent) => {
4342 4342 }
4343 4343 const dataReturn = (await commonServices.postValueService(app.token, body, url)).data;
4344 4344 if (dataReturn.code === 1) {
4345   - /* 获取数据集 */
  4345 + /* 获取数据集 */
4346 4346 const { rows } = dataReturn.dataset;
4347 4347 const slaveDataNew = [];
4348 4348 rows.forEach((row) => {
... ... @@ -4401,7 +4401,7 @@ export default (ChildComponent) => {
4401 4401 };
4402 4402 const dataReturn = (await commonServices.postValueService(app.token, body, url)).data;
4403 4403 if (dataReturn.code === 1) {
4404   - /* 获取数据集 */
  4404 + /* 获取数据集 */
4405 4405 const { rows } = dataReturn.dataset;
4406 4406 const slaveDataNew = [];
4407 4407 rows.forEach((row) => {
... ... @@ -4450,7 +4450,7 @@ export default (ChildComponent) => {
4450 4450 return returnData;
4451 4451 }
4452 4452 }
4453   - handleBtnPrint =async (sActiveId, checked, eKey) => {
  4453 + handleBtnPrint = async (sActiveId, checked, eKey) => {
4454 4454 const {
4455 4455 app, sModelsId, masterConfig, masterData, slaveConfig, sModelsType, reportData, menuChildData, formRoute, controlConfig,
4456 4456 } = this.props;
... ... @@ -4529,7 +4529,7 @@ export default (ChildComponent) => {
4529 4529 window.open(`${encodeURI(`${urlPrint}&queryFilter=${queryFilterJson}`)}&token=${encodeURIComponent(token)}`);
4530 4530 }
4531 4531 };
4532   - handleOpenPost= (url, params) => {
  4532 + handleOpenPost = (url, params) => {
4533 4533 const newWin = window.open();
4534 4534 let formStr = '';
4535 4535 formStr = `<form style="visibility:hidden;" method="POST" action="${url}">` +
... ... @@ -4565,7 +4565,7 @@ export default (ChildComponent) =&gt; {
4565 4565 handleTitleChange1 = (name, slavePagination, filters, sorter) => {
4566 4566 this.props.onSaveState({ [`${name}Pagination`]: slavePagination });
4567 4567 const {
4568   - slaveConfig, slaveFilterCondition, sGroupByList,[`${name}Config`] : tableConfig, [`${name}FilterCondition`]: tableFilterCondition,
  4568 + slaveConfig, slaveFilterCondition, sGroupByList, [`${name}Config`]: tableConfig, [`${name}FilterCondition`]: tableFilterCondition,
4569 4569 } = this.props;
4570 4570 let bGetData = true;
4571 4571 if (commonUtils.isNotEmptyObject(filters)) {
... ... @@ -4591,7 +4591,7 @@ export default (ChildComponent) =&gt; {
4591 4591 };
4592 4592  
4593 4593 /* 工单、工艺卡、报价单控制表回带图片地址 */
4594   - handleFilfileManageOk= async (controlFilfileData, controlFilfileDelData, sSrcSlaveId) => {
  4594 + handleFilfileManageOk = async (controlFilfileData, controlFilfileDelData, sSrcSlaveId) => {
4595 4595 const {
4596 4596 controlData: tableData, app, sModelsId, token, controlConfig,
4597 4597 } = this.props;
... ... @@ -4742,7 +4742,7 @@ export default (ChildComponent) =&gt; {
4742 4742 child.dTotalMoney = 0;
4743 4743 child.handleType = commonUtils.isEmpty(child.handleType) ? 'update' : child.handleType;
4744 4744 child.dRoundingMoney = commonUtils.isNum(child.dRoundingMoney) ? child.dRoundingMoney : 0;
4745   - child.dBalanceMoney = commonUtils.convertFixNum(child.dBalanceMoney, dNetMoney); /* 根据系统设定位数格式未付款金额*/
  4745 + child.dBalanceMoney = commonUtils.convertFixNum(child.dBalanceMoney, dNetMoney); /* 根据系统设定位数格式未付款金额*/
4746 4746 if (child.dBalanceMoney < 0) {
4747 4747 minusSum -= Math.abs(child.dBalanceMoney);
4748 4748 minusRoundingSum -= Math.abs(child.dRoundingMoney);
... ... @@ -5018,40 +5018,40 @@ export default (ChildComponent) =&gt; {
5018 5018 this.handleOutTemplate();
5019 5019 } else if (name === 'BtnOutTemplateData') { /* 导出模版数据 */
5020 5020 this.handleOutTemplateData();
5021   - }else if (name === 'BtnShowAll') { /* 显示全部部件 */
  5021 + } else if (name === 'BtnShowAll') { /* 显示全部部件 */
5022 5022 this.handleTableCancelSelect('slave');
5023 5023 } else if (name === 'BtnShowControl') { /* 显示部件层级 */
5024   - const { controlData } = this.props;
5025   - const expandedRowKeys =[];
5026   - if(commonUtils.isNotEmptyArr(controlData)) { /* 当显示全部时 展开所有部件层级 */
  5024 + const { controlData } = this.props;
  5025 + const expandedRowKeys = [];
  5026 + if (commonUtils.isNotEmptyArr(controlData)) { /* 当显示全部时 展开所有部件层级 */
5027 5027 controlData.forEach((item) => {
5028 5028 const { sId } = item;
5029 5029 expandedRowKeys.push(sId);
5030 5030 });
5031 5031 }
5032   - this.props.onSaveState({ showAllTreeVisible: true, controlShowExpandedRowKeys: { expandedRowKeys: expandedRowKeys } });
  5032 + this.props.onSaveState({ showAllTreeVisible: true, controlShowExpandedRowKeys: { expandedRowKeys: expandedRowKeys } });
5033 5033 } else if (name === 'BtnRefresh') {
5034 5034 if (this.props.app.currentPane.refresh !== undefined) {
5035 5035 this.props.app.currentPane.refresh();
5036 5036 }
5037 5037 const { masterConfig, slaveConfig, checkConfig } = this.props;
5038 5038 this.handleGetData(masterConfig, slaveConfig, checkConfig);
5039   - } else if(name && name.includes('BtnTempSql')) { /* 通过BtnTempSql按钮 自定义调用Sql 并将数据回填到界面上 */
  5039 + } else if (name && name.includes('BtnTempSql')) { /* 通过BtnTempSql按钮 自定义调用Sql 并将数据回填到界面上 */
5040 5040 const { masterConfig, slaveConfig, sModelsId, token } = this.props;
5041   - let { masterData,slaveData } = this.props;
  5041 + let { masterData, slaveData } = this.props;
5042 5042 const slave0Data = [];
5043 5043 const slave1Data = [];
5044 5044 const slave2Data = [];
5045 5045 const slave3Data = [];
5046 5046 const slave4Data = [];
5047   - const copyTo ={};
  5047 + const copyTo = {};
5048 5048 copyTo.name = name;
5049 5049 copyTo.slaveData = slaveData;
5050   - const buttonConfigArr = masterConfig && masterConfig.gdsconfigformslave.filter(item => item.sControlName && item.sControlName.includes('BtnTempSql'));
  5050 + const buttonConfigArr = masterConfig && masterConfig.gdsconfigformslave.filter(item => item.sControlName && item.sControlName.includes('BtnTempSql'));
5051 5051 const allConfig = {
5052 5052 slaveConfig, masterConfig,
5053 5053 };
5054   - if(commonUtils.isNotEmptyArr(buttonConfigArr)) {
  5054 + if (commonUtils.isNotEmptyArr(buttonConfigArr)) {
5055 5055 copyTo.config = buttonConfigArr;
5056 5056 const sTmpInfoConfig = buttonConfigArr.filter(item => item.sControlName && item.sControlName.includes('BtnTempSql'))[0];
5057 5057 const sControlName = sTmpInfoConfig.sControlName;
... ... @@ -5162,7 +5162,7 @@ export default (ChildComponent) =&gt; {
5162 5162 slave4Data.push(slave4Row);
5163 5163 });
5164 5164 }
5165   - this.props.onSaveState({ slaveData, slave1Data, slave2Data, slave3Data, slave4Data});
  5165 + this.props.onSaveState({ slaveData, slave1Data, slave2Data, slave3Data, slave4Data });
5166 5166 } else {
5167 5167 this.props.getServiceError(dataReturn);
5168 5168 }
... ... @@ -5170,20 +5170,20 @@ export default (ChildComponent) =&gt; {
5170 5170 } else {
5171 5171 message.error('请正确配置自定义按钮!');
5172 5172 }
5173   - }else if (name && name.includes('BtnCalc')) { /* 实现通用计算功能 */
  5173 + } else if (name && name.includes('BtnCalc')) { /* 实现通用计算功能 */
5174 5174 const { masterConfig, masterData, sModelsId, } = this.props;
5175 5175 const btnConfig = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => (item.sControlName === name))) ?
5176 5176 masterConfig.gdsconfigformslave.filter(item => (item.sControlName === name))[0] : {};// sButtonEnabled sButtonParam
5177   - if(commonUtils.isNotEmptyObject(btnConfig)) {
  5177 + if (commonUtils.isNotEmptyObject(btnConfig)) {
5178 5178 /* 组装allTableData */
5179   - const allTableMap ={};
5180   - const allReturnMap ={};
5181   - const slaveNameList = [];
  5179 + const allTableMap = {};
  5180 + const allReturnMap = {};
  5181 + const slaveNameList = [];
5182 5182 /* 从props找到 所有的Config */
5183   - if(commonUtils.isNotEmptyArr(this.props)) {
  5183 + if (commonUtils.isNotEmptyArr(this.props)) {
5184 5184 for (const key of Object.keys(this.props)) {
5185   - if(key.includes('Config') && !key.includes('onGet') && !key.includes('report')) {
5186   - const tablename = key.replace('Config', '').trim();
  5185 + if (key.includes('Config') && !key.includes('onGet') && !key.includes('report')) {
  5186 + const tablename = key.replace('Config', '').trim();
5187 5187 slaveNameList.push(tablename);
5188 5188 }
5189 5189 }
... ... @@ -5191,13 +5191,13 @@ export default (ChildComponent) =&gt; {
5191 5191  
5192 5192 if (commonUtils.isNotEmptyArr(slaveNameList)) {
5193 5193 slaveNameList.forEach((name, index) => {
5194   - const tableConfig = this.props[name +'Config']; /* 动态配置 */
5195   - const tableData = this.props[name +'Data']; /* 动态配置 */
5196   - const tableSelectedRowKeys = this.props[name + 'SelectedRowKeys']; /* 选中Key */
5197   - allTableMap[name +'.'+ tableConfig.sTbName] = tableData
  5194 + const tableConfig = this.props[name + 'Config']; /* 动态配置 */
  5195 + const tableData = this.props[name + 'Data']; /* 动态配置 */
  5196 + const tableSelectedRowKeys = this.props[name + 'SelectedRowKeys']; /* 选中Key */
  5197 + allTableMap[name + '.' + tableConfig.sTbName] = tableData
5198 5198 })
5199 5199 const masterTbName = masterConfig.sTbName;
5200   - allTableMap['master.'+ masterTbName] = masterData;
  5200 + allTableMap['master.' + masterTbName] = masterData;
5201 5201 }
5202 5202 const sButtonParam = btnConfig.sButtonParam;
5203 5203 const btn = JSON.parse(sButtonParam);
... ... @@ -5215,16 +5215,16 @@ export default (ChildComponent) =&gt; {
5215 5215 const returnData = dataReturn.dataset.rows[0];
5216 5216 if (commonUtils.isNotEmptyArr(slaveNameList) && commonUtils.isNotEmptyObject(returnData)) {
5217 5217 slaveNameList.forEach((name, index) => {
5218   - const tableConfig = this.props[name +'Config']; /* 动态配置 */
  5218 + const tableConfig = this.props[name + 'Config']; /* 动态配置 */
5219 5219 let tableData = [];
5220   - if(commonUtils.isNotEmptyObject(tableConfig)) {
5221   - console.log('666', name +'.'+ tableConfig.sTbName);
5222   - tableData = returnData[name +'.'+ tableConfig.sTbName]; /* 动态配置 */
  5220 + if (commonUtils.isNotEmptyObject(tableConfig)) {
  5221 + console.log('666', name + '.' + tableConfig.sTbName);
  5222 + tableData = returnData[name + '.' + tableConfig.sTbName]; /* 动态配置 */
5223 5223 }
5224   - allReturnMap[name +'Data'] = tableData;
  5224 + allReturnMap[name + 'Data'] = tableData;
5225 5225 });
5226 5226 const masterTbName = masterConfig.sTbName;
5227   - allReturnMap.master = returnData['master.'+ masterTbName];
  5227 + allReturnMap.master = returnData['master.' + masterTbName];
5228 5228 }
5229 5229 this.props.onSaveState({ ...allReturnMap });
5230 5230 } else { /* 失败 */
... ... @@ -5466,11 +5466,11 @@ export default (ChildComponent) =&gt; {
5466 5466 }
5467 5467  
5468 5468 /* 取消表格行选中 */
5469   - handleTableCancelSelect= (name) => {
  5469 + handleTableCancelSelect = (name) => {
5470 5470 const { [`${name}SelectedRowKeys`]: tableSelectedRowKeys } = this.props;
5471 5471 if (name === 'slave' && commonUtils.isNotEmptyArr(tableSelectedRowKeys)) {
5472 5472 this.props.onSaveState({
5473   - [`${name}SelectedRowKeys`]: [], controlSelectedRowKeys :[],
  5473 + [`${name}SelectedRowKeys`]: [], controlSelectedRowKeys: [],
5474 5474 });
5475 5475 }
5476 5476 }
... ... @@ -5556,7 +5556,7 @@ export default (ChildComponent) =&gt; {
5556 5556 if (commonUtils.isNotEmptyObject(slaveSelectOneData)) {
5557 5557 paramType = slaveSelectOneData.sProcessParam;
5558 5558 }
5559   - if(commonUtils.isEmpty(paramType)) {
  5559 + if (commonUtils.isEmpty(paramType)) {
5560 5560 message.warn('无报价参数!');
5561 5561 return;
5562 5562 }
... ... @@ -5619,29 +5619,29 @@ export default (ChildComponent) =&gt; {
5619 5619 }
5620 5620 }
5621 5621 /* 将sParam1中的数据 还原到sParamData数据中 */
5622   - if(commonUtils.isNotEmptyObject(record.sQuoParams)) {
  5622 + if (commonUtils.isNotEmptyObject(record.sQuoParams)) {
5623 5623 const selectedData = JSON.parse(record.sQuoParams);
5624   - if(commonUtils.isNotEmptyArr(selectedData)) {
  5624 + if (commonUtils.isNotEmptyArr(selectedData)) {
5625 5625 selectedData.forEach((itemS) => {
5626 5626 const iIndex = sParamData.findIndex(item => item.sParamName === itemS.sParamName);
5627   - if(iIndex > -1) {
5628   - const addState ={};
  5627 + if (iIndex > -1) {
  5628 + const addState = {};
5629 5629 addState.sParamValue = itemS.sParamValue;
5630 5630 addState.bSelfCbx = itemS.bSelfCbx;
5631   - sParamData[iIndex] ={...sParamData[iIndex], ...addState};
  5631 + sParamData[iIndex] = { ...sParamData[iIndex], ...addState };
5632 5632 }
5633 5633 });
5634 5634 }
5635 5635  
5636 5636 /* 如果数据集有一个是非选中的则非选中状态 否则全选 */
5637   - if(commonUtils.isNotEmptyArr(sParamColumn)) {
5638   - const iIndex = sParamColumn.findIndex(item => item.dataIndex ==='bSelfCbx');
5639   - if(iIndex > -1) {
  5637 + if (commonUtils.isNotEmptyArr(sParamColumn)) {
  5638 + const iIndex = sParamColumn.findIndex(item => item.dataIndex === 'bSelfCbx');
  5639 + if (iIndex > -1) {
5640 5640 const filterData = sParamData.filter(item => !item.bSelfCbx);
5641   - if(commonUtils.isNotEmptyArr(filterData)) {
5642   - sParamColumn[iIndex] ={ ...sParamColumn[iIndex], bCheckAll:false};
5643   - }else {
5644   - sParamColumn[iIndex] ={ ...sParamColumn[iIndex], bCheckAll:true};
  5641 + if (commonUtils.isNotEmptyArr(filterData)) {
  5642 + sParamColumn[iIndex] = { ...sParamColumn[iIndex], bCheckAll: false };
  5643 + } else {
  5644 + sParamColumn[iIndex] = { ...sParamColumn[iIndex], bCheckAll: true };
5645 5645 }
5646 5646 }
5647 5647 }
... ... @@ -5654,7 +5654,7 @@ export default (ChildComponent) =&gt; {
5654 5654 sParamConfig,
5655 5655 sParamColumn,
5656 5656 sParamData,
5657   - sParamModalType:'sQuo'
  5657 + sParamModalType: 'sQuo'
5658 5658 });
5659 5659 } else if (name === 'process' && sName === 'sParams') { // process sProcessParam
5660 5660 const { processConfig, enabled, sModelsType } = this.props;
... ... @@ -5666,7 +5666,7 @@ export default (ChildComponent) =&gt; {
5666 5666 if (commonUtils.isNotEmptyObject(slaveSelectOneData)) {
5667 5667 paramType = slaveSelectOneData.sWorkOrderParam;
5668 5668 }
5669   - if(commonUtils.isEmpty(paramType)) {
  5669 + if (commonUtils.isEmpty(paramType)) {
5670 5670 message.warn('无工艺参数!');
5671 5671 return;
5672 5672 }
... ... @@ -5729,29 +5729,29 @@ export default (ChildComponent) =&gt; {
5729 5729 }
5730 5730 }
5731 5731 /* 将sParam1中的数据 还原到sParamData数据中 */
5732   - if(commonUtils.isNotEmptyObject(record.sParams)) {
  5732 + if (commonUtils.isNotEmptyObject(record.sParams)) {
5733 5733 const selectedData = JSON.parse(record.sParams);
5734   - if(commonUtils.isNotEmptyArr(selectedData)) {
  5734 + if (commonUtils.isNotEmptyArr(selectedData)) {
5735 5735 selectedData.forEach((itemS) => {
5736 5736 const iIndex = sParamData.findIndex(item => item.sParamName === itemS.sParamName);
5737   - if(iIndex > -1) {
5738   - const addState ={};
  5737 + if (iIndex > -1) {
  5738 + const addState = {};
5739 5739 addState.sParamValue = itemS.sParamValue;
5740 5740 addState.bSelfCbx = itemS.bSelfCbx;
5741   - sParamData[iIndex] ={...sParamData[iIndex], ...addState};
  5741 + sParamData[iIndex] = { ...sParamData[iIndex], ...addState };
5742 5742 }
5743 5743 });
5744 5744 }
5745 5745  
5746 5746 /* 如果数据集有一个是非选中的则非选中状态 否则全选 */
5747   - if(commonUtils.isNotEmptyArr(sParamColumn)) {
5748   - const iIndex = sParamColumn.findIndex(item => item.dataIndex ==='bSelfCbx');
5749   - if(iIndex > -1) {
  5747 + if (commonUtils.isNotEmptyArr(sParamColumn)) {
  5748 + const iIndex = sParamColumn.findIndex(item => item.dataIndex === 'bSelfCbx');
  5749 + if (iIndex > -1) {
5750 5750 const filterData = sParamData.filter(item => !item.bSelfCbx);
5751   - if(commonUtils.isNotEmptyArr(filterData)) {
5752   - sParamColumn[iIndex] ={ ...sParamColumn[iIndex], bCheckAll:false};
5753   - }else {
5754   - sParamColumn[iIndex] ={ ...sParamColumn[iIndex], bCheckAll:true};
  5751 + if (commonUtils.isNotEmptyArr(filterData)) {
  5752 + sParamColumn[iIndex] = { ...sParamColumn[iIndex], bCheckAll: false };
  5753 + } else {
  5754 + sParamColumn[iIndex] = { ...sParamColumn[iIndex], bCheckAll: true };
5755 5755 }
5756 5756 }
5757 5757 }
... ... @@ -5764,23 +5764,23 @@ export default (ChildComponent) =&gt; {
5764 5764 sParamConfig,
5765 5765 sParamColumn,
5766 5766 sParamData,
5767   - sParamModalType:'sWork',
  5767 + sParamModalType: 'sWork',
5768 5768 enabled,
5769 5769 });
5770   - }else if ( name === 'control' && sName === 'dSinglePQty') { /* 控制表 查看开版图 */
  5770 + } else if (name === 'control' && sName === 'dSinglePQty') { /* 控制表 查看开版图 */
5771 5771 this.props.onSaveState({
5772 5772 showSinglePQtyPictureVisible: true, /* 弹出查看开版图Modal*/
5773 5773 });
5774 5774 } else {
5775   - if(sName === 'myTableConfig') {
  5775 + if (sName === 'myTableConfig') {
5776 5776 this.handleQuickViewClick(name, sName, record, index, myConfig, configName);
5777 5777 } else {
5778   - this.props.onViewClick(name, sName, record, index, myConfig );
  5778 + this.props.onViewClick(name, sName, record, index, myConfig);
5779 5779 }
5780 5780 }
5781 5781 };
5782 5782  
5783   - handleQuickViewClick = async (name, sName, record, index , myConfigArr, configName) => {
  5783 + handleQuickViewClick = async (name, sName, record, index, myConfigArr, configName) => {
5784 5784 const {
5785 5785 slaveConfig,
5786 5786 slaveData,
... ... @@ -5800,7 +5800,7 @@ export default (ChildComponent) =&gt; {
5800 5800 } = this.props;
5801 5801  
5802 5802 let picArr = [];
5803   - if(commonUtils.isNotEmptyArr(myConfigArr)) {
  5803 + if (commonUtils.isNotEmptyArr(myConfigArr)) {
5804 5804 picArr = myConfigArr;
5805 5805 }
5806 5806  
... ... @@ -5881,7 +5881,7 @@ export default (ChildComponent) =&gt; {
5881 5881 /* 选择基础颜色 */
5882 5882 handleSelectSisColor = async (name, selectConfig, selectData) => {
5883 5883 const {
5884   - enabled, processData, processSelectedRowId, controlSelectedRowId, controlData, sisColorField, masterData, slaveSelectedRowKeys, slaveData,packData,
  5884 + enabled, processData, processSelectedRowId, controlSelectedRowId, controlData, sisColorField, masterData, slaveSelectedRowKeys, slaveData, packData,
5885 5885 } = this.props;
5886 5886 if (enabled && commonUtils.isNotEmptyObject(processSelectedRowId)) {
5887 5887 let sColorSerialMemoStr = '';
... ... @@ -5962,11 +5962,11 @@ export default (ChildComponent) =&gt; {
5962 5962 if (sFieldName === 'sPositiveColor') {
5963 5963 addState.iPositiveColor = trueColor;
5964 5964 addState.iPositiveSpecialColor = trueSpecialColor;
5965   - addState.sOppositeColor= controlData[iIndex].sOppositeColor;
  5965 + addState.sOppositeColor = controlData[iIndex].sOppositeColor;
5966 5966 } else if (sFieldName === 'sOppositeColor') {
5967 5967 addState.iOppositeColor = falseColor;
5968 5968 addState.iOppositeSpecialColor = falseSpecialColor;
5969   - addState.sPositiveColor= controlData[iIndex].sPositiveColor;
  5969 + addState.sPositiveColor = controlData[iIndex].sPositiveColor;
5970 5970 }
5971 5971 controlData[iIndex] = { ...controlData[iIndex], ...addState };
5972 5972 }
... ... @@ -5976,7 +5976,7 @@ export default (ChildComponent) =&gt; {
5976 5976 });
5977 5977 }
5978 5978  
5979   - handleViewChoose= (name, sName, record) => {
  5979 + handleViewChoose = (name, sName, record) => {
5980 5980 const { sId } = record; /* 控制表主键 */
5981 5981 const { enabled } = this.props;
5982 5982 const sisColorSelectedRowKeys = [];
... ... @@ -6005,7 +6005,7 @@ export default (ChildComponent) =&gt; {
6005 6005 sisColorSelectedRowKeys,
6006 6006 sisColorSelectedData: jsonData,
6007 6007 });
6008   - }else if (sName === 'sParams' && location.pathname.includes('productionReport')) { // 产量上报 工艺参数
  6008 + } else if (sName === 'sParams' && location.pathname.includes('productionReport')) { // 产量上报 工艺参数
6009 6009 const { enabled } = this.props;
6010 6010 const slaveSelectOneData = record;
6011 6011 const sProcessParamsSelects = [];
... ... @@ -6124,7 +6124,7 @@ export default (ChildComponent) =&gt; {
6124 6124 sParamModalType: 'sReport',
6125 6125 enabled,
6126 6126 });
6127   - }else if (enabled && name === 'control' && (sName === 'sPositiveColor' || sName === 'sOppositeColor')) { /* 控制表 选择正面颜色、反面颜色 */
  6127 + } else if (enabled && name === 'control' && (sName === 'sPositiveColor' || sName === 'sOppositeColor')) { /* 控制表 选择正面颜色、反面颜色 */
6128 6128 const { [`${name}Data`]: tableData } = this.props;
6129 6129 const iIndex = tableData.findIndex(item => item.sId === sId);
6130 6130 if (iIndex > -1) {
... ... @@ -6183,15 +6183,15 @@ export default (ChildComponent) =&gt; {
6183 6183 }
6184 6184 /* 根据不同条件 计算排版数 */
6185 6185 //竖排(上机高、上机宽、部件高、部件宽、出血咬口) dPartsLength --》dMachineLength,dPartsWidth--》dMachineWidth
6186   - getSp = (dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth)=>{
  6186 + getSp = (dMachineLength, dMachineWidth, dPartsLength, dPartsWidth) => {
6187 6187 var dMachineWidth = dMachineWidth;
6188 6188 var dMachineLength = dMachineLength;
6189 6189 //计算合版数量
6190   - var iTemp = Math.floor(dMachineWidth / dPartsWidth) * Math.floor(dMachineLength /dPartsLength );
  6190 + var iTemp = Math.floor(dMachineWidth / dPartsWidth) * Math.floor(dMachineLength / dPartsLength);
6191 6191 return iTemp;
6192 6192 }
6193 6193 //横排(上机高、上机宽、部件高、部件宽、出血咬口) dPartsLength --》dMachineWidth,dPartsWidth--》dMachineLength
6194   - getHp = (dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth) =>{
  6194 + getHp = (dMachineLength, dMachineWidth, dPartsLength, dPartsWidth) => {
6195 6195 var dMachineWidth = dMachineWidth;
6196 6196 var dMachineLength = dMachineLength;
6197 6197 //计算合版数量
... ... @@ -6199,10 +6199,10 @@ export default (ChildComponent) =&gt; {
6199 6199 return iTemp;
6200 6200 }
6201 6201 //横竖取大
6202   - getHSQD = (dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth) =>{
6203   - var iTemp =this.getHp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
6204   - var iTemp2 =this.getSp(dMachineLength,dMachineWidth,dPartsLength,dPartsWidth);
6205   - if(iTemp2>iTemp){
  6202 + getHSQD = (dMachineLength, dMachineWidth, dPartsLength, dPartsWidth) => {
  6203 + var iTemp = this.getHp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
  6204 + var iTemp2 = this.getSp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
  6205 + if (iTemp2 > iTemp) {
6206 6206 iTemp = iTemp2;
6207 6207 // tag= 2;//竖排
6208 6208 }
... ... @@ -6227,97 +6227,97 @@ export default (ChildComponent) =&gt; {
6227 6227 var xxfx = 3;//虚线方向 1:横虚线 2:树虚线;3:无需虚线
6228 6228 var wlfx = 1;//竖纹
6229 6229 //机器长宽转换
6230   - if(dMachineWidth > dMachineLength){
  6230 + if (dMachineWidth > dMachineLength) {
6231 6231 dMachineTmp = dMachineWidth;//上级高
6232 6232 dMachineWidth = dMachineLength;//上级宽
6233 6233 dMachineLength = dMachineTmp;
6234 6234 wlfx = 2;
6235 6235 }
6236 6236 //长宽转换(dLength 高度、dWidth 表示宽度,高度永远大于宽度)
6237   - if(dPartsWidth > dPartsLength){
  6237 + if (dPartsWidth > dPartsLength) {
6238 6238 dPartsTmp = dPartsWidth;//上级高
6239 6239 dPartsWidth = dPartsLength;//上级宽
6240 6240 dPartsLength = dPartsTmp;
6241 6241 }
6242   - dMachineWidth = dMachineWidth-dBite;
  6242 + dMachineWidth = dMachineWidth - dBite;
6243 6243  
6244 6244 const sCutMethod = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.sCutMethod, 0)); /* 裁切方式 */
6245 6245 const sSpineDirection = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.sSpineDirection, 0)); /* 书脊方向 */
6246   - const sPrintingPlate = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.sPrintingPlate, 0)); /* 排版方式 */
  6246 + const sPrintingPlate = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.sPrintingPlate, 0)); /* 排版方式 */
6247 6247 // console.log('sPrintingPlate', sPrintingPlate);
6248 6248 // console.log('sCutMethod', sCutMethod);
6249 6249 // console.log('sSpineDirection', sSpineDirection);
6250 6250 let tmpBl = 1;//排版数乘的数字,如果书类为2 默认是1
6251 6251 let tmp = 0;
6252 6252 //三边裁切
6253   - if( sCutMethod === 1){
  6253 + if (sCutMethod === 1) {
6254 6254 //长书(1,3,4)
6255   - if(sSpineDirection=== 1){
  6255 + if (sSpineDirection === 1) {
6256 6256 dPartsLength = dPartsLength;
6257   - dPartsWidth = dPartsWidth*2;
6258   - }else{
  6257 + dPartsWidth = dPartsWidth * 2;
  6258 + } else {
6259 6259 dPartsWidth = dPartsWidth
6260   - dPartsLength = dPartsLength*2;
  6260 + dPartsLength = dPartsLength * 2;
6261 6261 }
6262 6262 tmpBl = 2;
6263   - dPartsWidth = dPartsWidth + 2*dBoold;
6264   - dPartsLength = dPartsLength + 2*dBoold;
6265   - if(sPrintingPlate === 1){ /* 横竖取大 */
6266   - tmp = this.getHSQD(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
6267   - dSingleQty = tmp*2;
  6263 + dPartsWidth = dPartsWidth + 2 * dBoold;
  6264 + dPartsLength = dPartsLength + 2 * dBoold;
  6265 + if (sPrintingPlate === 1) { /* 横竖取大 */
  6266 + tmp = this.getHSQD(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
  6267 + dSingleQty = tmp * 2;
6268 6268 console.log('横竖取大排版数:', dSingleQty);
6269   - }else if(sPrintingPlate ===3){ /* 横排 */
6270   - if(wlfx===1 && sSpineDirection===1){
  6269 + } else if (sPrintingPlate === 3) { /* 横排 */
  6270 + if (wlfx === 1 && sSpineDirection === 1) {
6271 6271 //长书脊
6272   - tmp = this.getHp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
6273   - dSingleQty = tmp*2;
6274   - }else if(wlfx===2 && sSpineDirection===1){
  6272 + tmp = this.getHp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
  6273 + dSingleQty = tmp * 2;
  6274 + } else if (wlfx === 2 && sSpineDirection === 1) {
6275 6275 //长书脊
6276   - tmp = this.getSp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
  6276 + tmp = this.getSp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
6277 6277 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,4,1);
6278   - dSingleQty = tmp*2;
6279   - }else if(wlfx===1 && sSpineDirection===2){
  6278 + dSingleQty = tmp * 2;
  6279 + } else if (wlfx === 1 && sSpineDirection === 2) {
6280 6280 //长书脊
6281   - tmp = this.getSp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
  6281 + tmp = this.getSp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
6282 6282 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,4,1);
6283   - dSingleQty = tmp*2;
6284   - }else if(wlfx==2 && sSpineDirection==2){
  6283 + dSingleQty = tmp * 2;
  6284 + } else if (wlfx == 2 && sSpineDirection == 2) {
6285 6285 //长书脊
6286   - tmp = this.getHp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
  6286 + tmp = this.getHp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
6287 6287 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,3,2);
6288   - dSingleQty = tmp*2;
  6288 + dSingleQty = tmp * 2;
6289 6289 }
6290   - }else if(sPrintingPlate===4) { /* 竖排 */
  6290 + } else if (sPrintingPlate === 4) { /* 竖排 */
6291 6291 //竖排
6292   - if(wlfx===1 && sSpineDirection===1){
  6292 + if (wlfx === 1 && sSpineDirection === 1) {
6293 6293 //长书脊
6294   - tmp = this.getSp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
  6294 + tmp = this.getSp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
6295 6295 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,4,1);
6296   - dSingleQty = tmp*2;
6297   - }else if(wlfx===2 && sSpineDirection===1){
  6296 + dSingleQty = tmp * 2;
  6297 + } else if (wlfx === 2 && sSpineDirection === 1) {
6298 6298 //长书脊
6299   - tmp = this.getHp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
  6299 + tmp = this.getHp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
6300 6300 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,3,2);
6301   - dSingleQty = tmp*2;
6302   - }else if(wlfx===1 && sSpineDirection===2){
  6301 + dSingleQty = tmp * 2;
  6302 + } else if (wlfx === 1 && sSpineDirection === 2) {
6303 6303 //长书脊
6304   - tmp = this.getHp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
  6304 + tmp = this.getHp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
6305 6305 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,3,2);
6306   - dSingleQty = tmp*2;
6307   - }else if(wlfx===2 && sSpineDirection===2){
  6306 + dSingleQty = tmp * 2;
  6307 + } else if (wlfx === 2 && sSpineDirection === 2) {
6308 6308 //长书脊
6309   - tmp = this.getSp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
  6309 + tmp = this.getSp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
6310 6310 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,4,1);
6311   - dSingleQty = tmp*2;
  6311 + dSingleQty = tmp * 2;
6312 6312 }
6313   - }else if(sPrintingPlate===2){ /* 混排 */
  6313 + } else if (sPrintingPlate === 2) { /* 混排 */
6314 6314 //混排 横排 多余部分 看看是否能够竖着排 如果竖排 看看能否再横着排(折页没有混排)
6315 6315 }
6316   - }else{ /* 四边裁 */
6317   - dPartsWidth = dPartsWidth+2*dBoold;
6318   - dPartsLength = dPartsLength+2*dBoold;
6319   - if(sPrintingPlate===1){
6320   - tmp = this.getHSQD(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
  6316 + } else { /* 四边裁 */
  6317 + dPartsWidth = dPartsWidth + 2 * dBoold;
  6318 + dPartsLength = dPartsLength + 2 * dBoold;
  6319 + if (sPrintingPlate === 1) {
  6320 + tmp = this.getHSQD(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
6321 6321 //1:横虚线 2:树虚线;3:无需虚线
6322 6322 // if(tag==2){
6323 6323 // //alert("横竖取大==版数:"+tmp);
... ... @@ -6326,17 +6326,17 @@ export default (ChildComponent) =&gt; {
6326 6326 // //alert("横竖取大==版数:"+tmp);
6327 6327 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,3,3);
6328 6328 // }
6329   - console.log("四边裁-横竖取大:"+tmp);
  6329 + console.log("四边裁-横竖取大:" + tmp);
6330 6330 dSingleQty = tmp;
6331   - }else if(sPrintingPlate===3){
6332   - if(wlfx===1){
  6331 + } else if (sPrintingPlate === 3) {
  6332 + if (wlfx === 1) {
6333 6333 //长书级
6334   - tmp = this.getHp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
  6334 + tmp = this.getHp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
6335 6335 dSingleQty = tmp;
6336 6336 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,3,3);
6337   - }else{
  6337 + } else {
6338 6338 //长书级
6339   - tmp = this.getSp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
  6339 + tmp = this.getSp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
6340 6340 dSingleQty = tmp;
6341 6341 // $("#dPlateQty").val(tmp);
6342 6342 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,4,3);
... ... @@ -6344,60 +6344,60 @@ export default (ChildComponent) =&gt; {
6344 6344 // var tmp = getHp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
6345 6345 // alert("横排版数:"+tmp);
6346 6346 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,3,2);
6347   - }else if(sPrintingPlate===4) {
  6347 + } else if (sPrintingPlate === 4) {
6348 6348 //竖排
6349   - if(wlfx===1){
  6349 + if (wlfx === 1) {
6350 6350 //长书级
6351   - tmp = this.getSp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
6352   - console.log("竖排版数:"+tmp);
  6351 + tmp = this.getSp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
  6352 + console.log("竖排版数:" + tmp);
6353 6353 dSingleQty = tmp;
6354 6354 // $("#dPlateQty").val(tmp);
6355 6355 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,4,3);
6356   - }else{
  6356 + } else {
6357 6357 //长书级
6358   - tmp = this.getHp(dMachineLength,dMachineWidth ,dPartsLength ,dPartsWidth);
6359   - console.log("竖排版数:"+tmp);
  6358 + tmp = this.getHp(dMachineLength, dMachineWidth, dPartsLength, dPartsWidth);
  6359 + console.log("竖排版数:" + tmp);
6360 6360 dSingleQty = tmp;
6361 6361 // $("#dPlateQty").val(tmp);
6362 6362 // addHtml(dMachineLength,dMachineWidth ,dPartsLength,dPartsWidth,dBoold ,dBite,3,3);
6363 6363 }
6364   - }else if(sPrintingPlate===2){
  6364 + } else if (sPrintingPlate === 2) {
6365 6365 //混排 横排 多余部分 看看是否能够竖着排 如果竖排 看看能否再横着排(折页没有混排)
6366   - if( sCutMethod===1){
  6366 + if (sCutMethod === 1) {
6367 6367 message.warning("书没有混排");
6368 6368 return;
6369 6369 }
6370 6370 //竖排+横排
6371 6371 let htTmpTag = 0;
6372 6372 let tmp3 = 0;
6373   - tmp = this.getHHP(dMachineWidth,dMachineLength ,dPartsLength ,dPartsWidth);
6374   - tmp3 = this.getHHP(dMachineWidth,dMachineLength ,dPartsWidth,dPartsLength);
6375   - if(tmp<tmp3){
  6373 + tmp = this.getHHP(dMachineWidth, dMachineLength, dPartsLength, dPartsWidth);
  6374 + tmp3 = this.getHHP(dMachineWidth, dMachineLength, dPartsWidth, dPartsLength);
  6375 + if (tmp < tmp3) {
6376 6376 tmp = tmp3;
6377 6377 htTmpTag = 1;
6378 6378 }
6379 6379 // alert("混拼排版数:"+tmp);
6380 6380 // $("#dPlateQty").val(tmp);
6381   - console.log("混拼排版数:"+tmp);
  6381 + console.log("混拼排版数:" + tmp);
6382 6382 dSingleQty = tmp;
6383 6383 }
6384 6384 }
6385 6385  
6386   - const lrl= ((tmp*dPartsLength*dPartsWidth)/(dMachineWidth*(dMachineLength+dBite)))*100 ;
  6386 + const lrl = ((tmp * dPartsLength * dPartsWidth) / (dMachineWidth * (dMachineLength + dBite))) * 100;
6387 6387  
6388   - console.log("利润率:"+ lrl);
  6388 + console.log("利润率:" + lrl);
6389 6389 // $("#dLylQty").val(((tmp*dPartsLength*dPartsWidth)/(dMachineWidth*(dMachineLength+dBite)))*100);
6390 6390 // $("#dPlateQty").css("background-color","#0000ff80");
6391 6391 // $("#dLylQty").css("background-color","#0000ff80");
6392 6392 return dSingleQty;
6393 6393 }
6394 6394  
6395   - /* 查询单表数据 */
6396   - handleGetDataOne = async (name, slaveInfoConfig, slaveFilterCondition, page, pageSize, slaveOrderBy, props, isWait) => {
  6395 + /* 查询单表数据 */
  6396 + handleGetDataOne = async (name, slaveInfoConfig, slaveFilterCondition, page, pageSize, slaveOrderBy, props, isWait) => {
6397 6397 const { slaveData, slaveSelectedRowKeys } = props || this.props;
6398 6398 if (commonUtils.isNotEmptyArr(slaveData) && commonUtils.isNotEmptyObject(slaveInfoConfig)) {
6399   - let record = slaveData[0]; /* 从表选中行 没有选中行时 取第一行 */
6400   - if(commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) {
  6399 + let record = slaveData[0]; /* 从表选中行 没有选中行时 取第一行 */
  6400 + if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) {
6401 6401 const iIndex = slaveData.findIndex(item => item.sId === slaveSelectedRowKeys[0]);
6402 6402 if (iIndex > -1) {
6403 6403 record = slaveData[iIndex];
... ... @@ -6408,7 +6408,7 @@ export default (ChildComponent) =&gt; {
6408 6408 if (commonUtils.isNotEmptyObject(sSqlCondition0)) {
6409 6409 conditonValues = this.props.getSqlCondition(slaveInfoConfig, 'slave', record);
6410 6410 }
6411   - conditonValues = { sParentId: record.sId, ...conditonValues};
  6411 + conditonValues = { sParentId: record.sId, ...conditonValues };
6412 6412 const pageNum = commonUtils.isEmpty(page) ? 1 : page;
6413 6413 const pageTableSize = commonUtils.isNotEmptyNumber(pageSize) ? pageSize : commonConfig.pageSize;
6414 6414 let addState = await this.props.handleGetDataSet({
... ... @@ -6419,10 +6419,10 @@ export default (ChildComponent) =&gt; {
6419 6419 },
6420 6420 flag: true,
6421 6421 clearSelectData: true,
6422   - isWait:true,
  6422 + isWait: true,
6423 6423 });
6424   - if(isWait) {
6425   - if(commonUtils.isEmptyObject(addState)) {
  6424 + if (isWait) {
  6425 + if (commonUtils.isEmptyObject(addState)) {
6426 6426 addState = {};
6427 6427 }
6428 6428 addState.pageLoading = false;
... ... @@ -6648,7 +6648,7 @@ export default (ChildComponent) =&gt; {
6648 6648 };
6649 6649  
6650 6650 /* 单据字段单击右键全部更新,弹出窗选择后,更新此列所有数据。(只更新非只读字段) */
6651   - handleContextMenuOk=(contextMenuValue) => {
  6651 + handleContextMenuOk = (contextMenuValue) => {
6652 6652 const {
6653 6653 contextMenuConfig, contextMenuTbName, [`${contextMenuTbName}Data`]: tableData, [`${contextMenuTbName}SelectedRowKeys`]: selectedRowKeys,
6654 6654 } = this.props;
... ... @@ -6691,19 +6691,19 @@ export default (ChildComponent) =&gt; {
6691 6691 enabled,
6692 6692 sParamModalType
6693 6693 } = this.props;
6694   - if(enabled) {
  6694 + if (enabled) {
6695 6695 if (commonUtils.isNotEmptyArr(processData) && commonUtils.isNotEmptyObject(processRecord)) {
6696 6696 const processSelectDataIndex = processData.findIndex(item => item.sId === processRecord.sId);
6697 6697 if (processSelectDataIndex > -1) {
6698 6698 if (commonUtils.isNotEmptyArr(sParamData)) {
6699 6699 let sParamJsonData = '';
6700 6700 const sParamSeletedData = sParamData.filter(item => item.bSelfCbx);
6701   - if(commonUtils.isNotEmptyObject(sParamSeletedData)) {
  6701 + if (commonUtils.isNotEmptyObject(sParamSeletedData)) {
6702 6702 sParamJsonData = JSON.stringify(sParamSeletedData);
6703 6703 }
6704 6704 let { handleType } = processData[processSelectDataIndex];
6705 6705 handleType = commonUtils.isEmpty(handleType) ? 'update' : handleType;
6706   - if(sParamModalType === 'sQuo') { /* 报价参数点击确定 */
  6706 + if (sParamModalType === 'sQuo') { /* 报价参数点击确定 */
6707 6707 processData[processSelectDataIndex].sQuoParams = sParamJsonData;
6708 6708 } else { /* 工单参数点击确定 */
6709 6709 processData[processSelectDataIndex].sParams = sParamJsonData;
... ... @@ -6763,7 +6763,7 @@ export default (ChildComponent) =&gt; {
6763 6763 }
6764 6764 }
6765 6765  
6766   - /* 动态参数标题选择框 全选/取消全选 */
  6766 + /* 动态参数标题选择框 全选/取消全选 */
6767 6767 handleCheckParamChange = (name) => {
6768 6768 const {
6769 6769 processData,
... ... @@ -6774,17 +6774,17 @@ export default (ChildComponent) =&gt; {
6774 6774 enabled,
6775 6775 } = this.props;
6776 6776 /* 全选 取消全选功能 */
6777   - if(commonUtils.isNotEmptyArr(sParamData)) {
  6777 + if (commonUtils.isNotEmptyArr(sParamData)) {
6778 6778 /* 标题bSelfCbx加标识 */
6779   - const iIndex = sParamColumn.findIndex(item=>item.dataIndex ==='bSelfCbx');
6780   - if(iIndex > -1) {
  6779 + const iIndex = sParamColumn.findIndex(item => item.dataIndex === 'bSelfCbx');
  6780 + if (iIndex > -1) {
6781 6781 let bSelfCbx = false;
6782   - if(sParamColumn[iIndex].bCheckAll) {
  6782 + if (sParamColumn[iIndex].bCheckAll) {
6783 6783 bSelfCbx = false;
6784 6784 } else {
6785 6785 bSelfCbx = true;
6786 6786 }
6787   - sParamColumn[iIndex] = {...sParamColumn[iIndex],bCheckAll:bSelfCbx}
  6787 + sParamColumn[iIndex] = { ...sParamColumn[iIndex], bCheckAll: bSelfCbx }
6788 6788 sParamData.forEach((item, index) => {
6789 6789 sParamData[index] = { ...sParamData[index], bSelfCbx: bSelfCbx };
6790 6790 })
... ... @@ -7360,34 +7360,820 @@ export default (ChildComponent) =&gt; {
7360 7360 let tableDataRow = {};
7361 7361 if (sFieldName === 'sMaterialsNo' || sFieldName === 'sMaterialsName' || sFieldName === 'dAuxiliaryQty' || sFieldName === 'dReelAuxiliaryQty' || sFieldName === 'dConversionQty' || sFieldName === 'sMaterialsStyle') {
7362 7362 let iIndex = -1;
7363   - if(commonUtils.isEmptyArr(tableSelectedRowKeys)) {
  7363 + if (commonUtils.isEmptyArr(tableSelectedRowKeys)) {
7364 7364 iIndex = 0;
7365 7365 } else {
7366 7366 tableData.findIndex(item => item.sId === tableSelectedRowKeys.toString())
7367 7367 }
7368 7368 tableDataRow = await this.handleMaterialsChange(record, sModelsId, masterData, {}, sFieldName, app, token, models);
7369   - if(iIndex > -1) {
  7369 + if (iIndex > -1) {
7370 7370 tableData[iIndex] = tableDataRow;
7371 7371 }
7372   - this.props.onSaveState({ [`${name}Data`]: tableData})
  7372 + this.props.onSaveState({ [`${name}Data`]: tableData })
7373 7373 } else {
7374 7374 this.props.onDropDownBlur(name, sFieldName, record, tableConfig);
7375 7375 }
7376 7376 };
7377 7377  
7378   - handleShowParam = (name, record, tableSelectedRowKeys) => {
  7378 + handleShowParam = (name, record, tableSelectedRowKeys) => {
7379 7379 let processSelectedData = [];
7380   - if(commonUtils.isNotEmptyObject(record)) {
  7380 + if (commonUtils.isNotEmptyObject(record)) {
7381 7381 processSelectedData = [record];
7382 7382 }
7383 7383 this.props.onSaveState({
7384 7384 commonParamVisible: true,
7385 7385 processSelectedData,
7386   - processSelectedRowKeys:tableSelectedRowKeys,
  7386 + processSelectedRowKeys: tableSelectedRowKeys,
7387 7387 });
7388 7388 }
7389 7389  
  7390 + handleSelectCommonPopup = (currentPaneName, selectConfig, selectData, tbName, commonPopupShowConfig, other) => {
  7391 + const {
  7392 + [`${tbName}Data`]: tableData, [`${tbName}SelectedRowKeys`]: tableSelectedRowKeys, masterData, processConfig,
  7393 + } = this.props;
  7394 +
  7395 + /* 工单,工艺卡 放大镜选择材料 直接插入全部材料中 */
  7396 + if (selectConfig.sControlName && selectConfig.sControlName === 'BtnPopupMaterialsWorkOrder') {
  7397 +
  7398 + let { materials0Data, materials1Data, materials1Config, materials2Data, materials2Config, } = this.props;
  7399 +
  7400 + if (commonUtils.isEmptyArr(materials0Data)) {
  7401 + materials0Data = [];
  7402 + }
  7403 + if (commonUtils.isEmptyArr(materials1Data)) {
  7404 + materials1Data = [];
  7405 + }
  7406 + if (commonUtils.isEmptyArr(materials2Data)) {
  7407 + materials2Data = [];
  7408 + }
  7409 + /* 找到放大镜复制到配置 */
  7410 +
  7411 + /* 材料大类 */
  7412 + const copyToConfig = processConfig.gdsconfigformslave.filter(item => item.sControlName.toLowerCase() === `${selectConfig.sControlName}.materials0`.toLowerCase());
  7413 + const copyToAssignField = commonUtils.isNotEmptyArr(copyToConfig) ? copyToConfig[0].sAssignField : ''; /* 材料大类 */
  7414 +
  7415 + const addState = {};
  7416 + const iIndex = commonUtils.isNotEmptyArr(tableSelectedRowKeys) ? tableData.findIndex(item => item.sId === tableSelectedRowKeys[0]) : -1;
  7417 + if (commonUtils.isNotEmptyArr(selectData)) {
  7418 + const selectFilterDataAll = selectData; /* 除了油墨,专色墨,电化铝之外的物料大类 */
  7419 +
  7420 + /* 全部材料 */
  7421 + if (commonUtils.isNotEmptyArr(selectFilterDataAll)) {
  7422 + selectFilterDataAll.forEach((item, index) => {
  7423 + const newCopyTo = {};
  7424 + newCopyTo.master = masterData;
  7425 + if (iIndex > -1) {
  7426 + newCopyTo.materials0 = item;
  7427 + }
  7428 + let tableDataRowAdd = this.handleTableAdd('materials0', true);
  7429 + item.handleType = 'add';
  7430 + // tableDataRowAdd = { ...tableDataRowAdd, ...item }; // 取赋值字段
  7431 + tableDataRowAdd = { ...tableDataRowAdd, ...commonFunc.getAssignFieldValue(copyToAssignField, item) }; // 取赋值字段
  7432 + tableDataRowAdd.sId = commonUtils.createSid();
  7433 + tableDataRowAdd.sParentId = masterData.sId;
  7434 + tableDataRowAdd.sParentSlaveId = tableData[iIndex].sId; /* 选中从表的sId */
  7435 + materials0Data.push(tableDataRowAdd);
  7436 + });
  7437 + }
  7438 + console.log('222', materials0Data, copyToAssignField);
  7439 +
  7440 + if (commonUtils.isNotEmptyArr(materials0Data) && location.pathname.includes('processCardPackTableTree')) {
  7441 + /* 根据配置过滤数据 */
  7442 + const sSqlCondition1 = materials1Config ? materials1Config.sSqlCondition : 'materials0.sBclassifyName.油墨';
  7443 + if (commonUtils.isNotEmptyObject(sSqlCondition1)) {
  7444 + let targetTbName = sSqlCondition1.split('.')[0]; /* 1.表名 control */
  7445 + let filteredValue = sSqlCondition1.split('.')[1]; /* 2.解析filterValue: controlSelectedRowKeys */
  7446 + let sParentKey = sSqlCondition1.split('.')[2]; /* 2.解析本身表对应的值,如控制表筛选材料表 则材料表的sControlId = 控制表的controlSelectedRowKeys[0] */
  7447 + if (targetTbName === 'materials0') {
  7448 + const filterData = materials0Data.filter(item => sParentKey && sParentKey.includes(item[filteredValue]));
  7449 + if (commonUtils.isNotEmptyArr(filterData))
  7450 + filterData.forEach((item, index) => {
  7451 + materials1Data.push(item);
  7452 + })
  7453 + }
  7454 + }
  7455 +
  7456 +
  7457 + const sSqlCondition2 = materials2Config ? materials2Config.sSqlCondition : 'materials0.sBclassifyName.电化铝';
  7458 + if (commonUtils.isNotEmptyObject(sSqlCondition2)) {
  7459 + let targetTbName = sSqlCondition2.split('.')[0]; /* 1.表名 control */
  7460 + let filteredValue = sSqlCondition2.split('.')[1]; /* 2.解析filterValue: controlSelectedRowKeys */
  7461 + let sParentKey = sSqlCondition2.split('.')[2]; /* 2.解析本身表对应的值,如控制表筛选材料表 则材料表的sControlId = 控制表的controlSelectedRowKeys[0] */
  7462 + if (targetTbName === 'materials0') {
  7463 + const filterData = materials0Data.filter(item => item[filteredValue] === sParentKey);
  7464 + if (commonUtils.isNotEmptyArr(filterData))
  7465 + filterData.forEach((item, index) => {
  7466 + materials2Data.push(item);
  7467 + })
  7468 + }
  7469 + }
  7470 +
  7471 + addState.materials1Data = materials1Data;
  7472 + addState.materials2Data = materials2Data;
  7473 + } else if (commonUtils.isNotEmptyArr(materials0Data) && location.pathname.includes('workOrderResearchTableTree')) {
  7474 + /* 根据配置过滤数据 */
  7475 + const sSqlCondition1 = materials1Config ? materials1Config.sSqlCondition : 'materials0.sBclassifyName.纸张';
  7476 + if (commonUtils.isNotEmptyObject(sSqlCondition1)) {
  7477 + let targetTbName = sSqlCondition1.split('.')[0]; /* 1.表名 control */
  7478 + let filteredValue = sSqlCondition1.split('.')[1]; /* 2.解析filterValue: controlSelectedRowKeys */
  7479 + let sParentKey = sSqlCondition1.split('.')[2]; /* 2.解析本身表对应的值,如控制表筛选材料表 则材料表的sControlId = 控制表的controlSelectedRowKeys[0] */
  7480 + if (targetTbName === 'materials0') {
  7481 + const filterData = materials0Data.filter(item => sParentKey && sParentKey.includes(item[filteredValue]));
  7482 + if (commonUtils.isNotEmptyArr(filterData))
  7483 + filterData.forEach((item, index) => {
  7484 + materials1Data.push(item);
  7485 + })
  7486 + }
  7487 + }
  7488 +
  7489 +
  7490 + const sSqlCondition2 = materials2Config ? materials2Config.sSqlCondition : 'materials0.sBclassifyName.油墨';
  7491 + if (commonUtils.isNotEmptyObject(sSqlCondition2)) {
  7492 + let targetTbName = sSqlCondition2.split('.')[0]; /* 1.表名 control */
  7493 + let filteredValue = sSqlCondition2.split('.')[1]; /* 2.解析filterValue: controlSelectedRowKeys */
  7494 + let sParentKey = sSqlCondition2.split('.')[2]; /* 2.解析本身表对应的值,如控制表筛选材料表 则材料表的sControlId = 控制表的controlSelectedRowKeys[0] */
  7495 + if (targetTbName === 'materials0') {
  7496 + const filterData = materials0Data.filter(item => item[filteredValue] === sParentKey);
  7497 + if (commonUtils.isNotEmptyArr(filterData))
  7498 + filterData.forEach((item, index) => {
  7499 + materials2Data.push(item);
  7500 + })
  7501 + }
  7502 + }
  7503 +
  7504 + addState.materials1Data = materials1Data;
  7505 + addState.materials2Data = materials2Data;
  7506 + }
  7507 + this.props.onSaveState({ materials0Data, ...addState });
  7508 + }
  7509 + } else if (selectConfig.sControlName && selectConfig.sControlName === 'BtnPopupMaterialsQuo') {
  7510 +
  7511 + let { materialsData, materials0Data, materials1Data, materials0Config, materials1Config, materials2Data, materials2Config, } = this.props;
  7512 +
  7513 + if (commonUtils.isEmptyArr(materialsData)) {
  7514 + materialsData = [];
  7515 + }
  7516 + if (commonUtils.isEmptyArr(materials0Data)) {
  7517 + materials0Data = [];
  7518 + }
  7519 +
  7520 + if (commonUtils.isEmptyArr(materials1Data)) {
  7521 + materials1Data = [];
  7522 + }
  7523 + if (commonUtils.isEmptyArr(materials2Data)) {
  7524 + materials2Data = [];
  7525 + }
  7526 + /* 找到放大镜复制到配置 */
  7527 +
  7528 + /* 材料大类 */
  7529 + const copyToConfig = processConfig.gdsconfigformslave.filter(item => item.sControlName.toLowerCase() === `${selectConfig.sControlName}.materials0`.toLowerCase());
  7530 + const copyToAssignField = commonUtils.isNotEmptyArr(copyToConfig) ? copyToConfig[0].sAssignField : ''; /* 材料大类 */
  7531 +
  7532 + const addState = {};
  7533 + const iIndex = commonUtils.isNotEmptyArr(tableSelectedRowKeys) ? tableData.findIndex(item => item.sId === tableSelectedRowKeys[0]) : -1;
  7534 + if (commonUtils.isNotEmptyArr(selectData)) {
  7535 + const selectFilterDataAll = selectData; /* 除了油墨,专色墨,电化铝之外的物料大类 */
  7536 + /* 全部材料 */
  7537 + if (commonUtils.isNotEmptyArr(selectFilterDataAll)) {
  7538 + selectFilterDataAll.forEach((item, index) => {
  7539 + const newCopyTo = {};
  7540 + newCopyTo.master = masterData;
  7541 + if (iIndex > -1) {
  7542 + newCopyTo.materials0 = item;
  7543 + }
  7544 + let tableDataRowAdd = this.handleTableAdd('materials0', true);
  7545 + item.handleType = 'add';
  7546 + // tableDataRowAdd = { ...tableDataRowAdd, ...item }; // 取赋值字段
  7547 + tableDataRowAdd = { ...tableDataRowAdd, ...commonFunc.getAssignFieldValue(copyToAssignField, item) }; // 取赋值字段
  7548 + tableDataRowAdd.sId = commonUtils.createSid();
  7549 + tableDataRowAdd.sParentId = masterData.sId;
  7550 + tableDataRowAdd.sParentSlaveId = tableData[iIndex].sId; /* 选中从表的sId */
  7551 + materialsData.push(tableDataRowAdd);
  7552 + });
  7553 + }
  7554 + if (false && commonUtils.isNotEmptyArr(materialsData)) {
  7555 + /* 根据配置过滤数据 */
  7556 + const sSqlCondition1 = materials0Config ? materials0Config.sSqlCondition : 'materials0.sBclassifyName.油墨';
  7557 + if (commonUtils.isNotEmptyObject(sSqlCondition1)) {
  7558 + let targetTbName = sSqlCondition1.split('.')[0]; /* 1.表名 control */
  7559 + let filteredValue = sSqlCondition1.split('.')[1]; /* 2.解析filterValue: controlSelectedRowKeys */
  7560 + let sParentKey = sSqlCondition1.split('.')[2]; /* 2.解析本身表对应的值,如控制表筛选材料表 则材料表的sControlId = 控制表的controlSelectedRowKeys[0] */
  7561 + if (targetTbName === 'materials0') {
  7562 + const filterData = materials0Data.filter(item => sParentKey && sParentKey.includes(item[filteredValue]));
  7563 + if (commonUtils.isNotEmptyArr(filterData))
  7564 + filterData.forEach((item, index) => {
  7565 + materials0Data.push(item);
  7566 + })
  7567 + }
  7568 + }
  7569 +
  7570 +
  7571 + const sSqlCondition2 = materials1Config ? materials1Config.sSqlCondition : 'materials0.sBclassifyName.电化铝';
  7572 + if (commonUtils.isNotEmptyObject(sSqlCondition2)) {
  7573 + let targetTbName = sSqlCondition2.split('.')[0]; /* 1.表名 control */
  7574 + let filteredValue = sSqlCondition2.split('.')[1]; /* 2.解析filterValue: controlSelectedRowKeys */
  7575 + let sParentKey = sSqlCondition2.split('.')[2]; /* 2.解析本身表对应的值,如控制表筛选材料表 则材料表的sControlId = 控制表的controlSelectedRowKeys[0] */
  7576 + if (targetTbName === 'materials0') {
  7577 + const filterData = materials0Data.filter(item => item[filteredValue] === sParentKey);
  7578 + if (commonUtils.isNotEmptyArr(filterData))
  7579 + filterData.forEach((item, index) => {
  7580 + materials1Data.push(item);
  7581 + })
  7582 + }
  7583 + }
  7584 + addState.materialsData = materialsData;
  7585 + addState.materials0Data = materials0Data;
  7586 + addState.materials1Data = materials1Data;
  7587 + addState.materials2Data = materials2Data;
  7588 + }
  7589 + this.props.onSaveState({ ...addState });
  7590 + }
  7591 + } else if (selectConfig.sControlName && (selectConfig.sControlName === 'BtnPopupMaterials1Child' || selectConfig.sControlName.includes('BtnHeadPopup'))) {
  7592 + const { materials0SelectedRowKeys, materials1SelectedRowKeys, materials2SelectedRowKeys } = this.props; /* 油墨数据选中行 */
  7593 + let { materials0Data } = this.props;
  7594 + let fatherRow = {};
  7595 + if (tbName === 'materials1Child') {
  7596 + const iIndex = commonUtils.isNotEmptyArr(materials1SelectedRowKeys) ? materials0Data.findIndex(item => item.sId === materials1SelectedRowKeys[0]) : -1;
  7597 + if (iIndex === -1) {
  7598 + message.error('请选择左侧选择行!');
  7599 + return;
  7600 + }
  7601 + fatherRow = materials1Data[iIndex];
  7602 + } else if (tbName === 'materials2Child') {
  7603 + const iIndex = commonUtils.isNotEmptyArr(materials2SelectedRowKeys) ? materials0Data.findIndex(item => item.sId === materials2SelectedRowKeys[0]) : -1;
  7604 + if (iIndex === -1) {
  7605 + message.error('请选择左侧选择行!');
  7606 + return;
  7607 + }
  7608 + fatherRow = materials2Data[iIndex];
  7609 + } else if (tbName === 'materials0Child') {
  7610 + const iIndex = commonUtils.isNotEmptyArr(materials0SelectedRowKeys) ? materials0Data.findIndex(item => item.sId === materials0SelectedRowKeys[0]) : -1;
  7611 + if (iIndex === -1) {
  7612 + message.error('请选择左侧选择行!');
  7613 + return;
  7614 + }
  7615 + fatherRow = materials0Data[iIndex];
  7616 + }
  7617 +
  7618 + let { [`${tbName}Data`]: tableData } = this.props;
  7619 + if (commonUtils.isEmptyArr(tableData)) {
  7620 + tableData = [];
  7621 + }
  7622 + if (commonUtils.isEmptyArr(materials0Data)) {
  7623 + materials0Data = [];
  7624 + }
  7625 +
  7626 + if (commonUtils.isNotEmptyArr(selectData)) {
  7627 + // eslint-disable-next-line no-unused-vars
  7628 + selectData.forEach((item, index) => {
  7629 + const newCopyTo = {};
  7630 + newCopyTo.master = masterData;
  7631 + let tableDataRowAdd = this.handleTableAdd(tbName, true);
  7632 + item.handleType = 'add';
  7633 + tableDataRowAdd = { ...tableDataRowAdd, ...commonFunc.getAssignFieldValue(selectConfig.sAssignField, item) }; // 取赋值字段
  7634 + tableDataRowAdd.handleType = 'add';
  7635 + tableDataRowAdd.sId = commonUtils.createSid();
  7636 + tableDataRowAdd.sParentId = masterData.sId;
  7637 + tableDataRowAdd.sParentMaterialsId = fatherRow.sId; /* 选中从表的sId */
  7638 + tableDataRowAdd.sProcessId = fatherRow.sProcessId; /* 工序ID */
  7639 + tableDataRowAdd.sProcessTbId = fatherRow.sProcessTbId; /* 工序表格ID */
  7640 + if (tbName === 'materials0Child') { /* 替代料 */
  7641 + tableDataRowAdd.sMaterialsNo1 = fatherRow.sMaterialsNo; /* 原材料编号 */
  7642 + tableDataRowAdd.sMaterialsName1 = fatherRow.sMaterialsName; /* 原材料名称 */
  7643 + tableDataRowAdd.bAlternative = true;
  7644 + }
  7645 +
  7646 + // const newTableDataRowAdd = JSON.parse(JSON.stringify(tableDataRowAdd));
  7647 + // newTableDataRowAdd.sId = commonUtils.createSid();
  7648 + materials0Data.push(tableDataRowAdd);
  7649 +
  7650 +
  7651 + });
  7652 + console.log('放大镜确认数据:', tbName, tableData, materials0Data)
  7653 + this.props.onSaveState({ materials0Data });
  7654 + }
  7655 + } else if (selectConfig.sControlName && selectConfig.sControlName.includes('BtnPopupMaterials')) { /* 报价单工序表放大镜 选择材料 */
  7656 + /* materials1ChildData:油墨, materials2ChildData:电化铝 */
  7657 + let { materials1Data, materials1ChildData, materials2Data, materials2ChildData, materials0Data, processData, processSelectedRowKeys } = this.props;
  7658 + let materialsOtherData = [];
  7659 +
  7660 + if (commonUtils.isEmptyArr(materials0Data)) {
  7661 + materials0Data = [];
  7662 + }
  7663 +
  7664 + if (commonUtils.isEmptyArr(materials1Data)) {
  7665 + materials1Data = [];
  7666 + }
  7667 +
  7668 + if (commonUtils.isEmptyArr(materials1ChildData)) {
  7669 + materials1ChildData = [];
  7670 + }
  7671 +
  7672 + if (commonUtils.isEmptyArr(materials2ChildData)) {
  7673 + materials2ChildData = [];
  7674 + }
  7675 +
  7676 + if (commonUtils.isEmptyArr(materials2Data)) {
  7677 + materials2Data = [];
  7678 + }
  7679 +
  7680 + /* 找到放大镜复制到配置 */
  7681 + /* 材料大类 */
  7682 + const copyToConfig = processConfig.gdsconfigformslave.filter(item => item.sControlName.toLowerCase() === `${selectConfig.sControlName}.materials0`.toLowerCase());
  7683 + const copyToAssignField = commonUtils.isNotEmptyArr(copyToConfig) ? copyToConfig[0].sAssignField : ''; /* 材料大类 */
  7684 +
  7685 + /* 自调专色墨 */
  7686 + const copyToConfig1Left = processConfig.gdsconfigformslave.filter(item => item.sControlName.toLowerCase() === `${selectConfig.sControlName}.materials1`.toLowerCase());
  7687 + const copyToAssignField1Left = commonUtils.isNotEmptyArr(copyToConfig1Left) ? copyToConfig1Left[0].sAssignField : ''; /* 专色墨 */
  7688 +
  7689 + /* 油墨 */
  7690 + const copyToConfig1 = processConfig.gdsconfigformslave.filter(item => item.sControlName.toLowerCase() === `${selectConfig.sControlName}.materials1Child`.toLowerCase());
  7691 + const copyToAssignField1 = commonUtils.isNotEmptyArr(copyToConfig1) ? copyToConfig1[0].sAssignField : ''; /* 油墨 */
  7692 +
  7693 + /* 油墨 */
  7694 + const copyToConfig2 = processConfig.gdsconfigformslave.filter(item => item.sControlName.toLowerCase() === `${selectConfig.sControlName}.materials2Child`.toLowerCase());
  7695 + const copyToAssignField2 = commonUtils.isNotEmptyArr(copyToConfig2) ? copyToConfig2[0].sAssignField : ''; /* 电化铝 */
  7696 +
  7697 + const iIndex = commonUtils.isNotEmptyArr(tableSelectedRowKeys) ? tableData.findIndex(item => item.sId === tableSelectedRowKeys[0]) : -1;
  7698 + if (commonUtils.isNotEmptyArr(selectData)) {
  7699 + if (commonUtils.isEmpty(materials1ChildData)) {
  7700 + materials1ChildData = [];
  7701 + }
  7702 + if (commonUtils.isEmpty(materials2ChildData)) {
  7703 + materials2ChildData = [];
  7704 + }
  7705 + // const selectFilterData1 = selectData.filter(item => item.sZmldlName === sMaterialsClassfiy.youmo);
  7706 + // const selectFilterData1Left = selectData.filter(item => item.sZmldlName === sMaterialsClassfiy.zsm);
  7707 + // // const selectFilterData1 = selectData.filter(item => item.sZmldlName === '纸张');
  7708 + // const selectFilterData2 = selectData.filter(item => item.sZmldlName === sMaterialsClassfiy.dhl );
  7709 + //
  7710 + // const selectFilterDataOther = selectData.filter(item => item.sZmldlName !== sMaterialsClassfiy.youmo &&
  7711 + // item.sZmldlName !== sMaterialsClassfiy.zsm && item.sZmldlName !== sMaterialsClassfiy.dhl ); /* 除了油墨,专色墨,电化铝之外的物料大类 */
  7712 + //
  7713 + // /* 自动专色墨 */
  7714 + // if(commonUtils.isNotEmptyArr(selectFilterData1Left)) {
  7715 + // selectFilterData1Left.forEach((item, index) => {
  7716 + // const newCopyTo = {};
  7717 + // newCopyTo.master = masterData;
  7718 + // if (iIndex > -1) {
  7719 + // newCopyTo.materials1Child = item;
  7720 + // }
  7721 + // let tableDataRowAdd = this.handleTableAdd('materials1', true);
  7722 + // item.handleType = 'add';
  7723 + // // tableDataRowAdd = { ...tableDataRowAdd, ...item }; // 取赋值字段
  7724 + // tableDataRowAdd = { ...tableDataRowAdd, ...commonFunc.getAssignFieldValue(copyToAssignField1Left, item) }; // 取赋值字段
  7725 + // tableDataRowAdd.sId = commonUtils.createSid();
  7726 + // tableDataRowAdd.sParentId = masterData.sId;
  7727 + // tableDataRowAdd.sParentSlaveId = tableData[iIndex].sId; /* 选中从表的sId */
  7728 + // materials1Data.push(tableDataRowAdd);
  7729 + // });
  7730 + // }
  7731 + //
  7732 + // /* 油墨 */
  7733 + // if(commonUtils.isNotEmptyArr(selectFilterData1)) {
  7734 + // selectFilterData1.forEach((item, index) => {
  7735 + // const newCopyTo = {};
  7736 + // newCopyTo.master = masterData;
  7737 + // if (iIndex > -1) {
  7738 + // newCopyTo.materials1Child = item;
  7739 + // }
  7740 + // let tableDataRowAdd = this.handleTableAdd('materials1Child', true);
  7741 + // item.handleType = 'add';
  7742 + // // tableDataRowAdd = { ...tableDataRowAdd, ...item }; // 取赋值字段
  7743 + // tableDataRowAdd = {...tableDataRowAdd, ...commonFunc.getAssignFieldValue(copyToAssignField1, item)}; // 取赋值字段
  7744 + // tableDataRowAdd.sId = commonUtils.createSid();
  7745 + // tableDataRowAdd.sParentId = masterData.sId;
  7746 + // tableDataRowAdd.sParentSlaveId = tableData[iIndex].sId; /* 选中从表的sId */
  7747 + // materials1ChildData.push(tableDataRowAdd);
  7748 + // });
  7749 + // }
  7750 + //
  7751 + // /* 电化铝 */
  7752 + // if(commonUtils.isNotEmptyArr(selectFilterData2)) {
  7753 + // selectFilterData2.forEach((item, index) => {
  7754 + // const newCopyTo = {};
  7755 + // newCopyTo.master = masterData;
  7756 + // if (iIndex > -1) {
  7757 + // newCopyTo.materials2Child = item;
  7758 + // }
  7759 + // let tableDataRowAdd = this.handleTableAdd('materials2Child', true);
  7760 + // item.handleType = 'add';
  7761 + // // tableDataRowAdd = { ...tableDataRowAdd, ...item }; // 取赋值字段
  7762 + // tableDataRowAdd = { ...tableDataRowAdd, ...commonFunc.getAssignFieldValue(copyToAssignField2, item) }; // 取赋值字段
  7763 + // tableDataRowAdd.sId = commonUtils.createSid();
  7764 + // tableDataRowAdd.sParentId = masterData.sId;
  7765 + // tableDataRowAdd.sParentSlaveId = tableData[iIndex].sId; /* 选中从表的sId */
  7766 + // materials2ChildData.push(tableDataRowAdd);
  7767 + // });
  7768 + // }
  7769 + //
  7770 + // if(commonUtils.isNotEmptyArr(materials2ChildData)) {
  7771 + // materials2ChildData.forEach((val) => {
  7772 + // const iIndex = materials2Data.findIndex(item => item.sMaterialsId === val.sMaterialsId && item.sControlId === val.sControlId && item.sMaterialsStyle === val.sMaterialsStyle);
  7773 + // if(iIndex === -1){
  7774 + // materials2Data.push(val);
  7775 + // }
  7776 + // });
  7777 + // }
  7778 + //
  7779 +
  7780 + // /* 其他材料 */
  7781 + // if(commonUtils.isNotEmptyArr(selectFilterDataOther)) {
  7782 + // selectFilterDataOther.forEach((item, index) => {
  7783 + // const newCopyTo = {};
  7784 + // newCopyTo.master = masterData;
  7785 + // if (iIndex > -1) {
  7786 + // newCopyTo.materials0 = item;
  7787 + // }
  7788 + // let tableDataRowAdd = this.handleTableAdd('materials0', true);
  7789 + // item.handleType = 'add';
  7790 + // // tableDataRowAdd = { ...tableDataRowAdd, ...item }; // 取赋值字段
  7791 + // tableDataRowAdd = { ...tableDataRowAdd, ...commonFunc.getAssignFieldValue(copyToAssignField, item) }; // 取赋值字段
  7792 + // tableDataRowAdd.sId = commonUtils.createSid();
  7793 + // tableDataRowAdd.sParentId = masterData.sId;
  7794 + // tableDataRowAdd.sParentSlaveId = tableData[iIndex].sId; /* 选中从表的sId */
  7795 + // if(commonUtils.isNotEmptyObject(processRow)) {
  7796 + // if(commonUtils.isEmptyObject(tableDataRowAdd.sProcessId) ) {
  7797 + // tableDataRowAdd.sProcessId = processRow.sProcessId; /* 选中从表的sId */
  7798 + // }
  7799 + // if(commonUtils.isEmptyObject(tableDataRowAdd.sProcessTbId) ) {
  7800 + // tableDataRowAdd.sProcessTbId = processRow.sId; /* 选中从表的sId */
  7801 + // }
  7802 + // if(commonUtils.isEmptyObject(tableDataRowAdd.sControlId) ) {
  7803 + // tableDataRowAdd.sControlId = processRow.sControlId; /* 选中从表的sId */
  7804 + // }
  7805 + // }
  7806 + //
  7807 + // materialsOtherData.push(tableDataRowAdd);
  7808 + // });
  7809 + // }
  7810 + // const temp1Data = materials1Data.concat(materials1ChildData);
  7811 + // const temp2Data = temp1Data.concat(materials2Data);
  7812 + //
  7813 + // materials0Data = temp2Data.concat(materialsOtherData);
  7814 + let processRow = {};
  7815 + if (commonUtils.isNotEmptyArr(processData) && commonUtils.isNotEmptyArr(processSelectedRowKeys)) {
  7816 + const iPIndex = processData.findIndex(item => processSelectedRowKeys.includes(item.sId));
  7817 + if (iPIndex > -1) {
  7818 + processRow = processData[iPIndex];
  7819 + }
  7820 + }
  7821 + const selectFilterDataAll = selectData; /* 除了油墨,专色墨,电化铝之外的物料大类 */
  7822 + /* 全部材料 */
  7823 + if (commonUtils.isNotEmptyArr(selectFilterDataAll)) {
  7824 + selectFilterDataAll.forEach((item, index) => {
  7825 + const newCopyTo = {};
  7826 + newCopyTo.master = masterData;
  7827 + if (iIndex > -1) {
  7828 + newCopyTo.materials0 = item;
  7829 + }
  7830 + let tableDataRowAdd = this.handleTableAdd('materials0', true);
  7831 + item.handleType = 'add';
  7832 + tableDataRowAdd = { ...tableDataRowAdd, ...commonFunc.getAssignFieldValue(copyToAssignField, item) }; // 取赋值字段
  7833 + tableDataRowAdd.sId = commonUtils.createSid();
  7834 + tableDataRowAdd.sParentId = masterData.sId;
  7835 + tableDataRowAdd.sParentSlaveId = tableData[iIndex].sId; /* 选中从表的sId */
  7836 + if (commonUtils.isNotEmptyObject(processRow)) {
  7837 + if (commonUtils.isEmptyObject(tableDataRowAdd.sProcessId)) {
  7838 + tableDataRowAdd.sProcessId = processRow.sProcessId; /* 选中从表的sId */
  7839 + }
  7840 + if (commonUtils.isEmptyObject(tableDataRowAdd.sProcessTbId)) {
  7841 + tableDataRowAdd.sProcessTbId = processRow.sId; /* 选中从表的sId */
  7842 + }
  7843 + if (commonUtils.isEmptyObject(tableDataRowAdd.sControlId)) {
  7844 + tableDataRowAdd.sControlId = processRow.sControlId; /* 选中从表的sId */
  7845 + }
  7846 + }
  7847 + materials0Data.push(tableDataRowAdd);
  7848 + });
  7849 + }
  7850 +
  7851 + console.log('materials1Data1:', materials0Data, materials1Data, materials1ChildData, materials2ChildData, materialsOtherData);
  7852 +
  7853 + this.props.onSaveState({ materials1Data, materials1ChildData, materials2ChildData, materialsOtherData, materials0Data });
  7854 + }
  7855 + } else if (location.pathname && location.pathname.includes('quotationPackTableTree') && selectConfig.sName && selectConfig.sName === 'sAlumiteBomBillNo') { /* 报价单电化铝Bom选择数据后,数据带入到电化铝 */
  7856 + let { materialsData, materials1Data, materials2Data, materials2ChildData, materials0Data } = this.props;
  7857 + const addState = {};
  7858 + if (commonUtils.isEmptyArr(materials0Data)) {
  7859 + materials0Data = [];
  7860 + }
  7861 + if (commonUtils.isEmptyArr(materials0Data)) {
  7862 + materials0Data = [];
  7863 + }
  7864 + if (commonUtils.isEmptyArr(materials1Data)) {
  7865 + materials1Data = [];
  7866 + }
  7867 + if (commonUtils.isEmptyArr(materials2Data)) {
  7868 + materials2Data = [];
  7869 + }
  7870 + if (commonUtils.isEmptyArr(materials2ChildData)) {
  7871 + materials2ChildData = [];
  7872 + }
  7873 + const sControlName = 'sPopupsAlumiteBomBillNo';
  7874 + /* 电化铝父级赋值配置 */
  7875 + const copyToConfig = processConfig.gdsconfigformslave.filter(item => item.sControlName.toLowerCase() === `${sControlName}.materials2Data`.toLowerCase());
  7876 + const copyToAssignField = commonUtils.isNotEmptyArr(copyToConfig) ? copyToConfig[0].sAssignField : ''; /* 电化铝 */
  7877 +
  7878 + /* 电化铝子级赋值配置 */
  7879 + const copyToChildConfig = processConfig.gdsconfigformslave.filter(item => item.sControlName.toLowerCase() === `${sControlName}.materials2ChildData`.toLowerCase());
  7880 + const copyToChildAssignField = commonUtils.isNotEmptyArr(copyToChildConfig) ? copyToChildConfig[0].sAssignField : ''; /* 电化铝子级 */
  7881 +
  7882 + if (commonUtils.isNotEmptyArr(selectData)) {
  7883 + // eslint-disable-next-line no-unused-vars
  7884 + selectData.forEach((item, index) => {
  7885 + const newCopyTo = {};
  7886 + newCopyTo.master = masterData;
  7887 + let tableDataRowAdd = this.handleTableAdd('materials1Data', true);
  7888 + item.handleType = 'add';
  7889 + tableDataRowAdd = { ...tableDataRowAdd, ...commonFunc.getAssignFieldValue(selectConfig.sAssignField, item) }; // 取赋值字段
  7890 + tableDataRowAdd.sId = commonUtils.createSid();
  7891 + tableDataRowAdd.sParentId = masterData.sId;
  7892 + // tableDataRowAdd.sParentMaterialsId = fatherRow.sId; /* 选中从表的sId */
  7893 + materials1Data.push(tableDataRowAdd);
  7894 + const newTableDataRowAdd = JSON.parse(JSON.stringify(tableDataRowAdd));
  7895 + // newTableDataRowAdd.sId = commonUtils.createSid();
  7896 + materialsData.push(newTableDataRowAdd);
  7897 + });
  7898 + addState.materials1Data = materials1Data;
  7899 + addState.materialsData = materialsData;
  7900 + this.props.onSaveState({ materials1Data, materials2Data, materials0Data });
  7901 + }
  7902 + } else if ((selectConfig.sName && selectConfig.sName === 'sAlumiteBomBillNo') || selectConfig?.sControlName === 'BtnPopupsAlumiteBomBillNo') { /* 电化铝Bom选择数据后,数据带入到电化铝 */
  7903 + let { materials2Data, materials2ChildData, materialsData, materials0Data, processData, processSelectedRowKeys, materialsDelData, materials0DelData } = this.props;
  7904 + const addState = {};
  7905 + if (commonUtils.isEmptyArr(materialsData)) {
  7906 + materialsData = [];
  7907 + }
  7908 + if (commonUtils.isEmptyArr(materials0Data)) {
  7909 + materials0Data = [];
  7910 + }
  7911 + if (commonUtils.isEmptyArr(materials2Data)) {
  7912 + materials2Data = [];
  7913 + }
  7914 + if (commonUtils.isEmptyArr(materials2ChildData)) {
  7915 + materials2ChildData = [];
  7916 + }
  7917 + if (commonUtils.isEmptyArr(materials0DelData)) {
  7918 + materials0DelData = [];
  7919 + }
  7920 + if (commonUtils.isEmptyArr(materialsDelData)) {
  7921 + materialsDelData = [];
  7922 + }
  7923 + const sControlName = 'sPopupsAlumiteBomBillNo';
  7924 + /* 电化铝父级赋值配置 */
  7925 + const copyToConfig = processConfig.gdsconfigformslave.filter(item => item.sControlName.toLowerCase() === `${sControlName}.materials2Data`.toLowerCase());
  7926 + const copyToAssignField = commonUtils.isNotEmptyArr(copyToConfig) ? copyToConfig[0].sAssignField : ''; /* 电化铝 */
  7927 +
  7928 + /* 电化铝子级赋值配置 */
  7929 + const copyToChildConfig = processConfig.gdsconfigformslave.filter(item => item.sControlName.toLowerCase() === `${sControlName}.materials2ChildData`.toLowerCase());
  7930 + const copyToChildAssignField = commonUtils.isNotEmptyArr(copyToChildConfig) ? copyToChildConfig[0].sAssignField : ''; /* 电化铝子级 */
  7931 +
  7932 + if (commonUtils.isNotEmptyArr(selectData)) {
  7933 + if (commonUtils.isNotEmptyArr(processSelectedRowKeys) && commonUtils.isNotEmptyArr(processData)) {
  7934 + const iProcessIndex = processData.findIndex(item => item.sId === processSelectedRowKeys[0]);
  7935 + processData[iProcessIndex].handleType = commonUtils.isEmpty(processData[iProcessIndex].handleType) ? 'update' : processData[iProcessIndex].handleType;
  7936 + processData[iProcessIndex].sAlumiteBomBillNo = selectData[0].sVersionNum;
  7937 + addState.processData = processData;
  7938 + /* 移除该工序下的所有电化铝 */
  7939 + const filterDelData = materials0Data.filter(row => row.sProcessId === processData[iProcessIndex].sProcessId &&
  7940 + row.sProcessTbId === processData[iProcessIndex].sId && row.sBclassifyName === '电化铝' && commonUtils.isEmptyObject(row.sParentMaterialsId));
  7941 + console.log('移除该工序下的所有电化铝', filterDelData);
  7942 + if (commonUtils.isNotEmptyArr(filterDelData)) {
  7943 + filterDelData.forEach((item, index) => {
  7944 + const iIndex = materials0Data.findIndex(row => row.sId === item.sId);
  7945 + if (iIndex > -1) {
  7946 + const delRow = materials0Data[iIndex];
  7947 + delRow.handleType = 'del';
  7948 + if (selectConfig?.sControlName === 'BtnPopupsAlumiteBomBillNo') {
  7949 + materialsData.splice(iIndex, 1);
  7950 + materialsDelData.push(delRow);
  7951 + } else {
  7952 + materials0Data.splice(iIndex, 1);
  7953 + materials0DelData.push(delRow);
  7954 + }
  7955 + }
  7956 + })
  7957 + }
  7958 + }
  7959 + // eslint-disable-next-line no-unused-vars
  7960 + selectData.forEach((item, index) => {
  7961 + // const iIndex = materials0Data.findIndex(row => row.sAluminumBomId === item.sId && row.sAluminumBomSlaveId === item.sSlaveId);
  7962 + // console.log('iIndex', iIndex);
  7963 + // if(iIndex > -1) {
  7964 + // const delRow = materials0Data[iIndex];
  7965 + // delRow.handleType = 'del';
  7966 + // if(selectConfig?.sControlName === 'BtnPopupsAlumiteBomBillNo') {
  7967 + // materialsData.splice(iIndex, 1);
  7968 + // materialsDelData.push(delRow);
  7969 + // } else {
  7970 + // materials0Data.splice(iIndex, 1);
  7971 + // materials0DelData.push(delRow);
  7972 + // }
  7973 + // }
  7974 + const newCopyTo = {};
  7975 + newCopyTo.master = masterData;
  7976 + let tableDataRowAdd = this.handleTableAdd('materials2Data', true);
  7977 + item.handleType = 'add';
  7978 + tableDataRowAdd = { ...tableDataRowAdd, ...commonFunc.getAssignFieldValue(selectConfig.sAssignField, item) }; // 取赋值字段
  7979 + tableDataRowAdd.sId = commonUtils.createSid();
  7980 + tableDataRowAdd.sParentId = masterData.sId;
  7981 + // tableDataRowAdd.sParentMaterialsId = fatherRow.sId; /* 选中从表的sId */
  7982 + materials2Data.push(tableDataRowAdd);
  7983 +
  7984 + /* 替代料对应的材料id重新刷一遍 */
  7985 + const tdlFilterData = materials0Data.filter(item => commonUtils.isNotEmptyObject(item.sParentMaterialsId) &&
  7986 + item.sMaterialsNo1 === tableDataRowAdd.sMaterialsNo);
  7987 + if (commonUtils.isNotEmptyObject(tdlFilterData)) {
  7988 + tdlFilterData.forEach((item, index) => {
  7989 + const iFIndex = materials0Data.findIndex(child => child.sId === item.sId);
  7990 + if (iFIndex > -1) {
  7991 + const addState = {};
  7992 + addState.sParentMaterialsId = tableDataRowAdd.sId;
  7993 + addState.handleType = commonUtils.isEmpty(materials0Data[iFIndex].handleType) ? 'update' : materials0Data[iFIndex].handleType;
  7994 + materials0Data[iFIndex] = { ...materials0Data[iFIndex], ...addState };
  7995 + }
  7996 + });
  7997 + }
  7998 +
  7999 + const newTableDataRowAdd = JSON.parse(JSON.stringify(tableDataRowAdd));
  8000 + // newTableDataRowAdd.sId = commonUtils.createSid();
  8001 + materials0Data.push(newTableDataRowAdd);
  8002 + if (selectConfig?.sControlName === 'BtnPopupsAlumiteBomBillNo') {
  8003 + materialsData.push(newTableDataRowAdd);
  8004 + }
  8005 + });
  8006 + if (selectConfig?.sControlName === 'BtnPopupsAlumiteBomBillNo') {
  8007 + addState.materialsData = materialsData;
  8008 + addState.materialsDelData = materialsDelData;
  8009 + } else {
  8010 + addState.materials0Data = materials0Data;
  8011 + addState.materials0DelData = materials0DelData;
  8012 + }
  8013 +
7390 8014  
  8015 + const iIndex = commonUtils.isNotEmptyArr(tableSelectedRowKeys) ? tableData.findIndex(item => item.sId === tableSelectedRowKeys[0]) : -1;
  8016 + if (commonUtils.isJSON(selectData[0].sParams)) {
  8017 + const paramsNewData = JSON.parse(selectData[0].sParams);
  8018 + if (commonUtils.isJSON(tableData[iIndex].sParams)) {
  8019 + const paramsOldData = JSON.parse(tableData[iIndex].sParams);
  8020 + const iNewIndex = paramsNewData.findIndex(item => item.sParamType === 'sWorkOrder');
  8021 + if (iNewIndex > -1) {
  8022 + const iOldIndex = paramsOldData.findIndex(item => item.sParamType === 'sWorkOrder');
  8023 + if (iOldIndex > -1) {
  8024 + paramsOldData[iOldIndex].data = { ...paramsOldData[iOldIndex].data, ...paramsNewData[iNewIndex].data };
  8025 + } else {
  8026 + paramsOldData.push(paramsNewData[iNewIndex]);
  8027 + }
  8028 + tableData[iIndex].sParams = JSON.stringify(paramsOldData);
  8029 + }
  8030 + } else {
  8031 + tableData[iIndex].sParams = selectData[0].sParams;
  8032 + }
  8033 + }
  8034 + console.log('materials0DelData', materials0DelData);
  8035 +
  8036 + this.props.onSaveState({ ...addState });
  8037 + }
  8038 + } else if (selectConfig.sControlName?.startsWith('BtnPopupEdit')) {
  8039 + if (!Array.isArray(selectData)) return;
  8040 + if (other?.index >= 0 && tableData[other.index]) {
  8041 + tableData[other.index][selectConfig.sActiveKey] = JSON.stringify(selectData || []);
  8042 + if (!tableData[other.index].handleType) {
  8043 + tableData[other.index].handleType = 'update';
  8044 + }
  8045 + }
  8046 + this.props.onSaveState({ [`${tbName}Data`]: [...tableData] });
  8047 + } else if (selectConfig.sControlName && selectConfig.sControlName === 'BtnPopup.dPreMatProductQty') { /* 消耗备料 */
  8048 + let { slaveData, slaveSelectedRowKeys } = this.props;
  8049 + const addState = {};
  8050 + if (commonUtils.isEmptyArr(slaveData)) {
  8051 + slaveData = [];
  8052 + }
  8053 + const iIndex = this.handleGetSelectedIndex(this.props, 'slave');
  8054 + let dModifyProductQty = 0;
  8055 + const jsonData = [];
  8056 + let jsonStr = '';
  8057 + if (commonUtils.isNotEmptyArr(selectData)) {
  8058 + // eslint-disable-next-line no-unused-vars
  8059 + selectData.forEach((item, index) => {
  8060 + dModifyProductQty += commonUtils.isNull(item.dModifyProductQty, 0);
  8061 + const obj = {};
  8062 + obj.sSlaveId = commonUtils.isNotEmptyObject(item.sSlaveId) ? item.sSlaveId : item.sId;
  8063 + obj.sId = item.sId;
  8064 + obj.dModifyProductQty = commonUtils.isNotEmptyNumber(item.dModifyProductQty) ? item.dModifyProductQty : 0;
  8065 + jsonData.push(obj);
  8066 + });
  8067 + addState.dPreMatProductQty = dModifyProductQty;
  8068 + addState.handleType = commonUtils.isEmpty(tableData[iIndex].handleType) ? 'update' : tableData[iIndex].handleType;
  8069 + if (commonUtils.isNotEmptyArr(jsonData)) {
  8070 + jsonStr = commonUtils.isNotEmptyArr(jsonData) ? JSON.stringify(jsonData) : ''; /* JSON对象转换为字符串存放到合版信息中 */
  8071 + addState.sPreMatProduct = jsonStr;
  8072 + }
  8073 + if (iIndex > -1) {
  8074 + slaveData[iIndex] = { ...slaveData[iIndex], ...addState };
  8075 + }
  8076 + addState.slaveData = slaveData;
  8077 + this.props.onSaveState({ ...addState });
  8078 + } else {
  8079 + addState.dPreMatProductQty = 0;
  8080 + addState.handleType = commonUtils.isEmpty(tableData[iIndex].handleType) ? 'update' : tableData[iIndex].handleType;
  8081 + addState.sPreMatProduct = '';
  8082 + if (iIndex > -1) {
  8083 + slaveData[iIndex] = { ...slaveData[iIndex], ...addState };
  8084 + }
  8085 + addState.slaveData = slaveData;
  8086 + this.props.onSaveState({ ...addState });
  8087 + }
  8088 + } else if (selectConfig.sName === 'sOrderNo') { /* 选择试制订单号 */
  8089 + const { controlData: controlDataNew, packData } = this.props;
  8090 + const addReturn = this.props.onSelectCommonPopup(currentPaneName, selectConfig, selectData, tbName, true);
  8091 + const addState = {};
  8092 + const tableData = commonUtils.isNotEmptyObject(addReturn) && commonUtils.isNotEmptyArr(addReturn[tbName + 'Data']) ? addReturn[tbName + 'Data'] : [];
  8093 + if (commonUtils.isNotEmptyArr(tableData)) {
  8094 + const iIndex = commonUtils.isNotEmptyArr(tableSelectedRowKeys) && commonUtils.isNotEmptyObject(tableSelectedRowKeys[0]) ? tableData.findIndex(item => item.sId === tableSelectedRowKeys[0]) : -1;
  8095 + const tableDataRow = iIndex > -1 ? tableData[iIndex] : {};
  8096 + /* 如果packData只有一条数据 则同步合版数据 及增加控制表合版备注 */
  8097 + if (commonUtils.isNotEmptyArr(packData) && packData.length === 1 && packData[0].sSlaveId === tableDataRow.sId) {
  8098 + let packDataRow = packData[0];
  8099 + const sControlId = packDataRow.sControlId;
  8100 + packDataRow = this.handlePackDataAdd(tableDataRow, 0, sControlId);
  8101 + packDataRow.dCombineQty = 1;
  8102 + packData[0] = { ...packData[0], ...packDataRow }
  8103 +
  8104 + if (commonUtils.isNotEmptyObject(packData[0])) {
  8105 + const { sId, sProductNo, dProductQty, dCombineQty, dFactProductQty, sCombinePartsName } = packData[0];
  8106 + const tableCombineSelectedData = [];
  8107 + const jsonObj = {};
  8108 + jsonObj.sId = sId;
  8109 + jsonObj.sProductNo = sProductNo; /* 产品编号 */
  8110 + jsonObj.dCombineQty = commonUtils.isNotEmptyNumber(dCombineQty) ? dCombineQty : 0; /* 排版数 */
  8111 + jsonObj.dProductQty = commonUtils.isNotEmptyNumber(dProductQty) ? dProductQty : 0; /* 生产数 */
  8112 + jsonObj.dFactProductQty = commonUtils.isNotEmptyNumber(dFactProductQty) ? dFactProductQty : 0; /* 实际生产数 */
  8113 + jsonObj.sCombinePartsName = sCombinePartsName; /* 合版部件名称 */
  8114 + tableCombineSelectedData.push(jsonObj);
  8115 + const sCombinedMemo = commonUtils.isNotEmptyArr(tableCombineSelectedData) ? JSON.stringify(tableCombineSelectedData) : ''; /* JSON对象转换为字符串存放到合版信息中 */
  8116 + // const controlDataNew =commonUtils.isNotEmptyArr(addState.controlData)? addState.controlData: controlDataOld;
  8117 + if (commonUtils.isNotEmptyArr(controlDataNew)) {
  8118 + const iControlIndex = controlDataNew.findIndex(item => item.sId === sControlId);
  8119 + if (iControlIndex > -1) {
  8120 + controlDataNew[iControlIndex].sCombinedMemo = sCombinedMemo;
  8121 + controlDataNew[iControlIndex].sPartsName = tableDataRow.sProductName;
  8122 + }
  8123 + addState.controlData = controlDataNew;
  8124 + }
  8125 + }
  8126 + } else if (packData.length > 1) {
  8127 + const packFilterData = packData.filter(item => item.sSlaveId === tableDataRow.sId);
  8128 + if (commonUtils.isNotEmptyArr(packFilterData)) {
  8129 + packFilterData.forEach((itemPack, index) => {
  8130 + let packDataRow = itemPack;
  8131 + const sControlId = packDataRow.sControlId;
  8132 + packDataRow = this.handlePackDataAdd(tableDataRow, 0, sControlId);
  8133 + // packDataRow.dCombineQty = 1;
  8134 + const pIndex = packData.findIndex(item => item.sId === itemPack.sId);
  8135 + if (pIndex > -1) {
  8136 + packData[pIndex] = { ...packData[pIndex], ...packDataRow }; /* 根据选中的从表 找到所有的合版数据,将合版数据中的产品换成切换后的产品 */
  8137 + let sCombinedMemoStr = ''; /* 将控制表合版信息中的产品换成新选择的产品 */
  8138 + if (commonUtils.isNotEmptyArr(controlDataNew)) {
  8139 + const iControlIndex = controlDataNew.findIndex(item => item.sId === sControlId);
  8140 + if (iControlIndex > -1) {
  8141 + sCombinedMemoStr = controlDataNew[iControlIndex].sCombinedMemo;
  8142 + if (sCombinedMemoStr) {
  8143 + const sCombinedMemoArr = commonUtils.isNotEmptyObject(sCombinedMemoStr) ? JSON.parse(sCombinedMemoStr) : {};
  8144 + if (commonUtils.isNotEmptyArr(sCombinedMemoArr)) {
  8145 + const iIndex = sCombinedMemoArr.findIndex(item => item.sId === itemPack.sId);
  8146 + if (iIndex > -1) {
  8147 + const addState = {};
  8148 + addState.sProductId = tableDataRow.sProductId; /* 产品id */
  8149 + addState.sCustomerId = tableDataRow.sCustomerId; /* 客户id */
  8150 + addState.sCustomerName = tableDataRow.sCustomerName; /* 客户名称 */
  8151 + addState.sProductName = tableDataRow.sProductName; /* 产品名称 */
  8152 + addState.sProductNo = tableDataRow.sProductNo; /* 产品编号 */
  8153 + sCombinedMemoArr[iIndex] = { ...sCombinedMemoArr[iIndex], ...addState };
  8154 + const sCombinedMemo = commonUtils.isNotEmptyArr(sCombinedMemoArr) ? JSON.stringify(sCombinedMemoArr) : ''; /* JSON对象转换为字符串存放到合版信息中 */
  8155 + controlDataNew[iControlIndex].sCombinedMemo = sCombinedMemo;
  8156 + controlDataNew[iControlIndex].sPartsName = tableDataRow.sProductName;
  8157 + }
  8158 + }
  8159 + }
  8160 + }
  8161 + }
  8162 + }
  8163 + });
  8164 + addState.controlData = controlDataNew;
  8165 + }
  8166 +
  8167 + }
  8168 + addState.packData = packData;
  8169 + this.props.onSaveState({ [`${tbName}Data`]: tableData, ...addState });
  8170 + }
  8171 +
  8172 + }
  8173 + else {
  8174 + this.props.onSelectCommonPopup(currentPaneName, selectConfig, selectData, tbName);
  8175 + }
  8176 + };
7391 8177 render() {
7392 8178 const { masterData } = this.props;
7393 8179 const imgSrc = commonBusiness.handleAddIcon(masterData);
... ... @@ -7451,12 +8237,13 @@ export default (ChildComponent) =&gt; {
7451 8237 onBtnPreview={this.handleBtnPreview}
7452 8238 onSelectCommonPopupProduct={this.handleSelectCommonPopupProduct}
7453 8239 onResolveSinglePQty={this.handleResolveSinglePQty}
7454   - onGetDataOne ={this.handleGetDataOne}
  8240 + onGetDataOne={this.handleGetDataOne}
7455 8241 onParamsOk={this.handleParamsOk}
7456 8242 onReportParamsOk={this.handleReportParamsOk}
7457   - onCheckParamChange ={this.handleCheckParamChange}
  8243 + onCheckParamChange={this.handleCheckParamChange}
7458 8244 onDropDownBlur={this.handleTableBlur}
7459 8245 onDataRowShowParam={this.handleShowParam}
  8246 + onSelectCommonPopup={this.handleSelectCommonPopup} /* 送货单个性化放大镜弹窗 */
7460 8247 />
7461 8248 );
7462 8249 }
... ...
src/components/Common/CommonComponent/index.js
... ... @@ -605,15 +605,11 @@ export default class CommonComponent extends Component {
605 605 /* 主表时才赋值value */
606 606 if (this.props.bTable) {
607 607 if (this.props.showConfig.bMultipleChoice) {
608   - if (this.state.dataValue) {
609   - obj.value = this.state.dataValue.split(',');
610   - } else {
611   - obj.value = [];
612   - }
  608 + obj.value = !commonUtils.isEmpty(this.state.dataValue) ? this.state.dataValue.split(",") : []; /* 数据值 */
613 609 } else {
614   - obj.value = this.state.dataValue;
  610 + obj.value = this.state.dataValue; /* 数据值 */
615 611 }
616   - !this.props.bNewForm && (obj.className = styles.editSelect);
  612 + obj.className = this.props.costomClassName === undefined ? styles.editSelect : this.props.costomClassName;
617 613 }
618 614 if (this.props.showConfig.iDropWidth > 0) {
619 615 obj.dropdownMatchSelectWidth = false; /* true时 下拉菜单和选择器同宽。默认将设置 min-width,当值小于选择框宽度时会被忽略。 */
... ...
src/components/Common/CommonHooks/useCommonBase.js
... ... @@ -56,7 +56,7 @@ const useCommonBase = props =&gt; {
56 56 }
57 57 const { sModelsId, app } = state;
58 58 const formData = await handleGetModelConfig({ sModelsId });
59   -
  59 +
60 60 const addState = {};
61 61 let pageRoute = props.sModelType;
62 62 // 如果是弹窗且没有pageLayout,则认为是commonBill
... ... @@ -70,7 +70,7 @@ const useCommonBase = props =&gt; {
70 70 formData[0].gdsconfigformslave.push({
71 71 sId: commonUtils.createSid(),
72 72 sControlName: 'pageLayout',
73   - sDefault: JSON.stringify([["slave"],[{"configList":[{"sName":"slave","sTabName":"","sEnglishTabName":"","sBig5TabName":"","showType":"table","bHideTitle":true,"tableBtnsConfig":[]}],"mode":"advanced","height":"100%","width":"100%"}]])
  73 + sDefault: JSON.stringify([["slave"], [{ "configList": [{ "sName": "slave", "sTabName": "", "sEnglishTabName": "", "sBig5TabName": "", "showType": "table", "bHideTitle": true, "tableBtnsConfig": [] }], "mode": "advanced", "height": "100%", "width": "100%" }]])
74 74 })
75 75 } else if (pageRoute === '/indexPage/commonBill') {
76 76 const { sLanguage } = app.userinfo;
... ... @@ -79,15 +79,15 @@ const useCommonBase = props =&gt; {
79 79 if (index === 0) {
80 80 item.sGrd = 'master';
81 81 tableList.push('master');
82   - tabConfig.push({"configList":[{"sName":"master","showType":"form","bHideTitle":true,"defaultEnabled":true}],"mode":"advanced","height":"auto","width":"100%"});
  82 + tabConfig.push({ "configList": [{ "sName": "master", "showType": "form", "bHideTitle": true, "defaultEnabled": true }], "mode": "advanced", "height": "auto", "width": "100%" });
83 83 } else {
84 84 const tablename = `slave${index - 2 < 0 ? '' : index - 2}`;
85 85 item.sGrd = tablename;
86 86 tableList.push(tablename);
87 87 if (!tabConfig[1]) {
88   - tabConfig.push({"configList":[],"mode":"advanced"});
  88 + tabConfig.push({ "configList": [], "mode": "advanced" });
89 89 }
90   - tabConfig[1].configList.push({"sName":tablename,"sTabName":item[sLanguage],"showType":"table","defaultEnabled":true,"bHideTitle":true});
  90 + tabConfig[1].configList.push({ "sName": tablename, "sTabName": item[sLanguage], "showType": "table", "defaultEnabled": true, "bHideTitle": true });
91 91 }
92 92 });
93 93 formData[0].gdsconfigformslave.push({
... ... @@ -115,14 +115,107 @@ const useCommonBase = props =&gt; {
115 115 * @param {Function} callback - 回调函数
116 116 */
117 117 const handleSaveState = (values, callback) => {
  118 + if (commonUtils.isNotEmptyObject(values.masterConfig) && values.masterConfig.bMerged) {
  119 + delete values.masterConfig;
  120 + }
  121 + Object.keys(values).forEach(key => {
  122 + // 如果将要保存的slaveConfig是合并过的,则删除掉
  123 + if (key.startsWith('slave') && key.endsWith('Config') && commonUtils.isNotEmptyObject(values[key]) && values[key].bMerged) {
  124 + delete values[key];
  125 + }
  126 + });
  127 + // 如果改变了主表数据,遍历下所有配置sButtonEnabled的字段,生成配置
  128 + const addState = {};
  129 + const sRulesJsonTotal = handleGetRulesJsonTotal(values);
  130 + if (sRulesJsonTotal) {
  131 + addState.sRulesJsonTotal = sRulesJsonTotal;
  132 + }
118 133 const cbState = {};
119 134 if (typeof callback === "function") {
120 135 cbState.callbackRefresh = callbackRefresh + 1;
121 136 cbState.callback = callback;
122 137 }
  138 + console.log(values, 'values');
  139 +
123 140 dispatch(["saveState", { ...values, ...cbState }]);
124 141 };
125 142  
  143 + // 遍历下所有配置sButtonEnabled的字段,生成配置
  144 +
  145 + const handleGetRulesJsonTotal = (values) => {
  146 + const { masterConfig: masterConfig1, masterData: masterData1 } = values;
  147 + const { masterConfig: masterConfig2, masterData: masterData2, sRulesJsonTotal } = state;
  148 +
  149 + const masterConfig = masterConfig1 || masterConfig2;
  150 + const masterData = masterData1 || masterData2;
  151 +
  152 + const condition0 = commonUtils.isEmptyObject(masterConfig1) && commonUtils.isEmptyObject(masterData1);
  153 + const condition1 = commonUtils.isNotEmptyObject(masterConfig) && commonUtils.isNotEmptyObject(masterData1);
  154 + const condition2 = commonUtils.isNotEmptyObject(masterConfig) && sRulesJsonTotal === undefined && commonUtils.isNotEmptyObject(masterData);
  155 + const condition3 = commonUtils.convertObjToStr(masterData1) === commonUtils.convertObjToStr(masterData2) && sRulesJsonTotal !== undefined;
  156 +
  157 + const { sRulesTableList = [] } = state;
  158 + let condition4 = false;
  159 + if (sRulesTableList.length) {
  160 + sRulesTableList.forEach(tableName => {
  161 + const { [`${tableName}Data`]: tableData1 } = values;
  162 + const { [`${tableName}Data`]: tableData2 = [] } = state;
  163 + if (tableData1 !== undefined && commonUtils.convertObjToStr(tableData1) !== commonUtils.convertObjToStr(tableData2)) {
  164 + condition4 = true;
  165 + }
  166 + })
  167 + }
  168 +
  169 + if (condition0 || !(condition1 || condition2) || condition3) {
  170 + if (!condition4) {
  171 + return '';
  172 + }
  173 + }
  174 +
  175 + const { gdsconfigformslave = [] } = masterConfig;
  176 + return gdsconfigformslave.reduce((result, config) => {
  177 + const { sButtonEnabled } = config;
  178 + const sRulesJson = commonUtils.convertStrToObj(sButtonEnabled, []);
  179 + if (commonUtils.isNotEmptyArr(sRulesJson)) {
  180 + for (let i = 0; i < sRulesJson.length; i += 1) {
  181 + const rule = sRulesJson[i] || {};
  182 + const { condition = [] } = rule;
  183 + let flag = false; // 是否满足条件
  184 + for (let j = 0; j < condition.length; j += 1) {
  185 + const item = condition[j];
  186 + const { bFilterName, bFilterCondition, bFilterValue, jsCondition } = item;
  187 + if (jsCondition) {
  188 + flag = commonFunc.getEvalResult({
  189 + props: { ...props, ...state, ...values },
  190 + str: jsCondition,
  191 + defaultValue: false,
  192 + reocrdRules: true,
  193 + onSaveState: handleSaveState,
  194 + })
  195 + } else if (bFilterName !== undefined && bFilterCondition !== undefined && bFilterValue !== undefined) {
  196 + const currentValue = masterData[bFilterName];
  197 + flag = handleCompareValues(currentValue, bFilterValue, bFilterCondition);
  198 + }
  199 + if (!flag) {
  200 + break;
  201 + }
  202 + }
  203 + if (flag) {
  204 + // console.log('=====匹配的规则', config, rule);
  205 + const columnList = Object.keys(rule).filter(columnName => columnName && columnName.indexOf('Column') !== -1);
  206 + columnList.forEach((columnName) => {
  207 + if (commonUtils.isEmptyArr(result[columnName])) {
  208 + result[columnName] = [];
  209 + }
  210 + result[columnName] = Array.from(new Set([...result[columnName], ...rule[columnName]]));
  211 + });
  212 + // return result;
  213 + }
  214 + }
  215 + }
  216 + return result;
  217 + }, {});
  218 + }
126 219 /**
127 220 * 获取模型配置
128 221 * @param {Object} params - 参数对象
... ... @@ -132,9 +225,8 @@ const useCommonBase = props =&gt; {
132 225 const handleGetModelConfig = async params => {
133 226 const { sModelsId } = params;
134 227 const { token, formSrcRoute } = state;
135   - const configUrl = `${
136   - commonConfig.server_host
137   - }business/getModelBysId/${sModelsId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
  228 + const configUrl = `${commonConfig.server_host
  229 + }business/getModelBysId/${sModelsId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
138 230 const configReturn = (await commonServices.getService(token, configUrl))
139 231 .data;
140 232 let formData = [];
... ... @@ -238,9 +330,8 @@ const useCommonBase = props =&gt; {
238 330 }
239 331  
240 332 const configDataId = configData.sId;
241   - const dataUrl = `${
242   - commonConfig.server_host
243   - }business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
  333 + const dataUrl = `${commonConfig.server_host
  334 + }business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
244 335 const dataReturn = (await commonServices.postValueService(
245 336 token,
246 337 condition,
... ... @@ -325,9 +416,8 @@ const useCommonBase = props =&gt; {
325 416 let treeData = [];
326 417 const expandedKeys = [];
327 418 const configDataId = configData.sParentId;
328   - const dataUrl = `${
329   - commonConfig.server_host
330   - }filterTree/getFilterTree/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
  419 + const dataUrl = `${commonConfig.server_host
  420 + }filterTree/getFilterTree/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
331 421 const dataReturn = (await commonServices.postValueService(
332 422 token,
333 423 condition,
... ... @@ -535,8 +625,8 @@ const useCommonBase = props =&gt; {
535 625 iIndex > -1
536 626 ? iIndex
537 627 : data.findIndex(
538   - itemData => itemData.sSlaveId === selectedRowKeys[0]
539   - );
  628 + itemData => itemData.sSlaveId === selectedRowKeys[0]
  629 + );
540 630 if (iIndex > -1) {
541 631 conditonValues[fieldNameFilter] = data[iIndex][fieldName];
542 632 }
... ... @@ -590,9 +680,8 @@ const useCommonBase = props =&gt; {
590 680 conditonValues: {}
591 681 };
592 682 }
593   - const url = `${commonConfig.server_host}business/getSelectLimit/${
594   - showConfig.sId
595   - }?sModelsId=${state.sModelsId}&sName=${formSrcRoute}`;
  683 + const url = `${commonConfig.server_host}business/getSelectLimit/${showConfig.sId
  684 + }?sModelsId=${state.sModelsId}&sName=${formSrcRoute}`;
596 685 /* 参数 */
597 686 let conditonValues = getSqlCondition(showConfig, name, record);
598 687 if (record?.conditonValues) {
... ... @@ -705,8 +794,8 @@ const useCommonBase = props =&gt; {
705 794 iIndex > -1
706 795 ? iIndex
707 796 : dataCondition.findIndex(
708   - itemData => itemData.sSlaveId === selectedRowKeys[0]
709   - );
  797 + itemData => itemData.sSlaveId === selectedRowKeys[0]
  798 + );
710 799 if (iIndex > -1) {
711 800 data = data.filter(
712 801 item =>
... ... @@ -804,8 +893,8 @@ const useCommonBase = props =&gt; {
804 893 slaveSelectedData = commonUtils.isEmpty(slaveSelectedData)
805 894 ? []
806 895 : slaveSelectedData.filter(item =>
807   - selectedRowKeys.toString().includes(item.sSlaveId)
808   - );
  896 + selectedRowKeys.toString().includes(item.sSlaveId)
  897 + );
809 898 selectedRowKeys.forEach(item => {
810 899 const iIndex = slaveSelectedData.findIndex(
811 900 selectItem => selectItem.sSlaveId === item
... ... @@ -829,7 +918,7 @@ const useCommonBase = props =&gt; {
829 918 !commonUtils.isEmpty(sFieldName) &&
830 919 (commonUtils.isEmptyArr(state[`${name}SelectedRowKeys`]) ||
831 920 selectedRowKeys.toString() !==
832   - state[`${name}SelectedRowKeys`].toString())
  921 + state[`${name}SelectedRowKeys`].toString())
833 922 ) {
834 923 tableConfig.gdsconfigformslave
835 924 .filter(
... ... @@ -871,8 +960,8 @@ const useCommonBase = props =&gt; {
871 960 if (name === "slave0") {
872 961 const viewRow = slave0SelectedRowKeys.length
873 962 ? slave0Data?.filter(item =>
874   - slave0SelectedRowKeys.includes(item.sId)
875   - )[0]
  963 + slave0SelectedRowKeys.includes(item.sId)
  964 + )[0]
876 965 : {};
877 966 if (viewRow?.sAbnormalEventId) {
878 967 handleSaveState({
... ... @@ -1140,7 +1229,7 @@ const useCommonBase = props =&gt; {
1140 1229 (sFieldName === "sWareHouseId" ||
1141 1230 sFieldName === "sWareHouseNo" ||
1142 1231 sFieldName === "sWareHouseName") &&
1143   - sModelsType.includes("materialsStock/productionmaterialsadjust")
  1232 + sModelsType.includes("materialsStock/productionmaterialsadjust")
1144 1233 ? { ...item }
1145 1234 : { ...item, [sFieldName]: changeValue[sFieldName] };
1146 1235 if (
... ... @@ -1162,8 +1251,8 @@ const useCommonBase = props =&gt; {
1162 1251 : tableDataRow.handleType;
1163 1252 const models =
1164 1253 sModelsType.includes("sales/") ||
1165   - sModelsType.includes("manufacture/") ||
1166   - sModelsType.includes("productStock/")
  1254 + sModelsType.includes("manufacture/") ||
  1255 + sModelsType.includes("productStock/")
1167 1256 ? "Product"
1168 1257 : "Materials";
1169 1258  
... ... @@ -1258,9 +1347,8 @@ const useCommonBase = props =&gt; {
1258 1347 /* 待用数据声明 */
1259 1348 const sTabId = props.app.currentPane.key; /* 当前标签页TabId */
1260 1349 /* 接口地址 */
1261   - const sNameUrl = `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${
1262   - showConfig.sActiveId
1263   - }?sModelsId=${showConfig.sActiveId}&sName=${formSrcRoute}`;
  1350 + const sNameUrl = `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${showConfig.sActiveId
  1351 + }?sModelsId=${showConfig.sActiveId}&sName=${formSrcRoute}`;
1264 1352 const CallBackRecord = handleCallBackRecord; /* 字段名,主从表,字段名 */
1265 1353 /* newRecord时,如果是新增产品,则要带客户过去 */
1266 1354 const addStata = {};
... ... @@ -2128,9 +2216,8 @@ const useCommonBase = props =&gt; {
2128 2216 changeValue: sValue,
2129 2217 sButtonParam: btn
2130 2218 });
2131   - const url = `${
2132   - commonConfig.server_host
2133   - }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`;
  2219 + const url = `${commonConfig.server_host
  2220 + }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`;
2134 2221 const returnData = (await commonServices.postValueService(
2135 2222 token,
2136 2223 value,
... ... @@ -2657,7 +2744,160 @@ const useCommonBase = props =&gt; {
2657 2744 }
2658 2745 return tableConfigNew;
2659 2746 };
  2747 + /* 通用弹窗 选择数据带回窗体 */
  2748 + const handleSelectCommonPopup = (currentPaneName, selectConfig, selectData, tbName, isWait) => {
  2749 + // 如果配置了sAfterClickInstruct,先走指令集再走原逻辑,否值直接走原逻辑
  2750 + const { sAfterClickInstruct, showName } = selectConfig;
  2751 + if (sAfterClickInstruct) {
  2752 + instructSet({
  2753 + ...props,
  2754 + ...state,
  2755 + slavepupData: selectData,
  2756 + btnConfig: { sInstruct: sAfterClickInstruct, showName },
  2757 + onSaveState: handleSaveState,
  2758 + callback: () => {
  2759 + handleSelectCommonPopupNew(currentPaneName, selectConfig, selectData, tbName, isWait);
  2760 + }
  2761 + })
  2762 + } else {
  2763 + if (typeof isWait === 'boolean' && isWait) {
  2764 + return handleSelectCommonPopupNew(currentPaneName, selectConfig, selectData, tbName, isWait);
  2765 + } else {
  2766 + handleSelectCommonPopupNew(currentPaneName, selectConfig, selectData, tbName);
  2767 + }
  2768 + }
  2769 + };
  2770 + const handleSelectCommonPopupNew = (currentPaneName, selectConfig, selectData, tbName, isWait) => {
  2771 + const {
  2772 + [`${tbName}SelectedRowKeys`]: tableSelectedRowKeys, masterData,
  2773 + controlData, controlSelectedRowKeys, sModelsId,
  2774 + } = state;
  2775 + const { sOnChangeInstruct, showName } = selectConfig;
  2776 + const type = 'change';
  2777 + const onChangeNew = commonUtils.convertStrToObj(sOnChangeInstruct, {});
  2778 + const instructType = onChangeNew[type];
  2779 + // 回弹字段直接设置单价
  2780 + async function setProductPrice(tableDataRowAdd, item, props) {
  2781 + if (selectConfig.sName === 'sProductId' || selectConfig.sName === 'sProductName' || selectConfig.sName === 'sProductNo') {
  2782 + const url = `${commonConfig.server_host}business/getProData?sModelsId=${sModelsId}`;
  2783 + const { sCustomerId } = masterData; /* 增加客户id参数 */
  2784 + const value = {
  2785 + sProName: 'Sp_Cashier_GetProductPrice',
  2786 + paramsMap: {
  2787 + sProductGuid: item.sId,
  2788 + sCustomerId,
  2789 + },
  2790 + };
  2791 + const returnData = (await commonServices.postValueService(props.app.token, value, url)).data;
  2792 + if (returnData.code === 1) {
  2793 + tableDataRowAdd.dNProductPrice = returnData.dataset.rows[0].dataSet.outData[0].dPrice; /* 产品单价 */
  2794 + const dProofingMoney = commonUtils.convertToNum(tableDataRowAdd.dProofingMoney); /* 打样金额 */
  2795 + const dPlateMoney = commonUtils.convertToNum(tableDataRowAdd.dPlateMoney); /* 制版金额 */
  2796 + const dKnifeMouldMoney = commonUtils.convertToNum(tableDataRowAdd.dKnifeMouldMoney); /* 刀模金额 */
  2797 + const dProductQty = commonUtils.convertToNum(tableDataRowAdd.dProductQty); /* 数量 */
  2798 + const dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */
  2799 + const { dNetPrice } = props.app.decimals;
  2800 + if (dProductQty === 0 || (dProofingMoney === 0 && dPlateMoney === 0 && dKnifeMouldMoney === 0)) {
  2801 + const dProductForeignPrice = returnData.dataset.rows[0].dataSet.outData[0].dPrice;
  2802 + tableDataRowAdd.dProductForeignPrice = dProductForeignPrice;
  2803 + tableDataRowAdd.dProductPrice = commonUtils.convertFixNum(dProductForeignPrice * dCurrencyRate, dNetPrice);
  2804 + }
  2805 + }
  2806 + return tableDataRowAdd;
  2807 + } else {
  2808 + return tableDataRowAdd;
  2809 + }
  2810 + }
  2811 + let { [`${tbName}Data`]: tableData, [`${tbName}Pagination`]: pagination = {} } = state;
  2812 + let addReturn = {};
  2813 + if (commonUtils.isNotEmptyArr(tableData) && commonUtils.isNotEmptyArr(selectData)) {
  2814 + const iIndex = commonUtils.isNotEmptyArr(tableSelectedRowKeys) && commonUtils.isNotEmptyObject(tableSelectedRowKeys[0]) ? tableData.findIndex(item => item.sId === tableSelectedRowKeys[0]) : -1;
  2815 + const iControlIndex = commonUtils.isNotEmptyArr(controlSelectedRowKeys) ? controlData.findIndex(item => item.sId === controlSelectedRowKeys[0]) : -1; /* 控制表 */
  2816 + selectData.forEach(async (item, index) => {
  2817 + const newCopyTo = {};
  2818 + newCopyTo.master = masterData;
  2819 + const sName = selectConfig.sKeyUpFilter; /* 将后台配置筛选字段作为 列字段 */
  2820 + let sValue = '';
  2821 + if (iIndex > -1) {
  2822 + newCopyTo.slave = tableData[iIndex];
  2823 + sValue = tableData[iIndex][sName];
  2824 + }
  2825 + if (iControlIndex > -1) {
  2826 + newCopyTo.control = controlData[iControlIndex];
  2827 + }
  2828 + /* 第一条数据若字段值为空或者只有一条数据时 则添加到该行 否则新增一行 */
  2829 + if (selectData.length === 1 || (index === 0 && commonUtils.isEmptyObject(sValue))) {
  2830 + let tableDataRow = {}; // 取默认值
  2831 + if (tbName === 'master') {
  2832 + tableDataRow = { ...tableData, ...commonFunc.getAssignFieldValue(selectConfig.sAssignField, item, newCopyTo) }; // 取赋值字段
  2833 + tableData = tableDataRow;
  2834 + tableData.handleType = commonUtils.isEmpty(tableData.handleType) ? 'update' : tableData.handleType;
  2835 + if (instructType) {
  2836 + handleExecInstructSet({
  2837 + type,
  2838 + sInstruct: instructType,
  2839 + showName: `${showName}-${type === 'blur' ? '离焦' : '变化'}`,
  2840 + });
  2841 + }
  2842 +
  2843 + } else {
  2844 + tableDataRow = { ...tableData[iIndex] };
  2845 + if (tbName === 'slave') {
  2846 + tableDataRow.sSqlConditionId = tableDataRow.sId;
  2847 + }
  2848 + tableDataRow = { ...tableDataRow, ...commonFunc.getAssignFieldValue(selectConfig.sAssignField, item, newCopyTo) }; // 取赋值字段
  2849 +
  2850 + tableData[iIndex] = tableDataRow;
  2851 + tableData[iIndex].handleType = commonUtils.isEmpty(tableData[iIndex].handleType) ? 'update' : tableData[iIndex].handleType;
  2852 + tableData[iIndex] = await setProductPrice(tableData[iIndex], item, props);
  2853 + if (instructType) {
  2854 + handleExecInstructSet({
  2855 + type,
  2856 + sInstruct: instructType,
  2857 + showName: `${showName}-${type === 'blur' ? '离焦' : '变化'}`,
  2858 + });
  2859 + }
  2860 + }
  2861 + } else {
  2862 + let tableDataRowAdd = handleTableAdd(tbName, true);
  2863 + if (tbName === 'slave') {
  2864 + tableDataRowAdd.sSqlConditionId = tableDataRowAdd.sId;
  2865 + }
  2866 + tableDataRowAdd = { ...tableDataRowAdd, ...commonFunc.getAssignFieldValue(selectConfig.sAssignField, item, newCopyTo) }; // 取赋值字段
  2867 + tableDataRowAdd = await setProductPrice(tableDataRowAdd, item, props);
  2868 + if (instructType) {
  2869 + handleExecInstructSet({
  2870 + type,
  2871 + sInstruct: instructType,
  2872 + showName: `${showName}-${type === 'blur' ? '离焦' : '变化'}`,
  2873 + });
  2874 + }
  2875 + tableData.push(tableDataRowAdd);
  2876 + }
  2877 +
  2878 + pagination = {
  2879 + ...pagination,
  2880 + total: tableData.length,
  2881 + }
2660 2882  
  2883 + if (tbName === 'master') {
  2884 + const result = handleMasterChange(tbName, selectConfig.sName, {}, null, null, true, tableData);
  2885 + tableData = result.masterData;
  2886 + }
  2887 +
  2888 + const addState = { [`${tbName}Data`]: tableData, [`${tbName}Pagination`]: pagination };
  2889 +
  2890 + if (typeof isWait !== 'boolean') {
  2891 + handleSaveState(addState);
  2892 + }
  2893 +
  2894 + });
  2895 + if (typeof isWait === 'boolean' && isWait) {
  2896 + addReturn = { [`${tbName}Data`]: tableData, [`${tbName}Pagination`]: pagination };
  2897 + return addReturn;
  2898 + }
  2899 + }
  2900 + };
2661 2901 const returnProps = {
2662 2902 ...props,
2663 2903 ...state,
... ... @@ -2687,7 +2927,8 @@ const useCommonBase = props =&gt; {
2687 2927 onMesTableLineCopy: handleMesTableLineCopy, // 表格行复制
2688 2928 onCopyTo: handleCopyTo, // 复制到
2689 2929 onMergeTableConfig: handleMergeTableConfig, // 合并config配置和所有sButtonEnabled配置
2690   - awaitPromiseReturn: awaitPromiseReturn
  2930 + awaitPromiseReturn: awaitPromiseReturn,
  2931 + onSelectCommonPopup: handleSelectCommonPopup
2691 2932 };
2692 2933  
2693 2934 // 切换页面时,加载角标数据
... ...
src/components/Common/CommonSubBillEvent.js
... ... @@ -5564,7 +5564,7 @@ export default (ChildComponent) =&gt; {
5564 5564 onResolveMachineComposing={this.handleResolveMachineComposing}
5565 5565 onContextMenuOk={this.handleContextMenuOk}
5566 5566 orderNum={this.orderNum}
5567   - // onSelectCommonPopup={this.handleSelectCommonPopup} /* 送货单个性化放大镜弹窗 */
  5567 + onSelectCommonPopup={this.handleSelectCommonPopup} /* 送货单个性化放大镜弹窗 */
5568 5568 />
5569 5569 );
5570 5570 }
... ...