From 97512ea7d1f35c2709007a46c59ca6e221ccc4d5 Mon Sep 17 00:00:00 2001 From: chenxt <10125295+chen-xintao97@user.noreply.gitee.com> Date: Wed, 4 Mar 2026 14:31:15 +0800 Subject: [PATCH] 出版选择颜色 --- src/components/Common/CommonBill/index.js | 566 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------- src/components/Common/CommonComponent/index.js | 6 ++++++ src/components/Common/CommonTable/index.js | 4 ++-- 3 files changed, 414 insertions(+), 162 deletions(-) diff --git a/src/components/Common/CommonBill/index.js b/src/components/Common/CommonBill/index.js index a6d9164..e6735e3 100644 --- a/src/components/Common/CommonBill/index.js +++ b/src/components/Common/CommonBill/index.js @@ -1,6 +1,6 @@ /* eslint-disable */ /* eslint-disable prefer-destructuring */ -import React, { Component } from 'react'; +import React, { Component, useEffect, useState } from 'react'; import { UploadOutlined } from '@ant-design/icons'; import { Form } from '@ant-design/compatible'; // import '@ant-design/compatible/assets/index.css'; @@ -16,7 +16,8 @@ import { Table, Upload, Input, - Modal + Modal, + Space } from 'antd-v4'; import { message } from '@/utils/common/message'; import CommonSales from '@/components/Common/CommonBillEvent';/* 继承销售模块业务功能 */ @@ -425,7 +426,7 @@ class CommonBill extends Component { const tableDataRowAdd = commonFunc.getDefaultData(controlConfig, allTableData); tableDataRowAdd.handleType = 'add'; tableDataRowAdd.sId = commonUtils.createSid(); - tableDataRowAdd.sNodeId = tableDataRowAdd.sId ; + tableDataRowAdd.sNodeId = tableDataRowAdd.sId; tableDataRowAdd.sParentId = masterData && masterData.sId ? masterData.sId : null; tableDataRowAdd.sSlaveId = slaveSelectedRowKeys[0]; tableDataRowAdd.key = tableDataRowAdd.sId; @@ -695,7 +696,7 @@ class CommonBill extends Component { } } tableData.push(tableDataRow); - this.props.onSaveState({ [`${name}Data`]: tableData, [`${name}SelectedRowKeys`]: [tableDataRow.sId]}); + this.props.onSaveState({ [`${name}Data`]: tableData, [`${name}SelectedRowKeys`]: [tableDataRow.sId] }); } else if (name === 'materials' || name === 'process') { tableDataRow = this.props.onDataRowAdd(name, true); if (commonUtils.isEmptyArr(controlSelectedRowKeys)) { @@ -773,7 +774,7 @@ class CommonBill extends Component { return false; } } else if (name === 'slave') { /* 删除子表 */ - if( slaveConfig.sTableType === 'multiple' && commonUtils.isNotEmptyObject(slaveInfoConfig)) { + if (slaveConfig.sTableType === 'multiple' && commonUtils.isNotEmptyObject(slaveInfoConfig)) { if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) { let slaveInfoReturnData = {}; if (commonUtils.isNotEmptyObject(slaveInfoConfig)) { @@ -786,11 +787,11 @@ class CommonBill extends Component { }); return true; } - } else if( slaveConfig.sTableType === 'single') { /* 单表删除 */ + } else if (slaveConfig.sTableType === 'single') { /* 单表删除 */ if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) { let slaveSelectedRowNewKeys = slaveSelectedRowKeys; const newSelectedRowKeys = this.handleDelSlaveChild(slaveData, slaveSelectedRowKeys[0], slaveSelectedRowKeys); - if(commonUtils.isNotEmptyArr(newSelectedRowKeys)) { + if (commonUtils.isNotEmptyArr(newSelectedRowKeys)) { slaveSelectedRowNewKeys = newSelectedRowKeys; } const slaveReturnData = this.props.onDataRowDel(name, isWait, slaveSelectedRowNewKeys); @@ -866,17 +867,17 @@ class CommonBill extends Component { }; handleSelect = async (name, selectConfig, selectData) => { const { - [`${name}Data`]: tableData, [`${name}SelectedRowKeys`]: tableSelectedRowKeys, [`${name}Config`]: tableConfig, masterConfig, controlSelectedRowKeys, sModelsId, token, app, tableName, sModelsType, + [`${name}Data`]: tableData, [`${name}SelectedRowKeys`]: tableSelectedRowKeys, [`${name}Config`]: tableConfig, masterConfig, controlSelectedRowKeys, sModelsId, token, app, tableName, sModelsType, } = this.props; - let { masterData}= this.props; - if(commonUtils.isNotEmptyObject(selectConfig.sControlName) && selectConfig.sControlName.toLowerCase().includes('tmplnfobysqlsalesorder')) { - const { slaveData, slaveSelectedRowKeys} = this.props; + let { masterData } = this.props; + if (commonUtils.isNotEmptyObject(selectConfig.sControlName) && selectConfig.sControlName.toLowerCase().includes('tmplnfobysqlsalesorder')) { + const { slaveData, slaveSelectedRowKeys } = this.props; const dataUrl = `${commonConfig.server_host}salesorder/getTmpInfoBySql/?sModelsId=${sModelsId}`; const sConfigformId = commonUtils.isEmpty(selectConfig) ? '' : selectConfig.sParentId; const sControlName = commonUtils.isNotEmptyObject(selectConfig.sControlName) ? selectConfig.sControlName : 'BtnCopyFrom.TmpInfoBySql'; let sSqlCondition = ''; const conditonValues0 = this.props.getSqlCondition(selectConfig, 'slave', selectData[0]); - if(commonUtils.isNotEmptyObject(conditonValues0)) { + if (commonUtils.isNotEmptyObject(conditonValues0)) { sSqlCondition = conditonValues0; } else { sSqlCondition = { sId: selectData[0].sId }; @@ -886,14 +887,14 @@ class CommonBill extends Component { let slaveRow = {}; if (commonUtils.isNotEmptyArr(slaveData)) { - if(commonUtils.isEmptyArr(slaveSelectedRowKeys)){ + if (commonUtils.isEmptyArr(slaveSelectedRowKeys)) { iSlaveIndex = 0; - } else{ + } else { iSlaveIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sId)); } } - if(iSlaveIndex > -1 ){ + if (iSlaveIndex > -1) { slaveRow = slaveData[iSlaveIndex]; } @@ -910,29 +911,29 @@ class CommonBill extends Component { const sName = `${key}Data`; const sDelName = `${key}DelData`; // allReturnMap[sName] = returnData[key]; - let {[`${key}Data`]: oldData, [`${sDelName}`]: oldDelData } = this.props; + let { [`${key}Data`]: oldData, [`${sDelName}`]: oldDelData } = this.props; - if(commonUtils.isEmptyArr(oldDelData)) { + if (commonUtils.isEmptyArr(oldDelData)) { oldDelData = []; } - if(commonUtils.isEmptyArr(oldData)) { + if (commonUtils.isEmptyArr(oldData)) { oldData = []; } /* 找到赋值字段 */ - const tableConfig = masterConfig.gdsconfigformslave.filter(item => item.sControlName.includes(sTmpInfoBySqlBtnName +'.' + key)); + const tableConfig = masterConfig.gdsconfigformslave.filter(item => item.sControlName.includes(sTmpInfoBySqlBtnName + '.' + key)); const tableField = commonUtils.isNotEmptyArr(tableConfig) ? tableConfig[0].sAssignField : ''; - if(sTmpInfoBySqlBtnName.includes('_edit')) { /* 替换 根据对应字段对比 相同的不管 不同的插入 */ + if (sTmpInfoBySqlBtnName.includes('_edit')) { /* 替换 根据对应字段对比 相同的不管 不同的插入 */ /* 对应字段 */ const sActiveKey = selectConfig.sActiveKey; const keyData = returnData[key]; /* 找到赋值字段 */ let newData = []; - if(commonUtils.isNotEmptyArr(keyData)) { + if (commonUtils.isNotEmptyArr(keyData)) { keyData.forEach((child) => { const filterData = oldData.filter(item => item[sActiveKey] !== child[sActiveKey]); - if(commonUtils.isNotEmptyArr(filterData) && filterData.length === oldData.length) { - let tableRow ={}; + if (commonUtils.isNotEmptyArr(filterData) && filterData.length === oldData.length) { + let tableRow = {}; tableRow = { ...tableRow, ...commonFunc.getAssignFieldValue(tableField, child) }; // 取赋值字段 tableRow.sId = commonUtils.createSid(); tableRow.sParentId = masterData.sId; @@ -943,18 +944,18 @@ class CommonBill extends Component { newData = oldData.concat(newData); } allReturnMap[sName] = newData; - } else if(sTmpInfoBySqlBtnName.includes('_del')) { /* 替换 根据对应字段对比 相同的不管 不同的插入 */ + } else if (sTmpInfoBySqlBtnName.includes('_del')) { /* 替换 根据对应字段对比 相同的不管 不同的插入 */ /* 对应字段 */ oldData.forEach((child) => { - child.handleType ='del'; + child.handleType = 'del'; oldDelData.push(child); }); allReturnMap[sDelName] = oldDelData; oldData = []; const keyData = returnData[key]; - if(commonUtils.isNotEmptyArr(keyData)) { + if (commonUtils.isNotEmptyArr(keyData)) { keyData.forEach((child) => { - let tableRow ={}; + let tableRow = {}; tableRow = { ...tableRow, ...commonFunc.getAssignFieldValue(tableField, child) }; // 取赋值字段 tableRow.sId = commonUtils.createSid(); tableRow.sParentId = masterData.sId; @@ -963,30 +964,30 @@ class CommonBill extends Component { }); } allReturnMap[sName] = oldData; - } else{ /* 插入 数据都插入进去 */ + } else { /* 插入 数据都插入进去 */ /* 对应字段 */ const keyData = returnData[key]; // 生产补印备料 - if (this.props.sModelsId === '12710101117005582604140' && key !=='master') { + if (this.props.sModelsId === '12710101117005582604140' && key !== 'master') { oldData.forEach((child) => { - child.handleType ='del'; + child.handleType = 'del'; oldDelData.push(child); }); allReturnMap[sDelName] = oldDelData; oldData = []; } - if(key === 'master') { + if (key === 'master') { let newData = keyData; if (commonUtils.isNotEmptyArr(keyData) && Array.isArray(keyData)) { newData = keyData[0] } oldData = { ...oldData, ...commonFunc.getAssignFieldValue(tableField, newData) }; // 取赋值字段 - masterData.handleType = commonUtils.isEmpty( masterData.handleType) ? 'update' : masterData.handleType; - } else if(key === 'slave') { /* 从表 */ - if(commonUtils.isNotEmptyObject(slaveRow) && commonUtils.isNotEmptyArr(oldData)) { + masterData.handleType = commonUtils.isEmpty(masterData.handleType) ? 'update' : masterData.handleType; + } else if (key === 'slave') { /* 从表 */ + if (commonUtils.isNotEmptyObject(slaveRow) && commonUtils.isNotEmptyArr(oldData)) { oldData[iSlaveIndex] = { ...slaveRow, ...commonFunc.getAssignFieldValue(tableField, keyData[0]) }; // 取赋值字段 - oldData[iSlaveIndex].sOriginalId = commonUtils.isNotEmptyObject(keyData[0].sOriginalId) ? keyData[0].sOriginalId: keyData[0].sSlaveId; + oldData[iSlaveIndex].sOriginalId = commonUtils.isNotEmptyObject(keyData[0].sOriginalId) ? keyData[0].sOriginalId : keyData[0].sSlaveId; // 生产补印备料 if (this.props.sModelsId === '12710101117005582604140') { oldData[iSlaveIndex].sBomId = selectData[0].sProductCardId; @@ -997,9 +998,9 @@ class CommonBill extends Component { } slaveData[iSlaveIndex] = oldData[iSlaveIndex]; } else { - if(commonUtils.isNotEmptyArr(keyData)) { + if (commonUtils.isNotEmptyArr(keyData)) { keyData.forEach((child) => { - let tableRow ={}; + let tableRow = {}; tableRow = { ...tableRow, ...commonFunc.getAssignFieldValue(tableField, child) }; // 取赋值字段 tableRow.sId = commonUtils.createSid(); tableRow.sParentId = masterData.sId; @@ -1018,7 +1019,7 @@ class CommonBill extends Component { } } /* sFatherSlaveId对应为新的sId */ - if(commonUtils.isNotEmptyArr(oldData)) { + if (commonUtils.isNotEmptyArr(oldData)) { const materialsFilterData = oldData.filter(item => commonUtils.isNotEmptyObject(item.sFatherSlaveId)); if (commonUtils.isNotEmptyArr(materialsFilterData)) { materialsFilterData.forEach((filterItem, index) => { @@ -1036,10 +1037,10 @@ class CommonBill extends Component { }); } } - }else { - if(commonUtils.isNotEmptyArr(keyData)) { + } else { + if (commonUtils.isNotEmptyArr(keyData)) { keyData.forEach((child) => { - let tableRow ={}; + let tableRow = {}; tableRow = { ...tableRow, ...commonFunc.getAssignFieldValue(tableField, child) }; // 取赋值字段 tableRow.sId = commonUtils.createSid(); tableRow.sParentId = masterData.sId; @@ -1048,7 +1049,7 @@ class CommonBill extends Component { if (this.props.sModelsId === '12710101117005582604140') { tableRow.sProductCardId = selectData[0].sProductCardId; tableRow.sZmldlt = child.sZmldlt; - tableRow.sSlaveId = commonUtils.isNotEmptyArr(slaveData) && slaveData[0].sId ? slaveData[0].sId : ''; + tableRow.sSlaveId = commonUtils.isNotEmptyArr(slaveData) && slaveData[0].sId ? slaveData[0].sId : ''; tableRow.sProcessTbId = child.sProcessTbId; tableRow.sParentMaterialsId = child.sParentMaterialsId; tableRow.sInkFatherMaterialsTbId = child.sInkFatherMaterialsTbId; @@ -1056,7 +1057,7 @@ class CommonBill extends Component { } - if(key === 'control') { + if (key === 'control') { tableRow.sSrcControlId = child.sId; } else { tableRow.sSrcControlId = child.sControlId; @@ -1065,9 +1066,9 @@ class CommonBill extends Component { oldData.push(tableRow); }); } - if(commonUtils.isNotEmptyObject(slaveRow)){ + if (commonUtils.isNotEmptyObject(slaveRow)) { /* 将部件、材料、工序的sSlaveId 均换成最新的 */ - oldData = commonUtils.genSlaveNewId(oldData, key, 'sSlaveId', 'sOriginalId', slaveData[iSlaveIndex]); + oldData = commonUtils.genSlaveNewId(oldData, key, 'sSlaveId', 'sOriginalId', slaveData[iSlaveIndex]); } } allReturnMap[sName] = oldData; @@ -1076,19 +1077,19 @@ class CommonBill extends Component { } /* 将工序材料表的sControlId 换成最新的 */ - if(commonUtils.isNotEmptyObject(allReturnMap)) { + if (commonUtils.isNotEmptyObject(allReturnMap)) { const controlNewData = allReturnMap.controlData; const materialsNewData = allReturnMap.materialsData; const processNewData = allReturnMap.processData; - if(commonUtils.isNotEmptyArr(controlNewData)) { + if (commonUtils.isNotEmptyArr(controlNewData)) { - controlNewData.forEach((controlRow) =>{ + controlNewData.forEach((controlRow) => { /* 替换工序数据中sControlId为最新控制表的sId */ - if(commonUtils.isNotEmptyArr(processNewData)) { + if (commonUtils.isNotEmptyArr(processNewData)) { const processFilterData = processNewData.filter(materialsRow => materialsRow.sSrcControlId === controlRow.sSrcControlId); - if(commonUtils.isNotEmptyArr(processFilterData)) { - processFilterData.forEach((filterRow) =>{ + if (commonUtils.isNotEmptyArr(processFilterData)) { + processFilterData.forEach((filterRow) => { const index = processNewData.findIndex(materialsRow => materialsRow.sId === filterRow.sId); filterRow.sControlId = controlRow.sId; filterRow.sPartsName = controlRow.sPartsName; @@ -1100,10 +1101,10 @@ class CommonBill extends Component { } /* 替换材料数据中sControlId为最新控制表的sId */ - if(commonUtils.isNotEmptyArr(materialsNewData)) { + if (commonUtils.isNotEmptyArr(materialsNewData)) { let materialsFilterData = materialsNewData.filter(materialsRow => materialsRow.sSrcControlId === controlRow.sSrcControlId); - if(commonUtils.isNotEmptyArr(materialsFilterData)) { - materialsFilterData.forEach((filterRow) =>{ + if (commonUtils.isNotEmptyArr(materialsFilterData)) { + materialsFilterData.forEach((filterRow) => { const index = materialsNewData.findIndex(materialsRow => materialsRow.sId === filterRow.sId); filterRow.sControlId = controlRow.sId; filterRow.sPartsName = controlRow.sPartsName; @@ -1123,13 +1124,13 @@ class CommonBill extends Component { const materialsData = materialsNewData; materialsFilterData = materialsData.filter(item => commonUtils.isNotEmptyObject(item.sParentMaterialsId)); - if(commonUtils.isNotEmptyArr(materialsFilterData)) { + if (commonUtils.isNotEmptyArr(materialsFilterData)) { materialsFilterData.forEach((filterItem, index) => { const iIndex = materialsData.findIndex(item => item.sOriginalOldId === filterItem.sParentMaterialsId); - if(iIndex > -1) { + if (iIndex > -1) { const iNexIndex = materialsData.findIndex(item => item.sId === filterItem.sId); if (iNexIndex > -1) { - materialsData[iNexIndex] = {...materialsData[iNexIndex], sParentMaterialsId: materialsData[iIndex].sId } + materialsData[iNexIndex] = { ...materialsData[iNexIndex], sParentMaterialsId: materialsData[iIndex].sId } } } @@ -1137,13 +1138,13 @@ class CommonBill extends Component { } const materialsInkFilterData = materialsData.filter(item => commonUtils.isNotEmptyObject(item.sInkFatherMaterialsTbId)); - if(commonUtils.isNotEmptyArr(materialsInkFilterData)) { + if (commonUtils.isNotEmptyArr(materialsInkFilterData)) { materialsInkFilterData.forEach((filterItem, index) => { const iIndex = materialsData.findIndex(item => item.sOriginalOldId === filterItem.sInkFatherMaterialsTbId); - if(iIndex > -1) { + if (iIndex > -1) { const iNexIndex = materialsData.findIndex(item => item.sId === filterItem.sId); - if(iNexIndex > -1) { - materialsData[iNexIndex] = { ...materialsData[iNexIndex], sInkFatherMaterialsTbId: materialsData[iIndex].sId} + if (iNexIndex > -1) { + materialsData[iNexIndex] = { ...materialsData[iNexIndex], sInkFatherMaterialsTbId: materialsData[iIndex].sId } } } }); @@ -1170,13 +1171,13 @@ class CommonBill extends Component { message.warn('数据未配置!不能生成!'); return; } - } else if(commonUtils.isNotEmptyObject(selectConfig.sControlName) && selectConfig.sControlName.toLowerCase().includes('tmpinfobysql')) { + } else if (commonUtils.isNotEmptyObject(selectConfig.sControlName) && selectConfig.sControlName.toLowerCase().includes('tmpinfobysql')) { const dataUrl = `${commonConfig.server_host}salesorder/getTmpInfoBySql/?sModelsId=${sModelsId}`; const sConfigformId = commonUtils.isEmpty(selectConfig) ? '' : selectConfig.sParentId; const sControlName = commonUtils.isNotEmptyObject(selectConfig.sControlName) ? selectConfig.sControlName : 'BtnCopyFrom.TmpInfoBySql'; let sSqlCondition = ''; const conditonValues0 = this.props.getSqlCondition(selectConfig, 'slave', selectData[0]); - if(commonUtils.isNotEmptyObject(conditonValues0)) { + if (commonUtils.isNotEmptyObject(conditonValues0)) { sSqlCondition = conditonValues0; } else { sSqlCondition = { sId: selectData[0].sId }; @@ -1194,29 +1195,29 @@ class CommonBill extends Component { const sName = `${key}Data`; const sDelName = `${key}DelData`; // allReturnMap[sName] = returnData[key]; - let {[`${key}Data`]: oldData, [`${key}Data`]: oldDelData } = this.props; + let { [`${key}Data`]: oldData, [`${key}Data`]: oldDelData } = this.props; - if(commonUtils.isEmptyArr(oldDelData)) { + if (commonUtils.isEmptyArr(oldDelData)) { oldDelData = []; } - if(commonUtils.isEmptyArr(oldData)) { + if (commonUtils.isEmptyArr(oldData)) { oldData = []; } /* 找到赋值字段 */ - const tableConfig = masterConfig.gdsconfigformslave.filter(item => item.sControlName.includes(sTmpInfoBySqlBtnName +'.' + key)); + const tableConfig = masterConfig.gdsconfigformslave.filter(item => item.sControlName.includes(sTmpInfoBySqlBtnName + '.' + key)); const tableField = commonUtils.isNotEmptyArr(tableConfig) ? tableConfig[0].sAssignField : ''; - if(sTmpInfoBySqlBtnName.includes('_edit')) { /* 替换 根据对应字段对比 相同的不管 不同的插入 */ + if (sTmpInfoBySqlBtnName.includes('_edit')) { /* 替换 根据对应字段对比 相同的不管 不同的插入 */ /* 对应字段 */ const sActiveKey = selectConfig.sActiveKey; const keyData = returnData[key]; /* 找到赋值字段 */ let newData = []; - if(commonUtils.isNotEmptyArr(keyData)) { + if (commonUtils.isNotEmptyArr(keyData)) { keyData.forEach((child) => { const filterData = oldData.filter(item => item[sActiveKey] !== child[sActiveKey]); - if(commonUtils.isNotEmptyArr(filterData) && filterData.length === oldData.length) { - let tableRow ={}; + if (commonUtils.isNotEmptyArr(filterData) && filterData.length === oldData.length) { + let tableRow = {}; tableRow = { ...tableRow, ...commonFunc.getAssignFieldValue(tableField, child) }; // 取赋值字段 tableRow.sId = commonUtils.createSid(); tableRow.sParentId = masterData.sId; @@ -1230,15 +1231,15 @@ class CommonBill extends Component { } else { /* 替换 根据对应字段对比 相同的不管 不同的插入 */ /* 对应字段 */ oldData.forEach((child) => { - child.handleType ='del'; + child.handleType = 'del'; oldDelData.push(child); }); allReturnMap[sDelName] = oldDelData; oldData = []; const keyData = returnData[key]; - if(commonUtils.isNotEmptyArr(keyData)) { + if (commonUtils.isNotEmptyArr(keyData)) { keyData.forEach((child) => { - let tableRow ={}; + let tableRow = {}; tableRow = { ...tableRow, ...commonFunc.getAssignFieldValue(tableField, child) }; // 取赋值字段 tableRow.sId = commonUtils.createSid(); tableRow.sParentId = masterData.sId; @@ -1612,7 +1613,7 @@ class CommonBill extends Component { } /* 审核备注文本框改变事件 */ - textChange= (e, record) => { + textChange = (e, record) => { const sCheckRemark = commonUtils.isNotEmptyObject(record) && commonUtils.isNotEmptyObject(e.target.value) ? e.target.value : ''; this.props.onSaveState({ sCheckRemark });/* 审核备注 */ } @@ -1702,7 +1703,7 @@ class CommonBill extends Component { }; // ----------------------------数据修改回带end ---------------------------- // - handleMenuClick= (e) => { + handleMenuClick = (e) => { let { sId } = this.props.masterData; const Type = e.key; const { token } = this.props.app; @@ -1717,7 +1718,7 @@ class CommonBill extends Component { sId = slaveSelectedRowKeys; } const downloadUrl = `${commonConfig.server_host}sqlfile/scriptSqlDownload?methodName=${Type - }&sId=${sId}&token=${token}&sType=${sType}`; + }&sId=${sId}&token=${token}&sType=${sType}`; window.open(downloadUrl); this.props.onSaveState({ downloadUrl, @@ -1757,7 +1758,7 @@ class CommonBill extends Component { } handleCheckBoxStatus = (status, dataIndex, name) => { - const { [`${name}Data`]: dataSource} = this.props; + const { [`${name}Data`]: dataSource } = this.props; if (!Array.isArray(dataSource)) return; const result = dataSource.map(i => ({ ...i, @@ -1823,10 +1824,10 @@ class CommonBill extends Component { // 找到关联的从表 */ let controlTableData = []; - if(visibleModal) { - if(commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) { + if (visibleModal) { + if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) { controlTableData = controlData.filter(item => item.sSlaveId === slaveSelectedRowKeys[0]) - }else { + } else { controlTableData = controlData; } } @@ -1835,7 +1836,7 @@ class CommonBill extends Component { tableProps: { CalLastWidth: modalWidth, AutoTableHeight: fixedAutoHeight, setCopyAll, setProcess, setMaterial, chooseProcessConfigRow: chooseProcessConfig, chooseMaterialsConfigRow: chooseMaterialsConfig, onRow: (record) => { return { onClick: () => { this.onRowClick('control', record); } }; }, }, - data: commonUtils.isNotEmptyArr(controlTableData) ? commonUtils.genTreeByArr(controlTableData, "sNodeId", "sControlParentId") : [], + data: commonUtils.isNotEmptyArr(controlTableData) ? commonUtils.genTreeByArr(controlTableData, "sNodeId", "sControlParentId") : [], filteredValue: slaveSelectedRowKeys, onFilterData: this.handleFilterSlaveData, OnGetFilterData: this.handleGetFilterData, @@ -1963,11 +1964,11 @@ class CommonBill extends Component { // eslint-disable-next-line jsx-a11y/anchor-is-valid const operateAdd = {this.props.enabled ? setAdd.img : setAdd.disableimg} ; // eslint-disable-next-line jsx-a11y/anchor-is-valid - const operateAddChild = {this.props.enabled ? setAddChild.img : setAddChild.disableimg }; + const operateAddChild = {this.props.enabled ? setAddChild.img : setAddChild.disableimg}; // eslint-disable-next-line jsx-a11y/anchor-is-valid const operateCopy = {this.props.enabled ? setCopy.img : setCopy.disableimg}; // eslint-disable-next-line jsx-a11y/anchor-is-valid - const operateUpdate = {this.props.enabled ? setCopyAll.img : setCopyAll.disableimg }; + const operateUpdate = {this.props.enabled ? setCopyAll.img : setCopyAll.disableimg}; // eslint-disable-next-line jsx-a11y/anchor-is-valid const operateDel = {this.props.enabled ? setDelete.img : setDelete.disableimg}; @@ -2019,14 +2020,14 @@ class CommonBill extends Component { , - ]} + ]} >