diff --git a/src/components/AuditInformation/AuditInformation.js b/src/components/AuditInformation/AuditInformation.js index 32be17e..fa5495e 100644 --- a/src/components/AuditInformation/AuditInformation.js +++ b/src/components/AuditInformation/AuditInformation.js @@ -33,7 +33,7 @@ class AuditInformation extends Component { let { masterConfig, canSendMsg } = nextProps; const { userinfo } = app; if (commonUtils.isEmptyArr(masterConfig) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ masterConfig = formData.filter(item => !item.bGrd)[0]; const checkConfig = formData.filter(item => item.bGrd && item.sTbName === 'sysbillcheckresult')[0]; @@ -58,7 +58,7 @@ class AuditInformation extends Component { /** 获取主表数据 */ handleGetData = async (masterConfig, checkConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; await this.props.handleGetDataOne({ name: 'master', configData: masterConfig, condition: { sId, pageSize: '', pageNum: '' } }); const { masterData } = this.props; if (!commonUtils.isEmptyObject(checkConfig) && !commonUtils.isEmptyObject(masterData)) { diff --git a/src/components/Common/CommonBillDeliverEvent.js b/src/components/Common/CommonBillDeliverEvent.js index 04b5d17..3ccafe1 100644 --- a/src/components/Common/CommonBillDeliverEvent.js +++ b/src/components/Common/CommonBillDeliverEvent.js @@ -47,7 +47,7 @@ export default (ChildComponent) => { employeeConfig: employeeConfigOld, } = nextProps; if (commonUtils.isEmptyObject(slaveConfigOld) && formData.length > 0 && (sModelsType !== 'cashier/financialTransfer' && sModelsType !== 'cashier/financialAdjustment' && sModelsType !== 'quality/accident' && sModelsType !== 'purchase/purchaseEnquiry' && sModelsType !== 'complaint/complaint' && sModelsType !== 'print/printLabel' && sModelsType !== 'commonBill/onlyMaster' && formRoute.indexOf('indexOee') === -1)) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; const BtnDesignFunctionConfig = commonUtils.isNotEmptyObject(masterConfig) ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'BtnBsOperation.BtnDesignFunction') : {}; @@ -274,7 +274,7 @@ export default (ChildComponent) => { }); } else if (commonUtils.isEmptyObject(masterConfigOld) && formData.length === 1 && (sModelsType === 'cashier/financialTransfer' || sModelsType === 'purchase/purchaseEnquiry' || sModelsType === 'cashier/financialAdjustment' || sModelsType === 'print/printLabel' || sModelsType === 'complaint/complaint' || sModelsType === 'commonBill/onlyMaster') && formRoute.indexOf('indexOee') === -1) { const config = {}; - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; let addState = {}; @@ -296,7 +296,7 @@ export default (ChildComponent) => { masterConfig, sId, pageLoading: false, ...addState, }); } else if (commonUtils.isEmptyObject(slaveConfigOld) && commonUtils.isEmptyObject(masterConfigOld) && formData.length === 2 && (sModelsType === 'quality/accident') && formRoute.indexOf('indexOee') === -1) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; const slaveConfig = formData.filter(item => item.bGrd && item.sTbName === 'mftqualityaccidentSlave')[0]; @@ -319,7 +319,7 @@ export default (ChildComponent) => { }); } else if (formRoute.indexOf('indexOee') > -1 && commonUtils.isEmptyObject(employeeConfigOld) && commonUtils.isEmptyObject(slaveConfigOld) && formData.length > 0) { if (formRoute === '/indexOee/labelPrint' && commonUtils.isEmpty(slaveConfigOld)) { /* 入库标签打印 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData[0]; const slaveConfig = formData[0]; @@ -507,7 +507,7 @@ export default (ChildComponent) => { /** 获取主表、从表、审核表数据 */ handleGetData = async (masterConfig, slaveConfig, checkConfig, bEditClick) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; await this.props.handleGetDataOne({ name: 'master', configData: masterConfig, condition: { sId, pageSize: '', pageNum: '' }, bEditClick, }); @@ -544,7 +544,7 @@ export default (ChildComponent) => { /* 获取表数据 */ handleGetMemoData = async (controlConfig, materialsConfig, processConfig, colorConfig, packConfig) => { const { currentId, sModelsType } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateControl = await this.props.handleGetDataSet({ name: 'control', configData: controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }); @@ -597,7 +597,7 @@ export default (ChildComponent) => { /* 获取单张表数据 */ handleGetOneMemoData = (memoName, memoConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ if (commonUtils.isNotEmptyObject(sId)) { /* 解决detail数据没有问题 */ this.props.handleGetDataSet({ name: memoName, configData: memoConfig, condition: { sSqlCondition: { sParentId: sId } }, diff --git a/src/components/Common/CommonBillEvent.js b/src/components/Common/CommonBillEvent.js index 3fc2fd8..e8c6bfc 100644 --- a/src/components/Common/CommonBillEvent.js +++ b/src/components/Common/CommonBillEvent.js @@ -79,7 +79,7 @@ export default (ChildComponent) => { slaveInfoList: slaveInfoListOld, } = nextProps; if (commonUtils.isEmptyObject(slaveConfigOld) && formData.length > 0 && (sModelsId === '12710101117024321284220' || (sModelsType !== 'cashier/financialTransfer' && sModelsType !== 'cashier/financialAdjustment' && sModelsType !== 'quality/accident' && sModelsType !== 'purchase/purchaseEnquiry' && sModelsType !== 'complaint/complaint' && sModelsType !== 'print/printLabel' && sModelsType !== 'commonBill/onlyMaster' && (formRoute.indexOf('indexOee') === -1 || formRoute === '/indexOee/commonOeeBill')))) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; const BtnDesignFunctionConfig = commonUtils.isNotEmptyObject(masterConfig) ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'BtnBsOperation.BtnDesignFunction') : {}; @@ -494,7 +494,7 @@ export default (ChildComponent) => { }); } else if (commonUtils.isEmptyObject(masterConfigOld) && formData.length === 1 && (sModelsType === 'cashier/financialTransfer' || sModelsType === 'purchase/purchaseEnquiry' || sModelsType === 'cashier/financialAdjustment' || sModelsType === 'print/printLabel' || sModelsType === 'complaint/complaint' || sModelsType === 'commonBill/onlyMaster') && formRoute.indexOf('indexOee') === -1) { const config = {}; - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; let addState = {}; @@ -516,7 +516,7 @@ export default (ChildComponent) => { masterConfig, sId, pageLoading: false, ...addState, }); } else if (commonUtils.isEmptyObject(slaveConfigOld) && commonUtils.isEmptyObject(masterConfigOld) && formData.length === 2 && (sModelsType === 'quality/accident') && formRoute.indexOf('indexOee') === -1) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; const slaveConfig = formData.filter(item => item.bGrd && item.sTbName === 'mftqualityaccidentSlave')[0]; @@ -551,7 +551,7 @@ export default (ChildComponent) => { // employeeConfig, employeeColumn, masterConfig, ...addState, // }); if (formRoute === '/indexOee/labelPrint' && commonUtils.isEmpty(slaveConfigOld)) { /* 入库标签打印 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData[0]; const slaveConfig = formData[0]; @@ -801,7 +801,7 @@ export default (ChildComponent) => { /* 获取表数据 */ handleGetMemoData = async (controlConfig, materialsConfig, processConfig, colorConfig, packConfig) => { const { currentId, sModelsType } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateControl = await this.props.handleGetDataSet({ name: 'control', configData: controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }); @@ -860,7 +860,7 @@ export default (ChildComponent) => { /* 获取单张表数据 */ handleGetOneMemoData = (memoName, memoConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ if (commonUtils.isNotEmptyObject(sId)) { /* 解决detail数据没有问题 */ this.props.handleGetDataSet({ name: memoName, configData: memoConfig, condition: { sSqlCondition: { sParentId: sId } }, @@ -2290,8 +2290,6 @@ export default (ChildComponent) => { }, onCancel() { }, - okText: '保存', - cancelText: '不保存', }); this.props.onSaveState({ loading: false, @@ -2829,7 +2827,8 @@ export default (ChildComponent) => { /* 上一条、下一条、首条、末条 */ handleSearchData = async (handleType) => { const { - sModelsId, app, currentIndexFlag, currentPageNo, masterData, masterConfig, slaveConfig, checkConfig + sModelsId, app, currentIndexFlag, currentPageNo, masterData, masterConfig, slaveConfig, checkConfig, + sSrcModelsId, } = this.props; let { sBillIdsArray = []} = this.props; let { currentId } = this.props; @@ -2888,7 +2887,7 @@ export default (ChildComponent) => { if(!bExist) { const value = { sClientType: '1', sFilterOrderBy, bFilter, sListFormmasterId, currentPosition, handleType, iCountSum: pages.total, - sUpId: masterData?.sId, + sUpId: masterData?.sId, sParentModelId :sSrcModelsId, }; const url = `${commonConfig.server_host}business/getBusinessDataByIndex?sModelsId=${sModelsId}`; /* 接收返回值 */ diff --git a/src/components/Common/CommonCheckBillEvent.js b/src/components/Common/CommonCheckBillEvent.js index 6ab6158..d1ca1ed 100644 --- a/src/components/Common/CommonCheckBillEvent.js +++ b/src/components/Common/CommonCheckBillEvent.js @@ -72,7 +72,7 @@ export default (ChildComponent) => { employeeConfig: employeeConfigOld, } = nextProps; if (commonUtils.isEmptyObject(slaveConfigOld) && formData.length > 0 && (sModelsType !== 'cashier/financialTransfer' && sModelsType !== 'cashier/financialAdjustment' && sModelsType !== 'quality/accident' && sModelsType !== 'purchase/purchaseEnquiry' && sModelsType !== 'complaint/complaint' && sModelsType !== 'print/printLabel' && sModelsType !== 'commonBill/onlyMaster' && (formRoute.indexOf('indexOee') === -1 || formRoute === '/indexOee/commonOeeBill'))) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; const BtnDesignFunctionConfig = commonUtils.isNotEmptyObject(masterConfig) ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'BtnBsOperation.BtnDesignFunction') : {}; @@ -373,7 +373,7 @@ export default (ChildComponent) => { }); } else if (commonUtils.isEmptyObject(masterConfigOld) && formData.length === 1 && (sModelsType === 'cashier/financialTransfer' || sModelsType === 'purchase/purchaseEnquiry' || sModelsType === 'cashier/financialAdjustment' || sModelsType === 'print/printLabel' || sModelsType === 'complaint/complaint' || sModelsType === 'commonBill/onlyMaster') && formRoute.indexOf('indexOee') === -1) { const config = {}; - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; let addState = {}; @@ -395,7 +395,7 @@ export default (ChildComponent) => { masterConfig, sId, pageLoading: false, ...addState, }); } else if (commonUtils.isEmptyObject(slaveConfigOld) && commonUtils.isEmptyObject(masterConfigOld) && formData.length === 2 && (sModelsType === 'quality/accident') && formRoute.indexOf('indexOee') === -1) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; const slaveConfig = formData.filter(item => item.bGrd && item.sTbName === 'mftqualityaccidentSlave')[0]; @@ -430,7 +430,7 @@ export default (ChildComponent) => { // employeeConfig, employeeColumn, masterConfig, ...addState, // }); if (formRoute === '/indexOee/labelPrint' && commonUtils.isEmpty(slaveConfigOld)) { /* 入库标签打印 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData[0]; const slaveConfig = formData[0]; @@ -618,7 +618,7 @@ export default (ChildComponent) => { /** 获取主表、从表、审核表数据 */ handleGetData = async (masterConfig, slaveConfig, checkConfig, bEditClick) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; const addStateMaster = await this.props.handleGetDataOne({ name: 'master', configData: masterConfig, condition: { sId, pageSize: '', pageNum: '' }, isWait: true, bEditClick, }); @@ -669,7 +669,7 @@ export default (ChildComponent) => { /* 获取表数据 */ handleGetMemoData = async (controlConfig, materialsConfig, processConfig, colorConfig, packConfig) => { const { currentId, sModelsType } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ let addStateControl = {}; if (commonUtils.isNotEmptyObject(controlConfig)) { addStateControl = await this.props.handleGetDataSet({ @@ -732,7 +732,7 @@ export default (ChildComponent) => { /* 获取单张表数据 */ handleGetOneMemoData = (memoName, memoConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ if (commonUtils.isNotEmptyObject(sId)) { /* 解决detail数据没有问题 */ this.props.handleGetDataSet({ name: memoName, configData: memoConfig, condition: { sSqlCondition: { sParentId: sId } }, diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js index 356ca1b..c270fe7 100644 --- a/src/components/Common/CommonComponent/index.js +++ b/src/components/Common/CommonComponent/index.js @@ -2758,15 +2758,17 @@ export default class CommonComponent extends Component { */ floatNumberCheck = (num) => { const dNetPrice = this.props.app?.decimals?.dNetPrice; + const Maximum = commonFunc.showLocalMessage(this.props, 'Maximum', '最多输入${digit}位小数'); const { showConfig } = this.props; const { sName, showName } = showConfig; const digit = sName.includes('Price') && dNetPrice ? dNetPrice : 6; + const Maximun = Maximum.replace('${digit}', digit); if (typeof num === 'string') { num = num.replace('*', ''); } const checkRule = new RegExp(`^(-?\\d+)(\\.?)(\\d{1,${digit}})?$`); if (!checkRule.test(num) && num && num !== '-' && num !== '.') { - message.warning(`【${showName}】【${sName}】最多输入${digit}位小数!`); + message.warning(`【${showName}】【${sName}】${Maximun}`); return undefined; } else { return num; diff --git a/src/components/Common/CommonCostomTabBill.js b/src/components/Common/CommonCostomTabBill.js index 57db879..500eb53 100644 --- a/src/components/Common/CommonCostomTabBill.js +++ b/src/components/Common/CommonCostomTabBill.js @@ -2371,6 +2371,8 @@ class CommonNewBill extends Component { slave6Child1Config, slave6Child1InfoConfig, } = this.props; + const confirmSetting = commonFunc.showLocalMessage(this.props, 'confirmSetting', '请配置按钮的存储过程'); + const confirmSettingParam = commonFunc.showLocalMessage(this.props, 'confirmSettingParam', '请先操作参数运算'); const iIndex = commonUtils.isNotEmptyObject(tableSelectedRowKeys) && commonUtils.isNotEmptyArr(tableData) @@ -2388,7 +2390,7 @@ class CommonNewBill extends Component { showConfig.sControlName.includes("BtnCustom.dSplitworkQty") ) { if (masterData.bFirstCalc !== 1) { - message.error("请先操作参数运算!"); + message.error(confirmSettingParam); return; } this.props.onSaveState({ pageLoading: true }); @@ -2435,7 +2437,7 @@ class CommonNewBill extends Component { }); } } else { - message.error("请正确配置存储过程名称!"); + message.error(confirmSetting); } } else if ( commonUtils.isNotEmptyObject(showConfig) && @@ -2523,7 +2525,7 @@ class CommonNewBill extends Component { }); } } else { - message.error("请正确配置存储过程名称!"); + message.error(confirmSetting); } } }; @@ -2554,7 +2556,7 @@ class CommonNewBill extends Component { // 刷新工单交期 handleRefreshGdjq = async() => { const { currentId, slave2Child0Config, slave2Child0InfoConfig } = this.props; - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; const conditonValues1 = this.props.onGetSqlConditionValues(slave2Child0Config); let returnData1 = await this.props.handleGetDataSet({ name: "slave2Child0", diff --git a/src/components/Common/CommonElementEvent.js b/src/components/Common/CommonElementEvent.js index a2cc6ca..bb48a59 100644 --- a/src/components/Common/CommonElementEvent.js +++ b/src/components/Common/CommonElementEvent.js @@ -35,7 +35,7 @@ export default (ChildComponent) => { eleknifemouldproductConfig: eleknifemouldOldproductConfig, eleteststandarditemConfig: eleteststandardOlditemConfig, } = nextProps; if (commonUtils.isEmptyObject(contactOldConfig) && (sModelsType === 'element/supplyInfo' || sModelsType === 'element/customerInfo') && formData.length > 0) { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; if (sModelsType === 'element/customerInfo') { @@ -91,7 +91,7 @@ export default (ChildComponent) => { } } if (commonUtils.isEmptyObject(supplyOldConfig) && formData.length > 0 && sModelsType === 'element/materialsInfo') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -122,7 +122,7 @@ export default (ChildComponent) => { } /* 印件分类 */ if (commonUtils.isEmptyObject(sisproductclassifyProcessClassifyConfig) && formData.length > 0 && sModelsType === 'element/sisproductclassify') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -147,7 +147,7 @@ export default (ChildComponent) => { }); } if (commonUtils.isEmptyObject(masterConfig) && formData.length > 0 && sModelsType === 'element/processInfo') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -214,7 +214,7 @@ export default (ChildComponent) => { }); } if (commonUtils.isEmptyObject(picFileOldConfig) && formData.length > 0 && sModelsType === 'element/printInfo') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -250,7 +250,7 @@ export default (ChildComponent) => { } // 常用规格信息 commonUtils.isEmptyArr(siscommonstyleproductclassifyColumn) if (commonUtils.isEmptyObject(siscommonstyleproductclassifyConfig) && formData.length > 0 && sModelsType === 'element/siscommonstyle') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -276,7 +276,7 @@ export default (ChildComponent) => { } // 班组信息 if (commonUtils.isEmptyObject(eleemployeeOldConfig) && formData.length > 0 && sModelsType === 'element/teamInfo') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; const masterConfig = formData.filter(item => !item.bGrd && item.sTbName === 'eleteam')[0]; const eleemployeeConfig = formData.filter(item => item.bGrd && item.sTbName === 'eleteamemployee')[0]; const eleemployeeColumn = commonFunc.getHeaderConfig(eleemployeeConfig); @@ -306,7 +306,7 @@ export default (ChildComponent) => { }); } if (commonUtils.isEmptyObject(jurgroupOldConfig) && formData.length > 0 && sModelsType === 'element/sftloginInfo') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -382,7 +382,7 @@ export default (ChildComponent) => { }); } if ((bReceived === undefined || !bReceived) && formData.length > 0 && sModelsType === 'system/sisformulaInfo') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; const masterConfig = formData.filter(item => !item.bGrd && item.sTbName === 'sisformula')[0]; const paramConfig = formData.filter(item => item.bGrd && item.sTbName === 'sisformulaparam')[0]; let customizeParamConfig = commonUtils.isNotEmptyArr(formData.filter(item => item.bGrd && item.sTbName === 'sisformulacustomizeparam')) ? formData.filter(item => item.bGrd && item.sTbName === 'sisformulacustomizeparam')[0] : {}; @@ -553,7 +553,7 @@ export default (ChildComponent) => { }); } if ((bReceived === undefined || !bReceived) && formData.length > 0 && sModelsType === 'element/machineInfo') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; const masterConfig = formData.filter(item => !item.bGrd && item.sTbName === 'elemachine')[0]; let addState = {}; let slaveConfig = {}; @@ -627,7 +627,7 @@ export default (ChildComponent) => { }); } if (commonUtils.isEmptyObject(userOldConfig) && formData.length > 0 && sModelsType === 'element/checkModelInfo') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd && item.sTbName === 'elecheckmodel')[0]; /* bGrd代表是否是表格 */ @@ -662,7 +662,7 @@ export default (ChildComponent) => { }); } if (commonUtils.isEmptyObject(sischeckphaselogininfoOldConfig) && formData.length > 0 && sModelsType === 'element/checkPhaseInfo') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd && item.sTbName === 'sischeckphase')[0]; /* bGrd代表是否是表格 */ @@ -687,7 +687,7 @@ export default (ChildComponent) => { }); } if ((bReceived === undefined || !bReceived) && formData.length > 0 && sModelsType === 'sis/paymentTerms') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; const masterConfig = formData.filter(item => !item.bGrd && item.sTbName === 'sispayment')[0]; const firstRow = masterConfig.gdsconfigformslave.filter(item => item.bVisible && item.sName === 'sName'); @@ -713,7 +713,7 @@ export default (ChildComponent) => { }); } if (commonUtils.isEmptyObject(employeeConfig) && formData.length > 0 && sModelsType === 'element/employeeInfo') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -735,7 +735,7 @@ export default (ChildComponent) => { }); } if (formData.length > 0 && commonUtils.isEmptyObject(sysmsguserOldConfig) && sModelsType === 'smg/sendMailMsg') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; @@ -762,7 +762,7 @@ export default (ChildComponent) => { }); } if (formData.length > 0 && commonUtils.isEmptyObject(masterConfig) && sModelsType === 'sis/monthEndingClosing') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; masterConfig = formData.filter(item => !item.bGrd)[0]; const firstRow = masterConfig.gdsconfigformslave[0]; @@ -784,7 +784,7 @@ export default (ChildComponent) => { } /* 刀模信息 */ if (commonUtils.isEmptyObject(eleknifemouldOldproductConfig) && formData.length > 0 && sModelsType === 'element/knifemouldInfo') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -821,7 +821,7 @@ export default (ChildComponent) => { } /* 检验标准 */ if (commonUtils.isEmptyObject(eleteststandardOlditemConfig) && formData.length > 0 && sModelsType === 'element/eleteststandInfo') { - const sId = currentId || this.props.masterData?.sId || ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ diff --git a/src/components/Common/CommonGroupBillEvent.js b/src/components/Common/CommonGroupBillEvent.js index b82c688..dc151c7 100644 --- a/src/components/Common/CommonGroupBillEvent.js +++ b/src/components/Common/CommonGroupBillEvent.js @@ -64,7 +64,7 @@ export default (ChildComponent) => { } = nextProps; const { masterConfig: masterConfigOld, app } = nextProps; if (commonUtils.isEmptyObject(masterConfigOld) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; const masterConfig = formData.filter(item => !item.bGrd)[0]; const sReasonTitle = commonUtils.isNotEmptyObject(commonFunc.showMessage(app.commonConst, 'sReason'))? @@ -360,7 +360,7 @@ export default (ChildComponent) => { /** 获取主表、从表、审核表数据 */ handleGetData = async (masterConfig, slaveConfig, slave0Config, slave1Config, slave2Config, slave3Config, slave4Config, bEditClick, slave5Config, slave6Config, slave7Config, slave8Config, slave9Config, slave10Config) => { const { currentId, app } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; const { sModelsId, masterData, sModelsType, slaveSelectedRowKeys } = this.props; await this.props.handleGetDataOne({ name: 'master', configData: masterConfig, condition: { sId, pageSize: '', pageNum: '' }, bEditClick }); let addStateSlave = {}; @@ -530,7 +530,7 @@ export default (ChildComponent) => { /* 获取表数据 */ handleGetMemoData = async (slaveConfig, slave0Config, slave1Config, slave2Config, slave3Config, slave4Config) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateSlave = slaveConfig ? await this.props.handleGetDataSet({ name: 'slave', configData: slaveConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }) : ''; @@ -564,7 +564,7 @@ export default (ChildComponent) => { /* 获取单张表数据 */ handleGetOneMemoData = (memoName, memoConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ if (commonUtils.isNotEmptyObject(sId)) { /* 解决detail数据没有问题 */ this.props.handleGetDataSet({ name: memoName, configData: memoConfig, condition: { sSqlCondition: { sParentId: sId } }, diff --git a/src/components/Common/CommonJurisdictionEvent.js b/src/components/Common/CommonJurisdictionEvent.js index bdfdea8..3cce5a9 100644 --- a/src/components/Common/CommonJurisdictionEvent.js +++ b/src/components/Common/CommonJurisdictionEvent.js @@ -22,7 +22,7 @@ export default (ChildComponent) => { formData, currentId, groupConfig, treeData, } = nextProps; let { bReceived } = nextProps; - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; if (commonUtils.isEmptyObject(groupConfig) && bReceived === undefined) { const masterConfig = formData.filter(item => !item.bGrd)[0]; @@ -199,7 +199,7 @@ export default (ChildComponent) => { handleGetSlaveData = (getType, sName, currConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; if (getType === 'One') { this.props.handleGetDataOne({ name: 'master', configData: currConfig, condition: { sId, pageSize: '', pageNum: '' }, diff --git a/src/components/Common/CommonJurisdictionNewEvent.js b/src/components/Common/CommonJurisdictionNewEvent.js index 4ca92ed..d8ca7fe 100644 --- a/src/components/Common/CommonJurisdictionNewEvent.js +++ b/src/components/Common/CommonJurisdictionNewEvent.js @@ -23,7 +23,7 @@ export default (ChildComponent) => { formData, currentId, groupConfig, treeData, formRoute, } = nextProps; let { bReceived } = nextProps; - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; if (commonUtils.isEmptyObject(groupConfig) && bReceived === undefined) { const masterConfig = formData.filter(item => !item.bGrd)[0]; @@ -228,7 +228,7 @@ export default (ChildComponent) => { handleGetSlaveData = (getType, sName, currConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; if (getType === 'One') { this.props.handleGetDataOne({ name: 'master', configData: currConfig, condition: { sId, pageSize: '', pageNum: '' }, diff --git a/src/components/Common/CommonListEditEvent.js b/src/components/Common/CommonListEditEvent.js index d7dac24..cbee204 100644 --- a/src/components/Common/CommonListEditEvent.js +++ b/src/components/Common/CommonListEditEvent.js @@ -65,7 +65,7 @@ export default (ChildComponent) => { } } if (commonUtils.isEmptyObject(slaveConfigOld) && formData.length > 0 && (formRoute.indexOf('/indexOee') > -1 || searchSolution !== undefined)) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const slaveConfig = formData[0]; let addState = {}; diff --git a/src/components/Common/CommonListEvent.js b/src/components/Common/CommonListEvent.js index 72d485c..a361722 100644 --- a/src/components/Common/CommonListEvent.js +++ b/src/components/Common/CommonListEvent.js @@ -65,7 +65,7 @@ export default (ChildComponent) => { } } if (commonUtils.isEmptyObject(slaveConfigOld) && formData.length > 0 && (formRoute.indexOf('/indexOee') > -1 || searchSolution !== undefined)) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const slaveConfig = formData[0]; let addState = {}; diff --git a/src/components/Common/CommonListSelectFlex/index.js b/src/components/Common/CommonListSelectFlex/index.js index 1d544ab..3c37748 100644 --- a/src/components/Common/CommonListSelectFlex/index.js +++ b/src/components/Common/CommonListSelectFlex/index.js @@ -501,8 +501,8 @@ const CommonListComponent = Form.create({ const sProcessParams = commonFunc.showMessage(app.commonConst, 'sProcessParams');/* 选择工艺参数标题 */ const displayLeft = (sModelsType !== 'search/sisColor' && sModelsType !== 'search/commonPopup'); - const BtnSure = commonFunc.showLocalMessage(this.props, 'BtnSure', '确定'); - const BtnCancel = commonFunc.showLocalMessage(this.props, 'BtnCancel', '取消'); + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确定'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); return (
diff --git a/src/components/Common/CommonListSelectMulti/index.js b/src/components/Common/CommonListSelectMulti/index.js index 367cdf2..25d7ad4 100644 --- a/src/components/Common/CommonListSelectMulti/index.js +++ b/src/components/Common/CommonListSelectMulti/index.js @@ -1,23 +1,23 @@ -import React, { Component } from 'react'; -import { DownOutlined } from '@ant-design/icons'; -import { Form } from '@ant-design/compatible'; +import React, { Component } from "react"; +import { DownOutlined } from "@ant-design/icons"; +import { Form } from "@ant-design/compatible"; // import '@ant-design/compatible/assets/index.css'; -import { Layout, Spin, Button, Row, Col, message } from 'antd-v4'; -import CommonListEvent from '@/components/Common/CommonListEvent';/* 继承销售模块业务功能 */ +import { Layout, Spin, Button, Row, Col, message } from "antd-v4"; +import CommonListEvent from "@/components/Common/CommonListEvent"; /* 继承销售模块业务功能 */ // import * as commonUtils from '../../utils/utils'; /* 通用方法 */ -import * as commonFunc from '@/components/Common//commonFunc';/* 通用单据方法 */ /* 通用单据方法 */ +import * as commonFunc from "@/components/Common//commonFunc"; /* 通用单据方法 */ /* 通用单据方法 */ // eslint-disable-next-line import/no-named-as-default -import StaticEditTable from '@/components/Common//CommonTable';/* 可编辑表格 */ -import StaticEditTree from '@/components/Common/Tree/StaticTree'; -import CommonBase from '@/components/Common/CommonBase';/* 获取配置及数据 */ -import * as commonBusiness from '@/components/Common//commonBusiness';/* 单据业务功能 */ -import SearchComponent from '@/components/Common/SearchComponent'; -import AntdDraggableModal from '@/components/Common/AntdDraggableModal'; -import * as commonUtils from '@/utils/utils'; -import ShowType from '@/components/Common/CommonComponent'; -import commonConfig from '@/utils/config'; +import StaticEditTable from "@/components/Common//CommonTable"; /* 可编辑表格 */ +import StaticEditTree from "@/components/Common/Tree/StaticTree"; +import CommonBase from "@/components/Common/CommonBase"; /* 获取配置及数据 */ +import * as commonBusiness from "@/components/Common//commonBusiness"; /* 单据业务功能 */ +import SearchComponent from "@/components/Common/SearchComponent"; +import AntdDraggableModal from "@/components/Common/AntdDraggableModal"; +import * as commonUtils from "@/utils/utils"; +import ShowType from "@/components/Common/CommonComponent"; +import commonConfig from "@/utils/config"; // eslint-disable-next-line no-unused-vars -import stylesIndex from '@/components/Common/CommonListSelectMulti/index.less'; +import stylesIndex from "@/components/Common/CommonListSelectMulti/index.less"; // import DelIcon from '../../assets/delete.svg'; // import DisableDelIcon from '../../assets/disabledelete.svg'; @@ -34,20 +34,18 @@ class CommonList extends Component { }; } componentWillReceiveProps(nextProps) { - const { - slaveData, selectedRowKeys, sModelsType, slaveFilterData, slaveSelectedData, masterConfig, - gdsjurisdiction, - } = nextProps; - if (slaveFilterData === undefined && sModelsType === 'search/sisColor') { + const { slaveData, selectedRowKeys, sModelsType, slaveFilterData, slaveSelectedData, masterConfig, gdsjurisdiction } = nextProps; + if (slaveFilterData === undefined && sModelsType === "search/sisColor") { if (commonUtils.isNotEmptyArr(slaveData) && commonUtils.isNotEmptyArr(selectedRowKeys)) { const slaveFilterData = slaveData.filter(item => selectedRowKeys.includes(item.sSlaveId)); if (commonUtils.isNotEmptyArr(slaveFilterData)) { this.props.onSaveState({ - slaveFilterData, slaveSelectedRowKeys: selectedRowKeys, + slaveFilterData, + slaveSelectedRowKeys: selectedRowKeys, }); } } - } else if (commonUtils.isEmptyArr(slaveFilterData) && sModelsType === 'search/commonPopup') { + } else if (commonUtils.isEmptyArr(slaveFilterData) && sModelsType === "search/commonPopup") { if (commonUtils.isNotEmptyArr(slaveData) && commonUtils.isNotEmptyArr(slaveSelectedData)) { this.props.onSaveState({ slaveFilterData: slaveSelectedData, @@ -57,13 +55,17 @@ class CommonList extends Component { if (masterConfig) { // 过滤存储需要展示的按钮 let btnList = masterConfig.gdsconfigformslave.filter(item => item.bVisible && !item.sName && item.showName && item.sControlName); - btnList = btnList.filter(item => gdsjurisdiction.findIndex(child => item.sControlName === child.sAction) < 0 && (item.sControlName.includes('BtnAdd') || item.sControlName.includes('BtnCopyTo'))); + btnList = btnList.filter( + item => + gdsjurisdiction.findIndex(child => item.sControlName === child.sAction) < 0 && + (item.sControlName.includes("BtnAdd") || item.sControlName.includes("BtnCopyTo")) + ); // 过滤权限 this.setState({ btnList }); } if (this.state.openFlag) { this.setState({ openFlag: false }, () => { - this.props.onButtonClick('BtnRefresh'); + this.props.onButtonClick("BtnRefresh"); }); } } @@ -71,21 +73,21 @@ class CommonList extends Component { onOpenNewTab = () => { this.setState({ openFlag: true }); this.props.onOpenNewTab(); - } + }; /** 确认下单 */ handleSelect = () => { - const { - slaveFilterData, app, processData, controlSelectedRowKeys, - } = this.props; + const { slaveFilterData, app, processData, controlSelectedRowKeys } = this.props; let startIndex = 0; /* 最开始下标 */ const iOrderArr = []; /* 当前控制表选中行下的工序 接着编号 */ - const filterData = commonUtils.isNotEmptyArr(processData) && commonUtils.isNotEmptyArr(controlSelectedRowKeys) ? - processData.filter(item => controlSelectedRowKeys.includes(item.sControlId)) : []; + const filterData = + commonUtils.isNotEmptyArr(processData) && commonUtils.isNotEmptyArr(controlSelectedRowKeys) + ? processData.filter(item => controlSelectedRowKeys.includes(item.sControlId)) + : []; if (commonUtils.isNotEmptyArr(filterData)) { /* 找到最大序号值 接着拍 */ - filterData.forEach((item) => { + filterData.forEach(item => { const iOrder = commonUtils.isNotEmptyNumber(item.iOrder) ? item.iOrder : 0; /* 获取tableData中iOrder最大值 */ iOrderArr.push(iOrder); }); @@ -108,10 +110,11 @@ class CommonList extends Component { }; handleDoubleClickSelect = () => { const { slaveConfig } = this.props; - if (commonUtils.isNotEmptyObject(slaveConfig) && !slaveConfig.bMutiSelect) { // 单选时双击选中数据 + if (commonUtils.isNotEmptyObject(slaveConfig) && !slaveConfig.bMutiSelect) { + // 单选时双击选中数据 this.handleSelect(); } - } + }; /** 关闭 */ handleCancelModal = () => { const { app } = this.props; @@ -125,17 +128,17 @@ class CommonList extends Component { handleTreeSelect = (name, checkedKeys, e) => { this.props.onSelect(name, checkedKeys, e); /* 调用CommonListEvent通用处理 */ }; - handleTableSelectRowChange = (name, selectedRowKeys, changeValue, chooseProcessParams) => { /* 表格行选择 */ + handleTableSelectRowChange = (name, selectedRowKeys, changeValue, chooseProcessParams) => { + /* 表格行选择 */ this.props.onTableSelectRowChange(name, selectedRowKeys); - if (name === 'slave') { /* 选择工序 从表表 */ - const { - [`${name}Data`]: tableData, slaveConfig, fatherModelsType, sModelsType, - } = this.props; + if (name === "slave") { + /* 选择工序 从表表 */ + const { [`${name}Data`]: tableData, slaveConfig, fatherModelsType, sModelsType } = this.props; const { selectedRowKeysLength } = this.props; const { slaveFilterData } = this.props; const oldSlaveFilterData = slaveFilterData === undefined ? [] : JSON.parse(JSON.stringify(slaveFilterData)); const newSlaveFilterData = []; - selectedRowKeys.forEach((key) => { + selectedRowKeys.forEach(key => { const filterDataIndex = oldSlaveFilterData.findIndex(item => item.sSlaveId === key); if (filterDataIndex < 0) { const tableDataIndex = tableData.findIndex(item => item.sSlaveId === key); @@ -144,8 +147,9 @@ class CommonList extends Component { newSlaveFilterData.push({ ...oldSlaveFilterData[filterDataIndex] }); } }); - let sDeliverRemark = ''; - if (sModelsType === 'search/commonPopup') { /* 选择成品库存 改变时候 增加数量信息提示 */ + let sDeliverRemark = ""; + if (sModelsType === "search/commonPopup") { + /* 选择成品库存 改变时候 增加数量信息提示 */ let dChooseProductQty = 0; let dSrcQty = 0; let dMinsQty = 0; /* 欠数 */ @@ -160,19 +164,22 @@ class CommonList extends Component { } this.props.onSaveState({ - slaveFilterData: newSlaveFilterData, sDeliverRemark, + slaveFilterData: newSlaveFilterData, + sDeliverRemark, }); if (chooseProcessParams) { let modalVisible = false; let slaveSelectOneData = {}; let slaveSelectOneDataIndex = -1; if (commonUtils.isNotEmptyArr(tableData)) { - if (selectedRowKeys instanceof Array) { // 多选情况下 - if (commonUtils.isEmpty(selectedRowKeysLength) || (selectedRowKeys.length - selectedRowKeysLength) > 0) { + if (selectedRowKeys instanceof Array) { + // 多选情况下 + if (commonUtils.isEmpty(selectedRowKeysLength) || selectedRowKeys.length - selectedRowKeysLength > 0) { modalVisible = true; } slaveSelectOneDataIndex = tableData.findIndex(item => item.sId === selectedRowKeys[selectedRowKeys.length - 1]); // 多选选择最后一个 - } else { // 单选情况下 + } else { + // 单选情况下 slaveSelectOneDataIndex = tableData.findIndex(item => item.sId === selectedRowKeys); } if (slaveSelectOneDataIndex > -1) { @@ -181,14 +188,14 @@ class CommonList extends Component { } // let masterData = {}; const sProcessParamsSelects = []; - let paramType = ''; + let paramType = ""; if (commonUtils.isNotEmptyObject(slaveSelectOneData) && commonUtils.isNotEmptyObject(fatherModelsType)) { - if (fatherModelsType.includes('manufacture/')) { + if (fatherModelsType.includes("manufacture/")) { paramType = slaveSelectOneData.sWorkOrderParam; if (commonUtils.isNotEmptyObject(slaveSelectOneData.sWorkOrderParam)) { slaveSelectOneData = { ...slaveSelectOneData, ...commonUtils.convertStrToObj(slaveSelectOneData.sWorkOrderParam) }; } - } else if (fatherModelsType.includes('quotation/')) { + } else if (fatherModelsType.includes("quotation/")) { paramType = slaveSelectOneData.sProcessParam; if (commonUtils.isNotEmptyObject(slaveSelectOneData.sProcessParam)) { slaveSelectOneData = { ...slaveSelectOneData, ...commonUtils.convertStrToObj(slaveSelectOneData.sProcessParam) }; @@ -200,36 +207,42 @@ class CommonList extends Component { bisMutiSelect: false, bMutiSelect: false, }; - const gdsconfigformslave = [{ - sId: commonUtils.createSid(), - sName: 'sId', - showName: '主键', - bVisible: false, - iFitWidth: 45, - }, { - sId: commonUtils.createSid(), - sName: 'bSelfCbx', - showName: '选择', - bVisible: true, - iFitWidth: 37, - }, { - sId: commonUtils.createSid(), - sName: 'sParamKey', - showName: '参数主键', - bVisible: false, - iFitWidth: 200, - }, { - sId: commonUtils.createSid(), - sName: 'sParamName', - showName: '参数名', - bVisible: true, - iFitWidth: 230, - }, { - sId: commonUtils.createSid(), - sName: 'sParamValue', - showName: '参数值', - bVisible: true, - }]; + const gdsconfigformslave = [ + { + sId: commonUtils.createSid(), + sName: "sId", + showName: "主键", + bVisible: false, + iFitWidth: 45, + }, + { + sId: commonUtils.createSid(), + sName: "bSelfCbx", + showName: "选择", + bVisible: true, + iFitWidth: 37, + }, + { + sId: commonUtils.createSid(), + sName: "sParamKey", + showName: "参数主键", + bVisible: false, + iFitWidth: 200, + }, + { + sId: commonUtils.createSid(), + sName: "sParamName", + showName: "参数名", + bVisible: true, + iFitWidth: 230, + }, + { + sId: commonUtils.createSid(), + sName: "sParamValue", + showName: "参数值", + bVisible: true, + }, + ]; sParamConfig.gdsconfigformslave = gdsconfigformslave; const sParamColumn = commonFunc.getHeaderConfig(sParamConfig); /* 要把数据以表格的形式显示出来 */ @@ -237,13 +250,13 @@ class CommonList extends Component { const sParamData = []; if (commonUtils.isNotEmptyArr(sParamJsonObj)) { for (const key of Object.keys(sParamJsonObj)) { - if (key.includes('sParam') && !key.includes('DropDown') && !key.includes('Default')) { + if (key.includes("sParam") && !key.includes("DropDown") && !key.includes("Default")) { const obj = {}; obj.sId = commonUtils.createSid(); obj.sParamKey = key; obj.sParamName = sParamJsonObj[key]; /* 找到数字 找到下拉数据源 */ - const num = key.replace(/[^\d]/g, '').trim(); + const num = key.replace(/[^\d]/g, "").trim(); if (Number(num)) { const number = Number(num); const sParamDropDownKey = `sParamDropDown${number}`; @@ -262,10 +275,10 @@ class CommonList extends Component { const iIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === `sParamValue${i.toString()}`); if (iIndex > -1 && !commonUtils.isEmpty(slaveSelectOneData[`sParam${i.toString()}`])) { slaveConfig.gdsconfigformslave[iIndex].showName = slaveSelectOneData[`sParam${i.toString()}`]; - slaveConfig.gdsconfigformslave[iIndex].bVisible = !slaveSelectOneData[`sParam${i.toString()}`].includes('参数值'); + slaveConfig.gdsconfigformslave[iIndex].bVisible = !slaveSelectOneData[`sParam${i.toString()}`].includes("参数值"); /* 判断是否是sql下拉 */ if (!commonUtils.isEmpty(slaveSelectOneData[`sParamDropDown${i.toString()}`])) { - slaveConfig.gdsconfigformslave[iIndex].sDropDownType = 'sql'; + slaveConfig.gdsconfigformslave[iIndex].sDropDownType = "sql"; } // masterData = { ...masterNewData, ...commonUtils.convertStrToObj(slaveFilterData[0].sProcessParam) }; sProcessParamsSelects.push(slaveConfig.gdsconfigformslave[iIndex]); @@ -295,7 +308,7 @@ class CommonList extends Component { sParamData, }); } - } else if (name === 'sParam' && commonUtils.isNotEmptyArr(selectedRowKeys)) { + } else if (name === "sParam" && commonUtils.isNotEmptyArr(selectedRowKeys)) { /* 点击工艺参数列表 根据点击行动态加载配置 */ const { sParamData, sParamConfig } = this.props; /* 找到最后一个选中 */ @@ -304,13 +317,13 @@ class CommonList extends Component { /* 选中数据时 塞入选中行的配置 */ if (iIndex > -1) { const sParamObj = sParamData[iIndex]; - const index = sParamConfig.gdsconfigformslave.findIndex(item => item.sName === 'sParamValue'); + const index = sParamConfig.gdsconfigformslave.findIndex(item => item.sName === "sParamValue"); if (index > -1) { if (commonUtils.isNotEmptyObject(sParamObj.sDropDownData)) { - sParamConfig.gdsconfigformslave[index].sDropDownType = 'const'; + sParamConfig.gdsconfigformslave[index].sDropDownType = "const"; sParamConfig.gdsconfigformslave[index].showDropDown = JSON.stringify(sParamObj.sDropDownData); } else { - sParamConfig.gdsconfigformslave[index].sDropDownType = ''; + sParamConfig.gdsconfigformslave[index].sDropDownType = ""; sParamConfig.gdsconfigformslave[index].showDropDown = undefined; } } @@ -325,20 +338,20 @@ class CommonList extends Component { }); } } - } + }; /* 连续点击 复制选择 */ - handleContinueTableSelectRowChange= (name, selectedRowKeys, changeValue, chooseProcessParams) => { /* 表格行选择 */ + handleContinueTableSelectRowChange = (name, selectedRowKeys, changeValue, chooseProcessParams) => { + /* 表格行选择 */ this.props.onTableSelectRowChange(name, selectedRowKeys); - if (name === 'slave') { /* 选择工序 从表表 */ - const { - [`${name}Data`]: tableData, slaveConfig, fatherModelsType, sModelsType, - } = this.props; + if (name === "slave") { + /* 选择工序 从表表 */ + const { [`${name}Data`]: tableData, slaveConfig, fatherModelsType, sModelsType } = this.props; const { selectedRowKeysLength } = this.props; const { slaveFilterData } = this.props; const oldSlaveFilterData = slaveFilterData === undefined ? [] : JSON.parse(JSON.stringify(slaveFilterData)); let newSlaveFilterData = []; - selectedRowKeys.forEach((key) => { + selectedRowKeys.forEach(key => { const filterDataIndex = oldSlaveFilterData.findIndex(item => item.sSlaveId === key); if (filterDataIndex < 0) { newSlaveFilterData = JSON.parse(JSON.stringify(oldSlaveFilterData)); @@ -347,7 +360,7 @@ class CommonList extends Component { const newRow = JSON.parse(JSON.stringify(tableData[tableDataIndex])); newRow.sId = commonUtils.createSid(); newRow.sSlaveId = newRow.sId; - newRow.handleType = 'add'; + newRow.handleType = "add"; newRow.key = newRow.sId; newSlaveFilterData.push(newRow); } @@ -357,13 +370,14 @@ class CommonList extends Component { const newRow = JSON.parse(JSON.stringify(oldSlaveFilterData[filterDataIndex])); newRow.sId = commonUtils.createSid(); newRow.sSlaveId = newRow.sId; - newRow.handleType = 'add'; + newRow.handleType = "add"; newRow.key = newRow.sId; newSlaveFilterData.push(newRow); } }); - let sDeliverRemark = ''; - if (sModelsType === 'search/commonPopup') { /* 选择成品库存 改变时候 增加数量信息提示 */ + let sDeliverRemark = ""; + if (sModelsType === "search/commonPopup") { + /* 选择成品库存 改变时候 增加数量信息提示 */ let dChooseProductQty = 0; let dSrcQty = 0; let dMinsQty = 0; /* 欠数 */ @@ -377,19 +391,22 @@ class CommonList extends Component { sDeliverRemark = `源单数量:${dSrcQty} 已选数量:${dChooseProductQty} 欠数:${dMinsQty}`; } this.props.onSaveState({ - slaveFilterData: newSlaveFilterData, sDeliverRemark, + slaveFilterData: newSlaveFilterData, + sDeliverRemark, }); if (chooseProcessParams) { let modalVisible = false; let slaveSelectOneData = {}; let slaveSelectOneDataIndex = -1; if (commonUtils.isNotEmptyArr(tableData)) { - if (selectedRowKeys instanceof Array) { // 多选情况下 - if (commonUtils.isEmpty(selectedRowKeysLength) || (selectedRowKeys.length - selectedRowKeysLength) > 0) { + if (selectedRowKeys instanceof Array) { + // 多选情况下 + if (commonUtils.isEmpty(selectedRowKeysLength) || selectedRowKeys.length - selectedRowKeysLength > 0) { modalVisible = true; } slaveSelectOneDataIndex = tableData.findIndex(item => item.sId === selectedRowKeys[selectedRowKeys.length - 1]); // 多选选择最后一个 - } else { // 单选情况下 + } else { + // 单选情况下 slaveSelectOneDataIndex = tableData.findIndex(item => item.sId === selectedRowKeys); } if (slaveSelectOneDataIndex > -1) { @@ -398,14 +415,14 @@ class CommonList extends Component { } // let masterData = {}; const sProcessParamsSelects = []; - let paramType = ''; + let paramType = ""; if (commonUtils.isNotEmptyObject(slaveSelectOneData) && commonUtils.isNotEmptyObject(fatherModelsType)) { - if (fatherModelsType.includes('manufacture/')) { + if (fatherModelsType.includes("manufacture/")) { paramType = slaveSelectOneData.sWorkOrderParam; if (commonUtils.isNotEmptyObject(slaveSelectOneData.sWorkOrderParam)) { slaveSelectOneData = { ...slaveSelectOneData, ...commonUtils.convertStrToObj(slaveSelectOneData.sWorkOrderParam) }; } - } else if (fatherModelsType.includes('quotation/')) { + } else if (fatherModelsType.includes("quotation/")) { paramType = slaveSelectOneData.sProcessParam; if (commonUtils.isNotEmptyObject(slaveSelectOneData.sProcessParam)) { slaveSelectOneData = { ...slaveSelectOneData, ...commonUtils.convertStrToObj(slaveSelectOneData.sProcessParam) }; @@ -417,36 +434,42 @@ class CommonList extends Component { bisMutiSelect: false, bMutiSelect: false, }; - const gdsconfigformslave = [{ - sId: commonUtils.createSid(), - sName: 'sId', - showName: '主键', - bVisible: false, - iFitWidth: 45, - }, { - sId: commonUtils.createSid(), - sName: 'bSelfCbx', - showName: '选择', - bVisible: true, - iFitWidth: 37, - }, { - sId: commonUtils.createSid(), - sName: 'sParamKey', - showName: '参数主键', - bVisible: false, - iFitWidth: 200, - }, { - sId: commonUtils.createSid(), - sName: 'sParamName', - showName: '参数名', - bVisible: true, - iFitWidth: 230, - }, { - sId: commonUtils.createSid(), - sName: 'sParamValue', - showName: '参数值', - bVisible: true, - }]; + const gdsconfigformslave = [ + { + sId: commonUtils.createSid(), + sName: "sId", + showName: "主键", + bVisible: false, + iFitWidth: 45, + }, + { + sId: commonUtils.createSid(), + sName: "bSelfCbx", + showName: "选择", + bVisible: true, + iFitWidth: 37, + }, + { + sId: commonUtils.createSid(), + sName: "sParamKey", + showName: "参数主键", + bVisible: false, + iFitWidth: 200, + }, + { + sId: commonUtils.createSid(), + sName: "sParamName", + showName: "参数名", + bVisible: true, + iFitWidth: 230, + }, + { + sId: commonUtils.createSid(), + sName: "sParamValue", + showName: "参数值", + bVisible: true, + }, + ]; sParamConfig.gdsconfigformslave = gdsconfigformslave; const sParamColumn = commonFunc.getHeaderConfig(sParamConfig); /* 要把数据以表格的形式显示出来 */ @@ -454,13 +477,13 @@ class CommonList extends Component { const sParamData = []; if (commonUtils.isNotEmptyArr(sParamJsonObj)) { for (const key of Object.keys(sParamJsonObj)) { - if (key.includes('sParam') && !key.includes('DropDown') && !key.includes('Default')) { + if (key.includes("sParam") && !key.includes("DropDown") && !key.includes("Default")) { const obj = {}; obj.sId = commonUtils.createSid(); obj.sParamKey = key; obj.sParamName = sParamJsonObj[key]; /* 找到数字 找到下拉数据源 */ - const num = key.replace(/[^\d]/g, '').trim(); + const num = key.replace(/[^\d]/g, "").trim(); if (Number(num)) { const number = Number(num); const sParamDropDownKey = `sParamDropDown${number}`; @@ -479,10 +502,10 @@ class CommonList extends Component { const iIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === `sParamValue${i.toString()}`); if (iIndex > -1 && !commonUtils.isEmpty(slaveSelectOneData[`sParam${i.toString()}`])) { slaveConfig.gdsconfigformslave[iIndex].showName = slaveSelectOneData[`sParam${i.toString()}`]; - slaveConfig.gdsconfigformslave[iIndex].bVisible = !slaveSelectOneData[`sParam${i.toString()}`].includes('参数值'); + slaveConfig.gdsconfigformslave[iIndex].bVisible = !slaveSelectOneData[`sParam${i.toString()}`].includes("参数值"); /* 判断是否是sql下拉 */ if (!commonUtils.isEmpty(slaveSelectOneData[`sParamDropDown${i.toString()}`])) { - slaveConfig.gdsconfigformslave[iIndex].sDropDownType = 'sql'; + slaveConfig.gdsconfigformslave[iIndex].sDropDownType = "sql"; } // masterData = { ...masterNewData, ...commonUtils.convertStrToObj(slaveFilterData[0].sProcessParam) }; sProcessParamsSelects.push(slaveConfig.gdsconfigformslave[iIndex]); @@ -512,7 +535,7 @@ class CommonList extends Component { sParamData, }); } - } else if (name === 'sParam' && commonUtils.isNotEmptyArr(selectedRowKeys)) { + } else if (name === "sParam" && commonUtils.isNotEmptyArr(selectedRowKeys)) { /* 点击工艺参数列表 根据点击行动态加载配置 */ const { sParamData, sParamConfig } = this.props; /* 找到最后一个选中 */ @@ -521,13 +544,13 @@ class CommonList extends Component { /* 选中数据时 塞入选中行的配置 */ if (iIndex > -1) { const sParamObj = sParamData[iIndex]; - const index = sParamConfig.gdsconfigformslave.findIndex(item => item.sName === 'sParamValue'); + const index = sParamConfig.gdsconfigformslave.findIndex(item => item.sName === "sParamValue"); if (index > -1) { if (commonUtils.isNotEmptyObject(sParamObj.sDropDownData)) { - sParamConfig.gdsconfigformslave[index].sDropDownType = 'const'; + sParamConfig.gdsconfigformslave[index].sDropDownType = "const"; sParamConfig.gdsconfigformslave[index].showDropDown = JSON.stringify(sParamObj.sDropDownData); } else { - sParamConfig.gdsconfigformslave[index].sDropDownType = ''; + sParamConfig.gdsconfigformslave[index].sDropDownType = ""; sParamConfig.gdsconfigformslave[index].showDropDown = undefined; } } @@ -542,22 +565,25 @@ class CommonList extends Component { }); } } - } + }; handleCancelProcessParamsModalVisible = () => { this.props.onSaveState({ sProcessParamsModalVisible: false, }); - } + }; handleProcessParamsOk1 = () => { - const { - slaveData, slaveSelectOneDataIndex, slaveFilterData, sProcessParamsSelects, - } = this.props; - let sProcessParamStr = ''; - if (commonUtils.isNotEmptyArr(slaveData) && !commonUtils.isEmpty(slaveSelectOneDataIndex) && commonUtils.isNotEmptyArr(slaveFilterData) && commonUtils.isNotEmptyArr(sProcessParamsSelects)) { + const { slaveData, slaveSelectOneDataIndex, slaveFilterData, sProcessParamsSelects } = this.props; + let sProcessParamStr = ""; + if ( + commonUtils.isNotEmptyArr(slaveData) && + !commonUtils.isEmpty(slaveSelectOneDataIndex) && + commonUtils.isNotEmptyArr(slaveFilterData) && + commonUtils.isNotEmptyArr(sProcessParamsSelects) + ) { // eslint-disable-next-line array-callback-return - sProcessParamsSelects.map((item) => { - let sParamValue = ''; + sProcessParamsSelects.map(item => { + let sParamValue = ""; if (commonUtils.isNotEmptyObject(slaveData[slaveSelectOneDataIndex][item.sName])) { sParamValue = slaveData[slaveSelectOneDataIndex][item.sName]; } @@ -570,17 +596,20 @@ class CommonList extends Component { slaveFilterData, sProcessParamsModalVisible: false, }); - } + }; handleProcessParamsOk = () => { - const { - slaveData, slaveSelectOneDataIndex, slaveFilterData, sProcessParamsSelects, sParamData, - } = this.props; + const { slaveData, slaveSelectOneDataIndex, slaveFilterData, sProcessParamsSelects, sParamData } = this.props; /* 保存时候把sParamData赛道sParam1中 */ - let sProcessParamStr = ''; - if (commonUtils.isNotEmptyArr(slaveData) && !commonUtils.isEmpty(slaveSelectOneDataIndex) && commonUtils.isNotEmptyArr(slaveFilterData) && commonUtils.isNotEmptyArr(sProcessParamsSelects)) { + let sProcessParamStr = ""; + if ( + commonUtils.isNotEmptyArr(slaveData) && + !commonUtils.isEmpty(slaveSelectOneDataIndex) && + commonUtils.isNotEmptyArr(slaveFilterData) && + commonUtils.isNotEmptyArr(sProcessParamsSelects) + ) { // eslint-disable-next-line array-callback-return - sProcessParamsSelects.map((item) => { - let sParamValue = ''; + sProcessParamsSelects.map(item => { + let sParamValue = ""; if (commonUtils.isNotEmptyObject(slaveData[slaveSelectOneDataIndex][item.sName])) { sParamValue = slaveData[slaveSelectOneDataIndex][item.sName]; } @@ -601,18 +630,32 @@ class CommonList extends Component { slaveFilterData, sProcessParamsModalVisible: false, }); - } + }; // ----------------------------数据修改回带end ---------------------------- // - copyTo = (sActiveId) => { + copyTo = sActiveId => { const { - dispatch, masterConfig, masterData, contactData, addressData, slavePagination, - sisproductclassifyProcessClassifyData, machineData, assortData, outsideData, processstyleData, processApsRuleData, - eleemployeeData, elemachineData, eleknifemouldproductData, eleknifemouldfileData, eleteststandarditemData, + dispatch, + masterConfig, + masterData, + contactData, + addressData, + slavePagination, + sisproductclassifyProcessClassifyData, + machineData, + assortData, + outsideData, + processstyleData, + processApsRuleData, + eleemployeeData, + elemachineData, + eleknifemouldproductData, + eleknifemouldfileData, + eleteststandarditemData, slaveSelectedData, } = this.props; const copyTo = {}; const copyToConfig = masterConfig.gdsconfigformslave.filter(item => item.sControlName.includes(name)); - copyTo.name = 'BtnCopyTo'; + copyTo.name = "BtnCopyTo"; copyTo.config = copyToConfig; copyTo.masterData = slaveSelectedData[0] || masterData; copyTo.supplyData = []; @@ -633,21 +676,21 @@ class CommonList extends Component { copyTo.eleknifemouldfileData = eleknifemouldfileData; copyTo.eleteststandarditemData = eleteststandarditemData; dispatch({ - type: 'content/onRouter', + type: "content/onRouter", payload: { - url: `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sActiveId}?sModelsId=${sActiveId}`, /* 接口地址 */ + url: `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sActiveId}?sModelsId=${sActiveId}` /* 接口地址 */, copyTo, pages: slavePagination, newRecordFlag: `NewRecord_${sActiveId}`, }, }); - } + }; - handleDrag = (data) => { + handleDrag = data => { this.props.onSaveState({ slaveFilterData: data, }); - } + }; handleTableDel = (name, isWait, tableSelectedRowKeys) => { const { slaveSelectedRowKeys } = this.props; @@ -659,14 +702,14 @@ class CommonList extends Component { }); this.props.onDataRowDel(name, isWait, tableSelectedRowKeys); } - } + }; /* 动态参数标题选择框 全选/取消全选 */ handleCheckParamChange = () => { const { sParamData, sParamColumn } = this.props; /* 全选 取消全选功能 */ if (commonUtils.isNotEmptyArr(sParamData)) { /* 标题bSelfCbx加标识 */ - const iIndex = sParamColumn.findIndex(item => item.dataIndex === 'bSelfCbx'); + const iIndex = sParamColumn.findIndex(item => item.dataIndex === "bSelfCbx"); if (iIndex > -1) { let bSelfCbx = false; if (sParamColumn[iIndex].bCheckAll) { @@ -684,13 +727,13 @@ class CommonList extends Component { sParamColumn, }); } - } + }; render() { const { pageLoading } = this.props; return ( -
+
-
+
{ +})(props => { const { form, onReturnForm, @@ -740,23 +783,28 @@ const CommonListComponent = Form.create({ onReturnForm(form); const pagination = { ...slavePagination, - size: 'large', + size: "large", showQuickJumper: true, hideOnSinglePage: false, showTotal: false, simple: true, }; const tableProps = { - ...commonBusiness.getTableTypes('slave', props), + ...commonBusiness.getTableTypes("slave", props), tableProps: { - rowKey: 'sSlaveId', pagination, onChange: props.onTitleChange, chooseProcessParams: true, sModelsType, AutoTableHeight: 350, // chooseProcessParams为选择工序中点击工序名称表格行出现弹窗 + rowKey: "sSlaveId", + pagination, + onChange: props.onTitleChange, + chooseProcessParams: true, + sModelsType, + AutoTableHeight: 350, // chooseProcessParams为选择工序中点击工序名称表格行出现弹窗 }, bContinueClick: true, }; const sParamProps = { - ...commonBusiness.getTableTypes('sParam', props), + ...commonBusiness.getTableTypes("sParam", props), tableProps: { - rowKey: 'sId', + rowKey: "sId", pagination, onChange: props.onTitleChange, sModelsType, @@ -776,17 +824,20 @@ const CommonListComponent = Form.create({ // disableimg: 删除, // }; const deleteSet = { - autoHeight: '100%', - setOpterationColumn: 'Y', + autoHeight: "100%", + setOpterationColumn: "Y", }; let tableFilterProps = { - ...commonBusiness.getTableTypes('slaveFilter', props), + ...commonBusiness.getTableTypes("slaveFilter", props), tableProps: { - rowSelection: null, rowKey: 'sSlaveId', onChange: props.onTitleChange, AutoTableHeight: 350, + rowSelection: null, + rowKey: "sSlaveId", + onChange: props.onTitleChange, + AutoTableHeight: 350, }, onDrag: props.onDrag, }; - if (props.sModelsType && props.sModelsType.includes('modal/searchProcess')) { + if (props.sModelsType && props.sModelsType.includes("modal/searchProcess")) { tableFilterProps = { ...tableFilterProps, ...deleteSet, @@ -800,11 +851,12 @@ const CommonListComponent = Form.create({ enabled: true, }; } - const tableBelone = commonUtils.isNotEmptyObject(app.currentPane) && commonUtils.isNotEmptyObject(app.currentPane.name) && app.currentPane.bEdit ? 'none' : 'list'; + const tableBelone = + commonUtils.isNotEmptyObject(app.currentPane) && commonUtils.isNotEmptyObject(app.currentPane.name) && app.currentPane.bEdit ? "none" : "list"; - const name = 'filterTree'; + const name = "filterTree"; const treeProps = { - ...commonBusiness.getTreeTypes('tree', props), + ...commonBusiness.getTreeTypes("tree", props), isSearch: false, checkable: false, [`${name}Column`]: props[`${name}Column`], @@ -829,17 +881,17 @@ const CommonListComponent = Form.create({ showLine: true, switcherIcon: , }; - const sProcessParams = commonFunc.showMessage(app.commonConst, 'sProcessParams');/* 选择工艺参数标题 */ - const displayLeft = (sModelsType !== 'search/sisColor' && sModelsType !== 'search/commonPopup'); + const sProcessParams = commonFunc.showMessage(app.commonConst, "sProcessParams"); /* 选择工艺参数标题 */ + const displayLeft = sModelsType !== "search/sisColor" && sModelsType !== "search/commonPopup"; const realizeHeight = commonUtils.isNotEmptyNumber(props.realizeHeight) ? props.realizeHeight : 0; - const BtnSure = commonFunc.showLocalMessage(this.props, 'BtnSure', '确定'); - const BtnCancel = commonFunc.showLocalMessage(this.props, 'BtnCancel', '取消'); - const btnClick = (btn) => { + const BtnSure = commonFunc.showLocalMessage(props, "BtnSure", "确定"); + const BtnCancel = commonFunc.showLocalMessage(props, "BtnCancel", "取消"); + const btnClick = btn => { const { sControlName } = btn; - const picArr = slaveConfig.gdsconfigformslave.filter(item => (item.sName === 'picArr')); + const picArr = slaveConfig.gdsconfigformslave.filter(item => item.sName === "picArr"); if (picArr.length) { - const sActiveId = picArr[0] ? picArr[0].sActiveId : ''; - if (sControlName === 'BtnAdd') { + const sActiveId = picArr[0] ? picArr[0].sActiveId : ""; + if (sControlName === "BtnAdd") { const params = { newRecordFlag: `NewRecord_${sActiveId}`, }; @@ -852,9 +904,9 @@ const CommonListComponent = Form.create({ } props.onAdd(params); props.onOpenNewTab(); - } else if (sControlName === 'BtnCopyTo') { + } else if (sControlName === "BtnCopyTo") { if (!Array.isArray(slaveSelectedData) || slaveSelectedData.length !== 1) { - message.warn('请选择一例单据'); // 请选择数据 + message.warn("请选择一例单据"); // 请选择数据 } else { onCopyTo(sActiveId); props.onOpenNewTab(); @@ -862,80 +914,97 @@ const CommonListComponent = Form.create({ } } }; + const filteItem = commonFunc.showLocalMessage(props, "filteItem", "过滤项"); return (
- +
-
+
0 ? `${500 + realizeHeight}px` : 'auto', paddingLeft: '10px' }} + className={realizeHeight <= 0 ? "xly-normal-list" : "xly-normal-list resize-container"} + style={{ height: realizeHeight > 0 ? `${500 + realizeHeight}px` : "auto", paddingLeft: "10px" }} > - {displayLeft ? - 0 ? `${500 + realizeHeight}px` : 'auto' }}> + {displayLeft ? ( + 0 ? `${500 + realizeHeight}px` : "auto" }}>
-
过滤项
+
{filteItem}
- : '' - } - 0 ? `${500 + realizeHeight}px` : 'auto' }} span={sModelsType === 'search/commonPopup' ? 15 : 5}> + + ) : ( + "" + )} + 0 ? `${500 + realizeHeight}px` : "auto" }} + span={sModelsType === "search/commonPopup" ? 15 : 5} + > - 0 ? `${500 + realizeHeight}px` : 'auto' }} span={displayLeft ? 15 : sModelsType === 'search/commonPopup' ? 9 : 19} > - + 0 ? `${500 + realizeHeight}px` : "auto" }} + span={displayLeft ? 15 : sModelsType === "search/commonPopup" ? 9 : 19} + > +
-
+
- { - props.btnList.map(btn => ( - - )) - } + {props.btnList.map(btn => ( + + ))}
- { - commonUtils.isNotEmptyObject(app.currentPane) && commonUtils.isNotEmptyObject(app.currentPane.name) && app.currentPane.bEdit ? -
{props.sDeliverRemark}
: '' - } -
{props.sDeliverRemark}
+ ) : ( + "" + )} +
- - + +
- { - false ? - -
- { commonUtils.isNotEmptyArr(sProcessParamsSelects) && commonUtils.isNotEmptyArr(selectedRowKeys) ? - sProcessParamsSelects.map((child) => { - const sMemo = child.sName.toLowerCase().endsWith('memo'); + {false ? ( + +
+ {commonUtils.isNotEmptyArr(sProcessParamsSelects) && commonUtils.isNotEmptyArr(selectedRowKeys) + ? sProcessParamsSelects.map(child => { + const sMemo = child.sName.toLowerCase().endsWith("memo"); let enabledNew = !child.bReadonly; if (child.iTag === 1) { enabledNew = false; @@ -944,11 +1013,11 @@ const CommonListComponent = Form.create({ } const slaveSelectOneDataIndex = slaveData.findIndex(item => item.sId === selectedRowKeys[selectedRowKeys.length - 1]); // 多选选择最后一个 /* 如果没值 则取默认值 */ - let sDataValue = ''; + let sDataValue = ""; if (commonUtils.isNotEmptyArr(slaveData) && commonUtils.isNotEmptyObject(slaveData[slaveSelectOneDataIndex])) { sDataValue = slaveData[slaveSelectOneDataIndex][child.sName]; - const sDefaultName = child.sName.replace('Value', 'Default'); - let sDefaultValue = ''; + const sDefaultName = child.sName.replace("Value", "Default"); + let sDefaultValue = ""; if (sDefaultName) { sDefaultValue = slaveData[slaveSelectOneDataIndex][sDefaultName]; } @@ -957,7 +1026,7 @@ const CommonListComponent = Form.create({ } } const showTypeProps = { - name: 'slave', + name: "slave", form: props.form, record: slaveData[slaveSelectOneDataIndex], sId: slaveData[slaveSelectOneDataIndex].sId, @@ -979,30 +1048,32 @@ const CommonListComponent = Form.create({ {`${child.showName}:`}
- ); - }) : '' - } -
-
- : '' - } - { - props.sProcessParamsModalVisible ? - -
- -
-
: '' - } + ); + }) + : ""} +
+ + ) : ( + "" + )} + {props.sProcessParamsModalVisible ? ( + +
+ +
+
+ ) : ( + "" + )}
); diff --git a/src/components/Common/CommonListTabEvent.js b/src/components/Common/CommonListTabEvent.js index 5f9fdad..dab0106 100644 --- a/src/components/Common/CommonListTabEvent.js +++ b/src/components/Common/CommonListTabEvent.js @@ -65,7 +65,7 @@ export default (ChildComponent) => { } } if (commonUtils.isEmptyObject(slaveConfigOld) && formData.length > 0 && (formRoute.indexOf('/indexOee') > -1 || searchSolution !== undefined)) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const slaveConfig = formData[0]; let addState = {}; diff --git a/src/components/Common/CommonListTreeEvent.js b/src/components/Common/CommonListTreeEvent.js index 50c8f2f..2fbdec1 100644 --- a/src/components/Common/CommonListTreeEvent.js +++ b/src/components/Common/CommonListTreeEvent.js @@ -58,7 +58,7 @@ export default (ChildComponent) => { let { iPageSize } = nextProps; if (commonUtils.isEmptyObject(slaveConfigOld) && formData.length > 0 && (formRoute.indexOf('/indexOee') > -1 || searchSolution !== undefined)) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const slaveConfig = formData[0]; const addState = {}; diff --git a/src/components/Common/CommonNewBillEvent.js b/src/components/Common/CommonNewBillEvent.js index e36929e..11da830 100644 --- a/src/components/Common/CommonNewBillEvent.js +++ b/src/components/Common/CommonNewBillEvent.js @@ -66,7 +66,7 @@ export default (ChildComponent) => { } = nextProps; const { masterConfig: masterConfigOld, app } = nextProps; if (commonUtils.isEmptyObject(masterConfigOld) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; const masterConfig = formData.filter(item => !item.bGrd)[0]; const sReasonTitle = commonUtils.isNotEmptyObject(commonFunc.showMessage(app.commonConst, 'sReason'))? @@ -593,7 +593,7 @@ export default (ChildComponent) => { /* 获取表数据 */ handleGetMemoData = async (slaveConfig, slave0Config, slave1Config, slave2Config, slave3Config, slave4Config) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateSlave = slaveConfig ? await this.props.handleGetDataSet({ name: 'slave', configData: slaveConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }) : ''; @@ -627,7 +627,7 @@ export default (ChildComponent) => { /* 获取单张表数据 */ handleGetOneMemoData = (memoName, memoConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ if (commonUtils.isNotEmptyObject(sId)) { /* 解决detail数据没有问题 */ this.props.handleGetDataSet({ name: memoName, configData: memoConfig, condition: { sSqlCondition: { sParentId: sId } }, @@ -1935,7 +1935,7 @@ export default (ChildComponent) => { /* 上一条、下一条、首条、末条 */ handleSearchData = async (handleType) => { const { - sModelsId, app, currentIndexFlag, currentPageNo, masterData, + sModelsId, app, currentIndexFlag, currentPageNo, masterData, sSrcModelsId, masterConfig, slaveConfig, slave0Config, slave1Config, slave2Config, slave3Config, slave4Config, } = this.props; let { sBillIdsArray = []} = this.props; @@ -1993,7 +1993,7 @@ export default (ChildComponent) => { if(!bExist) { const value = { sClientType: '1', sFilterOrderBy, bFilter, sListFormmasterId, currentPosition, handleType, iCountSum: pages.total, - sUpId: masterData?.sId, + sUpId: masterData?.sId, sParentModelId :sSrcModelsId, }; const url = `${commonConfig.server_host}business/getBusinessDataByIndex?sModelsId=${sModelsId}`; /* 接收返回值 */ diff --git a/src/components/Common/CommonNewTabBillEvent.js b/src/components/Common/CommonNewTabBillEvent.js index 54b8f11..00c45a2 100644 --- a/src/components/Common/CommonNewTabBillEvent.js +++ b/src/components/Common/CommonNewTabBillEvent.js @@ -65,7 +65,7 @@ export default (ChildComponent) => { } = nextProps; const { masterConfig: masterConfigOld, app } = nextProps; if (commonUtils.isEmptyObject(masterConfigOld) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; const masterConfig = formData.filter(item => !item.bGrd)[0]; const sReasonTitle = commonUtils.isNotEmptyObject(commonFunc.showMessage(app.commonConst, 'sReason'))? @@ -514,7 +514,7 @@ export default (ChildComponent) => { } const { currentId, app } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; const { sModelsId, masterData, sModelsType, slaveSelectedRowKeys } = this.props; const conditonValues = this.handleGetSqlConditionValues(masterConfig) await this.props.handleGetDataOne({ name: 'master', configData: masterConfig, condition: { sSqlCondition: { ...conditonValues }, sId, pageSize: '', pageNum: '' }, bEditClick }); @@ -707,7 +707,7 @@ export default (ChildComponent) => { handleGetData1 = async (configArr, bEditClick, other, isWait) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; let addState = {}; @@ -846,7 +846,7 @@ export default (ChildComponent) => { /* 获取表数据 */ handleGetMemoData = async (slaveConfig, slave0Config, slave1Config, slave2Config, slave3Config, slave4Config) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateSlave = slaveConfig ? await this.props.handleGetDataSet({ name: 'slave', configData: slaveConfig, condition: { sSqlCondition: { ...this.handleGetSqlConditionValues(slaveConfig), sParentId: sId } }, isWait: true, }) : ''; @@ -880,7 +880,7 @@ export default (ChildComponent) => { /* 获取单张表数据 */ handleGetOneMemoData = (memoName, memoConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ if (commonUtils.isNotEmptyObject(sId)) { /* 解决detail数据没有问题 */ this.props.handleGetDataSet({ name: memoName, configData: memoConfig, condition: { sSqlCondition: { ...this.handleGetSqlConditionValues(memoConfig), sParentId: sId } }, diff --git a/src/components/Common/CommonProductionPlanEvent.js b/src/components/Common/CommonProductionPlanEvent.js index e9c1cec..e8fad58 100644 --- a/src/components/Common/CommonProductionPlanEvent.js +++ b/src/components/Common/CommonProductionPlanEvent.js @@ -34,7 +34,7 @@ export default (ChildComponent) => { const { otherCondition } = currentPane; if (formData.length > 0 && commonUtils.isEmptyObject(teamConfig) && commonUtils.isEmptyArr(searchSolution)) { isReceive = false; - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; const masterConfig = formData.filter(item => !item.bGrd && item.sTbName === 'eleteam')[0]; teamConfig = formData.filter(item => item.sTbName === 'Sp_Manufacture_ProductionPlanInfo_WorkCenter')[0]; diff --git a/src/components/Common/CommonProductionPlanOutsideEvent.js b/src/components/Common/CommonProductionPlanOutsideEvent.js index bce67fd..423fa53 100644 --- a/src/components/Common/CommonProductionPlanOutsideEvent.js +++ b/src/components/Common/CommonProductionPlanOutsideEvent.js @@ -36,7 +36,7 @@ export default (ChildComponent) => { const { otherCondition } = currentPane; if (formData.length > 0 && commonUtils.isEmptyObject(teamConfig) && commonUtils.isEmptyArr(searchSolution)) { isReceive = false; - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; const masterConfig = formData.filter(item => !item.bGrd && item.sTbName === 'eleteam')[0]; teamConfig = formData.filter(item => item.sTbName === 'Sp_Manufacture_ProductionPlanInfo_WorkCenter2')[0]; diff --git a/src/components/Common/CommonProductionPlanTreeEvent.js b/src/components/Common/CommonProductionPlanTreeEvent.js index 0ed2ad5..e5ae932 100644 --- a/src/components/Common/CommonProductionPlanTreeEvent.js +++ b/src/components/Common/CommonProductionPlanTreeEvent.js @@ -102,7 +102,7 @@ export default (ChildComponent) => { const { otherCondition } = currentPane; if (formData.length > 0 && !treeLoaded && searchSolution !== undefined) { isReceive = false; - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; const masterConfig = formData.filter(item => !item.bGrd && item.sTbName === 'eleteam')[0]; treeLoaded = true; // teamConfig = formData.filter(item => item.sTbName === 'Sp_Manufacture_ProductionPlanInfo_WorkCenter')[0]; diff --git a/src/components/Common/CommonSubBillEvent.js b/src/components/Common/CommonSubBillEvent.js index 4c99c2e..abc7bad 100644 --- a/src/components/Common/CommonSubBillEvent.js +++ b/src/components/Common/CommonSubBillEvent.js @@ -51,7 +51,7 @@ export default (ChildComponent) => { employeeConfig: employeeConfigOld, } = nextProps; if (commonUtils.isEmptyObject(slaveConfigOld) && formData.length > 0 && (sModelsType !== 'cashier/financialTransfer' && sModelsType !== 'cashier/financialAdjustment' && sModelsType !== 'quality/accident' && sModelsType !== 'purchase/purchaseEnquiry' && sModelsType !== 'complaint/complaint' && sModelsType !== 'print/printLabel' && sModelsType !== 'commonBill/onlyMaster' && formRoute.indexOf('indexOee') === -1)) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; const BtnDesignFunctionConfig = commonUtils.isNotEmptyObject(masterConfig) ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'BtnBsOperation.BtnDesignFunction') : {}; @@ -506,7 +506,7 @@ export default (ChildComponent) => { }); } else if (commonUtils.isEmptyObject(masterConfigOld) && formData.length === 1 && (sModelsType === 'cashier/financialTransfer' || sModelsType === 'purchase/purchaseEnquiry' || sModelsType === 'cashier/financialAdjustment' || sModelsType === 'print/printLabel' || sModelsType === 'complaint/complaint' || sModelsType === 'commonBill/onlyMaster') && formRoute.indexOf('indexOee') === -1) { const config = {}; - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; let addState = {}; @@ -528,7 +528,7 @@ export default (ChildComponent) => { masterConfig, sId, pageLoading: false, ...addState, }); } else if (commonUtils.isEmptyObject(slaveConfigOld) && commonUtils.isEmptyObject(masterConfigOld) && formData.length === 2 && (sModelsType === 'quality/accident') && formRoute.indexOf('indexOee') === -1) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; const slaveConfig = formData.filter(item => item.bGrd && item.sTbName === 'mftqualityaccidentSlave')[0]; @@ -551,7 +551,7 @@ export default (ChildComponent) => { }); } else if (formRoute.indexOf('indexOee') > -1 && commonUtils.isEmptyObject(employeeConfigOld) && commonUtils.isEmptyObject(slaveConfigOld) && formData.length > 0) { if (formRoute === '/indexOee/labelPrint' && commonUtils.isEmpty(slaveConfigOld)) { /* 入库标签打印 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData[0]; const slaveConfig = formData[0]; @@ -745,7 +745,7 @@ export default (ChildComponent) => { /** 获取主表、从表、审核表数据 */ handleGetData = async (masterConfig, slaveConfig, checkConfig, bEditClick) => { const { currentId, sModelsId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; await this.props.handleGetDataOne({ name: 'master', configData: masterConfig, condition: { sId, pageSize: '', pageNum: '' }, bEditClick, }); @@ -786,7 +786,7 @@ export default (ChildComponent) => { /* 获取表数据 */ handleGetMemoData = async (controlConfig, materialsConfig, processConfig, colorConfig, packConfig) => { const { currentId, sModelsType } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateControl = await this.props.handleGetDataSet({ name: 'control', configData: controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }); @@ -839,7 +839,7 @@ export default (ChildComponent) => { /* 获取单张表数据 */ handleGetOneMemoData = (memoName, memoConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ if (commonUtils.isNotEmptyObject(sId)) { /* 解决detail数据没有问题 */ this.props.handleGetDataSet({ name: memoName, configData: memoConfig, condition: { sSqlCondition: { sParentId: sId } }, @@ -849,7 +849,7 @@ export default (ChildComponent) => { handleGetMemoData1 = async (memoDataList, isWait) => { const { currentId, sModelsType, sModelsId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ let addState = {}; // eslint-disable-next-line no-plusplus for (let i = 0; i < memoDataList.length; i++) { @@ -2815,7 +2815,7 @@ export default (ChildComponent) => { handleSearchData = async (handleType) => { const { sModelsId, app, currentIndexFlag, currentPageNo, slaveChildConfig, memoDataList, masterData, - masterConfig, slaveConfig, checkConfig, + masterConfig, slaveConfig, checkConfig, sSrcModelsId, } = this.props; let { sBillIdsArray = []} = this.props; let { currentId } = this.props; @@ -2868,7 +2868,7 @@ export default (ChildComponent) => { if(!bExist) { const value = { sClientType: '1', sFilterOrderBy, bFilter, sListFormmasterId, currentPosition, handleType, iCountSum: pages.total, - sUpId: masterData?.sId, + sUpId: masterData?.sId, sParentModelId :sSrcModelsId, }; const url = `${commonConfig.server_host}business/getBusinessDataByIndex?sModelsId=${sModelsId}`; /* 接收返回值 */ diff --git a/src/components/Common/CommonSystemSettingEvent.js b/src/components/Common/CommonSystemSettingEvent.js index 99db9cc..899168a 100644 --- a/src/components/Common/CommonSystemSettingEvent.js +++ b/src/components/Common/CommonSystemSettingEvent.js @@ -23,7 +23,7 @@ export default (ChildComponent) => { const { formData, currentId } = nextProps; let { masterConfig } = nextProps; if (commonUtils.isEmptyArr(masterConfig) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; masterConfig = formData.filter(item => !item.bGrd)[0]; const sysaccountperiodConfig = formData.filter(item => item.bGrd && item.sTbName === 'sysaccountperiod')[0]; const sysaccountperiodColumn = commonFunc.getHeaderConfig(sysaccountperiodConfig); @@ -58,7 +58,7 @@ export default (ChildComponent) => { } handleGetData = (masterConfig, sysaccountperiodConfig, sysbillnosettingsConfig, syspushMsgConfig) => { const { currentId, year } = this.props; - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; const condition = { sSqlCondition: { sParentId: masterConfig.sId, diff --git a/src/components/Common/CommonTable/index.js b/src/components/Common/CommonTable/index.js index 3a4216d..3f99b62 100644 --- a/src/components/Common/CommonTable/index.js +++ b/src/components/Common/CommonTable/index.js @@ -6987,6 +6987,7 @@ class CommonTableRc extends React.Component { } const hasColorInfo = this.props?.masterConfig?.sTableColorTs; + const BtnUpload = commonFunc.showLocalMessage(this.props, "BtnUpload", "上传"); return ( @@ -7009,7 +7010,7 @@ class CommonTableRc extends React.Component { this.uploadRef.setAttribute('contenteditable', "true"); }} > - 上传 + {BtnUpload} : null } diff --git a/src/components/Common/MakeUpPDF/index.js b/src/components/Common/MakeUpPDF/index.js index 6926fb0..60327aa 100644 --- a/src/components/Common/MakeUpPDF/index.js +++ b/src/components/Common/MakeUpPDF/index.js @@ -226,6 +226,8 @@ const MakeUpPDF = baseProps => { }; const tabsConfig = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible && item.sControlName); + const tabOrderInfomation = commonFunc.showLocalMessage(props, "tabOrderInfomation", "订单信息"); + const tabPlatemakingProgress = commonFunc.showLocalMessage(props, "tabPlatemakingProgress", "拼版进度"); return ( { ), }} items={[ - { label: "订单信息", key: "100", children: }, - { label: "拼板进度", key: "200", children: }, + { label: tabOrderInfomation, key: "100", children: }, + { label: tabPlatemakingProgress, key: "200", children: }, ...tabsConfig.map((config, index) => { const { showName, sName } = config; const fileUrl = masterData[sName]; diff --git a/src/components/Common/ToolBar/ToolBarNew.js b/src/components/Common/ToolBar/ToolBarNew.js index c97234a..840ad68 100644 --- a/src/components/Common/ToolBar/ToolBarNew.js +++ b/src/components/Common/ToolBar/ToolBarNew.js @@ -1281,9 +1281,10 @@ class ToolBarComponent extends Component { loading: true, }); const { sModelsId, masterData, slaveData, slaveDelData: slaveDelDataOld, app } = this.props; + const confirmSetting = commonFunc.showLocalMessage(this.props, 'confirmSetting', '请配置按钮的存储过程'); const btnConfig = this.props.masterConfig.gdsconfigformslave.filter(item => item.sControlName === "BtnCommonImport")[0]; // sButtonEnabled sButtonParam if (!commonUtils.isNotEmptyObject(btnConfig) || !commonUtils.isNotEmptyStr(btnConfig.sButtonParam)) { - message.error("请配置按钮的存储过程"); + message.error(confirmSetting); this.props.onSaveState({ loading: false, }); @@ -1527,6 +1528,7 @@ class ToolBarComponent extends Component { const bInvalidCancel = commonFunc.showLocalMessage(this.props, 'bInvalidCancel', '确定要作废'); + const confirmSetting = commonFunc.showLocalMessage(this.props, 'confirmSetting', '请配置按钮的存储过程'); /* 新增 */ if (key === "BtnAdd") { /* 增加 */ @@ -2354,7 +2356,7 @@ class ToolBarComponent extends Component { loading: false, }); } else { - message.error("请配置按钮的存储过程"); + message.error(confirmSetting); this.props.onSaveState({ loading: false, }); diff --git a/src/components/CommonElementEvent/FilfileManageInfo.js b/src/components/CommonElementEvent/FilfileManageInfo.js index 32ad854..aeb8a20 100644 --- a/src/components/CommonElementEvent/FilfileManageInfo.js +++ b/src/components/CommonElementEvent/FilfileManageInfo.js @@ -193,6 +193,8 @@ const FilfileManageComponent = Form.create({ tableProps: { setUpload: true, setDownload: true }, enabled: true, }; + const BtnSure = commonFunc.showLocalMessage(props, "BtnSure", "确定"); + const BtnCancel = commonFunc.showLocalMessage(props, "BtnCancel", "取消"); return (
@@ -204,8 +206,8 @@ const FilfileManageComponent = Form.create({
- - + +
diff --git a/src/components/CommonElementEvent/SftLoginInfo.js b/src/components/CommonElementEvent/SftLoginInfo.js index 96d6aef..f4c5eb1 100644 --- a/src/components/CommonElementEvent/SftLoginInfo.js +++ b/src/components/CommonElementEvent/SftLoginInfo.js @@ -59,7 +59,8 @@ const SftLoginComponent = Form.create({ const tabDrivergroup = commonFunc.showMessage(app.commonConst, 'tabDrivergroup');/* 司机查看权限 */ const tabDepartgroup = commonFunc.showMessage(app.commonConst, 'tabDepartgroup');/* 部门查看权限 */ const tabApproveGroup = commonFunc.showMessage(app.commonConst, 'sftlogininfoCheck');/* 审核组权限 */ - const tabBrandgroup = '分管公司权限'; + const tabCompanyAuthority = commonFunc.showLocalMessage(this.props, 'tabCompanyAuthority', '分管公司权限'); + const tabBrandgroup = tabCompanyAuthority; return (
diff --git a/src/components/Manufacture/ProcessCard/ProcessCard.js b/src/components/Manufacture/ProcessCard/ProcessCard.js index 40c8873..b9dfd5c 100644 --- a/src/components/Manufacture/ProcessCard/ProcessCard.js +++ b/src/components/Manufacture/ProcessCard/ProcessCard.js @@ -55,7 +55,7 @@ class ProcessCard extends Component { } = nextProps; const { formData, currentId } = nextProps; if (commonUtils.isEmptyArr(controlColumn) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -136,7 +136,7 @@ class ProcessCard extends Component { } // // 未清复制到时,产品ID需要再获取动态部件 - // const sId = currentId !== undefined ? currentId : ''; + // const sId = currentId || nextProps.masterData?.sId || ''; // if (sId === '' && commonUtils.isNotEmptyObject(this.props.masterData) && !this.props.bGetPartsData) { // const { sAllPartsName } = this.props.masterData; // if (sAllPartsName !== undefined) { @@ -164,7 +164,7 @@ class ProcessCard extends Component { /* 获取表数据 */ handleGetData = async (controlConfig, materialsConfig, processConfig, colorConfig, dailyConfig, extraState = {}) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateControl = await this.props.handleGetDataSet({ name: 'control', configData: controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }); diff --git a/src/components/Manufacture/ProcessCardPack/ProcessCardPack.js b/src/components/Manufacture/ProcessCardPack/ProcessCardPack.js index 5cd2789..dccbdba 100644 --- a/src/components/Manufacture/ProcessCardPack/ProcessCardPack.js +++ b/src/components/Manufacture/ProcessCardPack/ProcessCardPack.js @@ -80,7 +80,7 @@ class ProcessCardPack extends Component { } = nextProps; const { formData, currentId } = nextProps; if (commonUtils.isEmptyArr(controlColumn) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -210,7 +210,7 @@ class ProcessCardPack extends Component { } } // // 未清复制到时,产品ID需要再获取动态部件; - // const sId = currentId !== undefined ? currentId : ''; + // const sId = currentId || nextProps.masterData?.sId || ''; // if (sId === '' && commonUtils.isNotEmptyObject(this.props.masterData) && !this.props.bGetPartsData) { // const { sAllPartsName } = this.props.masterData; // if (sAllPartsName !== undefined) { @@ -287,7 +287,7 @@ class ProcessCardPack extends Component { /* 获取表数据 */ handleGetData = async (controlConfig, materialsConfig, processConfig, colorConfig, dailyConfig, packConfig, extraState = {}) => { const { currentId, slaveData } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateControl = await this.props.handleGetDataSet({ name: 'control', configData: controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }); diff --git a/src/components/Manufacture/ProcessCardPack/ProcessCardPackTableTree.js b/src/components/Manufacture/ProcessCardPack/ProcessCardPackTableTree.js index a3d33f6..b8e87d0 100644 --- a/src/components/Manufacture/ProcessCardPack/ProcessCardPackTableTree.js +++ b/src/components/Manufacture/ProcessCardPack/ProcessCardPackTableTree.js @@ -98,7 +98,7 @@ class ProcessCardPackTableTree extends Component { } = nextProps; const { formData, currentId } = nextProps; if (commonUtils.isEmptyArr(controlColumn) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; if(masterConfig && masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'bLayout')[0]) { @@ -273,7 +273,7 @@ class ProcessCardPackTableTree extends Component { }); } // // 未清复制到时,产品ID需要再获取动态部件; - // const sId = currentId !== undefined ? currentId : ''; + // const sId = currentId || nextProps.masterData?.sId || ''; // if (sId === '' && commonUtils.isNotEmptyObject(this.props.masterData) && !this.props.bGetPartsData) { // const { sAllPartsName } = this.props.masterData; // if (sAllPartsName !== undefined) { @@ -426,7 +426,7 @@ class ProcessCardPackTableTree extends Component { /* 获取表数据 */ handleGetData1 = async (controlConfig, materialsConfig, processConfig, colorConfig, dailyConfig, packConfig, extraState = {}, configMap) => { const { currentId, slaveData, masterData } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateControl = await this.props.handleGetDataSet({ name: 'control', configData: controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }); @@ -703,7 +703,7 @@ class ProcessCardPackTableTree extends Component { /* 获取表数据 */ handleGetData = async (controlConfig, materialsConfig, processConfig, colorConfig, dailyConfig, packConfig, extraState = {}, configMap) => { const { currentId, slaveData } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ this.handleGetAllData(controlConfig, processConfig, sId, materialsConfig, colorConfig, dailyConfig, packConfig, extraState, configMap); }; @@ -711,7 +711,7 @@ class ProcessCardPackTableTree extends Component { handleGetOtherData = async (tableList, childTableList, configMap) => { const { currentId, slaveData, sModelsType, masterData } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ if(commonUtils.isNotEmptyObject(configMap)){ for (const configName of Object.keys(configMap)) { const tableName = configName.replace('Config', '').trim(); diff --git a/src/components/Manufacture/WorkOrder/WorkOrder.js b/src/components/Manufacture/WorkOrder/WorkOrder.js index 239f283..b165e32 100644 --- a/src/components/Manufacture/WorkOrder/WorkOrder.js +++ b/src/components/Manufacture/WorkOrder/WorkOrder.js @@ -100,7 +100,7 @@ class WorkOrder extends Component { } = nextProps; const { formData, currentId } = nextProps; if (commonUtils.isEmptyArr(controlColumn) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -167,7 +167,7 @@ class WorkOrder extends Component { } // // 未清复制到时,产品ID需要再获取动态部件 - // const sId = currentId !== undefined ? currentId : ''; + // const sId = currentId || nextProps.masterData?.sId || ''; // if (sId === '' && commonUtils.isNotEmptyObject(this.props.masterData) && !this.props.bGetPartsData) { // const { sAllPartsName } = this.props.masterData; // if (sAllPartsName !== undefined) { @@ -220,7 +220,7 @@ class WorkOrder extends Component { /* 获取表数据 */ handleGetData = async (controlConfig, materialsConfig, processConfig, colorConfig, extraState = {}) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateControl = await this.props.handleGetDataSet({ name: 'control', configData: controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }); diff --git a/src/components/Manufacture/WorkOrderPack/WorkOrderPack.js b/src/components/Manufacture/WorkOrderPack/WorkOrderPack.js index 86692dc..e7a013d 100644 --- a/src/components/Manufacture/WorkOrderPack/WorkOrderPack.js +++ b/src/components/Manufacture/WorkOrderPack/WorkOrderPack.js @@ -95,7 +95,7 @@ class WorkOrderPack extends Component { } = nextProps; const { formData, currentId } = nextProps; if (commonUtils.isEmptyArr(controlColumn) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -300,7 +300,7 @@ class WorkOrderPack extends Component { /* 获取表数据 */ handleGetData = async (controlConfig, materialsConfig, processConfig, colorConfig, packConfig, extraState = {}) => { const { currentId, slaveData, sModelsType } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateControl = await this.props.handleGetDataSet({ name: 'control', configData: controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }); diff --git a/src/components/Manufacture/WorkOrderPack/WorkOrderPackTableTree.js b/src/components/Manufacture/WorkOrderPack/WorkOrderPackTableTree.js index ec8c947..ff8dfb5 100644 --- a/src/components/Manufacture/WorkOrderPack/WorkOrderPackTableTree.js +++ b/src/components/Manufacture/WorkOrderPack/WorkOrderPackTableTree.js @@ -140,7 +140,7 @@ class WorkOrderPack extends Component { } = nextProps; const { formData, currentId, sModelsId } = nextProps; if (commonUtils.isEmptyArr(controlColumn) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; if(masterConfig && masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'bLayout')[0]) { @@ -613,7 +613,7 @@ class WorkOrderPack extends Component { /* 获取表数据 */ handleGetData = async (controlConfig, materialsConfig, processConfig, colorConfig, packConfig, extraState = {}) => { const { currentId, slaveData } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ this.handleGetAllData(controlConfig, processConfig, sId, materialsConfig, colorConfig, packConfig, extraState); }; @@ -621,7 +621,7 @@ class WorkOrderPack extends Component { handleGetOtherData = async (tableList, childTableList, configMap) => { const { currentId, slaveData, sModelsType, masterData } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ if(commonUtils.isNotEmptyObject(configMap)){ for (const configName of Object.keys(configMap)) { const tableName = configName.replace('Config', '').trim(); diff --git a/src/components/Manufacture/WorkOrderPack/WorkOrderResearchTableTree.js b/src/components/Manufacture/WorkOrderPack/WorkOrderResearchTableTree.js index e9f4e57..704d217 100644 --- a/src/components/Manufacture/WorkOrderPack/WorkOrderResearchTableTree.js +++ b/src/components/Manufacture/WorkOrderPack/WorkOrderResearchTableTree.js @@ -117,7 +117,7 @@ class WorkOrderPack extends Component { } = nextProps; const { formData, currentId, sModelsId } = nextProps; if (commonUtils.isEmptyArr(controlColumn) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; if(masterConfig && masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'bLayout')[0]) { @@ -428,7 +428,7 @@ class WorkOrderPack extends Component { /* 获取表数据 */ handleGetData = async (controlConfig, materialsConfig, processConfig, colorConfig, packConfig, extraState = {}) => { const { currentId, slaveData, sModelsType, masterData } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateControl = await this.props.handleGetDataSet({ name: 'control', configData: controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }); @@ -540,7 +540,7 @@ class WorkOrderPack extends Component { handleGetOtherData = async (tableList, childTableList, configMap) => { const { currentId, slaveData, sModelsType, masterData } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ if(commonUtils.isNotEmptyObject(configMap)){ for (const configName of Object.keys(configMap)) { const tableName = configName.replace('Config', '').trim(); @@ -1524,8 +1524,12 @@ class WorkOrderPack extends Component { /* 验证通过与不通过走不同的流程 */ if (err) { /* 验证失败 */ /* 直接渲染显示错误提示 */ + const language = this.props?.app?.userinfo?.sLanguage || 'sChinese'; // 默认简体中文 + const requiredText = language === 'sEnglish' ? 'is Required' : + (language === 'sBig5' ? '為必填項' : '为必填项'); for (const key of Object.keys(err)) { - message.warning(err[key].errors[0].message); + const sContent = err[key].errors[0].message?.replace('为必填项', requiredText); + message.warning(sContent); } this.props.onSaveState({ loading: false, @@ -1543,6 +1547,7 @@ class WorkOrderPack extends Component { }); return; } + console.log('3332', 1111); if (!commonBusiness.validateTable(slaveConfig, slaveData, this.props) || !commonBusiness.validateTable(controlConfig, controlData, this.props) || (!commonBusiness.validateTable(materialsConfig, materialsData, this.props)) || !commonBusiness.validateTable(processConfig, processData, this.props) || !commonBusiness.validateTable(colorConfig, colorData, this.props)) { diff --git a/src/components/Manufacture/WorkOrderPackTableTreeNew/index.js b/src/components/Manufacture/WorkOrderPackTableTreeNew/index.js index cbab0dc..1380c4c 100644 --- a/src/components/Manufacture/WorkOrderPackTableTreeNew/index.js +++ b/src/components/Manufacture/WorkOrderPackTableTreeNew/index.js @@ -3213,14 +3213,21 @@ const controlProps = props => { const tableRow = controlData.find(item => item.sId === tableSelectedRowKeys[0]); let controlChildData = []; if(commonUtils.isNotEmptyObject(tableRow)) { - // 递归查找所有子节点 + // 使用Set来记录已处理节点,防止循环引用 + const processedNodes = new Set(); + const findChildren = (parentId, allNodes) => { - const children = allNodes.filter(node => node.sControlParentId === parentId); - let result = [...children]; - children.forEach(child => { - result = result.concat(findChildren(child.sNodeId, allNodes)); - }); - return result; + // 防止重复处理同一个父节点 + if (processedNodes.has(parentId)) return []; + processedNodes.add(parentId); + + const children = allNodes.filter(node => + node.sControlParentId === parentId && !processedNodes.has(node.sNodeId) + ); + + return children.concat( + ...children.map(child => findChildren(child.sNodeId, allNodes)) + ); }; controlChildData = findChildren(tableRow.sNodeId, controlData); diff --git a/src/components/ProductionReport/ProductionReport.js b/src/components/ProductionReport/ProductionReport.js index 6970231..d0fe18c 100644 --- a/src/components/ProductionReport/ProductionReport.js +++ b/src/components/ProductionReport/ProductionReport.js @@ -50,7 +50,7 @@ class ProductionReport extends Component { } = nextProps; const { formData, currentId } = nextProps; if (commonUtils.isEmptyArr(employeeColumn) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -115,7 +115,7 @@ class ProductionReport extends Component { /* 获取表数据 */ handleGetData = (employeeConfig, extraState = {}) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ this.props.handleGetDataSet({ name: 'employee', configData: employeeConfig, condition: { sSqlCondition: { sParentId: sId } }, }); @@ -364,7 +364,7 @@ class ProductionReport extends Component { /** 获取主表、从表、审核表、员工表数据 */ handleGetTableData = (masterConfig, slaveConfig, checkConfig, employeeConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; this.props.handleGetDataOne({ name: 'master', configData: masterConfig, condition: { sId, pageSize: '', pageNum: '' }, }); diff --git a/src/components/QuoQuotation/Quotation/Quotation.js b/src/components/QuoQuotation/Quotation/Quotation.js index 1ecbb4b..87bc9bf 100644 --- a/src/components/QuoQuotation/Quotation/Quotation.js +++ b/src/components/QuoQuotation/Quotation/Quotation.js @@ -63,7 +63,7 @@ class Quotation extends Component { } = nextProps; const { formData, currentId } = nextProps; if (commonUtils.isEmptyArr(controlColumn) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -177,7 +177,7 @@ class Quotation extends Component { /* 获取表数据 */ handleGetData = async (controlConfig, materialsConfig, processConfig, manyqtysConfig, colorConfig, extraState = {}) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateControl = await this.props.handleGetDataSet({ name: 'control', configData: controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }); diff --git a/src/components/QuoQuotation/QuotationPack/QuotationPack.js b/src/components/QuoQuotation/QuotationPack/QuotationPack.js index 93758cf..0e16632 100644 --- a/src/components/QuoQuotation/QuotationPack/QuotationPack.js +++ b/src/components/QuoQuotation/QuotationPack/QuotationPack.js @@ -80,7 +80,7 @@ class QuotationPack extends Component { } = nextProps; const { formData, currentId } = nextProps; if (commonUtils.isEmptyArr(controlColumn) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; /* bGrd代表是否是表格 */ @@ -291,7 +291,7 @@ class QuotationPack extends Component { /* 获取表数据 */ handleGetData = async (controlConfig, materialsConfig, processConfig, manyqtysConfig, colorConfig, packConfig, extraState = {}) => { const { currentId, slaveData } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateControl = await this.props.handleGetDataSet({ name: 'control', configData: controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }); diff --git a/src/components/QuoQuotation/QuotationPackTableTree/QuotationPackTableTree.js b/src/components/QuoQuotation/QuotationPackTableTree/QuotationPackTableTree.js index 61bc9be..f55582a 100644 --- a/src/components/QuoQuotation/QuotationPackTableTree/QuotationPackTableTree.js +++ b/src/components/QuoQuotation/QuotationPackTableTree/QuotationPackTableTree.js @@ -101,7 +101,7 @@ class QuotationPackTableTree extends Component { } = nextProps; const { formData, currentId } = nextProps; if (commonUtils.isEmptyArr(controlColumn) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; if(masterConfig && masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'bLayout')[0]) { @@ -382,7 +382,7 @@ class QuotationPackTableTree extends Component { /* 获取表数据 */ handleGetData = async (controlConfig, materialsConfig, processConfig, manyqtysConfig, colorConfig, packConfig, extraState = {}) => { const { currentId, masterData, slaveData } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ const addStateControl = await this.props.handleGetDataSet({ name: 'control', configData: controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, }); @@ -654,7 +654,7 @@ class QuotationPackTableTree extends Component { handleGetOtherData = async (tableList, childTableList, configMap) => { const { currentId, slaveData, sModelsType, masterData } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ if(commonUtils.isNotEmptyObject(configMap)){ for (const configName of Object.keys(configMap)) { const tableName = configName.replace('Config', '').trim(); diff --git a/src/components/productionMainPlan/productionMainPlan.js b/src/components/productionMainPlan/productionMainPlan.js index 71a3282..b524944 100644 --- a/src/components/productionMainPlan/productionMainPlan.js +++ b/src/components/productionMainPlan/productionMainPlan.js @@ -561,6 +561,10 @@ const ProductionPlanComponent = Form.create({ }; } + const WorkCenterMachinePlan = commonFunc.showLocalMessage(props, "WorkCenter&MachinePlan", "工作中心&机台计划"); + + const MPS = commonFunc.showLocalMessage(props, "MPS", "产品主计划"); + const machineCharProps = commonBusiness.getCharTypes('machineChar', charConfigArr, charConfigAndDataArr, props); const setUp = commonFunc.showMessage(app.commonConst, 'setUp');/* 上移 */ const setDown = commonFunc.showMessage(app.commonConst, 'setDown');/* 下移 */ @@ -584,7 +588,7 @@ const ProductionPlanComponent = Form.create({
- +
@@ -612,7 +616,7 @@ const ProductionPlanComponent = Form.create({
- + @@ -1563,7 +1563,7 @@ const ProductionScheduleComponent = Form.create({
- 工作中心 + {WorkCenter}
{ diff --git a/src/mobile/common/CommobileBillEvent.js b/src/mobile/common/CommobileBillEvent.js index 3c3c1ef..171be4a 100644 --- a/src/mobile/common/CommobileBillEvent.js +++ b/src/mobile/common/CommobileBillEvent.js @@ -25,7 +25,7 @@ export default (ChildComponent) => { formData, currentId, masterConfig: masterConfigOld, sModelsId, } = nextProps; if (commonUtils.isEmptyObject(masterConfigOld) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; const slaveConfig = formData.filter(item => item.bGrd)[0]; @@ -777,7 +777,7 @@ export default (ChildComponent) => { /** 获取主表、从表、审核表数据 */ handleGetData = async (masterConfig, slaveConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || this.props.masterData?.sId || ''; await this.props.handleGetDataOne({ name: 'master', configData: masterConfig, condition: { sId, pageSize: '', pageNum: '' } }); if (!commonUtils.isEmptyObject(slaveConfig)) { this.props.handleGetDataSet({ @@ -788,7 +788,7 @@ export default (ChildComponent) => { handleGetMemoData = async (employeeConfig) => { const { currentId } = this.props; /* 当前页签数据 */ - const sId = currentId !== undefined ? currentId : ''; /* 数据Id */ + const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ this.props.handleGetDataSet({ name: 'employee', configData: employeeConfig, condition: { sSqlCondition: { sParentId: sId } }, }); diff --git a/src/mobile/common/CommobileSubBillEvent.js b/src/mobile/common/CommobileSubBillEvent.js index 45ebd14..1648a42 100644 --- a/src/mobile/common/CommobileSubBillEvent.js +++ b/src/mobile/common/CommobileSubBillEvent.js @@ -25,7 +25,7 @@ export default (ChildComponent) => { formData, currentId, masterConfig: masterConfigOld, sModelsId, } = nextProps; if (commonUtils.isEmptyObject(masterConfigOld) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; /* 数据Id */ const masterConfig = formData.filter(item => !item.bGrd)[0]; const slaveConfig = formData.filter(item => item.bGrd)[0]; diff --git a/src/mobile/common/ProcessReportMobile.js b/src/mobile/common/ProcessReportMobile.js index c65ed01..f486e96 100644 --- a/src/mobile/common/ProcessReportMobile.js +++ b/src/mobile/common/ProcessReportMobile.js @@ -59,7 +59,7 @@ class ProcessReportMobileComponent extends React.Component { componentWillReceiveProps(nextProps) { const { formData, employeeConfig, currentId } = nextProps; if (commonUtils.isEmptyObject(employeeConfig) && formData.length > 0) { - const sId = currentId !== undefined ? currentId : ''; + const sId = currentId || nextProps.masterData?.sId || ''; const employeeConfig = formData.filter(item => item.sTbName.toUpperCase() === 'mftproductionreportemployee'.toUpperCase())[0]; const addState = {}; if (sId === '') {