Commit 48c13d567baefb891b7dc10cf8d6714cc4750826
1 parent
10140d0b
1.生产工单增加成品工序,成品材料,选择,增加功能
Showing
3 changed files
with
655 additions
and
6 deletions
src/components/Common/CommonBillEvent.js
| ... | ... | @@ -9834,6 +9834,237 @@ export default (ChildComponent) => { |
| 9834 | 9834 | addState[`${type}Data`] = newData; |
| 9835 | 9835 | return addState; |
| 9836 | 9836 | } |
| 9837 | + | |
| 9838 | + /* 选择成品工序 点确定 */ | |
| 9839 | + handleSelectFinalProcessNew = async (name, selectConfig, selectData, slaveFinalSelectedData) => { | |
| 9840 | + const targetname = 'process'; | |
| 9841 | + const { | |
| 9842 | + [`${targetname}Data`]: tableData, [`${targetname}Config`]: tableConfig, controlSelectedRowKeys, sModelsId, token, | |
| 9843 | + materialsConfig, processConfig,masterConfig, | |
| 9844 | + } = this.props; | |
| 9845 | + const { masterData } = this.props; | |
| 9846 | + if (name === 'chooseProductProcess') { | |
| 9847 | + const { controlData } = this.props; | |
| 9848 | + const iControlIndex = commonUtils.isNotEmptyArr(controlSelectedRowKeys) ? controlData.findIndex(item => item.sId === controlSelectedRowKeys[0]) : -1; | |
| 9849 | + /* 取选择工序从表配置 */ | |
| 9850 | + const slavesControlName = commonUtils.isNotEmptyObject(selectConfig.sControlName) ? `${selectConfig.sControlName}.slave` : ''; | |
| 9851 | + let slaveSelectConfig = {}; | |
| 9852 | + let slaveIndex = -1; | |
| 9853 | + if (commonUtils.isNotEmptyObject(masterConfig)) { | |
| 9854 | + slaveIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === slavesControlName); | |
| 9855 | + if (slaveIndex > -1) { | |
| 9856 | + slaveSelectConfig = masterConfig.gdsconfigformslave[slaveIndex]; | |
| 9857 | + } | |
| 9858 | + } | |
| 9859 | + /* 通过slaveFinalSelectedRowKeys找到slaveData数据 */ | |
| 9860 | + if (commonUtils.isNotEmptyArr(slaveFinalSelectedData)) { | |
| 9861 | + for (const slaveObj of slaveFinalSelectedData) { | |
| 9862 | + if (commonUtils.isNotEmptyArr(selectData)) { | |
| 9863 | + for (const item of selectData) { | |
| 9864 | + const newCopyTo = {}; | |
| 9865 | + newCopyTo.master = masterData; | |
| 9866 | + if (iControlIndex > -1) { | |
| 9867 | + newCopyTo.control = controlData[iControlIndex]; | |
| 9868 | + } | |
| 9869 | + let tableDataRow = commonFunc.getDefaultData(tableConfig, newCopyTo); // 取默认值 | |
| 9870 | + tableDataRow = { ...tableDataRow, ...commonFunc.getAssignFieldValue(selectConfig.sAssignField, item, newCopyTo) }; // 取赋值字段 | |
| 9871 | + if (commonUtils.isNotEmptyObject(slaveSelectConfig)) { | |
| 9872 | + tableDataRow = { ...tableDataRow, ...commonFunc.getAssignFieldValue(slaveSelectConfig.sAssignField, slaveObj, newCopyTo) }; // 取从表赋值字段 | |
| 9873 | + } | |
| 9874 | + tableDataRow.handleType = 'add'; | |
| 9875 | + tableDataRow.sId = commonUtils.createSid(); | |
| 9876 | + tableDataRow.sParentId = masterData.sId; | |
| 9877 | + | |
| 9878 | + tableDataRow.sCombinePartsName = slaveObj.sId; /* 成品工序sCombinePartsName 为从表id */ | |
| 9879 | + tableDataRow.sCombinePartsNameNew = slaveObj.sProductName; /* 成品工序sCombinePartsName 为从表产品名称 */ | |
| 9880 | + // tableDataRow.sSlaveProductId = slaveObj.sId; | |
| 9881 | + | |
| 9882 | + tableDataRow.sType = '3'; | |
| 9883 | + if (commonUtils.isNotEmptyObject(tableDataRow.sWorkOrderParam)) { | |
| 9884 | + tableDataRow = { ...tableDataRow, ...commonUtils.convertStrToObj(tableDataRow.sWorkOrderParam) }; | |
| 9885 | + } | |
| 9886 | + if (targetname === 'process') { | |
| 9887 | + const value = { sSqlCondition: { sParentId: item.sId } }; | |
| 9888 | + const configDataId = '11811781131121915166093023980'; | |
| 9889 | + const dataUrl = `${commonConfig.server_host}business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}`; | |
| 9890 | + const returnData = (await commonServices.postValueService(token, value, dataUrl)).data; | |
| 9891 | + if (returnData.code === 1) { | |
| 9892 | + const eleprocessmachineData = returnData.dataset.rows[0].dataSet; | |
| 9893 | + const newData = eleprocessmachineData.filter(item => item.bDefault); | |
| 9894 | + if (commonUtils.isNotEmptyArr(newData)) { | |
| 9895 | + tableDataRow.sMachineId = newData[0].sMachineId; | |
| 9896 | + } | |
| 9897 | + } | |
| 9898 | + const bProcessAssort = false; | |
| 9899 | + let returnProcessAssort = []; | |
| 9900 | + let processAssignAssort = ''; | |
| 9901 | + let dropDownDataProcessName; | |
| 9902 | + if (bProcessAssort) { | |
| 9903 | + const dataUrl = `${commonConfig.server_host}salesorder/getProcessAssort?sModelsId=${sModelsId}`; | |
| 9904 | + const dataProcessAssort = (await commonServices.postValueService(token, {}, dataUrl)).data; | |
| 9905 | + if (dataProcessAssort.code === 1) { | |
| 9906 | + returnProcessAssort = dataProcessAssort.dataset.rows[0].processassort; | |
| 9907 | + const iIndex = processConfig.gdsconfigformslave.findIndex(item => item.sName === 'sProcessName'); | |
| 9908 | + if (iIndex > -1) { | |
| 9909 | + const sqlDropDownData = await this.props.getSqlDropDownData(sModelsId, 'slave', processConfig.gdsconfigformslave[iIndex]); | |
| 9910 | + dropDownDataProcessName = sqlDropDownData.dropDownData; | |
| 9911 | + processAssignAssort = processConfig.gdsconfigformslave[iIndex].sAssignField; | |
| 9912 | + } | |
| 9913 | + } | |
| 9914 | + } | |
| 9915 | + // 配套工序 | |
| 9916 | + if (bProcessAssort) { | |
| 9917 | + returnProcessAssort.filter(item => item.sParentId === tableDataRow.sProcessId).forEach(((itemProcessAssort) => { | |
| 9918 | + const iIndex = dropDownDataProcessName.findIndex(item => item.sId === itemProcessAssort.sProcessId); | |
| 9919 | + if (iIndex > -1) { | |
| 9920 | + const iProcessIndex = selectData.findIndex(item => item.sId === itemProcessAssort.sProcessId); | |
| 9921 | + const iNewProcessIndex = tableDataRow.sType === '3' ? | |
| 9922 | + tableData.findIndex(item => item.sProcessId === itemProcessAssort.sProcessId) : | |
| 9923 | + tableData.findIndex(item => item.sProcessId === itemProcessAssort.sProcessId && item.sControlId === controlData[iControlIndex].sId); | |
| 9924 | + if (iProcessIndex < 0 && iNewProcessIndex < 0) { | |
| 9925 | + let processRow = commonFunc.getDefaultData(processConfig, newCopyTo); // 取默认值 | |
| 9926 | + processRow = { ...processRow, ...commonFunc.getAssignFieldValue(processAssignAssort, dropDownDataProcessName[iIndex], newCopyTo) }; // 取赋值字段 | |
| 9927 | + processRow.handleType = 'add'; | |
| 9928 | + processRow.sId = commonUtils.createSid(); | |
| 9929 | + processRow.sParentId = masterData.sId; | |
| 9930 | + processRow.sType = dropDownDataProcessName[iIndex].sType; | |
| 9931 | + | |
| 9932 | + // 成品工序的配套工序带入产品名称-开始 | |
| 9933 | + processRow.sCombinePartsName = slaveObj.sId; /* 成品工序sCombinePartsName 为从表id */ | |
| 9934 | + processRow.sCombinePartsNameNew = slaveObj.sProductName; /* 成品工序sCombinePartsName 为从表产品名称 */ | |
| 9935 | + processRow.sCombineProductNameNew = slaveObj.sProductName; /* 成品工序sCombinePartsName 为从表产品名称 */ | |
| 9936 | + // processRow.sParentProcessId = item.sId; | |
| 9937 | + // 成品工序的配套工序带入产品名称-结束 | |
| 9938 | + | |
| 9939 | + if (iControlIndex > -1 && processRow.sType !== '3') { | |
| 9940 | + processRow.sControlId = controlData[iControlIndex].sId; | |
| 9941 | + processRow.sPartsName = controlData[iControlIndex].sPartsName; | |
| 9942 | + } | |
| 9943 | + tableData.push(processRow); | |
| 9944 | + | |
| 9945 | + if (itemProcessAssort.sType === 'all') { | |
| 9946 | + controlData.filter(item => item.sId !== controlData[iControlIndex].sId).forEach((controlTableRow) => { | |
| 9947 | + const iNewProcessIndex = dropDownDataProcessName[iIndex].sType === '3' ? | |
| 9948 | + tableData.findIndex(item => item.sProcessId === itemProcessAssort.sProcessId) : | |
| 9949 | + tableData.findIndex(item => item.sProcessId === itemProcessAssort.sProcessId && item.sControlId === controlTableRow.sId); | |
| 9950 | + if (iNewProcessIndex < 0) { | |
| 9951 | + let processRow = commonFunc.getDefaultData(processConfig, newCopyTo); // 取默认值 | |
| 9952 | + processRow = { ...processRow, ...commonFunc.getAssignFieldValue(processAssignAssort, dropDownDataProcessName[iIndex], newCopyTo) }; // 取赋值字段 | |
| 9953 | + processRow.handleType = 'add'; | |
| 9954 | + processRow.sId = commonUtils.createSid(); | |
| 9955 | + processRow.sParentId = masterData.sId; | |
| 9956 | + processRow.sType = dropDownDataProcessName[iIndex].sType; | |
| 9957 | + | |
| 9958 | + // 成品工序的配套工序带入产品名称-开始 | |
| 9959 | + processRow.sCombinePartsName = slaveObj.sId; /* 成品工序sCombinePartsName 为从表id */ | |
| 9960 | + processRow.sCombinePartsNameNew = slaveObj.sProductName; /* 成品工序sCombinePartsName 为从表产品名称 */ | |
| 9961 | + processRow.sCombineProductNameNew = slaveObj.sProductName; /* 成品工序sCombinePartsName 为从表产品名称 */ | |
| 9962 | + // processRow.sParentProcessId = item.sId; | |
| 9963 | + // 成品工序的配套工序带入产品名称-结束 | |
| 9964 | + | |
| 9965 | + if (iControlIndex > -1 && processRow.sType !== '3') { | |
| 9966 | + processRow.sControlId = controlTableRow.sId; | |
| 9967 | + processRow.sPartsName = controlTableRow.sPartsName; | |
| 9968 | + } | |
| 9969 | + tableData.push(processRow); | |
| 9970 | + } | |
| 9971 | + }); | |
| 9972 | + } | |
| 9973 | + } | |
| 9974 | + } | |
| 9975 | + })); | |
| 9976 | + } | |
| 9977 | + } | |
| 9978 | + // const processLen = commonBusiness.getTableTypes('process', this.props).data.filter(item => this.state.currentTab.process.split('-').indexOf(item.sType) !== -1).length; | |
| 9979 | + // tableDataRow.iOrder = processLen; | |
| 9980 | + if (iControlIndex > -1 && tableDataRow.sType !== '3') { | |
| 9981 | + tableDataRow.sControlId = controlData[iControlIndex].sId; | |
| 9982 | + tableDataRow.sPartsName = controlData[iControlIndex].sPartsName; | |
| 9983 | + const processLen = tableData.filter(item => item.sType !== '3').length + 1; /* 工序序号自增 */ | |
| 9984 | + tableDataRow.iOrder = processLen; | |
| 9985 | + tableData.push(tableDataRow); | |
| 9986 | + } else if (tableDataRow.sType === '3') { | |
| 9987 | + const processLen = tableData.filter(item => item.sType === '3').length + 1; /* 工序序号自增 */ | |
| 9988 | + tableDataRow.iOrder = processLen; | |
| 9989 | + tableData.push(tableDataRow); | |
| 9990 | + } | |
| 9991 | + } | |
| 9992 | + } | |
| 9993 | + } | |
| 9994 | + } else { | |
| 9995 | + message.error('请选择产品!'); | |
| 9996 | + return; | |
| 9997 | + } | |
| 9998 | + const tableDataNew = this.sortData(controlData, tableData); | |
| 9999 | + this.props.onSaveState({ | |
| 10000 | + [`${targetname}Data`]: tableDataNew, [`${name}ChooseVisible`]: false, materialsConfig, materialsSelectedRowKeys: [], | |
| 10001 | + }); | |
| 10002 | + } | |
| 10003 | + } | |
| 10004 | + | |
| 10005 | + /* 选择成品材料 点确定 */ | |
| 10006 | + handleSelectFinalMaterialsNew = async (name, selectConfig, selectData, slaveFinalSelectedData) => { | |
| 10007 | + // 选择成品材料,将sType改为2 | |
| 10008 | + if (name === 'productMaterials') { | |
| 10009 | + selectData = selectData.map(val => ({ ...val, sType: '2' })); | |
| 10010 | + name = 'materials0'; | |
| 10011 | + } | |
| 10012 | + const { | |
| 10013 | + [`${name}Data`]: tableData = [], [`${name}Config`]: tableConfig, controlSelectedRowKeys, materialsConfig,masterConfig, | |
| 10014 | + } = this.props; | |
| 10015 | + const { masterData } = this.props; | |
| 10016 | + const { controlData } = this.props; | |
| 10017 | + const iControlIndex = commonUtils.isNotEmptyArr(controlSelectedRowKeys) ? controlData.findIndex(item => item.sId === controlSelectedRowKeys[0]) : -1; | |
| 10018 | + /* 取选择工序从表配置 */ | |
| 10019 | + const slavesControlName = commonUtils.isNotEmptyObject(selectConfig.sControlName) ? `${selectConfig.sControlName}.slave` : ''; | |
| 10020 | + let slaveSelectConfig = {}; | |
| 10021 | + let slaveIndex = -1; | |
| 10022 | + if (commonUtils.isNotEmptyObject(masterConfig)) { | |
| 10023 | + slaveIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === slavesControlName); | |
| 10024 | + if (slaveIndex > -1) { | |
| 10025 | + slaveSelectConfig = masterConfig.gdsconfigformslave[slaveIndex]; | |
| 10026 | + } | |
| 10027 | + } | |
| 10028 | + if (commonUtils.isNotEmptyArr(slaveFinalSelectedData)) { | |
| 10029 | + for (const slaveObj of slaveFinalSelectedData) { | |
| 10030 | + if (commonUtils.isNotEmptyArr(selectData)) { | |
| 10031 | + for (const item of selectData) { | |
| 10032 | + const newCopyTo = {}; | |
| 10033 | + newCopyTo.master = masterData; | |
| 10034 | + if (iControlIndex > -1) { | |
| 10035 | + newCopyTo.control = controlData[iControlIndex]; | |
| 10036 | + } | |
| 10037 | + let tableDataRow = commonFunc.getDefaultData(tableConfig, newCopyTo); // 取默认值 | |
| 10038 | + tableDataRow = { ...tableDataRow, ...commonFunc.getAssignFieldValue(selectConfig.sAssignField, item, newCopyTo) }; // 取赋值字段 | |
| 10039 | + if (commonUtils.isNotEmptyObject(slaveSelectConfig)) { | |
| 10040 | + tableDataRow = { ...tableDataRow, ...commonFunc.getAssignFieldValue(slaveSelectConfig.sAssignField, slaveObj, newCopyTo) }; // 取从表赋值字段 | |
| 10041 | + } | |
| 10042 | + tableDataRow.handleType = 'add'; | |
| 10043 | + tableDataRow.sId = commonUtils.createSid(); | |
| 10044 | + | |
| 10045 | + tableDataRow.sParentId = masterData.sId; | |
| 10046 | + tableDataRow.sCombinePartsName = slaveObj.sId; /* 成品材料sCombinePartsName 为从表id */ | |
| 10047 | + tableDataRow.sCombinePartsNameNew = slaveObj.sProductName; | |
| 10048 | + // tableDataRow.sSlaveProductId = slaveObj.sId; | |
| 10049 | + | |
| 10050 | + if (iControlIndex > -1 && tableDataRow.sType !== '2') { | |
| 10051 | + tableDataRow.sControlId = controlData[iControlIndex].sId; | |
| 10052 | + tableDataRow.sPartsName = controlData[iControlIndex].sPartsName; | |
| 10053 | + tableData.push(tableDataRow); | |
| 10054 | + } else if (tableDataRow.sType === '2') { | |
| 10055 | + tableData.push(tableDataRow); | |
| 10056 | + } | |
| 10057 | + } | |
| 10058 | + } | |
| 10059 | + } | |
| 10060 | + } else { | |
| 10061 | + message.error('请选择产品!'); | |
| 10062 | + return; | |
| 10063 | + } | |
| 10064 | + this.props.onSaveState({ | |
| 10065 | + [`${name}Data`]: tableData, [`${name}ChooseVisible`]: false, materialsConfig, materialsSelectedRowKeys: [], | |
| 10066 | + }); | |
| 10067 | + } | |
| 9837 | 10068 | handleOnExpand = async (expanded, record) => { |
| 9838 | 10069 | const { expKeys } = this.props; |
| 9839 | 10070 | /* 添加移除展开的sId */ |
| ... | ... | @@ -10147,6 +10378,8 @@ export default (ChildComponent) => { |
| 10147 | 10378 | isSColorSerialMemo={this.isSColorSerialMemo} |
| 10148 | 10379 | onBtnParamPage ={this.handleBtnParamPage} |
| 10149 | 10380 | onFilterData ={this.handleFilterData} |
| 10381 | + onSelectProductProcessNew={this.handleSelectFinalProcessNew} | |
| 10382 | + onSelectProductMaterialsNew={this.handleSelectFinalMaterialsNew} | |
| 10150 | 10383 | /> |
| 10151 | 10384 | ); |
| 10152 | 10385 | } | ... | ... |
src/components/Manufacture/CommonPackEvent.js
| ... | ... | @@ -14,6 +14,7 @@ import CommonPartsInfo from "@/components/Common/CommonPartsInfo"; |
| 14 | 14 | import CommonListSelect from "@/components/Common/CommonListSelect"; |
| 15 | 15 | import CommonListSelectMulti from "@/components/Common/CommonListSelectMulti"; |
| 16 | 16 | import CommonListSelectFlex from "@/components/Common/CommonListSelectFlex"; |
| 17 | +import CommonListSelectProductProcess from '@/components/Common/CommonListSelectAssignment'; | |
| 17 | 18 | import ContextMenuModal from "@/components/Common/ContextMenuModal"; |
| 18 | 19 | import WorkFlow from "@/components/Common/Flows/CommonFlow"; |
| 19 | 20 | import SvgIcon from "@/components/SvgIcon"; |
| ... | ... | @@ -859,6 +860,83 @@ const CommonPackEvent = props => { |
| 859 | 860 | }; |
| 860 | 861 | returnProps.materialsFilterNew = materialsFilterNew; |
| 861 | 862 | |
| 863 | + | |
| 864 | + // 公共方法-过滤工序数据 | |
| 865 | + const processFilteNew = (props, data, type, bFinal) => { | |
| 866 | + // materials : 0-1部件材料 : 2成品材料; | |
| 867 | + // process : 0-1-2 部品工序 : 3成品工序; | |
| 868 | + // bfinal: 是否成品 | |
| 869 | + const { slaveSelectedRowKeys, controlSelectedRowKeys } = props; | |
| 870 | + const oriData = data.data || []; | |
| 871 | + if (data.data) { | |
| 872 | + let res = []; | |
| 873 | + switch (type) { | |
| 874 | + case 'materials': | |
| 875 | + if (bFinal) { | |
| 876 | + if (bFinal) { /* 成品材料 */ | |
| 877 | + if (slaveSelectedRowKeys && slaveSelectedRowKeys.length) { | |
| 878 | + res = oriData.filter((val) => { | |
| 879 | + return val.sType === '2' && (val.sCombinePartsName === slaveSelectedRowKeys[0] || !val.sCombinePartsName); | |
| 880 | + }); | |
| 881 | + } else { | |
| 882 | + res = oriData.filter((val) => { | |
| 883 | + return val.sType === '2'; | |
| 884 | + }); | |
| 885 | + } | |
| 886 | + } else { /* 部件材料 */ | |
| 887 | + res = oriData.filter((val) => { | |
| 888 | + return val.sType !== '2'; | |
| 889 | + }); | |
| 890 | + } | |
| 891 | + } else { | |
| 892 | + res = oriData; | |
| 893 | + } | |
| 894 | + break; | |
| 895 | + case 'process': | |
| 896 | + if (bFinal) { | |
| 897 | + if (bFinal) { /* 成品工序 */ | |
| 898 | + if (slaveSelectedRowKeys && slaveSelectedRowKeys.length) { | |
| 899 | + res = oriData.filter((val) => { | |
| 900 | + return val.sType === '3' && (val.sCombinePartsName === slaveSelectedRowKeys[0] || !val.sCombinePartsName); | |
| 901 | + }); | |
| 902 | + } else { | |
| 903 | + res = oriData.filter((val) => { | |
| 904 | + return val.sType === '3'; | |
| 905 | + }); | |
| 906 | + } | |
| 907 | + } else { /* 部件工序 */ | |
| 908 | + if (controlSelectedRowKeys && controlSelectedRowKeys.length) { | |
| 909 | + res = oriData.filter((val) => { | |
| 910 | + return val.sType !== '3' && (controlSelectedRowKeys.includes(val.sControlId) || !val.sControlId); | |
| 911 | + }); | |
| 912 | + } else { | |
| 913 | + res = oriData.filter((val) => { | |
| 914 | + return val.sType !== '3'; | |
| 915 | + }); | |
| 916 | + } | |
| 917 | + | |
| 918 | + } | |
| 919 | + } else { | |
| 920 | + // 成品工序放最下面 | |
| 921 | + const processData = oriData.filter(item => item.sControlId !== props.controlSelectedRowKeys[0]) | |
| 922 | + const idsToRemove = processData.map(item => item.sControlId); | |
| 923 | + const allData = oriData.filter(item => !idsToRemove.includes(item.sControlId)) | |
| 924 | + res = allData.concat(processData); | |
| 925 | + const res3 = res.filter(item => item.sType === '3'); | |
| 926 | + const resOther = res.filter(item => item.sType !== '3'); | |
| 927 | + res = [...resOther, ...res3]; | |
| 928 | + } | |
| 929 | + break; | |
| 930 | + default: | |
| 931 | + res = oriData; | |
| 932 | + } | |
| 933 | + return res; | |
| 934 | + } else { | |
| 935 | + return oriData || []; | |
| 936 | + } | |
| 937 | + } | |
| 938 | + returnProps.processFilteNew = processFilteNew; | |
| 939 | + | |
| 862 | 940 | // 公共方法-递归数据 |
| 863 | 941 | const handleGetSlaveSelectedRowChildren = (allData, sId) => { |
| 864 | 942 | let result = []; |
| ... | ... | @@ -1146,6 +1224,10 @@ const CommonModal = props => { |
| 1146 | 1224 | <PartsInfoModal {...props} /> |
| 1147 | 1225 | /** 选择工序弹窗组件 */ |
| 1148 | 1226 | <ProcessChooseModal {...props} /> |
| 1227 | + /** 选择成品工序弹窗组件 */ | |
| 1228 | + <ProductProcessChooseModal {...props} /> | |
| 1229 | + /** 选择成品材料弹窗组件 */ | |
| 1230 | + <ProductMaterialsChooseModal {...props} /> | |
| 1149 | 1231 | /** 选择材料弹窗组件 */ |
| 1150 | 1232 | <MaterialsChooseModal {...props} /> |
| 1151 | 1233 | /** 选择工艺参数弹窗(旧) */ |
| ... | ... | @@ -1279,6 +1361,175 @@ const ProcessChooseModal = props => { |
| 1279 | 1361 | ); |
| 1280 | 1362 | }; |
| 1281 | 1363 | |
| 1364 | +// 选择成品工序弹窗 | |
| 1365 | +const ProductProcessChooseModal = props => { | |
| 1366 | + const { productProcessChooseVisible } = props; | |
| 1367 | + if (!productProcessChooseVisible) return ""; | |
| 1368 | + | |
| 1369 | + const { app, sModelsId, sModelsType, sTabId, content, productProcessChooseData, masterConfig, processData, controlSelectedRowKeys } = props; | |
| 1370 | + const pane = app.panes.filter(paneTmp => paneTmp.key === sTabId)[0]; | |
| 1371 | + const { notCurrentPane } = pane; | |
| 1372 | + | |
| 1373 | + let setProcessTitle = commonFunc.showMessage(app.commonConst, "setProcess"); //选择工序标题 | |
| 1374 | + | |
| 1375 | + let chooseProdutProcessType = {}; | |
| 1376 | + let chooseProdutProcessConfig = {}; | |
| 1377 | + if (commonUtils.isNotEmptyObject(productProcessChooseData)) { | |
| 1378 | + chooseProdutProcessConfig = masterConfig.gdsconfigformslave.find(item => item.sControlName === "BtnChooseProductProcess") || {}; | |
| 1379 | + setProcessTitle = chooseProdutProcessConfig.showName || setProcessTitle; | |
| 1380 | + const { sMenuName, sName, sId, sModelType } = productProcessChooseData; | |
| 1381 | + | |
| 1382 | + let slaveFinalData = []; | |
| 1383 | + let slaveFinalSelectedRowKeys =[]; | |
| 1384 | + if (commonUtils.isNotEmptyArr(props.slaveData)) { | |
| 1385 | + slaveFinalData = JSON.parse(JSON.stringify(props.slaveData)); | |
| 1386 | + if (commonUtils.isNotEmptyArr(slaveFinalData) && slaveFinalData.length > 0) { | |
| 1387 | + slaveFinalData.forEach((item) => { | |
| 1388 | + item.sSlaveId = commonUtils.createSid(); /* 添加成品工序从表 */ | |
| 1389 | + }); | |
| 1390 | + } | |
| 1391 | + /* 选择成品工序 只有一条从表 则默认选中 */ | |
| 1392 | + if(slaveFinalData.length ===1){ | |
| 1393 | + slaveFinalSelectedRowKeys.push(slaveFinalData[0].sSlaveId); | |
| 1394 | + } | |
| 1395 | + | |
| 1396 | + } | |
| 1397 | + | |
| 1398 | + let slaveFinalConfig = {}; | |
| 1399 | + if (commonUtils.isNotEmptyObject(props.slaveConfig)) { | |
| 1400 | + slaveFinalConfig = JSON.parse(JSON.stringify(props.slaveConfig)); | |
| 1401 | + slaveFinalConfig.bMutiSelect = true; | |
| 1402 | + } | |
| 1403 | + | |
| 1404 | + chooseProdutProcessType = { | |
| 1405 | + app: { | |
| 1406 | + ...props.app, | |
| 1407 | + currentPane: { | |
| 1408 | + name: 'chooseProductProcess', | |
| 1409 | + config: chooseProdutProcessConfig, | |
| 1410 | + conditonValues: props.getSqlCondition(chooseProdutProcessConfig), | |
| 1411 | + title: sMenuName, | |
| 1412 | + route: sName, | |
| 1413 | + formId: sId, | |
| 1414 | + key: sModelsId + sId, | |
| 1415 | + sModelsType: 'search/finalProcess', | |
| 1416 | + select: props.onSelectProductProcessNew, /* 选择成品工序 */ | |
| 1417 | + selectCancel: props.onCancelModal.bind(this, 'productProcessChooseVisible'), | |
| 1418 | + }, | |
| 1419 | + }, | |
| 1420 | + slaveFinalConfig, | |
| 1421 | + slaveFinalColumn: props.slaveColumn, | |
| 1422 | + slaveFinalData, | |
| 1423 | + slaveFinalSelectedRowKeys, | |
| 1424 | + dispatch: props.dispatch, | |
| 1425 | + fatherModelsType: props.sModelsType, | |
| 1426 | + content: props.content, | |
| 1427 | + id: new Date().getTime().toString(), | |
| 1428 | + }; | |
| 1429 | + } | |
| 1430 | + | |
| 1431 | + const onCancel = () => { | |
| 1432 | + props.onSaveState({ productProcessChooseVisible: false }); | |
| 1433 | + }; | |
| 1434 | + | |
| 1435 | + return ( | |
| 1436 | + <AntdDraggableModal | |
| 1437 | + width={1300} | |
| 1438 | + title={setProcessTitle} | |
| 1439 | + visible={notCurrentPane ? false : productProcessChooseVisible} | |
| 1440 | + onCancel={onCancel} | |
| 1441 | + footer={null} | |
| 1442 | + > | |
| 1443 | + <CommonListSelectProductProcess {...chooseProdutProcessType} productProcess /> | |
| 1444 | + </AntdDraggableModal> | |
| 1445 | + ); | |
| 1446 | +}; | |
| 1447 | + | |
| 1448 | + | |
| 1449 | +// 选择成品工序弹窗 | |
| 1450 | +const ProductMaterialsChooseModal = props => { | |
| 1451 | + const { productMaterialsChooseVisible } = props; | |
| 1452 | + if (!productMaterialsChooseVisible) return ""; | |
| 1453 | + | |
| 1454 | + const { app, sModelsId, sModelsType, sTabId, content, productMaterialsChooseData, masterConfig, processData, controlSelectedRowKeys } = props; | |
| 1455 | + const pane = app.panes.filter(paneTmp => paneTmp.key === sTabId)[0]; | |
| 1456 | + const { notCurrentPane } = pane; | |
| 1457 | + | |
| 1458 | + let setMaterialsTitle = ''; //选择工序标题 | |
| 1459 | + | |
| 1460 | + let chooseProductMaterialsType = {}; | |
| 1461 | + let chooseProductMaterialsConfig = {}; | |
| 1462 | + if (commonUtils.isNotEmptyObject(productMaterialsChooseData)) { | |
| 1463 | + chooseProductMaterialsConfig = masterConfig.gdsconfigformslave.find(item => item.sControlName === "BtnChooseProductMaterials") || {}; | |
| 1464 | + setMaterialsTitle = chooseProductMaterialsConfig.showName || setMaterialsTitle; | |
| 1465 | + const { sMenuName, sName, sId, sModelType } = productMaterialsChooseData; | |
| 1466 | + | |
| 1467 | + let slaveFinalData = []; | |
| 1468 | + let slaveFinalSelectedRowKeys =[]; | |
| 1469 | + if (commonUtils.isNotEmptyArr(props.slaveData)) { | |
| 1470 | + slaveFinalData = JSON.parse(JSON.stringify(props.slaveData)); | |
| 1471 | + if (commonUtils.isNotEmptyArr(slaveFinalData) && slaveFinalData.length > 0) { | |
| 1472 | + slaveFinalData.forEach((item) => { | |
| 1473 | + item.sSlaveId = commonUtils.createSid(); /* 添加成品工序从表 */ | |
| 1474 | + }); | |
| 1475 | + } | |
| 1476 | + /* 选择成品工序 只有一条从表 则默认选中 */ | |
| 1477 | + if(slaveFinalData.length ===1){ | |
| 1478 | + slaveFinalSelectedRowKeys.push(slaveFinalData[0].sSlaveId); | |
| 1479 | + } | |
| 1480 | + | |
| 1481 | + } | |
| 1482 | + | |
| 1483 | + let slaveFinalConfig = {}; | |
| 1484 | + if (commonUtils.isNotEmptyObject(props.slaveConfig)) { | |
| 1485 | + slaveFinalConfig = JSON.parse(JSON.stringify(props.slaveConfig)); | |
| 1486 | + slaveFinalConfig.bMutiSelect = true; | |
| 1487 | + } | |
| 1488 | + | |
| 1489 | + chooseProductMaterialsType = { | |
| 1490 | + app: { | |
| 1491 | + ...props.app, | |
| 1492 | + currentPane: { | |
| 1493 | + name: 'productMaterials', | |
| 1494 | + config: chooseProductMaterialsConfig, | |
| 1495 | + conditonValues: props.getSqlCondition(chooseProductMaterialsConfig), | |
| 1496 | + title: sMenuName, | |
| 1497 | + route: sName, | |
| 1498 | + formId: sId, | |
| 1499 | + key: sModelsId + sId, | |
| 1500 | + sModelsType: 'search/finalMaterials', | |
| 1501 | + select: props.onSelectProductMaterialsNew, /* 选择成品工序 */ | |
| 1502 | + selectCancel: props.onCancelModal.bind(this, 'productMaterialsChooseVisible'), | |
| 1503 | + }, | |
| 1504 | + }, | |
| 1505 | + slaveFinalConfig, | |
| 1506 | + slaveFinalColumn: props.slaveColumn, | |
| 1507 | + slaveFinalData, | |
| 1508 | + slaveFinalSelectedRowKeys, | |
| 1509 | + dispatch: props.dispatch, | |
| 1510 | + fatherModelsType: props.sModelsType, | |
| 1511 | + content: props.content, | |
| 1512 | + id: new Date().getTime().toString(), | |
| 1513 | + }; | |
| 1514 | + } | |
| 1515 | + | |
| 1516 | + const onCancel = () => { | |
| 1517 | + props.onSaveState({ productMaterialsChooseVisible: false }); | |
| 1518 | + }; | |
| 1519 | + | |
| 1520 | + return ( | |
| 1521 | + <AntdDraggableModal | |
| 1522 | + width={1300} | |
| 1523 | + title={setMaterialsTitle} | |
| 1524 | + visible={notCurrentPane ? false : productMaterialsChooseVisible} | |
| 1525 | + onCancel={onCancel} | |
| 1526 | + footer={null} | |
| 1527 | + > | |
| 1528 | + <CommonListSelectProductMaterial {...chooseProductMaterialsType} productMaterials /> | |
| 1529 | + </AntdDraggableModal> | |
| 1530 | + ); | |
| 1531 | +}; | |
| 1532 | + | |
| 1282 | 1533 | // 选择材料弹窗 |
| 1283 | 1534 | const MaterialsChooseModal = props => { |
| 1284 | 1535 | const { materialsChooseVisible } = props; | ... | ... |
src/components/Manufacture/WorkOrderPackTableTreeNew/index.js
| ... | ... | @@ -54,6 +54,23 @@ const WorkOrderPackTableTreeNewEvent = props => { |
| 54 | 54 | const processColumn = commonFunc.getHeaderConfig(processConfig); |
| 55 | 55 | tableList.push(["process", processConfig, processColumn]); |
| 56 | 56 | |
| 57 | + // 成品工序表配置 | |
| 58 | + const finishedProcessConfig = commonUtils.isNotEmptyArr(formData.filter(item => item.sGrd?.includes('productProcess'))) ? | |
| 59 | + formData.filter(item => item.sGrd?.includes('productProcess'))[0] : {}; | |
| 60 | + const finishedProcessColumn = commonUtils.isNotEmptyObject(finishedProcessConfig) ? commonFunc.getHeaderConfig(finishedProcessConfig) : false; | |
| 61 | + if(commonUtils.isNotEmptyObject(finishedProcessConfig)) { | |
| 62 | + tableList.push(["finishedProcess", finishedProcessConfig, finishedProcessColumn]); | |
| 63 | + } | |
| 64 | + | |
| 65 | + // 成品材料表配置 | |
| 66 | + let finishedMaterialsConfig = commonUtils.isNotEmptyArr(formData.filter(item => item.sGrd?.includes('productMaterials'))) ? | |
| 67 | + formData.filter(item => item.sGrd?.includes('productMaterials'))[0] : ''; | |
| 68 | + const finishedMaterialsColumn = finishedMaterialsConfig ? commonFunc.getHeaderConfig(finishedMaterialsConfig) : false; | |
| 69 | + if(commonUtils.isNotEmptyObject(finishedProcessConfig)) { | |
| 70 | + tableList.push(["finishedMaterials", finishedMaterialsConfig, finishedMaterialsColumn]); | |
| 71 | + } | |
| 72 | + | |
| 73 | + | |
| 57 | 74 | // 材料表配置 |
| 58 | 75 | const materialsConfig = formData.filter(item => item.sTbName.toUpperCase() === "MftWorkOrderMaterials".toUpperCase())[0]; |
| 59 | 76 | const materialsColumn = commonFunc.getHeaderConfig(materialsConfig); |
| ... | ... | @@ -1396,7 +1413,7 @@ const WorkOrderPackTableTreeNewEvent = props => { |
| 1396 | 1413 | controlData, |
| 1397 | 1414 | controlDelData, |
| 1398 | 1415 | materialsConfig, |
| 1399 | - materials0Data: materialsData, | |
| 1416 | + materials0Data : materialsData, | |
| 1400 | 1417 | materialsDelData, |
| 1401 | 1418 | processConfig, |
| 1402 | 1419 | processData, |
| ... | ... | @@ -3491,6 +3508,7 @@ const controlProps = props => { |
| 3491 | 3508 | const processProps = props => { |
| 3492 | 3509 | const returnProps = {}; |
| 3493 | 3510 | returnProps.onDataRowAdd = ({ name, bFinished, bModalAdd }) => { |
| 3511 | + bModalAdd = bFinished; | |
| 3494 | 3512 | const { masterConfig } = props; |
| 3495 | 3513 | if (bModalAdd === true) { |
| 3496 | 3514 | let iIndex = -1; |
| ... | ... | @@ -3870,7 +3888,9 @@ const processProps = props => { |
| 3870 | 3888 | const materialsProps = props => { |
| 3871 | 3889 | const returnProps = {}; |
| 3872 | 3890 | returnProps.onDataRowAdd = params => { |
| 3873 | - const { bFinished, bModalAdd } = params; | |
| 3891 | + const { bFinished } = params; | |
| 3892 | + let { bModalAdd } = params; | |
| 3893 | + bModalAdd = bFinished | |
| 3874 | 3894 | const { masterConfig } = props; |
| 3875 | 3895 | if (bModalAdd === true) { |
| 3876 | 3896 | let iIndex = -1; |
| ... | ... | @@ -4304,12 +4324,29 @@ const ControlComponent = props => { |
| 4304 | 4324 | |
| 4305 | 4325 | // 其他表布局 |
| 4306 | 4326 | const OtherComponent = props => { |
| 4307 | - const { app, materialsChildInfoList, colorConfig } = props; | |
| 4327 | + const { app, materialsChildInfoList, colorConfig , masterConfig } = props; | |
| 4308 | 4328 | |
| 4309 | 4329 | if (materialsChildInfoList === undefined) return ""; |
| 4310 | 4330 | |
| 4311 | 4331 | const { commonConst } = app; |
| 4312 | 4332 | |
| 4333 | + let bSplitProcess = false; /* 拆分工序 */ | |
| 4334 | + if (commonUtils.isNotEmptyObject(masterConfig)) { | |
| 4335 | + const iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'bSplitProcess'); | |
| 4336 | + if (iIndex > -1) { | |
| 4337 | + bSplitProcess = masterConfig.gdsconfigformslave[iIndex].bVisible; | |
| 4338 | + } | |
| 4339 | + } | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + let bSplitMaterials = false; /* 拆分材料 */ | |
| 4343 | + if (commonUtils.isNotEmptyObject(masterConfig)) { | |
| 4344 | + const iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'bSplitMaterials'); | |
| 4345 | + if (iIndex > -1) { | |
| 4346 | + bSplitMaterials = masterConfig.gdsconfigformslave[iIndex].bVisible; | |
| 4347 | + } | |
| 4348 | + } | |
| 4349 | + | |
| 4313 | 4350 | const [processTabValue, setProcessTabValue] = useState("processInfo"); |
| 4314 | 4351 | const processInfo = commonFunc.showMessage(commonConst, "processInfo"); // 工序信息 |
| 4315 | 4352 | const dailyInfo = commonFunc.showMessage(commonConst, "dailyInfo"); // 日志信息 |
| ... | ... | @@ -4322,6 +4359,9 @@ const OtherComponent = props => { |
| 4322 | 4359 | commonUtils.isNotEmptyObject(commonFunc.showMessage(commonConst, "colorInfo")) ? |
| 4323 | 4360 | commonFunc.showMessage(commonConst, "colorInfo") : '工艺颜色'; // "工艺颜色"; |
| 4324 | 4361 | |
| 4362 | + const productMaterialsInfo = commonFunc.showMessage(app.commonConst, 'productMaterialsInfo');/* 成品材料 */ | |
| 4363 | + const productProcessInfo = commonFunc.showMessage(app.commonConst, 'productProcessInfo');/* 成品工序 */ | |
| 4364 | + | |
| 4325 | 4365 | const [materialsTabValue, setMaterialsTabValue] = useState(12); |
| 4326 | 4366 | |
| 4327 | 4367 | const panelExtra = (type, { selfName, selfId } = {}) => { |
| ... | ... | @@ -4342,6 +4382,7 @@ const OtherComponent = props => { |
| 4342 | 4382 | const radioValue = index + 2 + 10; |
| 4343 | 4383 | return <Radio value={radioValue}>{radioTitle}</Radio>; |
| 4344 | 4384 | })} |
| 4385 | + {bSplitMaterials ? <Radio value={22}>{productMaterialsInfo}</Radio> : ""} | |
| 4345 | 4386 | </Radio.Group> |
| 4346 | 4387 | </div> |
| 4347 | 4388 | ); |
| ... | ... | @@ -4355,7 +4396,7 @@ const OtherComponent = props => { |
| 4355 | 4396 | }} |
| 4356 | 4397 | > |
| 4357 | 4398 | <Radio value={"processInfo"}>{processInfo}</Radio> |
| 4358 | - {/* {bSplitProcess ? <Radio value={3}>{productProcessInfo}</Radio> : ""} */} | |
| 4399 | + {bSplitProcess ? <Radio value={'productProcessInfo'}>{productProcessInfo}</Radio> : ""} | |
| 4359 | 4400 | </Radio.Group> |
| 4360 | 4401 | </div> |
| 4361 | 4402 | ); |
| ... | ... | @@ -4413,19 +4454,21 @@ const OtherComponent = props => { |
| 4413 | 4454 | <Collapse defaultActiveKey={activeKey} onChange={setActiveKey} className={`custom-collapse ${styles.collapse}`}> |
| 4414 | 4455 | <Panel collapsible="header" header={getHeaderIcon("process")} showArrow={false} extra={panelExtra("process")} key="process"> |
| 4415 | 4456 | {processTabValue === "processInfo" && <ProcessComponent {...props} />} |
| 4457 | + { processTabValue === "productProcessInfo" && <ProductProcessComponent {...props} /> } | |
| 4416 | 4458 | </Panel> |
| 4417 | 4459 | |
| 4418 | 4460 | <Panel collapsible="header" header={getHeaderIcon("material")} showArrow={false} extra={panelExtra("material")} key="material"> |
| 4419 | 4461 | <MaterialsComponent {...props} materialsTabValue={materialsTabValue} /> |
| 4462 | + { materialsTabValue === 22 && <ProductMaterialsComponent {...props} /> } | |
| 4420 | 4463 | </Panel> |
| 4421 | 4464 | {materialsChildInfoListFilter.map(tablename => { |
| 4422 | - const { showName } = props[`${tablename}Config`]; | |
| 4465 | + const { sChinese } = props[`${tablename}Config`]; | |
| 4423 | 4466 | return ( |
| 4424 | 4467 | <Panel |
| 4425 | 4468 | collapsible="header" |
| 4426 | 4469 | header={getHeaderIcon(tablename)} |
| 4427 | 4470 | showArrow={false} |
| 4428 | - extra={panelExtra("", { selfName: showName, selfId: tablename })} | |
| 4471 | + extra={panelExtra("", { selfName: sChinese, selfId: tablename })} | |
| 4429 | 4472 | key={tablename} |
| 4430 | 4473 | > |
| 4431 | 4474 | <MaterialsChildComponent {...props} materialsChildName={tablename} /> |
| ... | ... | @@ -4532,6 +4575,86 @@ const ProcessComponent = props => { |
| 4532 | 4575 | } |
| 4533 | 4576 | }; |
| 4534 | 4577 | |
| 4578 | +// 成品工序表 | |
| 4579 | +const ProductProcessComponent = props => { | |
| 4580 | + const { finishedProcessConfig, controlSelectedRowKeys } = props; | |
| 4581 | + if (!finishedProcessConfig) return ""; | |
| 4582 | + | |
| 4583 | + const productProcessTableId = useRef(`productProcessTableId_${commonUtils.createSid()}`); | |
| 4584 | + const { setAdd, setCopy, setDelete } = props.handleGetIcon(); | |
| 4585 | + | |
| 4586 | + const bProcessSort = finishedProcessConfig.gdsconfigformslave.find(item => item.sControlName === "handleSort")?.bVisible || false; | |
| 4587 | + | |
| 4588 | + const baseData = commonBusiness.getTableTypes("process", props); | |
| 4589 | + const finishedProcessPropsType = { | |
| 4590 | + ...baseData, | |
| 4591 | + configName: 'finishedProcess', | |
| 4592 | + config: finishedProcessConfig, | |
| 4593 | + data: props.processFilteNew(props, baseData, 'process', true), | |
| 4594 | + filteredValue: controlSelectedRowKeys, | |
| 4595 | + onFilterData: props.onFilterData, | |
| 4596 | + OnGetFilterData: props.OnGetFilterData, | |
| 4597 | + onKeyDown: props.onKeyDown, | |
| 4598 | + tableProps: { | |
| 4599 | + rowSelection: null, | |
| 4600 | + setAdd, | |
| 4601 | + setCopy, | |
| 4602 | + setDelete, | |
| 4603 | + AutoTableHeight: "100%", | |
| 4604 | + sticky: true, | |
| 4605 | + // sticky: layoutChange ? { offsetHeader: stickyHeight } : true | |
| 4606 | + }, | |
| 4607 | + onDrag: props.onDrag, | |
| 4608 | + isDragAndDrop: false, | |
| 4609 | + setOpterationColumn: "Y", | |
| 4610 | + bModalAdd: true, | |
| 4611 | + dragHandle: bProcessSort && props.enabled, | |
| 4612 | + selfTableHeight: 330, | |
| 4613 | + noVlist: true, | |
| 4614 | + tableId: productProcessTableId.current, | |
| 4615 | + }; | |
| 4616 | + | |
| 4617 | + const getProductProcessTable = () => <StaticEditTable {...finishedProcessPropsType} bFinished bModalAdd />; | |
| 4618 | + | |
| 4619 | + const showLeftConfig = finishedProcessConfig.gdsconfigformslave.find(item => item.sControlName === "bShowLeft"); | |
| 4620 | + | |
| 4621 | + if (showLeftConfig) { | |
| 4622 | + const { iColValue, sChinese: processShowTitle } = showLeftConfig; | |
| 4623 | + | |
| 4624 | + const processTitleWidth = finishedProcessConfig.gdsconfigformslave.find(item => item.sControlName === "titleWidth")?.sDefault; | |
| 4625 | + const commonViewDragableProps = { | |
| 4626 | + ...props, | |
| 4627 | + hideTabsNav: true, | |
| 4628 | + processTitleWidth, | |
| 4629 | + comparedTableId: productProcessTableId.current, | |
| 4630 | + sParamData: [ | |
| 4631 | + { | |
| 4632 | + sParamType: "sWorkOrder", | |
| 4633 | + sParamName: "工单参数", | |
| 4634 | + }, | |
| 4635 | + ], | |
| 4636 | + tableName: "process", | |
| 4637 | + }; | |
| 4638 | + return ( | |
| 4639 | + <Row gutter={[8, 0]}> | |
| 4640 | + <Col span={iColValue} order={1} id={productProcessTableId.current}> | |
| 4641 | + {getProductProcessTable()} | |
| 4642 | + </Col> | |
| 4643 | + <Col span={24 - iColValue} order={2}> | |
| 4644 | + {processShowTitle && ( | |
| 4645 | + <Divider className="workOrderDivider" orientation="center"> | |
| 4646 | + {processShowTitle} | |
| 4647 | + </Divider> | |
| 4648 | + )} | |
| 4649 | + <CommonViewDragable {...commonViewDragableProps} /> | |
| 4650 | + </Col> | |
| 4651 | + </Row> | |
| 4652 | + ); | |
| 4653 | + } else { | |
| 4654 | + return getProductProcessTable(); | |
| 4655 | + } | |
| 4656 | +}; | |
| 4657 | + | |
| 4535 | 4658 | // 材料表 |
| 4536 | 4659 | const MaterialsComponent = props => { |
| 4537 | 4660 | const { materialsInfoList = [], materialsChildInfoList = [], materialsTabValue } = props; |
| ... | ... | @@ -4658,6 +4781,48 @@ const MaterialsComponent = props => { |
| 4658 | 4781 | }); |
| 4659 | 4782 | }; |
| 4660 | 4783 | |
| 4784 | +// 成品材料表 | |
| 4785 | +const ProductMaterialsComponent = props => { | |
| 4786 | + const { finishedMaterialsConfig, controlSelectedRowKeys } = props; | |
| 4787 | + if (!finishedMaterialsConfig) return ""; | |
| 4788 | + | |
| 4789 | + const productMaterialsTableId = useRef(`productMaterialsTableId_${commonUtils.createSid()}`); | |
| 4790 | + const { setAdd, setCopy, setDelete } = props.handleGetIcon(); | |
| 4791 | + | |
| 4792 | + | |
| 4793 | + const baseData = commonBusiness.getTableTypes("materials0", props); | |
| 4794 | + const finishedMaterialsPropsType = { | |
| 4795 | + ...baseData, | |
| 4796 | + configName: 'finishedMaterials', | |
| 4797 | + config: finishedMaterialsConfig, | |
| 4798 | + data: props.materialsFilterNew(props, baseData, 'finishedMaterials', true), | |
| 4799 | + filteredValue: controlSelectedRowKeys, | |
| 4800 | + onFilterData: props.onFilterData, | |
| 4801 | + OnGetFilterData: props.OnGetFilterData, | |
| 4802 | + onKeyDown: props.onKeyDown, | |
| 4803 | + tableProps: { | |
| 4804 | + rowSelection: null, | |
| 4805 | + setAdd, | |
| 4806 | + setCopy, | |
| 4807 | + setDelete, | |
| 4808 | + AutoTableHeight: "100%", | |
| 4809 | + sticky: true, | |
| 4810 | + // sticky: layoutChange ? { offsetHeader: stickyHeight } : true | |
| 4811 | + }, | |
| 4812 | + onDrag: props.onDrag, | |
| 4813 | + isDragAndDrop: false, | |
| 4814 | + setOpterationColumn: "Y", | |
| 4815 | + bModalAdd: true, | |
| 4816 | + selfTableHeight: 330, | |
| 4817 | + noVlist: true, | |
| 4818 | + tableId: productMaterialsTableId.current, | |
| 4819 | + }; | |
| 4820 | + | |
| 4821 | + const getProductMaterialsTable = () => <StaticEditTable {...finishedMaterialsPropsType} bFinished bModalAdd />; | |
| 4822 | + | |
| 4823 | + return getProductMaterialsTable(); | |
| 4824 | +}; | |
| 4825 | + | |
| 4661 | 4826 | // 子材料表 |
| 4662 | 4827 | const MaterialsChildComponent = props => { |
| 4663 | 4828 | const { materialsChildName } = props; | ... | ... |