Commit 7bc4b753ec25150e5e70f74023fa73bcc65a48c1
1 parent
e2294523
放大镜弹窗
Showing
8 changed files
with
2223 additions
and
1080 deletions
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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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) => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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 => { |
| 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) => { |
| 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 | } | ... | ... |
src/components/Common/CommonTable/index.js
| ... | ... | @@ -215,7 +215,7 @@ class CommonTableRc extends React.Component { |
| 215 | 215 | }; |
| 216 | 216 | this.rowKey = |
| 217 | 217 | commonUtils.isNotEmptyObject(props.tableProps) && |
| 218 | - !commonUtils.isEmpty(props.tableProps.rowKey) | |
| 218 | + !commonUtils.isEmpty(props.tableProps.rowKey) | |
| 219 | 219 | ? props.tableProps.rowKey |
| 220 | 220 | : "sId"; /* 表格主键 */ |
| 221 | 221 | this.config = {}; /* 配置信息(基础)(数据格式:对象) */ |
| ... | ... | @@ -322,15 +322,15 @@ class CommonTableRc extends React.Component { |
| 322 | 322 | this.props.app.currentPane && |
| 323 | 323 | (this.props.app.currentPane.route.indexOf("commonList") !== -1 || |
| 324 | 324 | this.props.app.currentPane.route.indexOf("productionScheduleTree") !== |
| 325 | - -1) | |
| 325 | + -1) | |
| 326 | 326 | ) { |
| 327 | 327 | if (this.tableHeight !== "100%" && this.tableHeight !== 0) { |
| 328 | 328 | if (this.props.name !== "report") { |
| 329 | 329 | this.mydiv.getElementsByClassName( |
| 330 | 330 | "ant-table-body" |
| 331 | 331 | )[0].style.height = this.tableHeight |
| 332 | - ? this.tableHeight + "px" | |
| 333 | - : 80 + "px"; | |
| 332 | + ? this.tableHeight + "px" | |
| 333 | + : 80 + "px"; | |
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | } |
| ... | ... | @@ -434,7 +434,7 @@ class CommonTableRc extends React.Component { |
| 434 | 434 | this.props.updateRowNumTime !== nextState.updateRowNumTime || |
| 435 | 435 | enabled !== nextState.enabled || |
| 436 | 436 | JSON.stringify(this.props.isDragAndDrop) !== |
| 437 | - JSON.stringify(nextProps.isDragAndDrop) || | |
| 437 | + JSON.stringify(nextProps.isDragAndDrop) || | |
| 438 | 438 | // JSON.stringify(headerColumn) !== JSON.stringify(nextState.headerColumn) || |
| 439 | 439 | JSON.stringify(this.props.config) !== JSON.stringify(nextProps.config) || |
| 440 | 440 | JSON.stringify(tableColumn) !== JSON.stringify(nextState.tableColumn) || |
| ... | ... | @@ -442,21 +442,21 @@ class CommonTableRc extends React.Component { |
| 442 | 442 | JSON.stringify(totalData) !== JSON.stringify(nextState.totalData) || |
| 443 | 443 | JSON.stringify(totalData1) !== JSON.stringify(nextState.totalData1) || |
| 444 | 444 | JSON.stringify(selectedRowKeys) !== |
| 445 | - JSON.stringify(nextState.selectedRowKeys) || | |
| 445 | + JSON.stringify(nextState.selectedRowKeys) || | |
| 446 | 446 | JSON.stringify(slaveInfoSelectedRowKeys) !== |
| 447 | - JSON.stringify(nextState.slaveInfoSelectedRowKeys) || | |
| 447 | + JSON.stringify(nextState.slaveInfoSelectedRowKeys) || | |
| 448 | 448 | JSON.stringify(expKeys) !== JSON.stringify(nextState.expKeys) || |
| 449 | 449 | JSON.stringify(previewVisible) !== |
| 450 | - JSON.stringify(nextState.previewVisible) || | |
| 450 | + JSON.stringify(nextState.previewVisible) || | |
| 451 | 451 | JSON.stringify(commonPopupVisible) !== |
| 452 | - JSON.stringify(nextState.commonPopupVisible) || | |
| 452 | + JSON.stringify(nextState.commonPopupVisible) || | |
| 453 | 453 | JSON.stringify(commonFieldPopupVisible) !== |
| 454 | - JSON.stringify(nextState.commonFieldPopupVisible) || | |
| 454 | + JSON.stringify(nextState.commonFieldPopupVisible) || | |
| 455 | 455 | JSON.stringify(previewImage) !== JSON.stringify(nextState.previewImage) || |
| 456 | 456 | JSON.stringify(filteredValue) !== |
| 457 | - JSON.stringify(nextState.filteredValue) || | |
| 457 | + JSON.stringify(nextState.filteredValue) || | |
| 458 | 458 | JSON.stringify(this.props.tableProps.pagination) !== |
| 459 | - JSON.stringify(nextProps.tableProps.pagination) || | |
| 459 | + JSON.stringify(nextProps.tableProps.pagination) || | |
| 460 | 460 | // JSON.stringify(this.props.tableProps.AutoTableHeight) !== JSON.stringify(nextProps.tableProps.AutoTableHeight) || |
| 461 | 461 | JSON.stringify(nextProps.slaveInfo) !== slaveInfo || |
| 462 | 462 | JSON.stringify(nextProps.realizeHeight) !== realizeHeight || |
| ... | ... | @@ -658,7 +658,7 @@ class CommonTableRc extends React.Component { |
| 658 | 658 | ? this.handleResize(index, column, isSlaveInfo) |
| 659 | 659 | : null, |
| 660 | 660 | bnotresize: bNotResize ? "bNotResize" : null, |
| 661 | - onClick: () => {}, | |
| 661 | + onClick: () => { }, | |
| 662 | 662 | onMouseDown: () => { |
| 663 | 663 | if (this.lastTdMouseOver) { |
| 664 | 664 | return; |
| ... | ... | @@ -733,8 +733,7 @@ class CommonTableRc extends React.Component { |
| 733 | 733 | }); |
| 734 | 734 | if (isSlaveInfo) { |
| 735 | 735 | sessionStorage.setItem( |
| 736 | - `${this.props.formId}_${ | |
| 737 | - this.props.config.sId | |
| 736 | + `${this.props.formId}_${this.props.config.sId | |
| 738 | 737 | }_info_headerColumns`, |
| 739 | 738 | JSON.stringify(sortArr) |
| 740 | 739 | ); |
| ... | ... | @@ -866,7 +865,7 @@ class CommonTableRc extends React.Component { |
| 866 | 865 | ...columns[initColumnIndexArr[0]], |
| 867 | 866 | children: [ |
| 868 | 867 | columns[initColumnIndexArr[0]].children[ |
| 869 | - initColumnIndexArr[1] | |
| 868 | + initColumnIndexArr[1] | |
| 870 | 869 | ] |
| 871 | 870 | ] |
| 872 | 871 | }; |
| ... | ... | @@ -934,7 +933,7 @@ class CommonTableRc extends React.Component { |
| 934 | 933 | ...columns[initColumnIndexArr[0]], |
| 935 | 934 | children: [ |
| 936 | 935 | columns[initColumnIndexArr[0]].children[ |
| 937 | - initColumnIndexArr[1] | |
| 936 | + initColumnIndexArr[1] | |
| 938 | 937 | ] |
| 939 | 938 | ] |
| 940 | 939 | }; |
| ... | ... | @@ -1022,8 +1021,7 @@ class CommonTableRc extends React.Component { |
| 1022 | 1021 | if (isSlaveInfo) { |
| 1023 | 1022 | this.setState({ tableInfoColumn: columns }, () => { |
| 1024 | 1023 | sessionStorage.setItem( |
| 1025 | - `${this.props.formId}_${ | |
| 1026 | - this.props.config.sId | |
| 1024 | + `${this.props.formId}_${this.props.config.sId | |
| 1027 | 1025 | }_info_headerColumns`, |
| 1028 | 1026 | JSON.stringify(sortArr) |
| 1029 | 1027 | ); |
| ... | ... | @@ -1101,12 +1099,12 @@ class CommonTableRc extends React.Component { |
| 1101 | 1099 | // let { selectedRowKeys } = this.props; |
| 1102 | 1100 | const rowKey = |
| 1103 | 1101 | tabType === "slaveInfo" && |
| 1104 | - commonUtils.isNotEmptyObject(this.props.slaveInfo.tableProps) | |
| 1102 | + commonUtils.isNotEmptyObject(this.props.slaveInfo.tableProps) | |
| 1105 | 1103 | ? this.props.slaveInfo.tableProps.rowKey |
| 1106 | 1104 | : this.rowKey; |
| 1107 | 1105 | let selectedRowKeys = |
| 1108 | 1106 | tabType === "slaveInfo" && |
| 1109 | - commonUtils.isNotEmptyObject(this.props.slaveInfo.tableProps) | |
| 1107 | + commonUtils.isNotEmptyObject(this.props.slaveInfo.tableProps) | |
| 1110 | 1108 | ? this.props.slaveInfo.selectedRowKeys === undefined |
| 1111 | 1109 | ? undefined |
| 1112 | 1110 | : [...this.props.slaveInfo.selectedRowKeys] |
| ... | ... | @@ -1366,12 +1364,12 @@ class CommonTableRc extends React.Component { |
| 1366 | 1364 | : this.props.selectedRowKeys; |
| 1367 | 1365 | const rowKey = |
| 1368 | 1366 | tabType === "slaveInfo" && |
| 1369 | - commonUtils.isNotEmptyObject(this.props.slaveInfo.tableProps) | |
| 1367 | + commonUtils.isNotEmptyObject(this.props.slaveInfo.tableProps) | |
| 1370 | 1368 | ? this.props.slaveInfo.tableProps |
| 1371 | 1369 | : this.rowKey; |
| 1372 | 1370 | const rowClassName = |
| 1373 | 1371 | commonUtils.isNotEmptyArr(selectedRowKeys) && |
| 1374 | - selectedRowKeys.indexOf(record[rowKey]) > -1 | |
| 1372 | + selectedRowKeys.indexOf(record[rowKey]) > -1 | |
| 1375 | 1373 | ? `selected-record-row ${styleColor}` |
| 1376 | 1374 | : commonUtils.isNotEmptyObject(styleColor) |
| 1377 | 1375 | ? styleColor |
| ... | ... | @@ -1607,11 +1605,10 @@ class CommonTableRc extends React.Component { |
| 1607 | 1605 | if (commonUtils.isNotEmptyArr(sPicturePath)) { |
| 1608 | 1606 | sPicturePath[0].render = (value = "") => { |
| 1609 | 1607 | const picHref = value.includes("xlyerpfiles") |
| 1610 | - ? `${ | |
| 1611 | - commonConfig.server_host | |
| 1612 | - }file/download?savePathStr=${encodeURIComponent( | |
| 1613 | - value | |
| 1614 | - )}&sModelsId=100&token=${encodeURIComponent(this.props.app.token)}` | |
| 1608 | + ? `${commonConfig.server_host | |
| 1609 | + }file/download?savePathStr=${encodeURIComponent( | |
| 1610 | + value | |
| 1611 | + )}&sModelsId=100&token=${encodeURIComponent(this.props.app.token)}` | |
| 1615 | 1612 | : value; |
| 1616 | 1613 | return ( |
| 1617 | 1614 | <a target="_blank" key="sPicturePath" href={picHref}> |
| ... | ... | @@ -1630,11 +1627,10 @@ class CommonTableRc extends React.Component { |
| 1630 | 1627 | fileList[0].lastIndexOf("/") + 1 |
| 1631 | 1628 | ); |
| 1632 | 1629 | fileName = fileName.substring(fileName.indexOf("_") + 1); |
| 1633 | - const picHref = `${ | |
| 1634 | - commonConfig.server_host | |
| 1635 | - }file/download?savePathStr=${encodeURIComponent( | |
| 1636 | - value | |
| 1637 | - )}&sModelsId=100&token=${encodeURIComponent(this.props.app.token)}`; | |
| 1630 | + const picHref = `${commonConfig.server_host | |
| 1631 | + }file/download?savePathStr=${encodeURIComponent( | |
| 1632 | + value | |
| 1633 | + )}&sModelsId=100&token=${encodeURIComponent(this.props.app.token)}`; | |
| 1638 | 1634 | const fileType = fileName |
| 1639 | 1635 | .split(".") |
| 1640 | 1636 | .pop() |
| ... | ... | @@ -1722,12 +1718,11 @@ class CommonTableRc extends React.Component { |
| 1722 | 1718 | <div>{value}</div> |
| 1723 | 1719 | <div> |
| 1724 | 1720 | <div |
| 1725 | - className={`${ | |
| 1726 | - (this.props.name === "slaveWyrj3" && bCpStatus) || | |
| 1721 | + className={`${(this.props.name === "slaveWyrj3" && bCpStatus) || | |
| 1727 | 1722 | (this.props.name !== "slaveWyrj3" && bClStatus) |
| 1728 | - ? styles.indexNoLight | |
| 1729 | - : "" | |
| 1730 | - }`} | |
| 1723 | + ? styles.indexNoLight | |
| 1724 | + : "" | |
| 1725 | + }`} | |
| 1731 | 1726 | onClick={this.sIndexNoClick.bind(this, 1, record)} |
| 1732 | 1727 | > |
| 1733 | 1728 | 1 |
| ... | ... | @@ -1739,12 +1734,11 @@ class CommonTableRc extends React.Component { |
| 1739 | 1734 | "salveWybz3" |
| 1740 | 1735 | ].includes(this.props.name) ? ( |
| 1741 | 1736 | <div |
| 1742 | - className={`${ | |
| 1743 | - (this.props.name === "slaveWyrj3" && bClStatus) || | |
| 1737 | + className={`${(this.props.name === "slaveWyrj3" && bClStatus) || | |
| 1744 | 1738 | (this.props.name !== "slaveWyrj3" && bCpStatus) |
| 1745 | - ? styles.indexNoLight | |
| 1746 | - : "" | |
| 1747 | - }`} | |
| 1739 | + ? styles.indexNoLight | |
| 1740 | + : "" | |
| 1741 | + }`} | |
| 1748 | 1742 | onClick={this.sIndexNoClick.bind(this, 2, record)} |
| 1749 | 1743 | > |
| 1750 | 1744 | 2 |
| ... | ... | @@ -1759,13 +1753,12 @@ class CommonTableRc extends React.Component { |
| 1759 | 1753 | "salveWybz3" |
| 1760 | 1754 | ].includes(this.props.name) ? ( |
| 1761 | 1755 | <div |
| 1762 | - className={`${ | |
| 1763 | - bYcStatus | |
| 1764 | - ? ["slaveWyfq2"].includes(this.props.name) | |
| 1765 | - ? styles.indexNoLight | |
| 1766 | - : styles.indexNoLight1 | |
| 1767 | - : "" | |
| 1768 | - }`} | |
| 1756 | + className={`${bYcStatus | |
| 1757 | + ? ["slaveWyfq2"].includes(this.props.name) | |
| 1758 | + ? styles.indexNoLight | |
| 1759 | + : styles.indexNoLight1 | |
| 1760 | + : "" | |
| 1761 | + }`} | |
| 1769 | 1762 | onClick={this.sIndexNoClick.bind(this, 3, record)} |
| 1770 | 1763 | > |
| 1771 | 1764 | 3 |
| ... | ... | @@ -1989,9 +1982,8 @@ class CommonTableRc extends React.Component { |
| 1989 | 1982 | colorIndex = colorIndex === -1 ? 0 : colorIndex; |
| 1990 | 1983 | return ( |
| 1991 | 1984 | <span |
| 1992 | - className={`noInput ${ | |
| 1993 | - value ? styles[`mesColor${colorIndex}`] : "" | |
| 1994 | - }`} | |
| 1985 | + className={`noInput ${value ? styles[`mesColor${colorIndex}`] : "" | |
| 1986 | + }`} | |
| 1995 | 1987 | onClick={() => { |
| 1996 | 1988 | const { sModelType } = this.props.parentProps; |
| 1997 | 1989 | if (sModelType !== "/indexMes/productionExec") return; |
| ... | ... | @@ -2238,9 +2230,8 @@ class CommonTableRc extends React.Component { |
| 2238 | 2230 | if (value === "1" || value === "✓") { |
| 2239 | 2231 | return ( |
| 2240 | 2232 | <div |
| 2241 | - className={`${styles.xunjianCheck} ${ | |
| 2242 | - bEnabled ? styles.xunjianEnabled : "" | |
| 2243 | - }`} | |
| 2233 | + className={`${styles.xunjianCheck} ${bEnabled ? styles.xunjianEnabled : "" | |
| 2234 | + }`} | |
| 2244 | 2235 | onClick={xunjianClick.bind(this, { |
| 2245 | 2236 | bEnabled, |
| 2246 | 2237 | value, |
| ... | ... | @@ -2255,9 +2246,8 @@ class CommonTableRc extends React.Component { |
| 2255 | 2246 | } else if (value === "0" || value === "✗") { |
| 2256 | 2247 | return ( |
| 2257 | 2248 | <div |
| 2258 | - className={`${styles.xunjianUnCheck} ${ | |
| 2259 | - bEnabled ? styles.xunjianEnabled : "" | |
| 2260 | - }`} | |
| 2249 | + className={`${styles.xunjianUnCheck} ${bEnabled ? styles.xunjianEnabled : "" | |
| 2250 | + }`} | |
| 2261 | 2251 | onClick={xunjianClick.bind(this, { |
| 2262 | 2252 | bEnabled, |
| 2263 | 2253 | value, |
| ... | ... | @@ -2304,9 +2294,8 @@ class CommonTableRc extends React.Component { |
| 2304 | 2294 | if (value === "1" || value === "✓") { |
| 2305 | 2295 | return ( |
| 2306 | 2296 | <div |
| 2307 | - className={`${styles.xunjianCheck} ${ | |
| 2308 | - bEnabled ? styles.xunjianEnabled : "" | |
| 2309 | - }`} | |
| 2297 | + className={`${styles.xunjianCheck} ${bEnabled ? styles.xunjianEnabled : "" | |
| 2298 | + }`} | |
| 2310 | 2299 | onClick={xunjianClick.bind(this, { |
| 2311 | 2300 | bEnabled, |
| 2312 | 2301 | value, |
| ... | ... | @@ -2321,9 +2310,8 @@ class CommonTableRc extends React.Component { |
| 2321 | 2310 | } else if (value === "0" || value === "✗") { |
| 2322 | 2311 | return ( |
| 2323 | 2312 | <div |
| 2324 | - className={`${styles.xunjianUnCheck} ${ | |
| 2325 | - bEnabled ? styles.xunjianEnabled : "" | |
| 2326 | - }`} | |
| 2313 | + className={`${styles.xunjianUnCheck} ${bEnabled ? styles.xunjianEnabled : "" | |
| 2314 | + }`} | |
| 2327 | 2315 | onClick={xunjianClick.bind(this, { |
| 2328 | 2316 | bEnabled, |
| 2329 | 2317 | value, |
| ... | ... | @@ -2375,7 +2363,7 @@ class CommonTableRc extends React.Component { |
| 2375 | 2363 | this.useVListNew = true; |
| 2376 | 2364 | const sModelsType = |
| 2377 | 2365 | commonUtils.isNotEmptyObject(this.props) && |
| 2378 | - commonUtils.isNotEmptyObject(this.props.app) | |
| 2366 | + commonUtils.isNotEmptyObject(this.props.app) | |
| 2379 | 2367 | ? this.props.app.currentPane.sModelsType |
| 2380 | 2368 | : ""; |
| 2381 | 2369 | if ( |
| ... | ... | @@ -2412,7 +2400,7 @@ class CommonTableRc extends React.Component { |
| 2412 | 2400 | } else { |
| 2413 | 2401 | const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; |
| 2414 | 2402 | switch ( |
| 2415 | - Number(sState) // 根据状态显示颜色 | |
| 2403 | + Number(sState) // 根据状态显示颜色 | |
| 2416 | 2404 | ) { |
| 2417 | 2405 | case 2: |
| 2418 | 2406 | colorValue = "#FF6600"; /* 2:等待:黄色 */ |
| ... | ... | @@ -2436,11 +2424,11 @@ class CommonTableRc extends React.Component { |
| 2436 | 2424 | cursor: "default" |
| 2437 | 2425 | }} |
| 2438 | 2426 | key={i} |
| 2439 | - // onClick={this.handlesPartNameStatus.bind( | |
| 2440 | - // this, | |
| 2441 | - // "sPartNameStatus", | |
| 2442 | - // t.sWorkOrderId | |
| 2443 | - // )} | |
| 2427 | + // onClick={this.handlesPartNameStatus.bind( | |
| 2428 | + // this, | |
| 2429 | + // "sPartNameStatus", | |
| 2430 | + // t.sWorkOrderId | |
| 2431 | + // )} | |
| 2444 | 2432 | > |
| 2445 | 2433 | {commonUtils.isNotEmptyObject(t.sProcessName) |
| 2446 | 2434 | ? t.sProcessName |
| ... | ... | @@ -2492,169 +2480,169 @@ class CommonTableRc extends React.Component { |
| 2492 | 2480 | return ( |
| 2493 | 2481 | <div style={{ whiteSpace: "normal" }}> |
| 2494 | 2482 | {// eslint-disable-next-line array-callback-return |
| 2495 | - sPartItem.map((t, i) => { | |
| 2496 | - const sPartItemLength = sPartItem.length; | |
| 2497 | - const ArrItemStr = t.split("#")[0]; /* 工序名称 */ | |
| 2498 | - const ArrItemNum = t.split("#")[1]; /* 状态 */ | |
| 2499 | - const ArrItemName = t.split("#")[2]; /* 机台名称 */ | |
| 2500 | - const ArrItemBanZhu = t.split("#")[3]; /* 班组 */ | |
| 2501 | - const ArrItemTime = t.split("#")[4]; /* 排单时间 */ | |
| 2502 | - const ArrItemPCNum = t.split("#")[5]; /* 排程数 */ | |
| 2503 | - const ArrItemSBNum = t.split("#")[6]; /* 上报数 */ | |
| 2504 | - const ArrItem7Num = | |
| 2505 | - commonUtils.isNotEmptyArr(t.split("#")) && | |
| 2506 | - t.split("#").length > 8 | |
| 2507 | - ? t.split("#")[8] | |
| 2508 | - : ""; /* 包数 */ | |
| 2509 | - const ArrItem8Num = | |
| 2510 | - commonUtils.isNotEmptyArr(t.split("#")) && | |
| 2511 | - t.split("#").length > 9 | |
| 2512 | - ? t.split("#")[9] | |
| 2513 | - : ""; /* 每包数量 */ | |
| 2514 | - const ArrItem9Num = | |
| 2515 | - commonUtils.isNotEmptyArr(t.split("#")) && | |
| 2516 | - t.split("#").length > 10 | |
| 2517 | - ? t.split("#")[10] | |
| 2518 | - : ""; /* 零头数量 */ | |
| 2519 | - let ArrItemNumChange = ""; | |
| 2520 | - let icon; | |
| 2521 | - // eslint-disable-next-line default-case | |
| 2522 | - switch (Number(ArrItemNum)) { | |
| 2523 | - case 0: | |
| 2524 | - ArrItemNumChange = "未排程"; | |
| 2525 | - icon = ( | |
| 2526 | - <ExclamationCircleFilled | |
| 2527 | - style={{ margin: "0 6px 0 0", color: "#ffd591" }} | |
| 2528 | - title="未排程" | |
| 2529 | - /> | |
| 2530 | - ); | |
| 2531 | - break; | |
| 2532 | - case 1: | |
| 2533 | - ArrItemNumChange = "未完成"; | |
| 2534 | - icon = ( | |
| 2535 | - <CloseCircleFilled | |
| 2536 | - style={{ margin: "0 6px 0 0", color: "#ffa39e" }} | |
| 2537 | - title="未完成" | |
| 2538 | - /> | |
| 2539 | - ); | |
| 2540 | - break; | |
| 2541 | - case 2: | |
| 2542 | - ArrItemNumChange = "生产中"; | |
| 2543 | - icon = ( | |
| 2544 | - <ClockCircleFilled | |
| 2545 | - style={{ margin: "0 6px 0 0", color: "#69c0ff" }} | |
| 2546 | - title="生产中" | |
| 2547 | - /> | |
| 2548 | - ); | |
| 2549 | - break; | |
| 2550 | - case 3: | |
| 2551 | - ArrItemNumChange = "暂停"; | |
| 2552 | - icon = ( | |
| 2553 | - <LegacyIcon | |
| 2554 | - type="ause-circle" | |
| 2555 | - theme="filled" | |
| 2556 | - style={{ margin: "0 6px 0 0", color: "#fff566" }} | |
| 2557 | - title="暂停" | |
| 2558 | - /> | |
| 2559 | - ); | |
| 2560 | - break; | |
| 2561 | - case 4: | |
| 2562 | - ArrItemNumChange = "取消"; | |
| 2563 | - icon = ( | |
| 2564 | - <StopFilled | |
| 2565 | - style={{ margin: "0 6px 0 0", color: "#ff85c0" }} | |
| 2566 | - title="取消" | |
| 2567 | - /> | |
| 2568 | - ); | |
| 2569 | - break; | |
| 2570 | - case 5: | |
| 2571 | - ArrItemNumChange = "完成"; | |
| 2572 | - icon = ( | |
| 2573 | - <CheckCircleFilled | |
| 2574 | - style={{ margin: "0 6px 0 0", color: "#95de64" }} | |
| 2575 | - title="完成" | |
| 2576 | - /> | |
| 2577 | - ); | |
| 2578 | - break; | |
| 2579 | - } | |
| 2580 | - // eslint-disable-next-line no-unused-vars | |
| 2581 | - const content = ( | |
| 2582 | - <div> | |
| 2583 | - <div> | |
| 2584 | - <span style={{ color: "#fbca7b" }}>工序名称:</span> | |
| 2585 | - {ArrItemStr} | |
| 2586 | - </div> | |
| 2587 | - <div> | |
| 2588 | - <span style={{ color: "#fbca7b" }}>状态:</span> | |
| 2589 | - {ArrItemNumChange} | |
| 2590 | - </div> | |
| 2591 | - <div> | |
| 2592 | - <span style={{ color: "#fbca7b" }}>机台名称:</span> | |
| 2593 | - {ArrItemName} | |
| 2594 | - </div> | |
| 2595 | - <div> | |
| 2596 | - <span style={{ color: "#fbca7b" }}>班组:</span> | |
| 2597 | - {ArrItemBanZhu} | |
| 2598 | - </div> | |
| 2599 | - <div> | |
| 2600 | - <span style={{ color: "#fbca7b" }}>排单时间:</span> | |
| 2601 | - {ArrItemTime} | |
| 2602 | - </div> | |
| 2603 | - <div> | |
| 2604 | - <span style={{ color: "#fbca7b" }}>排程数:</span> | |
| 2605 | - {ArrItemPCNum} | |
| 2606 | - </div> | |
| 2483 | + sPartItem.map((t, i) => { | |
| 2484 | + const sPartItemLength = sPartItem.length; | |
| 2485 | + const ArrItemStr = t.split("#")[0]; /* 工序名称 */ | |
| 2486 | + const ArrItemNum = t.split("#")[1]; /* 状态 */ | |
| 2487 | + const ArrItemName = t.split("#")[2]; /* 机台名称 */ | |
| 2488 | + const ArrItemBanZhu = t.split("#")[3]; /* 班组 */ | |
| 2489 | + const ArrItemTime = t.split("#")[4]; /* 排单时间 */ | |
| 2490 | + const ArrItemPCNum = t.split("#")[5]; /* 排程数 */ | |
| 2491 | + const ArrItemSBNum = t.split("#")[6]; /* 上报数 */ | |
| 2492 | + const ArrItem7Num = | |
| 2493 | + commonUtils.isNotEmptyArr(t.split("#")) && | |
| 2494 | + t.split("#").length > 8 | |
| 2495 | + ? t.split("#")[8] | |
| 2496 | + : ""; /* 包数 */ | |
| 2497 | + const ArrItem8Num = | |
| 2498 | + commonUtils.isNotEmptyArr(t.split("#")) && | |
| 2499 | + t.split("#").length > 9 | |
| 2500 | + ? t.split("#")[9] | |
| 2501 | + : ""; /* 每包数量 */ | |
| 2502 | + const ArrItem9Num = | |
| 2503 | + commonUtils.isNotEmptyArr(t.split("#")) && | |
| 2504 | + t.split("#").length > 10 | |
| 2505 | + ? t.split("#")[10] | |
| 2506 | + : ""; /* 零头数量 */ | |
| 2507 | + let ArrItemNumChange = ""; | |
| 2508 | + let icon; | |
| 2509 | + // eslint-disable-next-line default-case | |
| 2510 | + switch (Number(ArrItemNum)) { | |
| 2511 | + case 0: | |
| 2512 | + ArrItemNumChange = "未排程"; | |
| 2513 | + icon = ( | |
| 2514 | + <ExclamationCircleFilled | |
| 2515 | + style={{ margin: "0 6px 0 0", color: "#ffd591" }} | |
| 2516 | + title="未排程" | |
| 2517 | + /> | |
| 2518 | + ); | |
| 2519 | + break; | |
| 2520 | + case 1: | |
| 2521 | + ArrItemNumChange = "未完成"; | |
| 2522 | + icon = ( | |
| 2523 | + <CloseCircleFilled | |
| 2524 | + style={{ margin: "0 6px 0 0", color: "#ffa39e" }} | |
| 2525 | + title="未完成" | |
| 2526 | + /> | |
| 2527 | + ); | |
| 2528 | + break; | |
| 2529 | + case 2: | |
| 2530 | + ArrItemNumChange = "生产中"; | |
| 2531 | + icon = ( | |
| 2532 | + <ClockCircleFilled | |
| 2533 | + style={{ margin: "0 6px 0 0", color: "#69c0ff" }} | |
| 2534 | + title="生产中" | |
| 2535 | + /> | |
| 2536 | + ); | |
| 2537 | + break; | |
| 2538 | + case 3: | |
| 2539 | + ArrItemNumChange = "暂停"; | |
| 2540 | + icon = ( | |
| 2541 | + <LegacyIcon | |
| 2542 | + type="ause-circle" | |
| 2543 | + theme="filled" | |
| 2544 | + style={{ margin: "0 6px 0 0", color: "#fff566" }} | |
| 2545 | + title="暂停" | |
| 2546 | + /> | |
| 2547 | + ); | |
| 2548 | + break; | |
| 2549 | + case 4: | |
| 2550 | + ArrItemNumChange = "取消"; | |
| 2551 | + icon = ( | |
| 2552 | + <StopFilled | |
| 2553 | + style={{ margin: "0 6px 0 0", color: "#ff85c0" }} | |
| 2554 | + title="取消" | |
| 2555 | + /> | |
| 2556 | + ); | |
| 2557 | + break; | |
| 2558 | + case 5: | |
| 2559 | + ArrItemNumChange = "完成"; | |
| 2560 | + icon = ( | |
| 2561 | + <CheckCircleFilled | |
| 2562 | + style={{ margin: "0 6px 0 0", color: "#95de64" }} | |
| 2563 | + title="完成" | |
| 2564 | + /> | |
| 2565 | + ); | |
| 2566 | + break; | |
| 2567 | + } | |
| 2568 | + // eslint-disable-next-line no-unused-vars | |
| 2569 | + const content = ( | |
| 2607 | 2570 | <div> |
| 2608 | - <span style={{ color: "#fbca7b" }}>上报数:</span> | |
| 2609 | - {ArrItemSBNum} | |
| 2610 | - </div> | |
| 2611 | - {ArrItem7Num ? ( | |
| 2612 | 2571 | <div> |
| 2613 | - <span style={{ color: "#fbca7b" }}>包数:</span> | |
| 2614 | - {ArrItem7Num} | |
| 2572 | + <span style={{ color: "#fbca7b" }}>工序名称:</span> | |
| 2573 | + {ArrItemStr} | |
| 2615 | 2574 | </div> |
| 2616 | - ) : ( | |
| 2617 | - "" | |
| 2618 | - )} | |
| 2619 | - {ArrItem8Num ? ( | |
| 2620 | 2575 | <div> |
| 2621 | - <span style={{ color: "#fbca7b" }}>每包数量:</span> | |
| 2622 | - {ArrItem8Num} | |
| 2576 | + <span style={{ color: "#fbca7b" }}>状态:</span> | |
| 2577 | + {ArrItemNumChange} | |
| 2623 | 2578 | </div> |
| 2624 | - ) : ( | |
| 2625 | - "" | |
| 2626 | - )} | |
| 2627 | - {ArrItem9Num ? ( | |
| 2628 | 2579 | <div> |
| 2629 | - <span style={{ color: "#fbca7b" }}>零头数量:</span> | |
| 2630 | - {ArrItem9Num} | |
| 2580 | + <span style={{ color: "#fbca7b" }}>机台名称:</span> | |
| 2581 | + {ArrItemName} | |
| 2631 | 2582 | </div> |
| 2632 | - ) : ( | |
| 2633 | - "" | |
| 2634 | - )} | |
| 2635 | - </div> | |
| 2636 | - ); | |
| 2637 | - // 数字转换图标 | |
| 2638 | - return ( | |
| 2639 | - <div | |
| 2640 | - style={{ | |
| 2641 | - display: "inline-block", | |
| 2642 | - margin: "5px 5px 5px 0px" | |
| 2643 | - }} | |
| 2644 | - key={i} | |
| 2645 | - > | |
| 2646 | - {icon} | |
| 2647 | - <Popover | |
| 2648 | - placement="top" | |
| 2649 | - content={content} | |
| 2650 | - trigger="click" | |
| 2583 | + <div> | |
| 2584 | + <span style={{ color: "#fbca7b" }}>班组:</span> | |
| 2585 | + {ArrItemBanZhu} | |
| 2586 | + </div> | |
| 2587 | + <div> | |
| 2588 | + <span style={{ color: "#fbca7b" }}>排单时间:</span> | |
| 2589 | + {ArrItemTime} | |
| 2590 | + </div> | |
| 2591 | + <div> | |
| 2592 | + <span style={{ color: "#fbca7b" }}>排程数:</span> | |
| 2593 | + {ArrItemPCNum} | |
| 2594 | + </div> | |
| 2595 | + <div> | |
| 2596 | + <span style={{ color: "#fbca7b" }}>上报数:</span> | |
| 2597 | + {ArrItemSBNum} | |
| 2598 | + </div> | |
| 2599 | + {ArrItem7Num ? ( | |
| 2600 | + <div> | |
| 2601 | + <span style={{ color: "#fbca7b" }}>包数:</span> | |
| 2602 | + {ArrItem7Num} | |
| 2603 | + </div> | |
| 2604 | + ) : ( | |
| 2605 | + "" | |
| 2606 | + )} | |
| 2607 | + {ArrItem8Num ? ( | |
| 2608 | + <div> | |
| 2609 | + <span style={{ color: "#fbca7b" }}>每包数量:</span> | |
| 2610 | + {ArrItem8Num} | |
| 2611 | + </div> | |
| 2612 | + ) : ( | |
| 2613 | + "" | |
| 2614 | + )} | |
| 2615 | + {ArrItem9Num ? ( | |
| 2616 | + <div> | |
| 2617 | + <span style={{ color: "#fbca7b" }}>零头数量:</span> | |
| 2618 | + {ArrItem9Num} | |
| 2619 | + </div> | |
| 2620 | + ) : ( | |
| 2621 | + "" | |
| 2622 | + )} | |
| 2623 | + </div> | |
| 2624 | + ); | |
| 2625 | + // 数字转换图标 | |
| 2626 | + return ( | |
| 2627 | + <div | |
| 2628 | + style={{ | |
| 2629 | + display: "inline-block", | |
| 2630 | + margin: "5px 5px 5px 0px" | |
| 2631 | + }} | |
| 2632 | + key={i} | |
| 2651 | 2633 | > |
| 2652 | - {ArrItemStr} | |
| 2653 | - </Popover> | |
| 2654 | - {/*{ i + 1 === sPartItemLength ? '' : <RightOutlined style={{ margin: '0 6px' }} />}*/} | |
| 2655 | - </div> | |
| 2656 | - ); | |
| 2657 | - })} | |
| 2634 | + {icon} | |
| 2635 | + <Popover | |
| 2636 | + placement="top" | |
| 2637 | + content={content} | |
| 2638 | + trigger="click" | |
| 2639 | + > | |
| 2640 | + {ArrItemStr} | |
| 2641 | + </Popover> | |
| 2642 | + {/*{ i + 1 === sPartItemLength ? '' : <RightOutlined style={{ margin: '0 6px' }} />}*/} | |
| 2643 | + </div> | |
| 2644 | + ); | |
| 2645 | + })} | |
| 2658 | 2646 | </div> |
| 2659 | 2647 | ); |
| 2660 | 2648 | } |
| ... | ... | @@ -2669,7 +2657,7 @@ class CommonTableRc extends React.Component { |
| 2669 | 2657 | this.useVListNew = true; |
| 2670 | 2658 | const sModelsType = |
| 2671 | 2659 | commonUtils.isNotEmptyObject(this.props) && |
| 2672 | - commonUtils.isNotEmptyObject(this.props.app) | |
| 2660 | + commonUtils.isNotEmptyObject(this.props.app) | |
| 2673 | 2661 | ? this.props.app.currentPane.sModelsType |
| 2674 | 2662 | : ""; |
| 2675 | 2663 | if ( |
| ... | ... | @@ -2725,6 +2713,224 @@ class CommonTableRc extends React.Component { |
| 2725 | 2713 | return ( |
| 2726 | 2714 | <div style={{ whiteSpace: "normal" }}> |
| 2727 | 2715 | {// eslint-disable-next-line array-callback-return; |
| 2716 | + sPartItem.map((t, i) => { | |
| 2717 | + const sPartItemLength = sPartItem.length; | |
| 2718 | + let colorValue = "#000000"; | |
| 2719 | + if (t?.background) { | |
| 2720 | + colorValue = t.background; | |
| 2721 | + } else { | |
| 2722 | + const sState = commonUtils.isEmpty(t.sState) | |
| 2723 | + ? 4 | |
| 2724 | + : t.sState; | |
| 2725 | + switch ( | |
| 2726 | + Number(sState) // 根据状态显示颜色 | |
| 2727 | + ) { | |
| 2728 | + case 0: | |
| 2729 | + colorValue = "#000000"; /* 0:黑色 */ | |
| 2730 | + break; | |
| 2731 | + case 1: | |
| 2732 | + colorValue = "#ff4d4f"; /* 1:红色 */ | |
| 2733 | + break; | |
| 2734 | + case 2: | |
| 2735 | + colorValue = "#49aa19"; /* 2:绿色 */ | |
| 2736 | + break; | |
| 2737 | + case 3: | |
| 2738 | + colorValue = "#49aa19"; /* 3:绿色 */ | |
| 2739 | + break; | |
| 2740 | + case 4: | |
| 2741 | + colorValue = "#ff4d4f"; /* 4:红色 */ | |
| 2742 | + break; | |
| 2743 | + default: | |
| 2744 | + colorValue = "#000000"; | |
| 2745 | + } | |
| 2746 | + } | |
| 2747 | + return ( | |
| 2748 | + <div | |
| 2749 | + style={{ | |
| 2750 | + display: "inline-block", | |
| 2751 | + width: "100%", | |
| 2752 | + color: colorValue | |
| 2753 | + }} | |
| 2754 | + key={i} | |
| 2755 | + > | |
| 2756 | + {commonUtils.isNotEmptyObject( | |
| 2757 | + t.sMaterialsName | |
| 2758 | + ) ? ( | |
| 2759 | + <span | |
| 2760 | + className={linkStyle} | |
| 2761 | + onClick={ | |
| 2762 | + commonUtils.isNotEmptyObject( | |
| 2763 | + linkStyle | |
| 2764 | + ) | |
| 2765 | + ? this.handleViewClick.bind( | |
| 2766 | + this, | |
| 2767 | + this.props.name, | |
| 2768 | + showConfig.sName, | |
| 2769 | + t, | |
| 2770 | + i, | |
| 2771 | + showConfig | |
| 2772 | + ) | |
| 2773 | + : null | |
| 2774 | + } | |
| 2775 | + > | |
| 2776 | + {t.sMaterialsName} | |
| 2777 | + </span> | |
| 2778 | + ) : ( | |
| 2779 | + "" | |
| 2780 | + )} | |
| 2781 | + {i + 1 === sPartItemLength ? ( | |
| 2782 | + "" | |
| 2783 | + ) : ( | |
| 2784 | + <span | |
| 2785 | + style={{ | |
| 2786 | + color: "#000000", | |
| 2787 | + margin: "0 2px" | |
| 2788 | + }} | |
| 2789 | + > | |
| 2790 | + - | |
| 2791 | + </span> | |
| 2792 | + )} | |
| 2793 | + </div> | |
| 2794 | + ); | |
| 2795 | + })} | |
| 2796 | + </div> | |
| 2797 | + ); | |
| 2798 | + }} | |
| 2799 | + > | |
| 2800 | + <div | |
| 2801 | + style={{ | |
| 2802 | + whiteSpace: "nowrap", | |
| 2803 | + width: "100%", | |
| 2804 | + height: "29px", | |
| 2805 | + overflow: "hidden", | |
| 2806 | + lineHeight: "29px", | |
| 2807 | + textOverflow: "ellipsis" | |
| 2808 | + }} | |
| 2809 | + > | |
| 2810 | + {// eslint-disable-next-line array-callback-return; | |
| 2811 | + sPartItem.map((t, i) => { | |
| 2812 | + const sPartItemLength = sPartItem.length; | |
| 2813 | + let colorValue = "#000000"; | |
| 2814 | + if (t?.background) { | |
| 2815 | + colorValue = t.background; | |
| 2816 | + } else { | |
| 2817 | + const sState = commonUtils.isEmpty(t.sState) | |
| 2818 | + ? 4 | |
| 2819 | + : t.sState; | |
| 2820 | + switch ( | |
| 2821 | + Number(sState) // 根据状态显示颜色 | |
| 2822 | + ) { | |
| 2823 | + case 0: | |
| 2824 | + colorValue = "#000000"; /* 0:黑色 */ | |
| 2825 | + break; | |
| 2826 | + case 1: | |
| 2827 | + colorValue = "#ff4d4f"; /* 1:红色 */ | |
| 2828 | + break; | |
| 2829 | + case 2: | |
| 2830 | + colorValue = "#49aa19"; /* 2:绿色 */ | |
| 2831 | + break; | |
| 2832 | + case 3: | |
| 2833 | + colorValue = "#49aa19"; /* 3:绿色 */ | |
| 2834 | + break; | |
| 2835 | + case 4: | |
| 2836 | + colorValue = "#ff4d4f"; /* 4:红色 */ | |
| 2837 | + break; | |
| 2838 | + default: | |
| 2839 | + colorValue = "#000000"; | |
| 2840 | + } | |
| 2841 | + } | |
| 2842 | + return ( | |
| 2843 | + <div | |
| 2844 | + style={{ | |
| 2845 | + display: "inline-block", | |
| 2846 | + width: "100%", | |
| 2847 | + color: colorValue | |
| 2848 | + }} | |
| 2849 | + key={i} | |
| 2850 | + > | |
| 2851 | + {commonUtils.isNotEmptyObject( | |
| 2852 | + t.sMaterialsName | |
| 2853 | + ) ? ( | |
| 2854 | + <span | |
| 2855 | + className={linkStyle} | |
| 2856 | + onClick={ | |
| 2857 | + commonUtils.isNotEmptyObject(linkStyle) | |
| 2858 | + ? this.handleViewClick.bind( | |
| 2859 | + this, | |
| 2860 | + this.props.name, | |
| 2861 | + showConfig.sName, | |
| 2862 | + t, | |
| 2863 | + i, | |
| 2864 | + showConfig | |
| 2865 | + ) | |
| 2866 | + : null | |
| 2867 | + } | |
| 2868 | + > | |
| 2869 | + {t.sMaterialsName} | |
| 2870 | + </span> | |
| 2871 | + ) : ( | |
| 2872 | + "" | |
| 2873 | + )} | |
| 2874 | + {i + 1 === sPartItemLength ? ( | |
| 2875 | + "" | |
| 2876 | + ) : ( | |
| 2877 | + <span | |
| 2878 | + style={{ | |
| 2879 | + color: "#000000", | |
| 2880 | + margin: "0 2px" | |
| 2881 | + }} | |
| 2882 | + > | |
| 2883 | + - | |
| 2884 | + </span> | |
| 2885 | + )} | |
| 2886 | + </div> | |
| 2887 | + ); | |
| 2888 | + })} | |
| 2889 | + </div> | |
| 2890 | + </Tooltip> | |
| 2891 | + ); | |
| 2892 | + } else { | |
| 2893 | + return itemStr; | |
| 2894 | + } | |
| 2895 | + }; | |
| 2896 | + } | |
| 2897 | + } else { | |
| 2898 | + /* 无嵌套列头JSON列解析 */ | |
| 2899 | + sMaterialsStatus[index].render = itemStr => { | |
| 2900 | + if (commonUtils.isJSON(itemStr)) { | |
| 2901 | + const sPartItem = JSON.parse(itemStr); | |
| 2902 | + /* 取箭头弹出的窗体配置 */ | |
| 2903 | + let showConfig = {}; | |
| 2904 | + let linkStyle = ""; /* 弹窗 */ | |
| 2905 | + if ( | |
| 2906 | + commonUtils.isNotEmptyArr(this.props.config) && | |
| 2907 | + commonUtils.isNotEmptyArr( | |
| 2908 | + this.props.config.gdsconfigformslave | |
| 2909 | + ) && | |
| 2910 | + commonUtils.isNotEmptyStr("sMaterialsStatus") | |
| 2911 | + ) { | |
| 2912 | + const showConfigArr = this.props.config.gdsconfigformslave.filter( | |
| 2913 | + item => item.sName === "sMaterialsStatus" && item.bVisible | |
| 2914 | + ); | |
| 2915 | + if (commonUtils.isNotEmptyArr(showConfigArr)) { | |
| 2916 | + showConfig = showConfigArr[0]; | |
| 2917 | + if ( | |
| 2918 | + commonUtils.isNotEmptyObject(showConfig) && | |
| 2919 | + showConfig.sDropDownType === "picArr" && | |
| 2920 | + !commonUtils.isEmpty(showConfig.sActiveId) && | |
| 2921 | + commonUtils.isEmptyArr(this.props.sGroupByList) | |
| 2922 | + ) { | |
| 2923 | + linkStyle = "sMaterialsStatusStyle"; | |
| 2924 | + } | |
| 2925 | + } | |
| 2926 | + } | |
| 2927 | + return ( | |
| 2928 | + <Tooltip | |
| 2929 | + color="#fff" | |
| 2930 | + title={() => { | |
| 2931 | + return ( | |
| 2932 | + <div style={{ whiteSpace: "normal" }}> | |
| 2933 | + {// eslint-disable-next-line array-callback-return; | |
| 2728 | 2934 | sPartItem.map((t, i) => { |
| 2729 | 2935 | const sPartItemLength = sPartItem.length; |
| 2730 | 2936 | let colorValue = "#000000"; |
| ... | ... | @@ -2735,7 +2941,7 @@ class CommonTableRc extends React.Component { |
| 2735 | 2941 | ? 4 |
| 2736 | 2942 | : t.sState; |
| 2737 | 2943 | switch ( |
| 2738 | - Number(sState) // 根据状态显示颜色 | |
| 2944 | + Number(sState) // 根据状态显示颜色 | |
| 2739 | 2945 | ) { |
| 2740 | 2946 | case 0: |
| 2741 | 2947 | colorValue = "#000000"; /* 0:黑色 */ |
| ... | ... | @@ -2771,17 +2977,15 @@ class CommonTableRc extends React.Component { |
| 2771 | 2977 | <span |
| 2772 | 2978 | className={linkStyle} |
| 2773 | 2979 | onClick={ |
| 2774 | - commonUtils.isNotEmptyObject( | |
| 2775 | - linkStyle | |
| 2776 | - ) | |
| 2980 | + commonUtils.isNotEmptyObject(linkStyle) | |
| 2777 | 2981 | ? this.handleViewClick.bind( |
| 2778 | - this, | |
| 2779 | - this.props.name, | |
| 2780 | - showConfig.sName, | |
| 2781 | - t, | |
| 2782 | - i, | |
| 2783 | - showConfig | |
| 2784 | - ) | |
| 2982 | + this, | |
| 2983 | + this.props.name, | |
| 2984 | + showConfig.sName, | |
| 2985 | + t, | |
| 2986 | + i, | |
| 2987 | + showConfig | |
| 2988 | + ) | |
| 2785 | 2989 | : null |
| 2786 | 2990 | } |
| 2787 | 2991 | > |
| ... | ... | @@ -2805,21 +3009,21 @@ class CommonTableRc extends React.Component { |
| 2805 | 3009 | </div> |
| 2806 | 3010 | ); |
| 2807 | 3011 | })} |
| 2808 | - </div> | |
| 2809 | - ); | |
| 3012 | + </div> | |
| 3013 | + ); | |
| 3014 | + }} | |
| 3015 | + > | |
| 3016 | + <div | |
| 3017 | + style={{ | |
| 3018 | + whiteSpace: "nowrap", | |
| 3019 | + width: "100%", | |
| 3020 | + height: "29px", | |
| 3021 | + overflow: "hidden", | |
| 3022 | + lineHeight: "29px", | |
| 3023 | + textOverflow: "ellipsis" | |
| 2810 | 3024 | }} |
| 2811 | 3025 | > |
| 2812 | - <div | |
| 2813 | - style={{ | |
| 2814 | - whiteSpace: "nowrap", | |
| 2815 | - width: "100%", | |
| 2816 | - height: "29px", | |
| 2817 | - overflow: "hidden", | |
| 2818 | - lineHeight: "29px", | |
| 2819 | - textOverflow: "ellipsis" | |
| 2820 | - }} | |
| 2821 | - > | |
| 2822 | - {// eslint-disable-next-line array-callback-return; | |
| 3026 | + {// eslint-disable-next-line array-callback-return; | |
| 2823 | 3027 | sPartItem.map((t, i) => { |
| 2824 | 3028 | const sPartItemLength = sPartItem.length; |
| 2825 | 3029 | let colorValue = "#000000"; |
| ... | ... | @@ -2830,7 +3034,7 @@ class CommonTableRc extends React.Component { |
| 2830 | 3034 | ? 4 |
| 2831 | 3035 | : t.sState; |
| 2832 | 3036 | switch ( |
| 2833 | - Number(sState) // 根据状态显示颜色 | |
| 3037 | + Number(sState) // 根据状态显示颜色 | |
| 2834 | 3038 | ) { |
| 2835 | 3039 | case 0: |
| 2836 | 3040 | colorValue = "#000000"; /* 0:黑色 */ |
| ... | ... | @@ -2868,13 +3072,13 @@ class CommonTableRc extends React.Component { |
| 2868 | 3072 | onClick={ |
| 2869 | 3073 | commonUtils.isNotEmptyObject(linkStyle) |
| 2870 | 3074 | ? this.handleViewClick.bind( |
| 2871 | - this, | |
| 2872 | - this.props.name, | |
| 2873 | - showConfig.sName, | |
| 2874 | - t, | |
| 2875 | - i, | |
| 2876 | - showConfig | |
| 2877 | - ) | |
| 3075 | + this, | |
| 3076 | + this.props.name, | |
| 3077 | + showConfig.sName, | |
| 3078 | + t, | |
| 3079 | + i, | |
| 3080 | + showConfig | |
| 3081 | + ) | |
| 2878 | 3082 | : null |
| 2879 | 3083 | } |
| 2880 | 3084 | > |
| ... | ... | @@ -2887,230 +3091,14 @@ class CommonTableRc extends React.Component { |
| 2887 | 3091 | "" |
| 2888 | 3092 | ) : ( |
| 2889 | 3093 | <span |
| 2890 | - style={{ | |
| 2891 | - color: "#000000", | |
| 2892 | - margin: "0 2px" | |
| 2893 | - }} | |
| 3094 | + style={{ color: "#000000", margin: "0 2px" }} | |
| 2894 | 3095 | > |
| 2895 | 3096 | - |
| 2896 | 3097 | </span> |
| 2897 | 3098 | )} |
| 2898 | - </div> | |
| 2899 | - ); | |
| 2900 | - })} | |
| 2901 | - </div> | |
| 2902 | - </Tooltip> | |
| 2903 | - ); | |
| 2904 | - } else { | |
| 2905 | - return itemStr; | |
| 2906 | - } | |
| 2907 | - }; | |
| 2908 | - } | |
| 2909 | - } else { | |
| 2910 | - /* 无嵌套列头JSON列解析 */ | |
| 2911 | - sMaterialsStatus[index].render = itemStr => { | |
| 2912 | - if (commonUtils.isJSON(itemStr)) { | |
| 2913 | - const sPartItem = JSON.parse(itemStr); | |
| 2914 | - /* 取箭头弹出的窗体配置 */ | |
| 2915 | - let showConfig = {}; | |
| 2916 | - let linkStyle = ""; /* 弹窗 */ | |
| 2917 | - if ( | |
| 2918 | - commonUtils.isNotEmptyArr(this.props.config) && | |
| 2919 | - commonUtils.isNotEmptyArr( | |
| 2920 | - this.props.config.gdsconfigformslave | |
| 2921 | - ) && | |
| 2922 | - commonUtils.isNotEmptyStr("sMaterialsStatus") | |
| 2923 | - ) { | |
| 2924 | - const showConfigArr = this.props.config.gdsconfigformslave.filter( | |
| 2925 | - item => item.sName === "sMaterialsStatus" && item.bVisible | |
| 2926 | - ); | |
| 2927 | - if (commonUtils.isNotEmptyArr(showConfigArr)) { | |
| 2928 | - showConfig = showConfigArr[0]; | |
| 2929 | - if ( | |
| 2930 | - commonUtils.isNotEmptyObject(showConfig) && | |
| 2931 | - showConfig.sDropDownType === "picArr" && | |
| 2932 | - !commonUtils.isEmpty(showConfig.sActiveId) && | |
| 2933 | - commonUtils.isEmptyArr(this.props.sGroupByList) | |
| 2934 | - ) { | |
| 2935 | - linkStyle = "sMaterialsStatusStyle"; | |
| 2936 | - } | |
| 2937 | - } | |
| 2938 | - } | |
| 2939 | - return ( | |
| 2940 | - <Tooltip | |
| 2941 | - color="#fff" | |
| 2942 | - title={() => { | |
| 2943 | - return ( | |
| 2944 | - <div style={{ whiteSpace: "normal" }}> | |
| 2945 | - {// eslint-disable-next-line array-callback-return; | |
| 2946 | - sPartItem.map((t, i) => { | |
| 2947 | - const sPartItemLength = sPartItem.length; | |
| 2948 | - let colorValue = "#000000"; | |
| 2949 | - if (t?.background) { | |
| 2950 | - colorValue = t.background; | |
| 2951 | - } else { | |
| 2952 | - const sState = commonUtils.isEmpty(t.sState) | |
| 2953 | - ? 4 | |
| 2954 | - : t.sState; | |
| 2955 | - switch ( | |
| 2956 | - Number(sState) // 根据状态显示颜色 | |
| 2957 | - ) { | |
| 2958 | - case 0: | |
| 2959 | - colorValue = "#000000"; /* 0:黑色 */ | |
| 2960 | - break; | |
| 2961 | - case 1: | |
| 2962 | - colorValue = "#ff4d4f"; /* 1:红色 */ | |
| 2963 | - break; | |
| 2964 | - case 2: | |
| 2965 | - colorValue = "#49aa19"; /* 2:绿色 */ | |
| 2966 | - break; | |
| 2967 | - case 3: | |
| 2968 | - colorValue = "#49aa19"; /* 3:绿色 */ | |
| 2969 | - break; | |
| 2970 | - case 4: | |
| 2971 | - colorValue = "#ff4d4f"; /* 4:红色 */ | |
| 2972 | - break; | |
| 2973 | - default: | |
| 2974 | - colorValue = "#000000"; | |
| 2975 | - } | |
| 2976 | - } | |
| 2977 | - return ( | |
| 2978 | - <div | |
| 2979 | - style={{ | |
| 2980 | - display: "inline-block", | |
| 2981 | - width: "100%", | |
| 2982 | - color: colorValue | |
| 2983 | - }} | |
| 2984 | - key={i} | |
| 2985 | - > | |
| 2986 | - {commonUtils.isNotEmptyObject( | |
| 2987 | - t.sMaterialsName | |
| 2988 | - ) ? ( | |
| 2989 | - <span | |
| 2990 | - className={linkStyle} | |
| 2991 | - onClick={ | |
| 2992 | - commonUtils.isNotEmptyObject(linkStyle) | |
| 2993 | - ? this.handleViewClick.bind( | |
| 2994 | - this, | |
| 2995 | - this.props.name, | |
| 2996 | - showConfig.sName, | |
| 2997 | - t, | |
| 2998 | - i, | |
| 2999 | - showConfig | |
| 3000 | - ) | |
| 3001 | - : null | |
| 3002 | - } | |
| 3003 | - > | |
| 3004 | - {t.sMaterialsName} | |
| 3005 | - </span> | |
| 3006 | - ) : ( | |
| 3007 | - "" | |
| 3008 | - )} | |
| 3009 | - {i + 1 === sPartItemLength ? ( | |
| 3010 | - "" | |
| 3011 | - ) : ( | |
| 3012 | - <span | |
| 3013 | - style={{ | |
| 3014 | - color: "#000000", | |
| 3015 | - margin: "0 2px" | |
| 3016 | - }} | |
| 3017 | - > | |
| 3018 | - - | |
| 3019 | - </span> | |
| 3020 | - )} | |
| 3021 | - </div> | |
| 3022 | - ); | |
| 3023 | - })} | |
| 3024 | - </div> | |
| 3025 | - ); | |
| 3026 | - }} | |
| 3027 | - > | |
| 3028 | - <div | |
| 3029 | - style={{ | |
| 3030 | - whiteSpace: "nowrap", | |
| 3031 | - width: "100%", | |
| 3032 | - height: "29px", | |
| 3033 | - overflow: "hidden", | |
| 3034 | - lineHeight: "29px", | |
| 3035 | - textOverflow: "ellipsis" | |
| 3036 | - }} | |
| 3037 | - > | |
| 3038 | - {// eslint-disable-next-line array-callback-return; | |
| 3039 | - sPartItem.map((t, i) => { | |
| 3040 | - const sPartItemLength = sPartItem.length; | |
| 3041 | - let colorValue = "#000000"; | |
| 3042 | - if (t?.background) { | |
| 3043 | - colorValue = t.background; | |
| 3044 | - } else { | |
| 3045 | - const sState = commonUtils.isEmpty(t.sState) | |
| 3046 | - ? 4 | |
| 3047 | - : t.sState; | |
| 3048 | - switch ( | |
| 3049 | - Number(sState) // 根据状态显示颜色 | |
| 3050 | - ) { | |
| 3051 | - case 0: | |
| 3052 | - colorValue = "#000000"; /* 0:黑色 */ | |
| 3053 | - break; | |
| 3054 | - case 1: | |
| 3055 | - colorValue = "#ff4d4f"; /* 1:红色 */ | |
| 3056 | - break; | |
| 3057 | - case 2: | |
| 3058 | - colorValue = "#49aa19"; /* 2:绿色 */ | |
| 3059 | - break; | |
| 3060 | - case 3: | |
| 3061 | - colorValue = "#49aa19"; /* 3:绿色 */ | |
| 3062 | - break; | |
| 3063 | - case 4: | |
| 3064 | - colorValue = "#ff4d4f"; /* 4:红色 */ | |
| 3065 | - break; | |
| 3066 | - default: | |
| 3067 | - colorValue = "#000000"; | |
| 3068 | - } | |
| 3069 | - } | |
| 3070 | - return ( | |
| 3071 | - <div | |
| 3072 | - style={{ | |
| 3073 | - display: "inline-block", | |
| 3074 | - width: "100%", | |
| 3075 | - color: colorValue | |
| 3076 | - }} | |
| 3077 | - key={i} | |
| 3078 | - > | |
| 3079 | - {commonUtils.isNotEmptyObject( | |
| 3080 | - t.sMaterialsName | |
| 3081 | - ) ? ( | |
| 3082 | - <span | |
| 3083 | - className={linkStyle} | |
| 3084 | - onClick={ | |
| 3085 | - commonUtils.isNotEmptyObject(linkStyle) | |
| 3086 | - ? this.handleViewClick.bind( | |
| 3087 | - this, | |
| 3088 | - this.props.name, | |
| 3089 | - showConfig.sName, | |
| 3090 | - t, | |
| 3091 | - i, | |
| 3092 | - showConfig | |
| 3093 | - ) | |
| 3094 | - : null | |
| 3095 | - } | |
| 3096 | - > | |
| 3097 | - {t.sMaterialsName} | |
| 3098 | - </span> | |
| 3099 | - ) : ( | |
| 3100 | - "" | |
| 3101 | - )} | |
| 3102 | - {i + 1 === sPartItemLength ? ( | |
| 3103 | - "" | |
| 3104 | - ) : ( | |
| 3105 | - <span | |
| 3106 | - style={{ color: "#000000", margin: "0 2px" }} | |
| 3107 | - > | |
| 3108 | - - | |
| 3109 | - </span> | |
| 3110 | - )} | |
| 3111 | - </div> | |
| 3112 | - ); | |
| 3113 | - })} | |
| 3099 | + </div> | |
| 3100 | + ); | |
| 3101 | + })} | |
| 3114 | 3102 | </div> |
| 3115 | 3103 | </Tooltip> |
| 3116 | 3104 | ); |
| ... | ... | @@ -3154,14 +3142,70 @@ class CommonTableRc extends React.Component { |
| 3154 | 3142 | }} |
| 3155 | 3143 | > |
| 3156 | 3144 | {// eslint-disable-next-line array-callback-return; |
| 3145 | + sPartItem.map((t, i) => { | |
| 3146 | + // const sPartItemLength = sPartItem.length; | |
| 3147 | + let colorValue = "#000000"; | |
| 3148 | + const sState = commonUtils.isEmpty(t.sState) | |
| 3149 | + ? 4 | |
| 3150 | + : t.sState; | |
| 3151 | + switch ( | |
| 3152 | + Number(sState) // 根据状态显示颜色 | |
| 3153 | + ) { | |
| 3154 | + case 1: | |
| 3155 | + colorValue = "#ff0000"; /* 1:红色 */ | |
| 3156 | + break; | |
| 3157 | + case 2: | |
| 3158 | + colorValue = "#49aa19"; /* 2:绿色 */ | |
| 3159 | + break; | |
| 3160 | + case 3: | |
| 3161 | + colorValue = "#ffff00"; /* 3:黄色 */ | |
| 3162 | + break; | |
| 3163 | + case 0: | |
| 3164 | + colorValue = ""; /* 3:不要颜色 */ | |
| 3165 | + break; | |
| 3166 | + default: | |
| 3167 | + colorValue = ""; | |
| 3168 | + } | |
| 3169 | + return ( | |
| 3170 | + <div | |
| 3171 | + className="dynamicColumnStyle" | |
| 3172 | + style={{ | |
| 3173 | + display: "flex", | |
| 3174 | + alignItems: "center", | |
| 3175 | + padding: "4px", | |
| 3176 | + backgroundColor: colorValue, | |
| 3177 | + color: "#000", | |
| 3178 | + width: "100%", | |
| 3179 | + height: "100%" | |
| 3180 | + }} | |
| 3181 | + key={i} | |
| 3182 | + > | |
| 3183 | + <div>{t.dSchedulHours}</div> | |
| 3184 | + </div> | |
| 3185 | + ); | |
| 3186 | + })} | |
| 3187 | + </div> | |
| 3188 | + ); | |
| 3189 | + } | |
| 3190 | + }; | |
| 3191 | + } | |
| 3192 | + } else { | |
| 3193 | + /* 无嵌套列头JSON列解析 */ | |
| 3194 | + dynamicColumn[index].render = itemStr => { | |
| 3195 | + if ( | |
| 3196 | + commonUtils.isNotEmptyObject(itemStr) && | |
| 3197 | + commonUtils.isJSON(itemStr) | |
| 3198 | + ) { | |
| 3199 | + const sPartItem = JSON.parse(itemStr); | |
| 3200 | + return ( | |
| 3201 | + <div style={{ whiteSpace: "normal" }}> | |
| 3202 | + {// eslint-disable-next-line array-callback-return; | |
| 3157 | 3203 | sPartItem.map((t, i) => { |
| 3158 | 3204 | // const sPartItemLength = sPartItem.length; |
| 3159 | 3205 | let colorValue = "#000000"; |
| 3160 | - const sState = commonUtils.isEmpty(t.sState) | |
| 3161 | - ? 4 | |
| 3162 | - : t.sState; | |
| 3206 | + const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; | |
| 3163 | 3207 | switch ( |
| 3164 | - Number(sState) // 根据状态显示颜色 | |
| 3208 | + Number(sState) // 根据状态显示颜色 | |
| 3165 | 3209 | ) { |
| 3166 | 3210 | case 1: |
| 3167 | 3211 | colorValue = "#ff0000"; /* 1:红色 */ |
| ... | ... | @@ -3172,75 +3216,19 @@ class CommonTableRc extends React.Component { |
| 3172 | 3216 | case 3: |
| 3173 | 3217 | colorValue = "#ffff00"; /* 3:黄色 */ |
| 3174 | 3218 | break; |
| 3175 | - case 0: | |
| 3176 | - colorValue = ""; /* 3:不要颜色 */ | |
| 3177 | - break; | |
| 3178 | 3219 | default: |
| 3179 | - colorValue = ""; | |
| 3220 | + colorValue = "#666"; | |
| 3180 | 3221 | } |
| 3181 | 3222 | return ( |
| 3182 | 3223 | <div |
| 3183 | 3224 | className="dynamicColumnStyle" |
| 3184 | - style={{ | |
| 3185 | - display: "flex", | |
| 3186 | - alignItems: "center", | |
| 3187 | - padding: "4px", | |
| 3188 | - backgroundColor: colorValue, | |
| 3189 | - color: "#000", | |
| 3190 | - width: "100%", | |
| 3191 | - height: "100%" | |
| 3192 | - }} | |
| 3225 | + style={{ backgroundColor: colorValue, color: "#000" }} | |
| 3193 | 3226 | key={i} |
| 3194 | 3227 | > |
| 3195 | 3228 | <div>{t.dSchedulHours}</div> |
| 3196 | 3229 | </div> |
| 3197 | 3230 | ); |
| 3198 | 3231 | })} |
| 3199 | - </div> | |
| 3200 | - ); | |
| 3201 | - } | |
| 3202 | - }; | |
| 3203 | - } | |
| 3204 | - } else { | |
| 3205 | - /* 无嵌套列头JSON列解析 */ | |
| 3206 | - dynamicColumn[index].render = itemStr => { | |
| 3207 | - if ( | |
| 3208 | - commonUtils.isNotEmptyObject(itemStr) && | |
| 3209 | - commonUtils.isJSON(itemStr) | |
| 3210 | - ) { | |
| 3211 | - const sPartItem = JSON.parse(itemStr); | |
| 3212 | - return ( | |
| 3213 | - <div style={{ whiteSpace: "normal" }}> | |
| 3214 | - {// eslint-disable-next-line array-callback-return; | |
| 3215 | - sPartItem.map((t, i) => { | |
| 3216 | - // const sPartItemLength = sPartItem.length; | |
| 3217 | - let colorValue = "#000000"; | |
| 3218 | - const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; | |
| 3219 | - switch ( | |
| 3220 | - Number(sState) // 根据状态显示颜色 | |
| 3221 | - ) { | |
| 3222 | - case 1: | |
| 3223 | - colorValue = "#ff0000"; /* 1:红色 */ | |
| 3224 | - break; | |
| 3225 | - case 2: | |
| 3226 | - colorValue = "#49aa19"; /* 2:绿色 */ | |
| 3227 | - break; | |
| 3228 | - case 3: | |
| 3229 | - colorValue = "#ffff00"; /* 3:黄色 */ | |
| 3230 | - break; | |
| 3231 | - default: | |
| 3232 | - colorValue = "#666"; | |
| 3233 | - } | |
| 3234 | - return ( | |
| 3235 | - <div | |
| 3236 | - className="dynamicColumnStyle" | |
| 3237 | - style={{ backgroundColor: colorValue, color: "#000" }} | |
| 3238 | - key={i} | |
| 3239 | - > | |
| 3240 | - <div>{t.dSchedulHours}</div> | |
| 3241 | - </div> | |
| 3242 | - ); | |
| 3243 | - })} | |
| 3244 | 3232 | </div> |
| 3245 | 3233 | ); |
| 3246 | 3234 | } else { |
| ... | ... | @@ -3263,44 +3251,44 @@ class CommonTableRc extends React.Component { |
| 3263 | 3251 | return ( |
| 3264 | 3252 | <div style={{ display: "flex" }}> |
| 3265 | 3253 | {// eslint-disable-next-line array-callback-return; |
| 3266 | - sPartItem.map((t, i) => { | |
| 3267 | - const sPartItemLength = sPartItem.length; | |
| 3268 | - const sColor = t.sColor; | |
| 3269 | - const dWidth = | |
| 3270 | - t.dRate !== undefined && t.dRate !== 0 | |
| 3271 | - ? `${t.dRate * 500}px` | |
| 3272 | - : "100px"; | |
| 3273 | - const content = ( | |
| 3274 | - <div> | |
| 3275 | - <p>{`${t.sName} :${t.sValue}`}</p> | |
| 3276 | - </div> | |
| 3277 | - ); | |
| 3278 | - | |
| 3279 | - return ( | |
| 3280 | - <Popover content={content} title="时间状态"> | |
| 3281 | - <div | |
| 3282 | - className={linkStyle} | |
| 3283 | - style={{ | |
| 3284 | - width: dWidth, | |
| 3285 | - color: "#000", | |
| 3286 | - textAlign: "center", | |
| 3287 | - backgroundColor: sColor, | |
| 3288 | - fontSize: "10px", | |
| 3289 | - height: "20px", | |
| 3290 | - borderRadius: | |
| 3291 | - i === 0 | |
| 3292 | - ? "10px 0 0 10px" | |
| 3293 | - : i === sPartItemLength - 1 | |
| 3294 | - ? "0 10px 10px 0" | |
| 3295 | - : "0px" | |
| 3296 | - }} | |
| 3297 | - key={i} | |
| 3298 | - > | |
| 3299 | - {t.sValue} | |
| 3254 | + sPartItem.map((t, i) => { | |
| 3255 | + const sPartItemLength = sPartItem.length; | |
| 3256 | + const sColor = t.sColor; | |
| 3257 | + const dWidth = | |
| 3258 | + t.dRate !== undefined && t.dRate !== 0 | |
| 3259 | + ? `${t.dRate * 500}px` | |
| 3260 | + : "100px"; | |
| 3261 | + const content = ( | |
| 3262 | + <div> | |
| 3263 | + <p>{`${t.sName} :${t.sValue}`}</p> | |
| 3300 | 3264 | </div> |
| 3301 | - </Popover> | |
| 3302 | - ); | |
| 3303 | - })} | |
| 3265 | + ); | |
| 3266 | + | |
| 3267 | + return ( | |
| 3268 | + <Popover content={content} title="时间状态"> | |
| 3269 | + <div | |
| 3270 | + className={linkStyle} | |
| 3271 | + style={{ | |
| 3272 | + width: dWidth, | |
| 3273 | + color: "#000", | |
| 3274 | + textAlign: "center", | |
| 3275 | + backgroundColor: sColor, | |
| 3276 | + fontSize: "10px", | |
| 3277 | + height: "20px", | |
| 3278 | + borderRadius: | |
| 3279 | + i === 0 | |
| 3280 | + ? "10px 0 0 10px" | |
| 3281 | + : i === sPartItemLength - 1 | |
| 3282 | + ? "0 10px 10px 0" | |
| 3283 | + : "0px" | |
| 3284 | + }} | |
| 3285 | + key={i} | |
| 3286 | + > | |
| 3287 | + {t.sValue} | |
| 3288 | + </div> | |
| 3289 | + </Popover> | |
| 3290 | + ); | |
| 3291 | + })} | |
| 3304 | 3292 | </div> |
| 3305 | 3293 | ); |
| 3306 | 3294 | } else { |
| ... | ... | @@ -3673,14 +3661,14 @@ class CommonTableRc extends React.Component { |
| 3673 | 3661 | ...this.props.tableProps, |
| 3674 | 3662 | pagination: bPagination |
| 3675 | 3663 | ? { |
| 3676 | - ...this.props.tableProps.pagination, | |
| 3677 | - onChange: (current, size) => { | |
| 3678 | - this.curPagination = { | |
| 3679 | - current, | |
| 3680 | - pageSize: size | |
| 3681 | - }; | |
| 3682 | - } | |
| 3664 | + ...this.props.tableProps.pagination, | |
| 3665 | + onChange: (current, size) => { | |
| 3666 | + this.curPagination = { | |
| 3667 | + current, | |
| 3668 | + pageSize: size | |
| 3669 | + }; | |
| 3683 | 3670 | } |
| 3671 | + } | |
| 3684 | 3672 | : false /* 表格是否分页 */, |
| 3685 | 3673 | onChange: this.onChange |
| 3686 | 3674 | }; |
| ... | ... | @@ -4212,6 +4200,59 @@ class CommonTableRc extends React.Component { |
| 4212 | 4200 | styleColorArrTotalM.styleColorArrTotalB = styleColorArrTotalB; |
| 4213 | 4201 | return styleColorArrTotalM; |
| 4214 | 4202 | }; |
| 4203 | + // 获取表格行按钮状态 | |
| 4204 | + getTableBtnState = (btnName, record) => { | |
| 4205 | + let result = false; | |
| 4206 | + const { enabled, config, masterData, name, sUseInfo, bLimitOperate } = this.props; | |
| 4207 | + result = enabled; | |
| 4208 | + /* 订单占用,则该行锁定 不能操作 */ | |
| 4209 | + const { sWorkOrderUsed } = record; | |
| 4210 | + if (commonUtils.isNotEmptyObject(sWorkOrderUsed)) { | |
| 4211 | + result = false; | |
| 4212 | + } | |
| 4213 | + /* 若红冲单据 则按钮锁定 不能操作 */ | |
| 4214 | + if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sMinusSrcId) && masterData.sMinusType === '1') { | |
| 4215 | + result = false; | |
| 4216 | + } | |
| 4217 | + if (btnName === 'BtnAdd' && bLimitOperate) { | |
| 4218 | + result = false; | |
| 4219 | + } | |
| 4220 | + | |
| 4221 | + const { sInstruct: sInstructStr } = config; | |
| 4222 | + const sInstruct = commonUtils.convertStrToObj(sInstructStr, {}); | |
| 4223 | + const { data = [] } = sInstruct; | |
| 4224 | + | |
| 4225 | + const btnConfig = data.find(item => item && item.name === btnName && item.enabled !== undefined); | |
| 4226 | + if (btnConfig) { | |
| 4227 | + const { enabled: enabledContent } = btnConfig; | |
| 4228 | + if (typeof enabledContent === 'boolean') { | |
| 4229 | + result = enabledContent; | |
| 4230 | + } else if (enabledContent) { | |
| 4231 | + const tempData = { | |
| 4232 | + props: { | |
| 4233 | + enabled | |
| 4234 | + }, | |
| 4235 | + master: masterData, | |
| 4236 | + [name]: record | |
| 4237 | + }; | |
| 4238 | + | |
| 4239 | + let strNew = enabledContent; | |
| 4240 | + Object.keys(tempData).forEach(key => { | |
| 4241 | + const reg = new RegExp(`${key}\\.`, "g"); | |
| 4242 | + strNew = strNew.replace(reg, `tempData["${key}"].`); | |
| 4243 | + }); | |
| 4244 | + try { | |
| 4245 | + const evalStr = eval("`" + strNew + "`"); | |
| 4246 | + result = !!eval(evalStr); | |
| 4247 | + // console.log('=====表格行按钮状态结果', result, { btnName, enabledContent, tempData, strNew, evalStr }); | |
| 4248 | + } catch (error) { | |
| 4249 | + console.log('=====表格行按钮状态错误', { error, enabledContent, strNew, tempData }); | |
| 4250 | + } | |
| 4251 | + } | |
| 4252 | + } | |
| 4253 | + | |
| 4254 | + return result; | |
| 4255 | + } | |
| 4215 | 4256 | /** 获取table的表头信息(主要是table中的表头信息合并,[{title:1-1},{title:1-2}]变成[{title:1,children:[{title:1},{title:2}]}]) type:是否过滤 */ |
| 4216 | 4257 | getTableColumn = (headerColumn, type, props) => { |
| 4217 | 4258 | // this.hasMergeHeader = false; |
| ... | ... | @@ -4385,9 +4426,8 @@ class CommonTableRc extends React.Component { |
| 4385 | 4426 | const marginLeft = this.props.bMutiSelect ? "6px" : "2px"; |
| 4386 | 4427 | expandedAllIcon = ( |
| 4387 | 4428 | <button |
| 4388 | - class={`table-expAllIcon ant-table-row-expand-icon ${ | |
| 4389 | - this.tableCollapsed ? "ant-table-row-expand-icon-collapsed" : "" | |
| 4390 | - }`} | |
| 4429 | + class={`table-expAllIcon ant-table-row-expand-icon ${this.tableCollapsed ? "ant-table-row-expand-icon-collapsed" : "" | |
| 4430 | + }`} | |
| 4391 | 4431 | style={{ margin: `1px 4px 0 ${marginLeft}` }} |
| 4392 | 4432 | ref={ref => { |
| 4393 | 4433 | this.expRef = ref; |
| ... | ... | @@ -4574,9 +4614,8 @@ class CommonTableRc extends React.Component { |
| 4574 | 4614 | |
| 4575 | 4615 | res = ( |
| 4576 | 4616 | <div |
| 4577 | - className={`th-div ${ | |
| 4578 | - column.bXunjianCheck ? styles.thXunjian : "" | |
| 4579 | - }`} | |
| 4617 | + className={`th-div ${column.bXunjianCheck ? styles.thXunjian : "" | |
| 4618 | + }`} | |
| 4580 | 4619 | style={styleObj} |
| 4581 | 4620 | > |
| 4582 | 4621 | {checkBoxAll} |
| ... | ... | @@ -4616,7 +4655,7 @@ class CommonTableRc extends React.Component { |
| 4616 | 4655 | sortOrder: |
| 4617 | 4656 | props && props.sortedInfo |
| 4618 | 4657 | ? props.sortedInfo.columnKey === column.dataIndex && |
| 4619 | - props.sortedInfo.order | |
| 4658 | + props.sortedInfo.order | |
| 4620 | 4659 | : false, |
| 4621 | 4660 | width, |
| 4622 | 4661 | title: renderTitle(), |
| ... | ... | @@ -4673,7 +4712,7 @@ class CommonTableRc extends React.Component { |
| 4673 | 4712 | } |
| 4674 | 4713 | const setOperation = commonFunc.showMessage(props.app.commonConst, 'operation') || '操作'; |
| 4675 | 4714 | const bHasMesBtn = |
| 4676 | - props.mesAdd || props.mesCopy || props.mesDel || props.mesSave; | |
| 4715 | + props.mesAdd || props.mesCopy || props.mesDel || props.mesSave || props.mesMaterials; | |
| 4677 | 4716 | const bEmptyTableBtnsConfig = commonUtils.isEmptyArr(props.tableBtnsConfig); |
| 4678 | 4717 | if (!bEmptyTableBtnsConfig || bHasMesBtn) { |
| 4679 | 4718 | let tableBtnsWidth = "150px"; |
| ... | ... | @@ -4705,6 +4744,9 @@ class CommonTableRc extends React.Component { |
| 4705 | 4744 | if (props.mesSave) { |
| 4706 | 4745 | tableBtnsWidth += 26; |
| 4707 | 4746 | } |
| 4747 | + if (props.mesMaterials) { | |
| 4748 | + tableBtnsWidth += 26 | |
| 4749 | + } | |
| 4708 | 4750 | // 如果有新增按钮,则按钮宽度至少为75 |
| 4709 | 4751 | if (props.mesAdd) { |
| 4710 | 4752 | tableBtnsWidth = Math.max(75, tableBtnsWidth); |
| ... | ... | @@ -4726,14 +4768,44 @@ class CommonTableRc extends React.Component { |
| 4726 | 4768 | const operationCol = { |
| 4727 | 4769 | dataIndex: "operation", |
| 4728 | 4770 | render: (text, record, index) => { |
| 4771 | + let { rowTag } = record || {} | |
| 4772 | + let operateMaterial = null; | |
| 4773 | + let operatePopupModal = null | |
| 4774 | + const modalProps = { ...this.getModalPropsTableRow(), disabled: false }; | |
| 4775 | + /* 通用弹窗按钮 */ | |
| 4776 | + const choosePopupProps = { ...this.getPopupPropsTableRow(), disabled: false }; | |
| 4777 | + const chooseParamProps = { ...this.getParamPropsTableRow(), disabled: false }; | |
| 4778 | + const materialIcon = true || props.tableProps.setMaterial; /* 材料操作 */ | |
| 4779 | + /** 放置选择材料图标 */ | |
| 4780 | + if (materialIcon) { | |
| 4781 | + const setMaterial = commonFunc.showMessage( | |
| 4782 | + props.app.commonConst, | |
| 4783 | + "setMaterial" | |
| 4784 | + ); /* 选择材料 */ | |
| 4785 | + operateMaterial = <Button | |
| 4786 | + className={styles.mesAdd} | |
| 4787 | + icon={props.enabled && rowTag !== 1 ? <SvgIcon iconClass="material" fill="#1296db" size="14" alt="选择材料"></SvgIcon> : <SvgIcon iconClass="material" fill="rgb(189, 189, 189)" size="14" alt="选择材料"></SvgIcon>} | |
| 4788 | + onClick={e => { | |
| 4789 | + e.stopPropagation(); | |
| 4790 | + // props.enabled && rowTag !== 1 ? this.modalTbRow.bind(this, index, props.name) : this.handleTbRowUsed.bind(this, index, record, 'setMaterial') | |
| 4791 | + | |
| 4792 | + }} | |
| 4793 | + /> | |
| 4794 | + } | |
| 4795 | + | |
| 4796 | + if (this.isPopupShow) { | |
| 4797 | + const enabled = this.getTableBtnState('BtnPopup', record); | |
| 4798 | + const setDownload = commonFunc.showMessage(props.app.commonConst, 'setPopup');/* 弹窗 */ | |
| 4799 | + operatePopupModal = <a title={setDownload} {...choosePopupProps} onClick={enabled ? this.popupModalTbRow.bind(this, index, record) : null}>{enabled ? <SvgIcon iconClass="search" fill="#1296db" size="14" alt="弹窗"></SvgIcon> : <SvgIcon iconClass="search" fill="rgb(189, 189, 189)" size="14" alt="弹窗"></SvgIcon>}</a>; | |
| 4800 | + } | |
| 4729 | 4801 | const tableBtnsConfig = |
| 4730 | 4802 | typeof props.tableBtnsConfig === "function" |
| 4731 | 4803 | ? props.tableBtnsConfig({ |
| 4732 | - record, | |
| 4733 | - index, | |
| 4734 | - name: props.name, | |
| 4735 | - tableData: props.data | |
| 4736 | - }) | |
| 4804 | + record, | |
| 4805 | + index, | |
| 4806 | + name: props.name, | |
| 4807 | + tableData: props.data | |
| 4808 | + }) | |
| 4737 | 4809 | : props.tableBtnsConfig || []; |
| 4738 | 4810 | |
| 4739 | 4811 | return ( |
| ... | ... | @@ -4766,7 +4838,7 @@ class CommonTableRc extends React.Component { |
| 4766 | 4838 | width: 90, |
| 4767 | 4839 | height: 36, |
| 4768 | 4840 | borderRadius: 5, |
| 4769 | - backgroundColor: disabled ? "#AAA" : (btnBgColor || sColor) , | |
| 4841 | + backgroundColor: disabled ? "#AAA" : (btnBgColor || sColor), | |
| 4770 | 4842 | color: "#FFF" |
| 4771 | 4843 | }} |
| 4772 | 4844 | loading={bLoading} |
| ... | ... | @@ -4814,16 +4886,20 @@ class CommonTableRc extends React.Component { |
| 4814 | 4886 | )} |
| 4815 | 4887 | {props.mesCopy |
| 4816 | 4888 | ? props.mesCopy({ |
| 4817 | - tableName: props.name, | |
| 4818 | - record, | |
| 4819 | - index, | |
| 4820 | - tableClassName: this.state.tableClassName | |
| 4821 | - }) | |
| 4889 | + tableName: props.name, | |
| 4890 | + record, | |
| 4891 | + index, | |
| 4892 | + tableClassName: this.state.tableClassName | |
| 4893 | + }) | |
| 4822 | 4894 | : ""} |
| 4823 | 4895 | {props.mesSave ? props.mesSave() : ""} |
| 4824 | 4896 | {props.mesDel |
| 4825 | 4897 | ? props.mesDel({ tableName: props.name, record, index }) |
| 4826 | 4898 | : ""} |
| 4899 | + {/* { | |
| 4900 | + props.mesMaterials ? props.mesMaterials({ tableName: props.name, record, index }) : '' | |
| 4901 | + } */} | |
| 4902 | + {operatePopupModal} | |
| 4827 | 4903 | </div> |
| 4828 | 4904 | ); |
| 4829 | 4905 | }, |
| ... | ... | @@ -4963,7 +5039,7 @@ class CommonTableRc extends React.Component { |
| 4963 | 5039 | } |
| 4964 | 5040 | }); |
| 4965 | 5041 | }, |
| 4966 | - onCancel() {} | |
| 5042 | + onCancel() { } | |
| 4967 | 5043 | }); |
| 4968 | 5044 | }} |
| 4969 | 5045 | > |
| ... | ... | @@ -4974,9 +5050,9 @@ class CommonTableRc extends React.Component { |
| 4974 | 5050 | )} |
| 4975 | 5051 | {props.mesAdd |
| 4976 | 5052 | ? props.mesAdd({ |
| 4977 | - tableName: props.name, | |
| 4978 | - tableClassName: this.state.tableClassName | |
| 4979 | - }) | |
| 5053 | + tableName: props.name, | |
| 5054 | + tableClassName: this.state.tableClassName | |
| 5055 | + }) | |
| 4980 | 5056 | : ""} |
| 4981 | 5057 | {props.choosePlate()} |
| 4982 | 5058 | </div> |
| ... | ... | @@ -5049,9 +5125,8 @@ class CommonTableRc extends React.Component { |
| 5049 | 5125 | const { formId } = props; |
| 5050 | 5126 | const { token } = props.app; |
| 5051 | 5127 | const divProps = { |
| 5052 | - action: `${ | |
| 5053 | - commonConfig.server_host | |
| 5054 | - }file/upload?sModelsId=${formId}&token=${token}`, | |
| 5128 | + action: `${commonConfig.server_host | |
| 5129 | + }file/upload?sModelsId=${formId}&token=${token}`, | |
| 5055 | 5130 | onChange: this.handleUploadChange, |
| 5056 | 5131 | accept: "*/*", |
| 5057 | 5132 | showUploadList: false, |
| ... | ... | @@ -5387,13 +5462,13 @@ class CommonTableRc extends React.Component { |
| 5387 | 5462 | {...addProps} |
| 5388 | 5463 | onClick={ |
| 5389 | 5464 | props.enabled || |
| 5390 | - this.findIsUpdByControlName(this.props, "BtnAdd") | |
| 5465 | + this.findIsUpdByControlName(this.props, "BtnAdd") | |
| 5391 | 5466 | ? this.addTbRow.bind(this, index) |
| 5392 | 5467 | : null |
| 5393 | 5468 | } |
| 5394 | 5469 | > |
| 5395 | 5470 | {props.enabled || |
| 5396 | - this.findIsUpdByControlName(this.props, "BtnAdd") ? ( | |
| 5471 | + this.findIsUpdByControlName(this.props, "BtnAdd") ? ( | |
| 5397 | 5472 | <SvgIcon |
| 5398 | 5473 | iconClass="plus" |
| 5399 | 5474 | fill="#1296db" |
| ... | ... | @@ -5417,14 +5492,14 @@ class CommonTableRc extends React.Component { |
| 5417 | 5492 | {...addProps} |
| 5418 | 5493 | onClick={ |
| 5419 | 5494 | props.enabled || |
| 5420 | - this.findIsUpdByControlName(this.props, "BtnAdd") | |
| 5495 | + this.findIsUpdByControlName(this.props, "BtnAdd") | |
| 5421 | 5496 | ? this.addTbRow.bind(this, index) |
| 5422 | 5497 | : null |
| 5423 | 5498 | } |
| 5424 | 5499 | > |
| 5425 | 5500 | {" "} |
| 5426 | 5501 | {props.enabled || |
| 5427 | - this.findIsUpdByControlName(this.props, "BtnAdd") ? ( | |
| 5502 | + this.findIsUpdByControlName(this.props, "BtnAdd") ? ( | |
| 5428 | 5503 | <SvgIcon |
| 5429 | 5504 | iconClass="plus" |
| 5430 | 5505 | fill="#1296db" |
| ... | ... | @@ -5551,7 +5626,7 @@ class CommonTableRc extends React.Component { |
| 5551 | 5626 | } |
| 5552 | 5627 | > |
| 5553 | 5628 | {props.enabled || |
| 5554 | - this.findIsUpdByControlName(this.props, "BtnCopyAll") ? ( | |
| 5629 | + this.findIsUpdByControlName(this.props, "BtnCopyAll") ? ( | |
| 5555 | 5630 | <SvgIcon |
| 5556 | 5631 | iconClass="copyall" |
| 5557 | 5632 | fill="#1296db" |
| ... | ... | @@ -5612,13 +5687,13 @@ class CommonTableRc extends React.Component { |
| 5612 | 5687 | {...delProps} |
| 5613 | 5688 | onClick={ |
| 5614 | 5689 | props.enabled || |
| 5615 | - this.findIsUpdByControlName(this.props, "BtnDel") | |
| 5690 | + this.findIsUpdByControlName(this.props, "BtnDel") | |
| 5616 | 5691 | ? this.delTbRow.bind(this, index, record) |
| 5617 | 5692 | : null |
| 5618 | 5693 | } |
| 5619 | 5694 | > |
| 5620 | 5695 | {props.enabled || |
| 5621 | - this.findIsUpdByControlName(this.props, "BtnDel") ? ( | |
| 5696 | + this.findIsUpdByControlName(this.props, "BtnDel") ? ( | |
| 5622 | 5697 | <SvgIcon |
| 5623 | 5698 | iconClass="close" |
| 5624 | 5699 | fill="#1296db" |
| ... | ... | @@ -5653,11 +5728,11 @@ class CommonTableRc extends React.Component { |
| 5653 | 5728 | props.enabled && rowTag !== 1 |
| 5654 | 5729 | ? this.modalTbRow.bind(this, index, props.name) |
| 5655 | 5730 | : this.handleTbRowUsed.bind( |
| 5656 | - this, | |
| 5657 | - index, | |
| 5658 | - record, | |
| 5659 | - "setMaterial" | |
| 5660 | - ) | |
| 5731 | + this, | |
| 5732 | + index, | |
| 5733 | + record, | |
| 5734 | + "setMaterial" | |
| 5735 | + ) | |
| 5661 | 5736 | } |
| 5662 | 5737 | > |
| 5663 | 5738 | {props.enabled && rowTag !== 1 ? ( |
| ... | ... | @@ -5746,10 +5821,10 @@ class CommonTableRc extends React.Component { |
| 5746 | 5821 | onClick={ |
| 5747 | 5822 | props.enabled |
| 5748 | 5823 | ? this.chooseProductProcessModalTbRow.bind( |
| 5749 | - this, | |
| 5750 | - index, | |
| 5751 | - record | |
| 5752 | - ) | |
| 5824 | + this, | |
| 5825 | + index, | |
| 5826 | + record | |
| 5827 | + ) | |
| 5753 | 5828 | : null |
| 5754 | 5829 | } |
| 5755 | 5830 | > |
| ... | ... | @@ -5784,10 +5859,10 @@ class CommonTableRc extends React.Component { |
| 5784 | 5859 | onClick={ |
| 5785 | 5860 | props.enabled |
| 5786 | 5861 | ? this.chooseProductMaterialsModalTbRow.bind( |
| 5787 | - this, | |
| 5788 | - index, | |
| 5789 | - record | |
| 5790 | - ) | |
| 5862 | + this, | |
| 5863 | + index, | |
| 5864 | + record | |
| 5865 | + ) | |
| 5791 | 5866 | : null |
| 5792 | 5867 | } |
| 5793 | 5868 | > |
| ... | ... | @@ -5928,7 +6003,7 @@ class CommonTableRc extends React.Component { |
| 5928 | 6003 | }, |
| 5929 | 6004 | title: () => |
| 5930 | 6005 | this.props.setOpterationColumn === "Y" && |
| 5931 | - this.getTableFilterData() === 0 ? ( | |
| 6006 | + this.getTableFilterData() === 0 ? ( | |
| 5932 | 6007 | <span |
| 5933 | 6008 | style={{ |
| 5934 | 6009 | width: "100%", |
| ... | ... | @@ -5971,13 +6046,13 @@ class CommonTableRc extends React.Component { |
| 5971 | 6046 | {...addProps} |
| 5972 | 6047 | onClick={ |
| 5973 | 6048 | props.enabled || |
| 5974 | - this.findIsUpdByControlName(this.props, "BtnAdd") | |
| 6049 | + this.findIsUpdByControlName(this.props, "BtnAdd") | |
| 5975 | 6050 | ? this.addTbRowInHeader |
| 5976 | 6051 | : null |
| 5977 | 6052 | } |
| 5978 | 6053 | > |
| 5979 | 6054 | {props.enabled || |
| 5980 | - this.findIsUpdByControlName(this.props, "BtnAdd") ? ( | |
| 6055 | + this.findIsUpdByControlName(this.props, "BtnAdd") ? ( | |
| 5981 | 6056 | <SvgIcon |
| 5982 | 6057 | iconClass="plus" |
| 5983 | 6058 | fill="#1296db" |
| ... | ... | @@ -6000,16 +6075,16 @@ class CommonTableRc extends React.Component { |
| 6000 | 6075 | {...headProps} |
| 6001 | 6076 | onClick={ |
| 6002 | 6077 | props.enabled || |
| 6003 | - this.findIsUpdByControlName(this.props, "BtnHeadPopup") | |
| 6078 | + this.findIsUpdByControlName(this.props, "BtnHeadPopup") | |
| 6004 | 6079 | ? this.popupModalTbRow |
| 6005 | 6080 | : null |
| 6006 | 6081 | } |
| 6007 | 6082 | > |
| 6008 | 6083 | {props.enabled || |
| 6009 | - this.findIsUpdByControlName( | |
| 6010 | - this.props, | |
| 6011 | - "BtnHeadPopup" | |
| 6012 | - ) ? ( | |
| 6084 | + this.findIsUpdByControlName( | |
| 6085 | + this.props, | |
| 6086 | + "BtnHeadPopup" | |
| 6087 | + ) ? ( | |
| 6013 | 6088 | <SvgIcon |
| 6014 | 6089 | iconClass="plus" |
| 6015 | 6090 | fill="#1296db" |
| ... | ... | @@ -6071,13 +6146,13 @@ class CommonTableRc extends React.Component { |
| 6071 | 6146 | {...headProps} |
| 6072 | 6147 | onClick={ |
| 6073 | 6148 | props.enabled || |
| 6074 | - this.findIsUpdByControlName(this.props, "BtnHeadPopup") | |
| 6149 | + this.findIsUpdByControlName(this.props, "BtnHeadPopup") | |
| 6075 | 6150 | ? this.popupModalTbRow |
| 6076 | 6151 | : null |
| 6077 | 6152 | } |
| 6078 | 6153 | > |
| 6079 | 6154 | {props.enabled || |
| 6080 | - this.findIsUpdByControlName(this.props, "BtnHeadPopup") ? ( | |
| 6155 | + this.findIsUpdByControlName(this.props, "BtnHeadPopup") ? ( | |
| 6081 | 6156 | <SvgIcon |
| 6082 | 6157 | iconClass="plus" |
| 6083 | 6158 | fill="#1296db" |
| ... | ... | @@ -6886,24 +6961,20 @@ class CommonTableRc extends React.Component { |
| 6886 | 6961 | }); |
| 6887 | 6962 | }; |
| 6888 | 6963 | handleSelectCommonPopup = (name, selectConfig, selectData) => { |
| 6889 | - const { commonPopupTbName, commonPopupShowConfig } = this.state; | |
| 6964 | + const { commonPopupTbName, commonPopupShowConfig, commonFieldPopupVisible, commonPopupVisible, commonFieldPopupTbName, commonFieldPopupShowConfig, | |
| 6965 | + commonModalVisible, commonModalShowConfig, commonModalTbName } = this.state; | |
| 6890 | 6966 | /* 若是产品名称弹窗 并且配置了调用产品工艺卡标识copyFromTechnology 则走自己的逻辑 */ |
| 6891 | - if (selectConfig.sCompareColor === "copyFromTechnology") { | |
| 6892 | - this.props.onSelectCommonPopupProduct( | |
| 6893 | - name, | |
| 6894 | - selectConfig, | |
| 6895 | - selectData, | |
| 6896 | - commonPopupTbName, | |
| 6897 | - commonPopupShowConfig | |
| 6898 | - ); | |
| 6967 | + if (selectConfig.sCompareColor === 'copyFromTechnology') { | |
| 6968 | + this.props.onSelectCommonPopupProduct(name, selectConfig, selectData, commonPopupTbName, commonPopupShowConfig); | |
| 6899 | 6969 | } else { |
| 6900 | - this.props.onSelectCommonPopup( | |
| 6901 | - name, | |
| 6902 | - selectConfig, | |
| 6903 | - selectData, | |
| 6904 | - commonPopupTbName, | |
| 6905 | - commonPopupShowConfig | |
| 6906 | - ); | |
| 6970 | + let tb = commonPopupVisible ? { name: commonPopupTbName, config: commonPopupShowConfig } : commonFieldPopupVisible ? { name: commonFieldPopupTbName, config: commonFieldPopupShowConfig } : undefined; | |
| 6971 | + tb = commonModalVisible ? { name: commonModalTbName, config: commonModalShowConfig } : tb; | |
| 6972 | + if (selectConfig.sControlName?.startsWith('BtnPopupEdit')) { | |
| 6973 | + this.props.onSelectCommonPopup(name, selectConfig, selectData, tb?.name, tb?.config, { index: this.rowClickRef.current }); | |
| 6974 | + return; | |
| 6975 | + } | |
| 6976 | + | |
| 6977 | + this.props.onSelectCommonPopup(name, selectConfig, selectData, tb?.name, commonPopupShowConfig); | |
| 6907 | 6978 | } |
| 6908 | 6979 | }; |
| 6909 | 6980 | |
| ... | ... | @@ -6935,7 +7006,7 @@ class CommonTableRc extends React.Component { |
| 6935 | 7006 | ) { |
| 6936 | 7007 | const iIndex = |
| 6937 | 7008 | commonUtils.isNotEmptyArr(tableSelectedRowKeys) && |
| 6938 | - commonUtils.isNotEmptyObject(tableSelectedRowKeys[0]) | |
| 7009 | + commonUtils.isNotEmptyObject(tableSelectedRowKeys[0]) | |
| 6939 | 7010 | ? tableData.findIndex(item => item.sId === tableSelectedRowKeys[0]) |
| 6940 | 7011 | : -1; |
| 6941 | 7012 | selectData.forEach((item, index) => { |
| ... | ... | @@ -7024,11 +7095,10 @@ class CommonTableRc extends React.Component { |
| 7024 | 7095 | : record.sFormId |
| 7025 | 7096 | : showConfig.sActiveId; |
| 7026 | 7097 | const printsId = record[sActiveKey]; |
| 7027 | - const urlPrint = `${ | |
| 7028 | - commonConfig.server_host | |
| 7029 | - }printReport/printPdfByFromDataId/${printsId}.pdf?sModelsId=${sActiveId}&sId=${printsId}&token=${encodeURIComponent( | |
| 7030 | - token | |
| 7031 | - )}`; | |
| 7098 | + const urlPrint = `${commonConfig.server_host | |
| 7099 | + }printReport/printPdfByFromDataId/${printsId}.pdf?sModelsId=${sActiveId}&sId=${printsId}&token=${encodeURIComponent( | |
| 7100 | + token | |
| 7101 | + )}`; | |
| 7032 | 7102 | window.open(urlPrint); |
| 7033 | 7103 | } else { |
| 7034 | 7104 | if (this.handleHideModal()) { |
| ... | ... | @@ -7133,9 +7203,8 @@ class CommonTableRc extends React.Component { |
| 7133 | 7203 | const index = sActiveKey.lastIndexOf("."); |
| 7134 | 7204 | sActiveKey = sActiveKey.substring(index + 1, sActiveKey.length); |
| 7135 | 7205 | } |
| 7136 | - const sNameUrl = `${ | |
| 7137 | - commonConfig.server_host | |
| 7138 | - }gdsmodule/getGdsmoduleById/${sFormId}?sModelsId=${sFormId}&sName=${formRoute}`; | |
| 7206 | + const sNameUrl = `${commonConfig.server_host | |
| 7207 | + }gdsmodule/getGdsmoduleById/${sFormId}?sModelsId=${sFormId}&sName=${formRoute}`; | |
| 7139 | 7208 | const filterCondition = []; |
| 7140 | 7209 | const conditionValues = this.props.getSqlCondition( |
| 7141 | 7210 | picArr[0], |
| ... | ... | @@ -7225,16 +7294,15 @@ class CommonTableRc extends React.Component { |
| 7225 | 7294 | fileList.forEach(item => { |
| 7226 | 7295 | let fileName = item.substring(item.lastIndexOf("/") + 1); |
| 7227 | 7296 | fileName = fileName.substring(fileName.indexOf("_") + 1); |
| 7228 | - const filepath = `${ | |
| 7229 | - commonConfig.server_host | |
| 7230 | - }file/download?savePathStr=${encodeURIComponent( | |
| 7231 | - item | |
| 7232 | - )}&sModelsId=100&token=${encodeURIComponent(this.props.app.token)}`; | |
| 7297 | + const filepath = `${commonConfig.server_host | |
| 7298 | + }file/download?savePathStr=${encodeURIComponent( | |
| 7299 | + item | |
| 7300 | + )}&sModelsId=100&token=${encodeURIComponent(this.props.app.token)}`; | |
| 7233 | 7301 | const xhr = new XMLHttpRequest(); |
| 7234 | 7302 | xhr.open("get", filepath); |
| 7235 | 7303 | xhr.responseType = "blob"; |
| 7236 | 7304 | xhr.send(); |
| 7237 | - xhr.onload = function() { | |
| 7305 | + xhr.onload = function () { | |
| 7238 | 7306 | if (this.status === 200 || this.status === 304) { |
| 7239 | 7307 | // 如果是IE10及以上,不支持download属性,采用msSaveOrOpenBlob方法,但是IE10以下也不支持msSaveOrOpenBlob |
| 7240 | 7308 | if ("msSaveOrOpenBlob" in navigator) { |
| ... | ... | @@ -7308,9 +7376,8 @@ class CommonTableRc extends React.Component { |
| 7308 | 7376 | const previewImageArr = []; |
| 7309 | 7377 | dataUrlArr.forEach((item = "") => { |
| 7310 | 7378 | const dataPreviewUrl = item.includes("xlyerpfiles") |
| 7311 | - ? `${ | |
| 7312 | - commonConfig.server_host | |
| 7313 | - }file/download?savePathStr=${item}&width=800&&height=500&sModelsId=100&token=${token}` | |
| 7379 | + ? `${commonConfig.server_host | |
| 7380 | + }file/download?savePathStr=${item}&width=800&&height=500&sModelsId=100&token=${token}` | |
| 7314 | 7381 | : item; /* 预览 */ |
| 7315 | 7382 | previewImageArr.push(dataPreviewUrl); |
| 7316 | 7383 | }); |
| ... | ... | @@ -7364,9 +7431,8 @@ class CommonTableRc extends React.Component { |
| 7364 | 7431 | : ""; |
| 7365 | 7432 | console.log("sFormId:", sFormId); |
| 7366 | 7433 | if (commonUtils.isNotEmptyObject(sBtnContent)) { |
| 7367 | - const urlPrint = `${ | |
| 7368 | - commonConfig.server_host | |
| 7369 | - }template/getSql/${sBtnName}/?sBtnContent=${sBtnContent}&sBtnControlName=${sBtnControlName}&sFormId=${sFormId}`; | |
| 7434 | + const urlPrint = `${commonConfig.server_host | |
| 7435 | + }template/getSql/${sBtnName}/?sBtnContent=${sBtnContent}&sBtnControlName=${sBtnControlName}&sFormId=${sFormId}`; | |
| 7370 | 7436 | const w = |
| 7371 | 7437 | window.innerWidth || |
| 7372 | 7438 | document.documentElement.clientWidth || |
| ... | ... | @@ -7385,8 +7451,8 @@ class CommonTableRc extends React.Component { |
| 7385 | 7451 | const newWin = window.open("", "SQL查看器", features); |
| 7386 | 7452 | newWin.document.write( |
| 7387 | 7453 | '<body scroll="no" style="margin: 0px;padding: 0px;border:0px;overflow:hidden;"><iframe style="margin: 0px;padding: 0px;border: 0px;width:100%;height:100%" src="' + |
| 7388 | - urlPrint + | |
| 7389 | - '"></iframe></body>' | |
| 7454 | + urlPrint + | |
| 7455 | + '"></iframe></body>' | |
| 7390 | 7456 | ); |
| 7391 | 7457 | // window.open(urlPrint); |
| 7392 | 7458 | } else { |
| ... | ... | @@ -7588,7 +7654,7 @@ class CommonTableRc extends React.Component { |
| 7588 | 7654 | const { dNetMoney, dNetPrice } = this.props.app.decimals; |
| 7589 | 7655 | const sModelsType = |
| 7590 | 7656 | commonUtils.isNotEmptyObject(this.props) && |
| 7591 | - commonUtils.isNotEmptyObject(this.props.app) | |
| 7657 | + commonUtils.isNotEmptyObject(this.props.app) | |
| 7592 | 7658 | ? this.props.app.currentPane.sModelsType |
| 7593 | 7659 | : ""; |
| 7594 | 7660 | let colSpan = 0; |
| ... | ... | @@ -7889,13 +7955,13 @@ class CommonTableRc extends React.Component { |
| 7889 | 7955 | ) { |
| 7890 | 7956 | tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( |
| 7891 | 7957 | commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + |
| 7892 | - commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 7958 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 7893 | 7959 | this.props.getFloatNum(sumItem.sName) |
| 7894 | 7960 | ); |
| 7895 | 7961 | } else { |
| 7896 | 7962 | tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( |
| 7897 | 7963 | commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + |
| 7898 | - commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 7964 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 7899 | 7965 | this.props.getFloatNum(sumItem.sName) |
| 7900 | 7966 | ); |
| 7901 | 7967 | } |
| ... | ... | @@ -7942,13 +8008,13 @@ class CommonTableRc extends React.Component { |
| 7942 | 8008 | ) { |
| 7943 | 8009 | tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( |
| 7944 | 8010 | commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + |
| 7945 | - commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 8011 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 7946 | 8012 | this.props.getFloatNum(sumItem.sName) |
| 7947 | 8013 | ); |
| 7948 | 8014 | } else { |
| 7949 | 8015 | tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( |
| 7950 | 8016 | commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + |
| 7951 | - commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 8017 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 7952 | 8018 | this.props.getFloatNum(sumItem.sName) |
| 7953 | 8019 | ); |
| 7954 | 8020 | } |
| ... | ... | @@ -7967,13 +8033,13 @@ class CommonTableRc extends React.Component { |
| 7967 | 8033 | ) { |
| 7968 | 8034 | tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( |
| 7969 | 8035 | commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + |
| 7970 | - commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 8036 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 7971 | 8037 | this.props.getFloatNum(sumItem.sName) |
| 7972 | 8038 | ); |
| 7973 | 8039 | } else { |
| 7974 | 8040 | tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( |
| 7975 | 8041 | commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + |
| 7976 | - commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 8042 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 7977 | 8043 | this.props.getFloatNum(sumItem.sName) |
| 7978 | 8044 | ); |
| 7979 | 8045 | } |
| ... | ... | @@ -8189,19 +8255,18 @@ class CommonTableRc extends React.Component { |
| 8189 | 8255 | const sActiveId = isSlaveInfo |
| 8190 | 8256 | ? this.props.slaveInfo.app.currentPane.formId |
| 8191 | 8257 | : this.props.app.currentPane.formId; |
| 8192 | - const url = `${ | |
| 8193 | - commonConfig.server_host | |
| 8194 | - }configform/sHandleConfigform?sModelsId=${sActiveId}&sName=${formSrcRoute}`; | |
| 8258 | + const url = `${commonConfig.server_host | |
| 8259 | + }configform/sHandleConfigform?sModelsId=${sActiveId}&sName=${formSrcRoute}`; | |
| 8195 | 8260 | const headerArr = isSlaveInfo |
| 8196 | 8261 | ? this.props.slaveInfo.headerColumn.map(item => item.dataIndex) |
| 8197 | 8262 | : this.props.headerColumn.map(item => item.dataIndex); |
| 8198 | 8263 | const handleData = isSlaveInfo |
| 8199 | 8264 | ? this.props.slaveInfo.config.gdsconfigformslave.filter( |
| 8200 | - item => headerArr.indexOf(item.sName) !== -1 | |
| 8201 | - ) | |
| 8265 | + item => headerArr.indexOf(item.sName) !== -1 | |
| 8266 | + ) | |
| 8202 | 8267 | : this.props.config.gdsconfigformslave.filter( |
| 8203 | - item => headerArr.indexOf(item.sName) !== -1 | |
| 8204 | - ); | |
| 8268 | + item => headerArr.indexOf(item.sName) !== -1 | |
| 8269 | + ); | |
| 8205 | 8270 | let sortIndexFirst = 0; |
| 8206 | 8271 | let sortIndexLast = 0; |
| 8207 | 8272 | |
| ... | ... | @@ -8220,11 +8285,11 @@ class CommonTableRc extends React.Component { |
| 8220 | 8285 | |
| 8221 | 8286 | const postData = isSlaveInfo |
| 8222 | 8287 | ? { |
| 8223 | - [this.props.slaveInfo.config.sId]: handleData | |
| 8224 | - } | |
| 8288 | + [this.props.slaveInfo.config.sId]: handleData | |
| 8289 | + } | |
| 8225 | 8290 | : { |
| 8226 | - [this.props.config.sId]: handleData | |
| 8227 | - }; | |
| 8291 | + [this.props.config.sId]: handleData | |
| 8292 | + }; | |
| 8228 | 8293 | // console.log(postData, 'postData'); |
| 8229 | 8294 | // console.log(sortItems, 'sortItems'); |
| 8230 | 8295 | |
| ... | ... | @@ -8438,9 +8503,8 @@ class CommonTableRc extends React.Component { |
| 8438 | 8503 | if (commonUtils.isNotEmptyObject(picAddr)) { |
| 8439 | 8504 | const { token } = props.app; |
| 8440 | 8505 | const dataUrl = picAddr[0].includes("xlyerpfiles") |
| 8441 | - ? `${commonConfig.server_host}file/download?savePathStr=${ | |
| 8442 | - picAddr[0] | |
| 8443 | - }&scale=0.1&sModelsId=100&token=${token}` | |
| 8506 | + ? `${commonConfig.server_host}file/download?savePathStr=${picAddr[0] | |
| 8507 | + }&scale=0.1&sModelsId=100&token=${token}` | |
| 8444 | 8508 | : picAddr[0]; /* 缩略图 */ |
| 8445 | 8509 | const officeFileTypeList = ["PDF", "DOCX", "XLSX"]; |
| 8446 | 8510 | const imgTypeList = [ |
| ... | ... | @@ -8565,8 +8629,8 @@ class CommonTableRc extends React.Component { |
| 8565 | 8629 | const iIndex = commonUtils.isEmpty(record[sName]) |
| 8566 | 8630 | ? -1 |
| 8567 | 8631 | : showDropDown.findIndex( |
| 8568 | - item => item.sId === record[sName].toString() | |
| 8569 | - ); | |
| 8632 | + item => item.sId === record[sName].toString() | |
| 8633 | + ); | |
| 8570 | 8634 | sValue = iIndex > -1 ? showDropDown[iIndex].value : ""; |
| 8571 | 8635 | } else if ( |
| 8572 | 8636 | firstDataIndex === "t" || |
| ... | ... | @@ -8677,7 +8741,7 @@ class CommonTableRc extends React.Component { |
| 8677 | 8741 | > |
| 8678 | 8742 | {(commonUtils.isNotEmptyObject(sName) && |
| 8679 | 8743 | sName.substring(0, 1) === "b") || |
| 8680 | - imgBox !== "" ? ( | |
| 8744 | + imgBox !== "" ? ( | |
| 8681 | 8745 | "" |
| 8682 | 8746 | ) : ( |
| 8683 | 8747 | <div |
| ... | ... | @@ -8699,13 +8763,13 @@ class CommonTableRc extends React.Component { |
| 8699 | 8763 | onClick={ |
| 8700 | 8764 | commonUtils.isNotEmptyObject(linkStyle) |
| 8701 | 8765 | ? this.handleViewClick.bind( |
| 8702 | - this, | |
| 8703 | - isSlaveInfo ? "slaveInfo" : this.props.name, | |
| 8704 | - showConfig.sName, | |
| 8705 | - record, | |
| 8706 | - index, | |
| 8707 | - showConfig | |
| 8708 | - ) | |
| 8766 | + this, | |
| 8767 | + isSlaveInfo ? "slaveInfo" : this.props.name, | |
| 8768 | + showConfig.sName, | |
| 8769 | + record, | |
| 8770 | + index, | |
| 8771 | + showConfig | |
| 8772 | + ) | |
| 8709 | 8773 | : null |
| 8710 | 8774 | } |
| 8711 | 8775 | > |
| ... | ... | @@ -8733,7 +8797,7 @@ class CommonTableRc extends React.Component { |
| 8733 | 8797 | > |
| 8734 | 8798 | {(commonUtils.isNotEmptyObject(sName) && |
| 8735 | 8799 | sName.substring(0, 1) === "b") || |
| 8736 | - imgBox !== "" ? ( | |
| 8800 | + imgBox !== "" ? ( | |
| 8737 | 8801 | "" |
| 8738 | 8802 | ) : ( |
| 8739 | 8803 | <Tooltip |
| ... | ... | @@ -8754,13 +8818,13 @@ class CommonTableRc extends React.Component { |
| 8754 | 8818 | onClick={ |
| 8755 | 8819 | commonUtils.isNotEmptyObject(linkStyle) |
| 8756 | 8820 | ? this.handleViewClick.bind( |
| 8757 | - this, | |
| 8758 | - isSlaveInfo ? "slaveInfo" : this.props.name, | |
| 8759 | - showConfig.sName, | |
| 8760 | - record, | |
| 8761 | - index, | |
| 8762 | - showConfig | |
| 8763 | - ) | |
| 8821 | + this, | |
| 8822 | + isSlaveInfo ? "slaveInfo" : this.props.name, | |
| 8823 | + showConfig.sName, | |
| 8824 | + record, | |
| 8825 | + index, | |
| 8826 | + showConfig | |
| 8827 | + ) | |
| 8764 | 8828 | : null |
| 8765 | 8829 | } |
| 8766 | 8830 | > |
| ... | ... | @@ -9026,8 +9090,8 @@ class CommonTableRc extends React.Component { |
| 9026 | 9090 | let iIndex = commonUtils.isEmpty(record[sName]) |
| 9027 | 9091 | ? -1 |
| 9028 | 9092 | : showDropDown.findIndex( |
| 9029 | - item => item.sId === record[sName].toString() | |
| 9030 | - ); | |
| 9093 | + item => item.sId === record[sName].toString() | |
| 9094 | + ); | |
| 9031 | 9095 | if (iIndex === -1 && record[sName] === "") { |
| 9032 | 9096 | iIndex = showDropDown.findIndex(item => item.sId === ""); |
| 9033 | 9097 | } |
| ... | ... | @@ -9037,7 +9101,7 @@ class CommonTableRc extends React.Component { |
| 9037 | 9101 | /* 选择合版产品弹窗 */ |
| 9038 | 9102 | const sModelsType = |
| 9039 | 9103 | commonUtils.isNotEmptyObject(props) && |
| 9040 | - commonUtils.isNotEmptyObject(props.app) | |
| 9104 | + commonUtils.isNotEmptyObject(props.app) | |
| 9041 | 9105 | ? props.app.currentPane.sModelsType |
| 9042 | 9106 | : ""; |
| 9043 | 9107 | if ( |
| ... | ... | @@ -9340,7 +9404,7 @@ class CommonTableRc extends React.Component { |
| 9340 | 9404 | {" "} |
| 9341 | 9405 | {(commonUtils.isNotEmptyObject(sName) && |
| 9342 | 9406 | sName.substring(0, 1) === "b") || |
| 9343 | - imgBox !== "" ? ( | |
| 9407 | + imgBox !== "" ? ( | |
| 9344 | 9408 | "" |
| 9345 | 9409 | ) : ( |
| 9346 | 9410 | <Tooltip |
| ... | ... | @@ -9366,29 +9430,29 @@ class CommonTableRc extends React.Component { |
| 9366 | 9430 | commonUtils.isNotEmptyObject(linkStyle) |
| 9367 | 9431 | ? clickEvent === "onViewChoose" |
| 9368 | 9432 | ? this.handleViewChoose.bind( |
| 9433 | + this, | |
| 9434 | + this.props.name, | |
| 9435 | + showConfig.sName, | |
| 9436 | + record, | |
| 9437 | + index | |
| 9438 | + ) | |
| 9439 | + : clickEvent === "onMemoShow" | |
| 9440 | + ? this.handleMemoShow.bind( | |
| 9369 | 9441 | this, |
| 9370 | 9442 | this.props.name, |
| 9371 | 9443 | showConfig.sName, |
| 9372 | 9444 | record, |
| 9373 | - index | |
| 9445 | + index, | |
| 9446 | + showConfig | |
| 9374 | 9447 | ) |
| 9375 | - : clickEvent === "onMemoShow" | |
| 9376 | - ? this.handleMemoShow.bind( | |
| 9377 | - this, | |
| 9378 | - this.props.name, | |
| 9379 | - showConfig.sName, | |
| 9380 | - record, | |
| 9381 | - index, | |
| 9382 | - showConfig | |
| 9383 | - ) | |
| 9384 | 9448 | : this.handleViewClick.bind( |
| 9385 | - this, | |
| 9386 | - this.props.name, | |
| 9387 | - showConfig.sName, | |
| 9388 | - record, | |
| 9389 | - index, | |
| 9390 | - showConfig | |
| 9391 | - ) | |
| 9449 | + this, | |
| 9450 | + this.props.name, | |
| 9451 | + showConfig.sName, | |
| 9452 | + record, | |
| 9453 | + index, | |
| 9454 | + showConfig | |
| 9455 | + ) | |
| 9392 | 9456 | : null |
| 9393 | 9457 | } |
| 9394 | 9458 | > |
| ... | ... | @@ -9745,7 +9809,7 @@ class CommonTableRc extends React.Component { |
| 9745 | 9809 | props.slaveInfo !== undefined && |
| 9746 | 9810 | props.slaveInfo.selectedRowKeys !== undefined && |
| 9747 | 9811 | JSON.stringify(slaveInfoSelectedRowKeys) !== |
| 9748 | - JSON.stringify(props.slaveInfo.selectedRowKeys) | |
| 9812 | + JSON.stringify(props.slaveInfo.selectedRowKeys) | |
| 9749 | 9813 | ) { |
| 9750 | 9814 | stateValue.slaveInfoSelectedRowKeys = [ |
| 9751 | 9815 | ...props.slaveInfo.selectedRowKeys |
| ... | ... | @@ -9796,7 +9860,7 @@ class CommonTableRc extends React.Component { |
| 9796 | 9860 | stateValue.previewVisible = props.previewVisible; |
| 9797 | 9861 | } |
| 9798 | 9862 | function compare(property) { |
| 9799 | - return function(a, b) { | |
| 9863 | + return function (a, b) { | |
| 9800 | 9864 | const value1 = a[property]; |
| 9801 | 9865 | const value2 = b[property]; |
| 9802 | 9866 | return value1 - value2; |
| ... | ... | @@ -9970,8 +10034,8 @@ class CommonTableRc extends React.Component { |
| 9970 | 10034 | this.props.tableProps.AutoTableHeight == "100%" |
| 9971 | 10035 | ? "100%" |
| 9972 | 10036 | : this.props.tableProps.AutoTableHeight + |
| 9973 | - tableHeaderHeight + | |
| 9974 | - footerHeight; | |
| 10037 | + tableHeaderHeight + | |
| 10038 | + footerHeight; | |
| 9975 | 10039 | return; |
| 9976 | 10040 | } |
| 9977 | 10041 | |
| ... | ... | @@ -10434,9 +10498,8 @@ class CommonTableRc extends React.Component { |
| 10434 | 10498 | |
| 10435 | 10499 | const { formId } = this.props; |
| 10436 | 10500 | const { token } = this.props.app; |
| 10437 | - const url = `${ | |
| 10438 | - commonConfig.server_host | |
| 10439 | - }file/upload?sModelsId=${formId}&token=${token}`; | |
| 10501 | + const url = `${commonConfig.server_host | |
| 10502 | + }file/upload?sModelsId=${formId}&token=${token}`; | |
| 10440 | 10503 | fetch(url, { |
| 10441 | 10504 | method: "POST", |
| 10442 | 10505 | body: formData |
| ... | ... | @@ -10553,8 +10616,8 @@ class CommonTableRc extends React.Component { |
| 10553 | 10616 | ); |
| 10554 | 10617 | masterData[`sSecond-${newKey}`] = |
| 10555 | 10618 | sSecondConditionPro && |
| 10556 | - iIndex > -1 && | |
| 10557 | - config.gdsconfigformslave[iIndex].sDropDownType === "sql" | |
| 10619 | + iIndex > -1 && | |
| 10620 | + config.gdsconfigformslave[iIndex].sDropDownType === "sql" | |
| 10558 | 10621 | ? commonConfig.seaJudge.s_proDropDown[0].sId |
| 10559 | 10622 | : sSecondConditionPro |
| 10560 | 10623 | ? commonConfig.seaJudge.s_pro[0].sId |
| ... | ... | @@ -10666,9 +10729,8 @@ class CommonTableRc extends React.Component { |
| 10666 | 10729 | const { formId, isSmall } = this.props; |
| 10667 | 10730 | const { token } = this.props.app; |
| 10668 | 10731 | const divProps = { |
| 10669 | - action: `${ | |
| 10670 | - commonConfig.server_host | |
| 10671 | - }file/upload?sModelsId=${formId}&token=${token}`, | |
| 10732 | + action: `${commonConfig.server_host | |
| 10733 | + }file/upload?sModelsId=${formId}&token=${token}`, | |
| 10672 | 10734 | onChange: this.handleUploadChange, |
| 10673 | 10735 | accept: "*/*", |
| 10674 | 10736 | showUploadList: false, |
| ... | ... | @@ -10727,7 +10789,7 @@ class CommonTableRc extends React.Component { |
| 10727 | 10789 | commonPopupConfig = config.gdsconfigformslave[iIndex]; |
| 10728 | 10790 | commonPopupTitle = |
| 10729 | 10791 | commonUtils.isNotEmptyObject(commonPopupConfig) && |
| 10730 | - commonUtils.isNotEmptyObject(commonPopupConfig.sActiveName) | |
| 10792 | + commonUtils.isNotEmptyObject(commonPopupConfig.sActiveName) | |
| 10731 | 10793 | ? commonPopupConfig.sActiveName |
| 10732 | 10794 | : commonPopupTitle; |
| 10733 | 10795 | commonPopupProps = { |
| ... | ... | @@ -10840,7 +10902,7 @@ class CommonTableRc extends React.Component { |
| 10840 | 10902 | } |
| 10841 | 10903 | commonFieldPopupTitle = |
| 10842 | 10904 | commonUtils.isNotEmptyObject(commonFieldPopupConfig) && |
| 10843 | - commonUtils.isNotEmptyObject(commonFieldPopupConfig.sActiveName) | |
| 10905 | + commonUtils.isNotEmptyObject(commonFieldPopupConfig.sActiveName) | |
| 10844 | 10906 | ? commonFieldPopupConfig.sActiveName |
| 10845 | 10907 | : commonFieldPopupTitle; |
| 10846 | 10908 | commonFieldPopupProps = { |
| ... | ... | @@ -11020,14 +11082,14 @@ class CommonTableRc extends React.Component { |
| 11020 | 11082 | <FormItem |
| 11021 | 11083 | className={styles.subForm} |
| 11022 | 11084 | style={{ height: "100%" }} |
| 11023 | - // key={tableFormItemKey} | |
| 11085 | + // key={tableFormItemKey} | |
| 11024 | 11086 | > |
| 11025 | 11087 | <div className={styles.extraAction} onselectstart="return false"> |
| 11026 | 11088 | {this.props.name === "picFile" || |
| 11027 | - (commonUtils.isNotEmptyObject(this.props.name) && | |
| 11028 | - this.props.name.indexOf("file") > -1) || | |
| 11029 | - (this.props.name.startsWith("slave") && | |
| 11030 | - this.findIsUpdByControlName(this.props, "BtnUpload")) ? ( | |
| 11089 | + (commonUtils.isNotEmptyObject(this.props.name) && | |
| 11090 | + this.props.name.indexOf("file") > -1) || | |
| 11091 | + (this.props.name.startsWith("slave") && | |
| 11092 | + this.findIsUpdByControlName(this.props, "BtnUpload")) ? ( | |
| 11031 | 11093 | <Upload {...divProps}> |
| 11032 | 11094 | <Button |
| 11033 | 11095 | {...uploadProps} |
| ... | ... | @@ -11053,11 +11115,9 @@ class CommonTableRc extends React.Component { |
| 11053 | 11115 | ) : null} |
| 11054 | 11116 | </div> |
| 11055 | 11117 | <div |
| 11056 | - className={`xlyCommonTable ${tableClassName} ${ | |
| 11057 | - this.hasSpanBgColor ? "tableNoPadding" : "" | |
| 11058 | - } ${this.props.enabled ? "tableEnabled" : ""} ${ | |
| 11059 | - otherTableHeight ? `xlyCommonTableHeight_${otherTableHeight}` : "" | |
| 11060 | - } ${this.props.bGyXunjian ? styles.xunjianTable : ""}`} | |
| 11118 | + className={`xlyCommonTable ${tableClassName} ${this.hasSpanBgColor ? "tableNoPadding" : "" | |
| 11119 | + } ${this.props.enabled ? "tableEnabled" : ""} ${otherTableHeight ? `xlyCommonTableHeight_${otherTableHeight}` : "" | |
| 11120 | + } ${this.props.bGyXunjian ? styles.xunjianTable : ""}`} | |
| 11061 | 11121 | style={{ height: isSmall ? "calc(100% - 44px)" : "" }} |
| 11062 | 11122 | ref={ref => { |
| 11063 | 11123 | this.mydiv = ref; |
| ... | ... | @@ -11070,8 +11130,8 @@ class CommonTableRc extends React.Component { |
| 11070 | 11130 | this.mydiv.getElementsByClassName( |
| 11071 | 11131 | "ant-table-body" |
| 11072 | 11132 | )[0].style.height = this.tableHeight |
| 11073 | - ? this.tableHeight + "px" | |
| 11074 | - : 80 + "px"; | |
| 11133 | + ? this.tableHeight + "px" | |
| 11134 | + : 80 + "px"; | |
| 11075 | 11135 | } |
| 11076 | 11136 | if (layoutScrollY) { |
| 11077 | 11137 | this.mydiv.getElementsByClassName( |
| ... | ... | @@ -11143,17 +11203,17 @@ class CommonTableRc extends React.Component { |
| 11143 | 11203 | <div className="showimg"> |
| 11144 | 11204 | {commonUtils.isNotEmptyArr(data) |
| 11145 | 11205 | ? data.map((item, i) => { |
| 11146 | - return ( | |
| 11147 | - // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions | |
| 11148 | - <img | |
| 11149 | - alt="example" | |
| 11150 | - style={{ width: "400px", height: "200px" }} | |
| 11151 | - src={item} | |
| 11152 | - onClick={() => this.showimg(i)} | |
| 11153 | - key={item} | |
| 11154 | - /> | |
| 11155 | - ); | |
| 11156 | - }) | |
| 11206 | + return ( | |
| 11207 | + // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions | |
| 11208 | + <img | |
| 11209 | + alt="example" | |
| 11210 | + style={{ width: "400px", height: "200px" }} | |
| 11211 | + src={item} | |
| 11212 | + onClick={() => this.showimg(i)} | |
| 11213 | + key={item} | |
| 11214 | + /> | |
| 11215 | + ); | |
| 11216 | + }) | |
| 11157 | 11217 | : ""} |
| 11158 | 11218 | </div> |
| 11159 | 11219 | {/* 引入的image组件s */} |
| ... | ... | @@ -11383,11 +11443,10 @@ class CommonTableRc extends React.Component { |
| 11383 | 11443 | bFitWidth={true} |
| 11384 | 11444 | previewUrl={ |
| 11385 | 11445 | pdfFileUrl.includes("xlyerpfiles") |
| 11386 | - ? `${ | |
| 11387 | - commonConfig.server_host | |
| 11388 | - }file/download?savePathStr=${encodeURIComponent( | |
| 11389 | - pdfFileUrl | |
| 11390 | - )}&sModelsId=100&token=${this.props.app.token}` | |
| 11446 | + ? `${commonConfig.server_host | |
| 11447 | + }file/download?savePathStr=${encodeURIComponent( | |
| 11448 | + pdfFileUrl | |
| 11449 | + )}&sModelsId=100&token=${this.props.app.token}` | |
| 11391 | 11450 | : pdfFileUrl |
| 11392 | 11451 | } |
| 11393 | 11452 | /> |
| ... | ... | @@ -11563,7 +11622,7 @@ const useCommonTableEvent = props => { |
| 11563 | 11622 | currentRecord: record, |
| 11564 | 11623 | userface: |
| 11565 | 11624 | props.parentProps && |
| 11566 | - commonUtils.isNotEmptyArr(props.parentProps.userfaceData) | |
| 11625 | + commonUtils.isNotEmptyArr(props.parentProps.userfaceData) | |
| 11567 | 11626 | ? props.parentProps.userfaceData[0] |
| 11568 | 11627 | : {} |
| 11569 | 11628 | }; |
| ... | ... | @@ -11762,9 +11821,8 @@ const useCommonTableEvent = props => { |
| 11762 | 11821 | cursortPosition >= record[sName].toString().length |
| 11763 | 11822 | ) { |
| 11764 | 11823 | // 当前列为空 或 光标位置不小于当前值的长度 |
| 11765 | - const nextId = `${tableColumn[columnIndex + 1].dataIndex}${ | |
| 11766 | - record.sId | |
| 11767 | - }`; | |
| 11824 | + const nextId = `${tableColumn[columnIndex + 1].dataIndex}${record.sId | |
| 11825 | + }`; | |
| 11768 | 11826 | if (!commonUtils.focus(nextId)) |
| 11769 | 11827 | move(keyCode, cursortPosition, columnIndex + 1); // 递归 |
| 11770 | 11828 | } |
| ... | ... | @@ -11985,7 +12043,7 @@ const useCommonTableEvent = props => { |
| 11985 | 12043 | onCopyToNextLine: handleCopyToNextLine, |
| 11986 | 12044 | onKeyDown: hanldeKeyDown, |
| 11987 | 12045 | onMoveLine: handleMoveLine, |
| 11988 | - onShowSimpleModal: handleShowSimpleModal | |
| 12046 | + onShowSimpleModal: handleShowSimpleModal, | |
| 11989 | 12047 | }; |
| 11990 | 12048 | }; |
| 11991 | 12049 | |
| ... | ... | @@ -12064,7 +12122,7 @@ const handleSetCostomEnabledList = (props, data) => { |
| 12064 | 12122 | currentRecord: record, |
| 12065 | 12123 | userface: |
| 12066 | 12124 | props.parentProps && |
| 12067 | - commonUtils.isNotEmptyArr(props.parentProps.userfaceData) | |
| 12125 | + commonUtils.isNotEmptyArr(props.parentProps.userfaceData) | |
| 12068 | 12126 | ? props.parentProps.userfaceData[0] |
| 12069 | 12127 | : {} |
| 12070 | 12128 | }; |
| ... | ... | @@ -12137,7 +12195,7 @@ const useGetTableBtnOprSetting = props => { |
| 12137 | 12195 | if (location.pathname.includes("indexPad") && sDefault) { |
| 12138 | 12196 | sDefault = "add,del,save"; |
| 12139 | 12197 | } |
| 12140 | - | |
| 12198 | + sDefault = sDefault + ',materials' | |
| 12141 | 12199 | const { bSubmit, bCheck } = props?.parentProps?.masterData || {}; |
| 12142 | 12200 | if (location.pathname.includes("indexPad") && sDefault && !props.enabled) { |
| 12143 | 12201 | if (!bSubmit && !bCheck) { |
| ... | ... | @@ -12172,7 +12230,6 @@ const useGetTableBtnOprSetting = props => { |
| 12172 | 12230 | } |
| 12173 | 12231 | }, 300); |
| 12174 | 12232 | }; |
| 12175 | - | |
| 12176 | 12233 | const resultTemp = {}; |
| 12177 | 12234 | const list = sDefault.split(","); |
| 12178 | 12235 | list.forEach(btnType => { |
| ... | ... | @@ -12184,7 +12241,7 @@ const useGetTableBtnOprSetting = props => { |
| 12184 | 12241 | defaultValue: false, |
| 12185 | 12242 | record: {} |
| 12186 | 12243 | }); |
| 12187 | - | |
| 12244 | + | |
| 12188 | 12245 | if (props.parentProps.bMesBill && !str) { |
| 12189 | 12246 | disabled = !props.enabled; |
| 12190 | 12247 | } |
| ... | ... | @@ -12252,7 +12309,7 @@ const useGetTableBtnOprSetting = props => { |
| 12252 | 12309 | }} |
| 12253 | 12310 | /> |
| 12254 | 12311 | } |
| 12255 | - ; | |
| 12312 | + ; | |
| 12256 | 12313 | } else if (btnType === "save") { |
| 12257 | 12314 | resultTemp.mesSave = () => ( |
| 12258 | 12315 | <Button |
| ... | ... | @@ -12264,8 +12321,25 @@ const useGetTableBtnOprSetting = props => { |
| 12264 | 12321 | }} |
| 12265 | 12322 | /> |
| 12266 | 12323 | ); |
| 12324 | + } else if (btnType === 'materials') { | |
| 12325 | + resultTemp.mesMaterials = (text, record, index) => { | |
| 12326 | + let { rowTag } = record || {}; | |
| 12327 | + console.log(rowTag, 'rowTag'); | |
| 12328 | + | |
| 12329 | + return ( | |
| 12330 | + <Button | |
| 12331 | + className={styles.mesMaterials} | |
| 12332 | + icon={props.enabled && rowTag !== 1 ? <SvgIcon iconClass="material" fill="#1296db" size="14" alt="选择材料"></SvgIcon> : <SvgIcon iconClass="material" fill="rgb(189, 189, 189)" size="14" alt="选择材料"></SvgIcon>} | |
| 12333 | + onClick={e => { | |
| 12334 | + e.stopPropagation(); | |
| 12335 | + props.enabled && rowTag !== 1 ? modalTbRow.bind(this, index, props.name) : this.handleTbRowUsed.bind(this, index, record, 'setMaterial') | |
| 12336 | + }} | |
| 12337 | + /> | |
| 12338 | + ); | |
| 12339 | + }; | |
| 12267 | 12340 | } |
| 12268 | 12341 | }); |
| 12342 | + | |
| 12269 | 12343 | result = resultTemp; |
| 12270 | 12344 | |
| 12271 | 12345 | return result; | ... | ... |
src/components/Common/commonBusiness.js
| ... | ... | @@ -171,9 +171,54 @@ export async function saveData(param) { |
| 171 | 171 | const { |
| 172 | 172 | token, value, sModelsId, bMachineTask, |
| 173 | 173 | } = param; |
| 174 | + console.log(param, 'param'); | |
| 175 | + | |
| 176 | + | |
| 174 | 177 | const { optName } = value; |
| 178 | + let vb = { | |
| 179 | + ...value, | |
| 180 | + data: value.data.map(item => { | |
| 181 | + if (item.name === 'slave') { | |
| 182 | + const d = { | |
| 183 | + ...item, | |
| 184 | + column: item.column.map(x => { | |
| 185 | + const c = { | |
| 186 | + ...x, | |
| 187 | + "dMaterialsQty": x.dAuxiliaryQty + '.000', | |
| 188 | + "dMaterialsMoney": 0, | |
| 189 | + "dNMaterialsMoney": 0, | |
| 190 | + "dMaterialsNoTaxMoney": 0, | |
| 191 | + "dMaterialsPrice": 0, | |
| 192 | + "dMaterialsForeignPrice": 0, | |
| 193 | + "dMaterialsNoTaxPrice": 0, | |
| 194 | + "dMaterialsTaxMoney": 0, | |
| 195 | + "dMaterialsForeignMoney": 0, | |
| 196 | + "dMaterialsTaxForeignMoney": 0, | |
| 197 | + "dSrcNoCheckMoney": 0, | |
| 198 | + "iOrder": 1, | |
| 199 | + "bDefault": false, | |
| 200 | + 'key': x.sId, | |
| 201 | + sNodeId | |
| 202 | + : | |
| 203 | + "17659590640005403595594904199000" | |
| 204 | + | |
| 205 | + } | |
| 206 | + delete c.sWareHouseId | |
| 207 | + return c | |
| 208 | + }) | |
| 209 | + } | |
| 210 | + | |
| 211 | + return d | |
| 212 | + } | |
| 213 | + return { | |
| 214 | + ...item | |
| 215 | + } | |
| 216 | + }).filter(x => x.name !== 'slave0') | |
| 217 | + } | |
| 218 | + console.log(vb, 'vb'); | |
| 219 | + | |
| 175 | 220 | const dataReturn = (await commonServices.postValueService( |
| 176 | - token, value, | |
| 221 | + token, vb, | |
| 177 | 222 | `${commonConfig.server_host}business/addUpdateDelBusinessData?sModelsId=${sModelsId}`, |
| 178 | 223 | )).data; |
| 179 | 224 | if (bMachineTask) return dataReturn; |
| ... | ... | @@ -195,7 +240,7 @@ export async function saveData(param) { |
| 195 | 240 | {dataReturn.msg} |
| 196 | 241 | </div> |
| 197 | 242 | ), |
| 198 | - onOk() {}, | |
| 243 | + onOk() { }, | |
| 199 | 244 | }); |
| 200 | 245 | } else if (dataReturn.code === -7) { /* 防呆校验 返回是-7 */ |
| 201 | 246 | return dataReturn; |
| ... | ... | @@ -314,7 +359,7 @@ export function getShowTypes(name, props) { |
| 314 | 359 | getFloatNum: props.getFloatNum, |
| 315 | 360 | getDateFormat: props.getDateFormat, |
| 316 | 361 | // onChange: props.onChange, |
| 317 | - onChange: () => {}, | |
| 362 | + onChange: () => { }, | |
| 318 | 363 | formRoute: props.formRoute, |
| 319 | 364 | } |
| 320 | 365 | } |
| ... | ... | @@ -1052,7 +1097,7 @@ export function handleUnitType(app, resultValue) { |
| 1052 | 1097 | } |
| 1053 | 1098 | export function showLocalMessage(props, sName, sChineseName) { |
| 1054 | 1099 | let sTitle = ''; |
| 1055 | - if(commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) && commonUtils.isNotEmptyArr(props.app.commonConst)) { | |
| 1100 | + if (commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) && commonUtils.isNotEmptyArr(props.app.commonConst)) { | |
| 1056 | 1101 | const gdsformconst = props.app.commonConst; |
| 1057 | 1102 | sTitle = showMessage(gdsformconst, sName) |
| 1058 | 1103 | } else { |
| ... | ... | @@ -1257,7 +1302,7 @@ export async function clearSocketData(param) { |
| 1257 | 1302 | message.destroy(); |
| 1258 | 1303 | const { token, value, sModelsId } = param; |
| 1259 | 1304 | const { optName } = value; |
| 1260 | - const dataReturn = (await commonServices.postValueService( token, value, `${commonConfig.server_host}sysWebsocket/clearUserOperationRecord?sModelsId=${sModelsId}` )).data; | |
| 1305 | + const dataReturn = (await commonServices.postValueService(token, value, `${commonConfig.server_host}sysWebsocket/clearUserOperationRecord?sModelsId=${sModelsId}`)).data; | |
| 1261 | 1306 | /* 成功的话返回数据 */ |
| 1262 | 1307 | if (dataReturn.code === 1) { /* 成功 */ |
| 1263 | 1308 | if (!commonUtils.isEmpty(optName)) { | ... | ... |
src/mes/common/commonModalComponent/index.js
src/mes/indexMes/index.js
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | * @Date: 2024-02-26 10:55:04 |
| 5 | 5 | * @Description: 首界面 |
| 6 | 6 | */ |
| 7 | - | |
| 7 | +/* eslint-disable */ | |
| 8 | 8 | // 第三方组件 |
| 9 | 9 | import React, { |
| 10 | 10 | useReducer, |
| ... | ... | @@ -1132,7 +1132,7 @@ const ContentComponent = () => { |
| 1132 | 1132 | onChangeRouter: rest.onChangeRouter, |
| 1133 | 1133 | onOpenModal: handleOpenModal, |
| 1134 | 1134 | onOpenFilePreviewModal: handleOpenfilePreviewModal, |
| 1135 | - onOpenCommonModal: rest.onOpenCommonModal | |
| 1135 | + onOpenCommonModal: rest.onOpenCommonModal, | |
| 1136 | 1136 | }; |
| 1137 | 1137 | |
| 1138 | 1138 | let viewComponent = { | ... | ... |