Commit 3cd0cc03d4718b334e9daa71c5b64535590c70f1
1 parent
cae34cb2
快速报价复制到
Showing
1 changed file
with
526 additions
and
489 deletions
src/components/QuoQuotation/QuotationPackTableTree/QuotationPackTableTree.js
| @@ -8,7 +8,7 @@ import React, { Component } from 'react'; | @@ -8,7 +8,7 @@ import React, { Component } from 'react'; | ||
| 8 | import moment from 'moment'; | 8 | import moment from 'moment'; |
| 9 | import { Form } from '@ant-design/compatible'; | 9 | import { Form } from '@ant-design/compatible'; |
| 10 | // import '@ant-design/compatible/assets/index.css'; | 10 | // import '@ant-design/compatible/assets/index.css'; |
| 11 | -import { Modal, Layout, Spin, Avatar, Select, message, Button, Slider, Tabs, Collapse, Radio, Row, Col, Table, Checkbox, } from 'antd-v4'; | 11 | +import { Modal, Layout, Spin, Avatar, Select, message, Button, Slider, Tabs, Collapse, Radio, Row, Col, Table, Checkbox, } from 'antd-v4'; |
| 12 | import { RightOutlined } from '@ant-design/icons'; | 12 | import { RightOutlined } from '@ant-design/icons'; |
| 13 | import AddIcon from '../../../assets/add.svg'; | 13 | import AddIcon from '../../../assets/add.svg'; |
| 14 | import DisableAddIcon from '../../../assets/disableadd.svg'; | 14 | import DisableAddIcon from '../../../assets/disableadd.svg'; |
| @@ -104,19 +104,19 @@ class QuotationPackTableTree extends Component { | @@ -104,19 +104,19 @@ class QuotationPackTableTree extends Component { | ||
| 104 | const sId = currentId || nextProps.masterData?.sId || ''; | 104 | const sId = currentId || nextProps.masterData?.sId || ''; |
| 105 | /* 数据Id */ | 105 | /* 数据Id */ |
| 106 | const masterConfig = formData.filter(item => !item.bGrd)[0]; | 106 | const masterConfig = formData.filter(item => !item.bGrd)[0]; |
| 107 | - if(masterConfig && masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'bLayout')[0]) { | 107 | + if (masterConfig && masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'bLayout')[0]) { |
| 108 | this.isLayout = masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'bLayout')[0].bVisible; | 108 | this.isLayout = masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'bLayout')[0].bVisible; |
| 109 | } | 109 | } |
| 110 | - if(masterConfig && masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'bLayout2')[0]) { | 110 | + if (masterConfig && masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'bLayout2')[0]) { |
| 111 | this.isLayout2 = masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'bLayout2')[0].bVisible; | 111 | this.isLayout2 = masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'bLayout2')[0].bVisible; |
| 112 | } | 112 | } |
| 113 | /* bGrd代表是否是表格 */ | 113 | /* bGrd代表是否是表格 */ |
| 114 | const slaveConfig = formData.filter(item => item.bGrd && item.sTbName !== 'sysbillcheckresult')[0]; | 114 | const slaveConfig = formData.filter(item => item.bGrd && item.sTbName !== 'sysbillcheckresult')[0]; |
| 115 | const slaveColumn = commonFunc.getHeaderConfig(slaveConfig); | 115 | const slaveColumn = commonFunc.getHeaderConfig(slaveConfig); |
| 116 | 116 | ||
| 117 | - let checkConfig ={}; | ||
| 118 | - let checkColumn ={}; | ||
| 119 | - if(commonUtils.isNotEmptyArr( formData.filter(item => item.bGrd && item.sTbName === 'sysbillcheckresult'))) { | 117 | + let checkConfig = {}; |
| 118 | + let checkColumn = {}; | ||
| 119 | + if (commonUtils.isNotEmptyArr(formData.filter(item => item.bGrd && item.sTbName === 'sysbillcheckresult'))) { | ||
| 120 | checkConfig = formData.filter(item => item.bGrd && item.sTbName === 'sysbillcheckresult')[0]; | 120 | checkConfig = formData.filter(item => item.bGrd && item.sTbName === 'sysbillcheckresult')[0]; |
| 121 | checkColumn = commonFunc.getHeaderConfig(checkConfig); | 121 | checkColumn = commonFunc.getHeaderConfig(checkConfig); |
| 122 | } | 122 | } |
| @@ -130,30 +130,30 @@ class QuotationPackTableTree extends Component { | @@ -130,30 +130,30 @@ class QuotationPackTableTree extends Component { | ||
| 130 | const finishedMaterialsConfig = formData.filter(item => item.sTbName.toUpperCase() === 'QuoQuotationMaterials'.toUpperCase() && item.showName === '成品材料')[0]; | 130 | const finishedMaterialsConfig = formData.filter(item => item.sTbName.toUpperCase() === 'QuoQuotationMaterials'.toUpperCase() && item.showName === '成品材料')[0]; |
| 131 | const finishedMaterialsColumn = finishedMaterialsConfig ? commonFunc.getHeaderConfig(finishedMaterialsConfig) : false; | 131 | const finishedMaterialsColumn = finishedMaterialsConfig ? commonFunc.getHeaderConfig(finishedMaterialsConfig) : false; |
| 132 | 132 | ||
| 133 | - const addState2 ={}; | ||
| 134 | - const addStateConfig ={}; | 133 | + const addState2 = {}; |
| 134 | + const addStateConfig = {}; | ||
| 135 | /* 取材料组配置放在数组 */ | 135 | /* 取材料组配置放在数组 */ |
| 136 | - let materialsInfoList = []; | ||
| 137 | - let materialsChildInfoList = []; | ||
| 138 | - const materialsFormData = formData.filter(item => item.showName !== '纸张1' && item.showName !== '成品辅料1' && item.sGrd && item.sGrd.includes('materials') && item.bGrdVisible ); | 136 | + let materialsInfoList = []; |
| 137 | + let materialsChildInfoList = []; | ||
| 138 | + const materialsFormData = formData.filter(item => item.showName !== '纸张1' && item.showName !== '成品辅料1' && item.sGrd && item.sGrd.includes('materials') && item.bGrdVisible); | ||
| 139 | // const materialsFormData = formData.filter(item => item.sTbName !== 'mftworkordermaterials' && item.sGrd && item.sGrd.includes('materials') && item.bGrdVisible ); | 139 | // const materialsFormData = formData.filter(item => item.sTbName !== 'mftworkordermaterials' && item.sGrd && item.sGrd.includes('materials') && item.bGrdVisible ); |
| 140 | /* 找到除了材料,成品材料外的其他所有父级材料 */ | 140 | /* 找到除了材料,成品材料外的其他所有父级材料 */ |
| 141 | 141 | ||
| 142 | - if(commonUtils.isNotEmptyArr(materialsFormData) ) { | 142 | + if (commonUtils.isNotEmptyArr(materialsFormData)) { |
| 143 | materialsFormData.forEach((item, index) => { | 143 | materialsFormData.forEach((item, index) => { |
| 144 | - const tableName = index === 0 ? 'materials' : `materials${index -1}`; | 144 | + const tableName = index === 0 ? 'materials' : `materials${index - 1}`; |
| 145 | addState2[`${tableName}Config`] = item; | 145 | addState2[`${tableName}Config`] = item; |
| 146 | addStateConfig[`${tableName}Config`] = item; | 146 | addStateConfig[`${tableName}Config`] = item; |
| 147 | addState2[`${tableName}Column`] = commonFunc.getHeaderConfig(item); | 147 | addState2[`${tableName}Column`] = commonFunc.getHeaderConfig(item); |
| 148 | /* 找到该配置的子从表 */ | 148 | /* 找到该配置的子从表 */ |
| 149 | - const childFormData = formData.filter(child => child.sGrd === item.sChildTableName ); | ||
| 150 | - if(commonUtils.isNotEmptyArr(childFormData)) { | 149 | + const childFormData = formData.filter(child => child.sGrd === item.sChildTableName); |
| 150 | + if (commonUtils.isNotEmptyArr(childFormData)) { | ||
| 151 | childFormData.forEach((child, num) => { | 151 | childFormData.forEach((child, num) => { |
| 152 | addState2[`${tableName}ChildConfig`] = child; | 152 | addState2[`${tableName}ChildConfig`] = child; |
| 153 | addStateConfig[`${tableName}ChildConfig`] = child; | 153 | addStateConfig[`${tableName}ChildConfig`] = child; |
| 154 | addState2[`${tableName}ChildColumn`] = commonFunc.getHeaderConfig(child); | 154 | addState2[`${tableName}ChildColumn`] = commonFunc.getHeaderConfig(child); |
| 155 | // materialsInfoList.push(child.showName); | 155 | // materialsInfoList.push(child.showName); |
| 156 | - const sChildName = item.showName + num +1; | 156 | + const sChildName = item.showName + num + 1; |
| 157 | materialsChildInfoList.push(`${tableName}Child`); | 157 | materialsChildInfoList.push(`${tableName}Child`); |
| 158 | }); | 158 | }); |
| 159 | } | 159 | } |
| @@ -204,7 +204,7 @@ class QuotationPackTableTree extends Component { | @@ -204,7 +204,7 @@ class QuotationPackTableTree extends Component { | ||
| 204 | const manyqtysConfig = commonUtils.isNotEmptyArr(formData.filter(item => item.sTbName.toUpperCase() === 'QuoQuotationManyQtys'.toUpperCase() && item.bGrdVisible)) ? | 204 | const manyqtysConfig = commonUtils.isNotEmptyArr(formData.filter(item => item.sTbName.toUpperCase() === 'QuoQuotationManyQtys'.toUpperCase() && item.bGrdVisible)) ? |
| 205 | formData.filter(item => item.sTbName.toUpperCase() === 'QuoQuotationManyQtys'.toUpperCase() && item.bGrdVisible)[0] : {}; | 205 | formData.filter(item => item.sTbName.toUpperCase() === 'QuoQuotationManyQtys'.toUpperCase() && item.bGrdVisible)[0] : {}; |
| 206 | 206 | ||
| 207 | - manyqtysColumn = commonUtils.isNotEmptyObject(manyqtysConfig) ? commonFunc.getHeaderConfig(manyqtysConfig, manyqtysColumn) : []; | 207 | + manyqtysColumn = commonUtils.isNotEmptyObject(manyqtysConfig) ? commonFunc.getHeaderConfig(manyqtysConfig, manyqtysColumn) : []; |
| 208 | 208 | ||
| 209 | let colorConfigGrdVisible; | 209 | let colorConfigGrdVisible; |
| 210 | const colorConfigTrue = formData.filter(item => item.sTbName.toUpperCase() === 'quoquotationparam'.toUpperCase())[0]; | 210 | const colorConfigTrue = formData.filter(item => item.sTbName.toUpperCase() === 'quoquotationparam'.toUpperCase())[0]; |
| @@ -358,7 +358,7 @@ class QuotationPackTableTree extends Component { | @@ -358,7 +358,7 @@ class QuotationPackTableTree extends Component { | ||
| 358 | } else { | 358 | } else { |
| 359 | filterTree.style.display = 'block'; | 359 | filterTree.style.display = 'block'; |
| 360 | 360 | ||
| 361 | - const { masterData, slaveData, controlData, materialsData, processData }=this.props; | 361 | + const { masterData, slaveData, controlData, materialsData, processData } = this.props; |
| 362 | if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyArr(slaveData)) { | 362 | if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyArr(slaveData)) { |
| 363 | const totalTreeState = this.handleGetTotalTreeData(masterData, slaveData, controlData, materialsData, processData, true); | 363 | const totalTreeState = this.handleGetTotalTreeData(masterData, slaveData, controlData, materialsData, processData, true); |
| 364 | if (commonUtils.isNotEmptyObject(totalTreeState)) { | 364 | if (commonUtils.isNotEmptyObject(totalTreeState)) { |
| @@ -420,7 +420,7 @@ class QuotationPackTableTree extends Component { | @@ -420,7 +420,7 @@ class QuotationPackTableTree extends Component { | ||
| 420 | } | 420 | } |
| 421 | }); | 421 | }); |
| 422 | addStateProcess.processSelectedRowKeys = []; | 422 | addStateProcess.processSelectedRowKeys = []; |
| 423 | - if(commonUtils.isNotEmptyArr(addStateProcess.processData) && commonUtils.isNotEmptyArr(addStateControl.controlSelectedRowKeys)) { | 423 | + if (commonUtils.isNotEmptyArr(addStateProcess.processData) && commonUtils.isNotEmptyArr(addStateControl.controlSelectedRowKeys)) { |
| 424 | const processFilterData = addStateProcess.processData.filter(item => item.sControlId === addStateControl.controlSelectedRowKeys[0]) | 424 | const processFilterData = addStateProcess.processData.filter(item => item.sControlId === addStateControl.controlSelectedRowKeys[0]) |
| 425 | if (commonUtils.isNotEmptyArr(processFilterData)) { | 425 | if (commonUtils.isNotEmptyArr(processFilterData)) { |
| 426 | addStateProcess.processSelectedData = [processFilterData[0]]; | 426 | addStateProcess.processSelectedData = [processFilterData[0]]; |
| @@ -436,7 +436,7 @@ class QuotationPackTableTree extends Component { | @@ -436,7 +436,7 @@ class QuotationPackTableTree extends Component { | ||
| 436 | name: 'pack', configData: packConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, | 436 | name: 'pack', configData: packConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true, |
| 437 | }); | 437 | }); |
| 438 | 438 | ||
| 439 | - if(commonUtils.isNotEmptyObject(manyqtysConfig)) { | 439 | + if (commonUtils.isNotEmptyObject(manyqtysConfig)) { |
| 440 | this.props.handleGetDataSet({ | 440 | this.props.handleGetDataSet({ |
| 441 | name: 'manyqtys', configData: manyqtysConfig, condition: { sSqlCondition: { sParentId: sId } }, | 441 | name: 'manyqtys', configData: manyqtysConfig, condition: { sSqlCondition: { sParentId: sId } }, |
| 442 | }); | 442 | }); |
| @@ -468,17 +468,17 @@ class QuotationPackTableTree extends Component { | @@ -468,17 +468,17 @@ class QuotationPackTableTree extends Component { | ||
| 468 | addStatePack.packData = packData; | 468 | addStatePack.packData = packData; |
| 469 | } | 469 | } |
| 470 | /* 默认展开第一层结构 */ | 470 | /* 默认展开第一层结构 */ |
| 471 | - const expandedRowKeys =[]; | ||
| 472 | - if(commonUtils.isNotEmptyObject(addStateControl) && commonUtils.isNotEmptyArr(addStateControl.controlData)) { | ||
| 473 | - const { controlData } = addStateControl; | 471 | + const expandedRowKeys = []; |
| 472 | + if (commonUtils.isNotEmptyObject(addStateControl) && commonUtils.isNotEmptyArr(addStateControl.controlData)) { | ||
| 473 | + const { controlData } = addStateControl; | ||
| 474 | const controlFilterData = controlData.filter(item => commonUtils.isEmptyObject(item.sControlParentId)); /* 筛选出第一层 */ | 474 | const controlFilterData = controlData.filter(item => commonUtils.isEmptyObject(item.sControlParentId)); /* 筛选出第一层 */ |
| 475 | - if(commonUtils.isNotEmptyArr(controlFilterData) && controlFilterData.length > 0) { /* 当显示全部时 展开所有部件层级 */ | 475 | + if (commonUtils.isNotEmptyArr(controlFilterData) && controlFilterData.length > 0) { /* 当显示全部时 展开所有部件层级 */ |
| 476 | controlFilterData.forEach((item) => { | 476 | controlFilterData.forEach((item) => { |
| 477 | const { sId } = item; | 477 | const { sId } = item; |
| 478 | expandedRowKeys.push(sId); | 478 | expandedRowKeys.push(sId); |
| 479 | }); | 479 | }); |
| 480 | } | 480 | } |
| 481 | - this.setState({ controlExpandedRowKeys:{ expandedRowKeys: expandedRowKeys }}) | 481 | + this.setState({ controlExpandedRowKeys: { expandedRowKeys: expandedRowKeys } }) |
| 482 | } | 482 | } |
| 483 | /* 获取整体树结构s */ | 483 | /* 获取整体树结构s */ |
| 484 | // const { materialsData } = addStateMaterials; /* 工序表 */ | 484 | // const { materialsData } = addStateMaterials; /* 工序表 */ |
| @@ -486,16 +486,16 @@ class QuotationPackTableTree extends Component { | @@ -486,16 +486,16 @@ class QuotationPackTableTree extends Component { | ||
| 486 | // const totalTreeState = this.handleGetTotalTreeData(masterData,slaveData,controlData,materialsData,processData, true); | 486 | // const totalTreeState = this.handleGetTotalTreeData(masterData,slaveData,controlData,materialsData,processData, true); |
| 487 | 487 | ||
| 488 | this.props.onSaveState({ | 488 | this.props.onSaveState({ |
| 489 | - pageLoading: false, ...addStateControl,...addStateMaterials, ...addStateProcess, ...addStateColor, ...addStatePack, ...treeState, treeSelectedKeys: controlSelectedRowKeys, ...extraState, | 489 | + pageLoading: false, ...addStateControl, ...addStateMaterials, ...addStateProcess, ...addStateColor, ...addStatePack, ...treeState, treeSelectedKeys: controlSelectedRowKeys, ...extraState, |
| 490 | }); | 490 | }); |
| 491 | }; | 491 | }; |
| 492 | 492 | ||
| 493 | - /* 获取套件树形全部结构 */ | ||
| 494 | - handleGetTotalTreeDataBak= (masterData,slaveData,controlData,materialsData,processData, isWait) => { | 493 | + /* 获取套件树形全部结构 */ |
| 494 | + handleGetTotalTreeDataBak = (masterData, slaveData, controlData, materialsData, processData, isWait) => { | ||
| 495 | /* 生成部件树结构 */ | 495 | /* 生成部件树结构 */ |
| 496 | let totalTreeData = []; | 496 | let totalTreeData = []; |
| 497 | const expandedKeys = []; | 497 | const expandedKeys = []; |
| 498 | - const addState ={}; | 498 | + const addState = {}; |
| 499 | // let { totalTreeSelectedKeys } = this.props; | 499 | // let { totalTreeSelectedKeys } = this.props; |
| 500 | if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sProductName1)) { | 500 | if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sProductName1)) { |
| 501 | const rootData = [masterData]; /* 找到所有一级树结构 */ | 501 | const rootData = [masterData]; /* 找到所有一级树结构 */ |
| @@ -510,50 +510,50 @@ class QuotationPackTableTree extends Component { | @@ -510,50 +510,50 @@ class QuotationPackTableTree extends Component { | ||
| 510 | /* 添加从表作为二级节点 */ | 510 | /* 添加从表作为二级节点 */ |
| 511 | const childrenSlave = []; | 511 | const childrenSlave = []; |
| 512 | let bRelation = false; /* 从表与控制表没有关联性 */ | 512 | let bRelation = false; /* 从表与控制表没有关联性 */ |
| 513 | - if(commonUtils.isNotEmptyArr(slaveData)){ | ||
| 514 | - slaveData.forEach((itemSlave,index) => { | 513 | + if (commonUtils.isNotEmptyArr(slaveData)) { |
| 514 | + slaveData.forEach((itemSlave, index) => { | ||
| 515 | const { sId, sProductName } = itemSlave; | 515 | const { sId, sProductName } = itemSlave; |
| 516 | const treeSlaveRow = {}; | 516 | const treeSlaveRow = {}; |
| 517 | treeSlaveRow.key = sId; | 517 | treeSlaveRow.key = sId; |
| 518 | - treeSlaveRow.showName ='产品-'+ sProductName; | 518 | + treeSlaveRow.showName = '产品-' + sProductName; |
| 519 | treeSlaveRow.sAllId = itemSlave.sId; | 519 | treeSlaveRow.sAllId = itemSlave.sId; |
| 520 | /* 获取从表关联的控制表 */ | 520 | /* 获取从表关联的控制表 */ |
| 521 | const childrenControl = []; | 521 | const childrenControl = []; |
| 522 | - if(commonUtils.isNotEmptyArr(controlData)){ | ||
| 523 | - const controlCollection =[]; | 522 | + if (commonUtils.isNotEmptyArr(controlData)) { |
| 523 | + const controlCollection = []; | ||
| 524 | controlData.forEach((itemControl) => { | 524 | controlData.forEach((itemControl) => { |
| 525 | - if(itemControl.sCombinedMemo && itemControl.sCombinedMemo !== '') { | 525 | + if (itemControl.sCombinedMemo && itemControl.sCombinedMemo !== '') { |
| 526 | const sCombinedMemoArr = commonUtils.isJSON(itemControl.sCombinedMemo) ? JSON.parse(itemControl.sCombinedMemo) : []; | 526 | const sCombinedMemoArr = commonUtils.isJSON(itemControl.sCombinedMemo) ? JSON.parse(itemControl.sCombinedMemo) : []; |
| 527 | const len = sCombinedMemoArr.filter(item => item.sProductNo.indexOf(itemSlave.sProductNo) !== -1).length; | 527 | const len = sCombinedMemoArr.filter(item => item.sProductNo.indexOf(itemSlave.sProductNo) !== -1).length; |
| 528 | - if(len > 0) { | ||
| 529 | - const sAllId =itemControl.sAllId; | 528 | + if (len > 0) { |
| 529 | + const sAllId = itemControl.sAllId; | ||
| 530 | /* 找到这个sAllId的第一级 把整个部件挂到产品下面 */ | 530 | /* 找到这个sAllId的第一级 把整个部件挂到产品下面 */ |
| 531 | if (commonUtils.isNotEmptyObject(sAllId)) { | 531 | if (commonUtils.isNotEmptyObject(sAllId)) { |
| 532 | const arr = sAllId.split(','); | 532 | const arr = sAllId.split(','); |
| 533 | - if (arr.length > 0){ | ||
| 534 | - const firstsId =arr[0]; /* 从sAllId找第一级*/ | ||
| 535 | - if(!controlCollection.includes(firstsId)){ | ||
| 536 | - controlCollection.push(firstsId) | ||
| 537 | - } | 533 | + if (arr.length > 0) { |
| 534 | + const firstsId = arr[0]; /* 从sAllId找第一级*/ | ||
| 535 | + if (!controlCollection.includes(firstsId)) { | ||
| 536 | + controlCollection.push(firstsId) | ||
| 537 | + } | ||
| 538 | } | 538 | } |
| 539 | } | 539 | } |
| 540 | } | 540 | } |
| 541 | } | 541 | } |
| 542 | }); | 542 | }); |
| 543 | - if(commonUtils.isNotEmptyArr(controlCollection)){ /* 作为子表子级 */ | ||
| 544 | - bRelation =true; | 543 | + if (commonUtils.isNotEmptyArr(controlCollection)) { /* 作为子表子级 */ |
| 544 | + bRelation = true; | ||
| 545 | for (const key of controlCollection) { | 545 | for (const key of controlCollection) { |
| 546 | - const iIndex =controlData.findIndex(item => item.sId === key); | ||
| 547 | - if(iIndex > -1) { | 546 | + const iIndex = controlData.findIndex(item => item.sId === key); |
| 547 | + if (iIndex > -1) { | ||
| 548 | const tableRow = controlData[iIndex]; | 548 | const tableRow = controlData[iIndex]; |
| 549 | - const { sId,sAllId } = tableRow; | 549 | + const { sId, sAllId } = tableRow; |
| 550 | const treeControlRow = {} | 550 | const treeControlRow = {} |
| 551 | - treeControlRow.key = sId + '-' +commonUtils.createSid(); | 551 | + treeControlRow.key = sId + '-' + commonUtils.createSid(); |
| 552 | treeControlRow.showName = '部件-' + tableRow.sPartsName; | 552 | treeControlRow.showName = '部件-' + tableRow.sPartsName; |
| 553 | treeControlRow.sAllId = sAllId; | 553 | treeControlRow.sAllId = sAllId; |
| 554 | /* 控制表根据一级菜单获取子集 */ | 554 | /* 控制表根据一级菜单获取子集 */ |
| 555 | let childrenChild = []; | 555 | let childrenChild = []; |
| 556 | - childrenChild = this.handleGetControlTreeChildData(sId, controlData,materialsData,processData); | 556 | + childrenChild = this.handleGetControlTreeChildData(sId, controlData, materialsData, processData); |
| 557 | let sChildren = '1'; /* 树形结构最后一个节点设置为1 */ | 557 | let sChildren = '1'; /* 树形结构最后一个节点设置为1 */ |
| 558 | if (commonUtils.isNotEmptyArr(childrenChild)) { | 558 | if (commonUtils.isNotEmptyArr(childrenChild)) { |
| 559 | sChildren = '0'; /* 树形结构其他节点设置为0 */ | 559 | sChildren = '0'; /* 树形结构其他节点设置为0 */ |
| @@ -573,53 +573,53 @@ class QuotationPackTableTree extends Component { | @@ -573,53 +573,53 @@ class QuotationPackTableTree extends Component { | ||
| 573 | childrenSlave.push(treeSlaveRow); | 573 | childrenSlave.push(treeSlaveRow); |
| 574 | 574 | ||
| 575 | /* 如果从表与控制表没有关联 */ | 575 | /* 如果从表与控制表没有关联 */ |
| 576 | - if(!bRelation){ | 576 | + if (!bRelation) { |
| 577 | controlData.forEach((itemControl) => { | 577 | controlData.forEach((itemControl) => { |
| 578 | - const { sId,sAllId,sPartsName } = itemControl; | 578 | + const { sId, sAllId, sPartsName } = itemControl; |
| 579 | const treeControlRow = {} | 579 | const treeControlRow = {} |
| 580 | - treeControlRow.key = sId + '-' +commonUtils.createSid(); | 580 | + treeControlRow.key = sId + '-' + commonUtils.createSid(); |
| 581 | treeControlRow.showName = '部件-' + sPartsName; | 581 | treeControlRow.showName = '部件-' + sPartsName; |
| 582 | treeControlRow.sAllId = sAllId; | 582 | treeControlRow.sAllId = sAllId; |
| 583 | - treeControlRow.sId =sId; | 583 | + treeControlRow.sId = sId; |
| 584 | /* 控制表根据一级菜单获取子集 */ | 584 | /* 控制表根据一级菜单获取子集 */ |
| 585 | let childrenChild = []; | 585 | let childrenChild = []; |
| 586 | - childrenChild = this.handleGetControlTreeChildData(sId, controlData,materialsData,processData); | 586 | + childrenChild = this.handleGetControlTreeChildData(sId, controlData, materialsData, processData); |
| 587 | let sChildren = '1'; /* 树形结构最后一个节点设置为1 */ | 587 | let sChildren = '1'; /* 树形结构最后一个节点设置为1 */ |
| 588 | if (commonUtils.isNotEmptyArr(childrenChild)) { | 588 | if (commonUtils.isNotEmptyArr(childrenChild)) { |
| 589 | sChildren = '0'; /* 树形结构其他节点设置为0 */ | 589 | sChildren = '0'; /* 树形结构其他节点设置为0 */ |
| 590 | } | 590 | } |
| 591 | treeControlRow.sChildren = sChildren; | 591 | treeControlRow.sChildren = sChildren; |
| 592 | treeControlRow.children = commonUtils.isNotEmptyArr(childrenChild) ? childrenChild : []; | 592 | treeControlRow.children = commonUtils.isNotEmptyArr(childrenChild) ? childrenChild : []; |
| 593 | - const filterData =childrenSlave.filter(item => item.sId ===treeControlRow.sId); | ||
| 594 | - if(commonUtils.isEmptyArr(filterData)){ | 593 | + const filterData = childrenSlave.filter(item => item.sId === treeControlRow.sId); |
| 594 | + if (commonUtils.isEmptyArr(filterData)) { | ||
| 595 | childrenSlave.push(treeControlRow); | 595 | childrenSlave.push(treeControlRow); |
| 596 | } | 596 | } |
| 597 | }); | 597 | }); |
| 598 | } | 598 | } |
| 599 | 599 | ||
| 600 | /* 加载成品材料、成品工序作为从表的同级 */ | 600 | /* 加载成品材料、成品工序作为从表的同级 */ |
| 601 | - if(commonUtils.isNotEmptyArr(materialsData)){ | 601 | + if (commonUtils.isNotEmptyArr(materialsData)) { |
| 602 | const childTree = commonUtils.isNotEmptyArr(materialsData) ? materialsData.filter(item => item.sType === 2) : []; | 602 | const childTree = commonUtils.isNotEmptyArr(materialsData) ? materialsData.filter(item => item.sType === 2) : []; |
| 603 | if (commonUtils.isNotEmptyArr(childTree)) { | 603 | if (commonUtils.isNotEmptyArr(childTree)) { |
| 604 | childTree.forEach((child) => { | 604 | childTree.forEach((child) => { |
| 605 | - const { sId, sMaterialsName,sPartsName } = child; | 605 | + const { sId, sMaterialsName, sPartsName } = child; |
| 606 | const treeDataRow = {}; | 606 | const treeDataRow = {}; |
| 607 | treeDataRow.key = sId; | 607 | treeDataRow.key = sId; |
| 608 | - treeDataRow.showName = '成品材料' +'-'+ sMaterialsName; | 608 | + treeDataRow.showName = '成品材料' + '-' + sMaterialsName; |
| 609 | treeDataRow.sAllId = child.sAllId; | 609 | treeDataRow.sAllId = child.sAllId; |
| 610 | childrenSlave.push(treeDataRow); | 610 | childrenSlave.push(treeDataRow); |
| 611 | }); | 611 | }); |
| 612 | } | 612 | } |
| 613 | } | 613 | } |
| 614 | /* 获取工序表 */ | 614 | /* 获取工序表 */ |
| 615 | - if(commonUtils.isNotEmptyArr(processData)){ | 615 | + if (commonUtils.isNotEmptyArr(processData)) { |
| 616 | const childTree = commonUtils.isNotEmptyArr(processData) ? processData.filter(item => item.sType === 3) : []; | 616 | const childTree = commonUtils.isNotEmptyArr(processData) ? processData.filter(item => item.sType === 3) : []; |
| 617 | if (commonUtils.isNotEmptyArr(childTree)) { | 617 | if (commonUtils.isNotEmptyArr(childTree)) { |
| 618 | childTree.forEach((child) => { | 618 | childTree.forEach((child) => { |
| 619 | - const { sId, sProcessName,sPartsName } = child; | 619 | + const { sId, sProcessName, sPartsName } = child; |
| 620 | const treeDataRow = {}; | 620 | const treeDataRow = {}; |
| 621 | treeDataRow.key = sId; | 621 | treeDataRow.key = sId; |
| 622 | - treeDataRow.showName = '成品工序' +'-'+ sProcessName; | 622 | + treeDataRow.showName = '成品工序' + '-' + sProcessName; |
| 623 | treeDataRow.sAllId = child.sAllId; | 623 | treeDataRow.sAllId = child.sAllId; |
| 624 | childrenSlave.push(treeDataRow); | 624 | childrenSlave.push(treeDataRow); |
| 625 | }); | 625 | }); |
| @@ -629,7 +629,7 @@ class QuotationPackTableTree extends Component { | @@ -629,7 +629,7 @@ class QuotationPackTableTree extends Component { | ||
| 629 | 629 | ||
| 630 | 630 | ||
| 631 | 631 | ||
| 632 | - if(!expandedKeys.includes(sId)){ | 632 | + if (!expandedKeys.includes(sId)) { |
| 633 | expandedKeys.push(sId); | 633 | expandedKeys.push(sId); |
| 634 | } | 634 | } |
| 635 | }); | 635 | }); |
| @@ -640,8 +640,8 @@ class QuotationPackTableTree extends Component { | @@ -640,8 +640,8 @@ class QuotationPackTableTree extends Component { | ||
| 640 | } else { | 640 | } else { |
| 641 | totalTreeData = []; | 641 | totalTreeData = []; |
| 642 | } | 642 | } |
| 643 | - addState.totalTreeData=totalTreeData; | ||
| 644 | - addState.expandedKeys=expandedKeys; | 643 | + addState.totalTreeData = totalTreeData; |
| 644 | + addState.expandedKeys = expandedKeys; | ||
| 645 | if (isWait) { | 645 | if (isWait) { |
| 646 | return { ...addState }; | 646 | return { ...addState }; |
| 647 | } else { | 647 | } else { |
| @@ -655,7 +655,7 @@ class QuotationPackTableTree extends Component { | @@ -655,7 +655,7 @@ class QuotationPackTableTree extends Component { | ||
| 655 | handleGetOtherData = async (tableList, childTableList, configMap) => { | 655 | handleGetOtherData = async (tableList, childTableList, configMap) => { |
| 656 | const { currentId, slaveData, sModelsType, masterData } = this.props; /* 当前页签数据 */ | 656 | const { currentId, slaveData, sModelsType, masterData } = this.props; /* 当前页签数据 */ |
| 657 | const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ | 657 | const sId = currentId || this.props.masterData?.sId || ''; /* 数据Id */ |
| 658 | - if(commonUtils.isNotEmptyObject(configMap)){ | 658 | + if (commonUtils.isNotEmptyObject(configMap)) { |
| 659 | for (const configName of Object.keys(configMap)) { | 659 | for (const configName of Object.keys(configMap)) { |
| 660 | const tableName = configName.replace('Config', '').trim(); | 660 | const tableName = configName.replace('Config', '').trim(); |
| 661 | const childConfig = configMap[configName]; | 661 | const childConfig = configMap[configName]; |
| @@ -667,26 +667,26 @@ class QuotationPackTableTree extends Component { | @@ -667,26 +667,26 @@ class QuotationPackTableTree extends Component { | ||
| 667 | }; | 667 | }; |
| 668 | 668 | ||
| 669 | /* 获取套件树形全部结构 */ | 669 | /* 获取套件树形全部结构 */ |
| 670 | - handleGetTotalTreeData= (masterData,slaveData,controlData,materialsData,processData, isWait) => { | 670 | + handleGetTotalTreeData = (masterData, slaveData, controlData, materialsData, processData, isWait) => { |
| 671 | /* 生成部件树结构 */ | 671 | /* 生成部件树结构 */ |
| 672 | let totalTreeData = []; | 672 | let totalTreeData = []; |
| 673 | const childrenSlave = []; | 673 | const childrenSlave = []; |
| 674 | const expandedKeys = []; | 674 | const expandedKeys = []; |
| 675 | - const addState ={}; | 675 | + const addState = {}; |
| 676 | // let { totalTreeSelectedKeys } = this.props; | 676 | // let { totalTreeSelectedKeys } = this.props; |
| 677 | if (commonUtils.isNotEmptyObject(masterData)) { | 677 | if (commonUtils.isNotEmptyObject(masterData)) { |
| 678 | /* 添加从表作为二级节点 */ | 678 | /* 添加从表作为二级节点 */ |
| 679 | let bRelation = false; /* 从表与控制表没有关联性 */ | 679 | let bRelation = false; /* 从表与控制表没有关联性 */ |
| 680 | let bSuit = false; /* 默认是非套件 */ | 680 | let bSuit = false; /* 默认是非套件 */ |
| 681 | - if(commonUtils.isNotEmptyArr(processData)) { | ||
| 682 | - const processFilterData= processData.filter(item => item.sType === '3' && commonUtils.isNotEmptyObject(item.sCombineChildProductName)); | ||
| 683 | - if(commonUtils.isNotEmptyArr(processFilterData)) { | 681 | + if (commonUtils.isNotEmptyArr(processData)) { |
| 682 | + const processFilterData = processData.filter(item => item.sType === '3' && commonUtils.isNotEmptyObject(item.sCombineChildProductName)); | ||
| 683 | + if (commonUtils.isNotEmptyArr(processFilterData)) { | ||
| 684 | bSuit = true; /* 只要有一个成品工序有子产品 则代表是套装 */ | 684 | bSuit = true; /* 只要有一个成品工序有子产品 则代表是套装 */ |
| 685 | } | 685 | } |
| 686 | } | 686 | } |
| 687 | 687 | ||
| 688 | - if(commonUtils.isNotEmptyArr(slaveData)){ | ||
| 689 | - slaveData.forEach((itemSlave,index) => { | 688 | + if (commonUtils.isNotEmptyArr(slaveData)) { |
| 689 | + slaveData.forEach((itemSlave, index) => { | ||
| 690 | const { sId, sProductName } = itemSlave; | 690 | const { sId, sProductName } = itemSlave; |
| 691 | const treeSlaveRow = {}; | 691 | const treeSlaveRow = {}; |
| 692 | treeSlaveRow.key = sId; | 692 | treeSlaveRow.key = sId; |
| @@ -695,20 +695,20 @@ class QuotationPackTableTree extends Component { | @@ -695,20 +695,20 @@ class QuotationPackTableTree extends Component { | ||
| 695 | treeSlaveRow.sIconType = '00'; /* 顶元素 */ | 695 | treeSlaveRow.sIconType = '00'; /* 顶元素 */ |
| 696 | /* 获取从表关联的控制表 */ | 696 | /* 获取从表关联的控制表 */ |
| 697 | const childrenControl = []; | 697 | const childrenControl = []; |
| 698 | - if(commonUtils.isNotEmptyArr(controlData)){ | ||
| 699 | - const controlCollection =[]; | 698 | + if (commonUtils.isNotEmptyArr(controlData)) { |
| 699 | + const controlCollection = []; | ||
| 700 | controlData.forEach((itemControl) => { | 700 | controlData.forEach((itemControl) => { |
| 701 | - if(itemControl.sCombinedMemo && itemControl.sCombinedMemo !== '') { | 701 | + if (itemControl.sCombinedMemo && itemControl.sCombinedMemo !== '') { |
| 702 | const sCombinedMemoArr = commonUtils.isJSON(itemControl.sCombinedMemo) ? JSON.parse(itemControl.sCombinedMemo) : []; | 702 | const sCombinedMemoArr = commonUtils.isJSON(itemControl.sCombinedMemo) ? JSON.parse(itemControl.sCombinedMemo) : []; |
| 703 | const len = sCombinedMemoArr.filter(item => item.sProductNo.indexOf(itemSlave.sProductNo) !== -1).length; | 703 | const len = sCombinedMemoArr.filter(item => item.sProductNo.indexOf(itemSlave.sProductNo) !== -1).length; |
| 704 | - if(len > 0) { | ||
| 705 | - const sAllId =itemControl.sAllId; | 704 | + if (len > 0) { |
| 705 | + const sAllId = itemControl.sAllId; | ||
| 706 | /* 找到这个sAllId的第一级 把整个部件挂到产品下面 */ | 706 | /* 找到这个sAllId的第一级 把整个部件挂到产品下面 */ |
| 707 | if (commonUtils.isNotEmptyObject(sAllId)) { | 707 | if (commonUtils.isNotEmptyObject(sAllId)) { |
| 708 | const arr = sAllId.split(','); | 708 | const arr = sAllId.split(','); |
| 709 | - if (arr.length > 0){ | ||
| 710 | - const firstsId =arr[0]; /* 从sAllId找第一级*/ | ||
| 711 | - if(!controlCollection.includes(firstsId)){ | 709 | + if (arr.length > 0) { |
| 710 | + const firstsId = arr[0]; /* 从sAllId找第一级*/ | ||
| 711 | + if (!controlCollection.includes(firstsId)) { | ||
| 712 | controlCollection.push(firstsId) | 712 | controlCollection.push(firstsId) |
| 713 | } | 713 | } |
| 714 | } | 714 | } |
| @@ -717,13 +717,13 @@ class QuotationPackTableTree extends Component { | @@ -717,13 +717,13 @@ class QuotationPackTableTree extends Component { | ||
| 717 | } | 717 | } |
| 718 | }); | 718 | }); |
| 719 | const sTitle = bSuit ? '子产品-' : '部件-'; | 719 | const sTitle = bSuit ? '子产品-' : '部件-'; |
| 720 | - if(commonUtils.isNotEmptyArr(controlCollection)){ /* 作为子表子级1 */ | ||
| 721 | - bRelation =true; | 720 | + if (commonUtils.isNotEmptyArr(controlCollection)) { /* 作为子表子级1 */ |
| 721 | + bRelation = true; | ||
| 722 | for (const key of controlCollection) { | 722 | for (const key of controlCollection) { |
| 723 | - const iIndex =controlData.findIndex(item => item.sId === key); | ||
| 724 | - if(iIndex > -1) { | 723 | + const iIndex = controlData.findIndex(item => item.sId === key); |
| 724 | + if (iIndex > -1) { | ||
| 725 | const tableRow = controlData[iIndex]; | 725 | const tableRow = controlData[iIndex]; |
| 726 | - const { sId,sAllId } = tableRow; | 726 | + const { sId, sAllId } = tableRow; |
| 727 | const treeControlRow = {} | 727 | const treeControlRow = {} |
| 728 | treeControlRow.key = sId; | 728 | treeControlRow.key = sId; |
| 729 | // treeControlRow.key = sId + '-' +commonUtils.createSid(); | 729 | // treeControlRow.key = sId + '-' +commonUtils.createSid(); |
| @@ -732,20 +732,20 @@ class QuotationPackTableTree extends Component { | @@ -732,20 +732,20 @@ class QuotationPackTableTree extends Component { | ||
| 732 | treeControlRow.sIconType = '10'; /* 部件 */ | 732 | treeControlRow.sIconType = '10'; /* 部件 */ |
| 733 | /* 控制表根据一级菜单获取子集 */ | 733 | /* 控制表根据一级菜单获取子集 */ |
| 734 | let childrenChild = []; | 734 | let childrenChild = []; |
| 735 | - childrenChild = this.handleGetControlTreeChildData(sId, controlData,materialsData,processData); | 735 | + childrenChild = this.handleGetControlTreeChildData(sId, controlData, materialsData, processData); |
| 736 | let sChildren = '1'; /* 树形结构最后一个节点设置为1 */ | 736 | let sChildren = '1'; /* 树形结构最后一个节点设置为1 */ |
| 737 | if (commonUtils.isNotEmptyArr(childrenChild)) { | 737 | if (commonUtils.isNotEmptyArr(childrenChild)) { |
| 738 | sChildren = '0'; /* 树形结构其他节点设置为0 */ | 738 | sChildren = '0'; /* 树形结构其他节点设置为0 */ |
| 739 | } | 739 | } |
| 740 | /* 挂载子产品对应的成品工序 */ | 740 | /* 挂载子产品对应的成品工序 */ |
| 741 | - if(bSuit && commonUtils.isNotEmptyArr(processData)){ | 741 | + if (bSuit && commonUtils.isNotEmptyArr(processData)) { |
| 742 | const childTree = commonUtils.isNotEmptyArr(processData) ? processData.filter(item => item.sType === '3' && key === item.sCombineChildProductName) : []; | 742 | const childTree = commonUtils.isNotEmptyArr(processData) ? processData.filter(item => item.sType === '3' && key === item.sCombineChildProductName) : []; |
| 743 | if (commonUtils.isNotEmptyArr(childTree)) { | 743 | if (commonUtils.isNotEmptyArr(childTree)) { |
| 744 | childTree.forEach((child) => { | 744 | childTree.forEach((child) => { |
| 745 | - const { sId, sProcessName,sPartsName } = child; | 745 | + const { sId, sProcessName, sPartsName } = child; |
| 746 | const treeProcessRow = {}; | 746 | const treeProcessRow = {}; |
| 747 | treeProcessRow.key = sId; | 747 | treeProcessRow.key = sId; |
| 748 | - treeProcessRow.showName = '成品工序' +'-'+ sProcessName; | 748 | + treeProcessRow.showName = '成品工序' + '-' + sProcessName; |
| 749 | treeProcessRow.sAllId = child.sAllId; | 749 | treeProcessRow.sAllId = child.sAllId; |
| 750 | treeControlRow.sIconType = '03'; /* 成品工序 */ | 750 | treeControlRow.sIconType = '03'; /* 成品工序 */ |
| 751 | childrenChild.push(treeProcessRow); | 751 | childrenChild.push(treeProcessRow); |
| @@ -768,41 +768,41 @@ class QuotationPackTableTree extends Component { | @@ -768,41 +768,41 @@ class QuotationPackTableTree extends Component { | ||
| 768 | childrenSlave.push(treeSlaveRow); | 768 | childrenSlave.push(treeSlaveRow); |
| 769 | 769 | ||
| 770 | /* 如果从表与控制表没有关联 */ | 770 | /* 如果从表与控制表没有关联 */ |
| 771 | - if(!bRelation){ | 771 | + if (!bRelation) { |
| 772 | controlData.forEach((itemControl) => { | 772 | controlData.forEach((itemControl) => { |
| 773 | - const { sId,sAllId,sPartsName } = itemControl; | 773 | + const { sId, sAllId, sPartsName } = itemControl; |
| 774 | const treeControlRow = {} | 774 | const treeControlRow = {} |
| 775 | - treeControlRow.key = sId + '-' +commonUtils.createSid(); | 775 | + treeControlRow.key = sId + '-' + commonUtils.createSid(); |
| 776 | // treeControlRow.key = sId; | 776 | // treeControlRow.key = sId; |
| 777 | treeControlRow.showName = '部件-' + sPartsName; | 777 | treeControlRow.showName = '部件-' + sPartsName; |
| 778 | treeControlRow.sAllId = sAllId; | 778 | treeControlRow.sAllId = sAllId; |
| 779 | - treeControlRow.sId =sId; | 779 | + treeControlRow.sId = sId; |
| 780 | treeControlRow.sIconType = '10'; /* 部件 */ | 780 | treeControlRow.sIconType = '10'; /* 部件 */ |
| 781 | /* 控制表根据一级菜单获取子集 */ | 781 | /* 控制表根据一级菜单获取子集 */ |
| 782 | let childrenChild = []; | 782 | let childrenChild = []; |
| 783 | - childrenChild = this.handleGetControlTreeChildData(sId, controlData,materialsData,processData); | 783 | + childrenChild = this.handleGetControlTreeChildData(sId, controlData, materialsData, processData); |
| 784 | let sChildren = '1'; /* 树形结构最后一个节点设置为1 */ | 784 | let sChildren = '1'; /* 树形结构最后一个节点设置为1 */ |
| 785 | if (commonUtils.isNotEmptyArr(childrenChild)) { | 785 | if (commonUtils.isNotEmptyArr(childrenChild)) { |
| 786 | sChildren = '0'; /* 树形结构其他节点设置为0 */ | 786 | sChildren = '0'; /* 树形结构其他节点设置为0 */ |
| 787 | } | 787 | } |
| 788 | treeControlRow.sChildren = sChildren; | 788 | treeControlRow.sChildren = sChildren; |
| 789 | treeControlRow.children = commonUtils.isNotEmptyArr(childrenChild) ? childrenChild : []; | 789 | treeControlRow.children = commonUtils.isNotEmptyArr(childrenChild) ? childrenChild : []; |
| 790 | - const filterData =childrenSlave.filter(item => item.sId ===treeControlRow.sId); | ||
| 791 | - if(commonUtils.isEmptyArr(filterData)){ | 790 | + const filterData = childrenSlave.filter(item => item.sId === treeControlRow.sId); |
| 791 | + if (commonUtils.isEmptyArr(filterData)) { | ||
| 792 | childrenSlave.push(treeControlRow); | 792 | childrenSlave.push(treeControlRow); |
| 793 | } | 793 | } |
| 794 | }); | 794 | }); |
| 795 | } | 795 | } |
| 796 | 796 | ||
| 797 | /* 加载成品材料、成品工序作为从表的同级 */ | 797 | /* 加载成品材料、成品工序作为从表的同级 */ |
| 798 | - if(commonUtils.isNotEmptyArr(materialsData)){ | 798 | + if (commonUtils.isNotEmptyArr(materialsData)) { |
| 799 | const childTree = commonUtils.isNotEmptyArr(materialsData) ? materialsData.filter(item => item.sType === '2') : []; | 799 | const childTree = commonUtils.isNotEmptyArr(materialsData) ? materialsData.filter(item => item.sType === '2') : []; |
| 800 | if (commonUtils.isNotEmptyArr(childTree)) { | 800 | if (commonUtils.isNotEmptyArr(childTree)) { |
| 801 | childTree.forEach((child) => { | 801 | childTree.forEach((child) => { |
| 802 | - const { sId, sMaterialsName,sPartsName } = child; | 802 | + const { sId, sMaterialsName, sPartsName } = child; |
| 803 | const treeDataRow = {}; | 803 | const treeDataRow = {}; |
| 804 | - treeDataRow.key = sId + '-' +commonUtils.createSid(); | ||
| 805 | - treeDataRow.showName = '成品材料' +'-'+ sMaterialsName; | 804 | + treeDataRow.key = sId + '-' + commonUtils.createSid(); |
| 805 | + treeDataRow.showName = '成品材料' + '-' + sMaterialsName; | ||
| 806 | treeDataRow.sIconType = '02'; /* 成品材料 */ | 806 | treeDataRow.sIconType = '02'; /* 成品材料 */ |
| 807 | treeDataRow.sAllId = child.sAllId; | 807 | treeDataRow.sAllId = child.sAllId; |
| 808 | childrenSlave.push(treeDataRow); | 808 | childrenSlave.push(treeDataRow); |
| @@ -810,27 +810,27 @@ class QuotationPackTableTree extends Component { | @@ -810,27 +810,27 @@ class QuotationPackTableTree extends Component { | ||
| 810 | } | 810 | } |
| 811 | } | 811 | } |
| 812 | /* 获取工序表 */ | 812 | /* 获取工序表 */ |
| 813 | - if(!bSuit){ | 813 | + if (!bSuit) { |
| 814 | const childTree = commonUtils.isNotEmptyArr(processData) ? processData.filter(item => item.sType === '3') : []; | 814 | const childTree = commonUtils.isNotEmptyArr(processData) ? processData.filter(item => item.sType === '3') : []; |
| 815 | if (commonUtils.isNotEmptyArr(childTree)) { | 815 | if (commonUtils.isNotEmptyArr(childTree)) { |
| 816 | childTree.forEach((child) => { | 816 | childTree.forEach((child) => { |
| 817 | - const { sId, sProcessName,sPartsName } = child; | 817 | + const { sId, sProcessName, sPartsName } = child; |
| 818 | const treeDataRow = {}; | 818 | const treeDataRow = {}; |
| 819 | - treeDataRow.key = sId + '-' +commonUtils.createSid();; | ||
| 820 | - treeDataRow.showName = '成品工序' +'-'+ sProcessName; | 819 | + treeDataRow.key = sId + '-' + commonUtils.createSid();; |
| 820 | + treeDataRow.showName = '成品工序' + '-' + sProcessName; | ||
| 821 | treeDataRow.sIconType = '03'; /* 部件 */ | 821 | treeDataRow.sIconType = '03'; /* 部件 */ |
| 822 | treeDataRow.sAllId = child.sAllId; | 822 | treeDataRow.sAllId = child.sAllId; |
| 823 | childrenSlave.push(treeDataRow); | 823 | childrenSlave.push(treeDataRow); |
| 824 | }); | 824 | }); |
| 825 | } | 825 | } |
| 826 | - }else { /* 成品工序挂在从表下的 */ | 826 | + } else { /* 成品工序挂在从表下的 */ |
| 827 | const childTree = commonUtils.isNotEmptyArr(processData) ? processData.filter(item => item.sType === '3' && commonUtils.isEmptyObject(item.sCombineChildProductName)) : []; | 827 | const childTree = commonUtils.isNotEmptyArr(processData) ? processData.filter(item => item.sType === '3' && commonUtils.isEmptyObject(item.sCombineChildProductName)) : []; |
| 828 | if (commonUtils.isNotEmptyArr(childTree)) { | 828 | if (commonUtils.isNotEmptyArr(childTree)) { |
| 829 | childTree.forEach((child) => { | 829 | childTree.forEach((child) => { |
| 830 | - const { sId, sProcessName,sPartsName } = child; | 830 | + const { sId, sProcessName, sPartsName } = child; |
| 831 | const treeDataRow = {}; | 831 | const treeDataRow = {}; |
| 832 | - treeDataRow.key = sId + '-' +commonUtils.createSid();; | ||
| 833 | - treeDataRow.showName = '成品工序' +'-'+ sProcessName; | 832 | + treeDataRow.key = sId + '-' + commonUtils.createSid();; |
| 833 | + treeDataRow.showName = '成品工序' + '-' + sProcessName; | ||
| 834 | treeDataRow.sIconType = '03'; /* 部件 */ | 834 | treeDataRow.sIconType = '03'; /* 部件 */ |
| 835 | treeDataRow.sAllId = child.sAllId; | 835 | treeDataRow.sAllId = child.sAllId; |
| 836 | childrenSlave.push(treeDataRow); | 836 | childrenSlave.push(treeDataRow); |
| @@ -838,17 +838,17 @@ class QuotationPackTableTree extends Component { | @@ -838,17 +838,17 @@ class QuotationPackTableTree extends Component { | ||
| 838 | } | 838 | } |
| 839 | } | 839 | } |
| 840 | 840 | ||
| 841 | - if(!expandedKeys.includes(sId)){ | 841 | + if (!expandedKeys.includes(sId)) { |
| 842 | expandedKeys.push(sId); | 842 | expandedKeys.push(sId); |
| 843 | } | 843 | } |
| 844 | - totalTreeData= childrenSlave; | 844 | + totalTreeData = childrenSlave; |
| 845 | }); | 845 | }); |
| 846 | } | 846 | } |
| 847 | } else { | 847 | } else { |
| 848 | totalTreeData = []; | 848 | totalTreeData = []; |
| 849 | } | 849 | } |
| 850 | - addState.totalTreeData=totalTreeData; | ||
| 851 | - addState.expandedKeys=expandedKeys; | 850 | + addState.totalTreeData = totalTreeData; |
| 851 | + addState.expandedKeys = expandedKeys; | ||
| 852 | if (isWait) { | 852 | if (isWait) { |
| 853 | return { ...addState }; | 853 | return { ...addState }; |
| 854 | } else { | 854 | } else { |
| @@ -861,7 +861,7 @@ class QuotationPackTableTree extends Component { | @@ -861,7 +861,7 @@ class QuotationPackTableTree extends Component { | ||
| 861 | 861 | ||
| 862 | 862 | ||
| 863 | /** 获取部件树 */ | 863 | /** 获取部件树 */ |
| 864 | - handleGetControlTreeData= (controlData, isWait) => { | 864 | + handleGetControlTreeData = (controlData, isWait) => { |
| 865 | /* 生成部件树结构 */ | 865 | /* 生成部件树结构 */ |
| 866 | let treeData = []; | 866 | let treeData = []; |
| 867 | if (isWait) { | 867 | if (isWait) { |
| @@ -875,7 +875,7 @@ class QuotationPackTableTree extends Component { | @@ -875,7 +875,7 @@ class QuotationPackTableTree extends Component { | ||
| 875 | }; | 875 | }; |
| 876 | 876 | ||
| 877 | 877 | ||
| 878 | - handleGetControlTreeDataBak= (controlData, isWait) => { | 878 | + handleGetControlTreeDataBak = (controlData, isWait) => { |
| 879 | /* 生成部件树结构 */ | 879 | /* 生成部件树结构 */ |
| 880 | let treeData = []; | 880 | let treeData = []; |
| 881 | const expandedKeys = []; | 881 | const expandedKeys = []; |
| @@ -921,7 +921,7 @@ class QuotationPackTableTree extends Component { | @@ -921,7 +921,7 @@ class QuotationPackTableTree extends Component { | ||
| 921 | }; | 921 | }; |
| 922 | 922 | ||
| 923 | /** 获取子节点数据 */ | 923 | /** 获取子节点数据 */ |
| 924 | - handleGetControlTreeChildData= (sParentId, controlData,materialsData,processData) => { | 924 | + handleGetControlTreeChildData = (sParentId, controlData, materialsData, processData) => { |
| 925 | if (commonUtils.isNotEmptyObject(sParentId) && commonUtils.isNotEmptyArr(controlData)) { | 925 | if (commonUtils.isNotEmptyObject(sParentId) && commonUtils.isNotEmptyArr(controlData)) { |
| 926 | const childTree = commonUtils.isNotEmptyArr(controlData) ? controlData.filter(item => item.sControlParentId === sParentId) : []; | 926 | const childTree = commonUtils.isNotEmptyArr(controlData) ? controlData.filter(item => item.sControlParentId === sParentId) : []; |
| 927 | const children = []; | 927 | const children = []; |
| @@ -934,7 +934,7 @@ class QuotationPackTableTree extends Component { | @@ -934,7 +934,7 @@ class QuotationPackTableTree extends Component { | ||
| 934 | treeDataRow.parentKey = sParentId; | 934 | treeDataRow.parentKey = sParentId; |
| 935 | treeDataRow.sAllId = child.sAllId; | 935 | treeDataRow.sAllId = child.sAllId; |
| 936 | treeDataRow.sIconType = '10'; /* 部件 */ | 936 | treeDataRow.sIconType = '10'; /* 部件 */ |
| 937 | - const data = this.handleGetControlTreeChildData(sId, controlData,materialsData,processData); | 937 | + const data = this.handleGetControlTreeChildData(sId, controlData, materialsData, processData); |
| 938 | let sChildren = '1'; /* 最后一个节点设置为1 */ | 938 | let sChildren = '1'; /* 最后一个节点设置为1 */ |
| 939 | if (commonUtils.isNotEmptyArr(data)) { | 939 | if (commonUtils.isNotEmptyArr(data)) { |
| 940 | sChildren = '0'; | 940 | sChildren = '0'; |
| @@ -952,7 +952,7 @@ class QuotationPackTableTree extends Component { | @@ -952,7 +952,7 @@ class QuotationPackTableTree extends Component { | ||
| 952 | } | 952 | } |
| 953 | 953 | ||
| 954 | /* 获取材料表 */ | 954 | /* 获取材料表 */ |
| 955 | - if(commonUtils.isNotEmptyArr(materialsData)){ | 955 | + if (commonUtils.isNotEmptyArr(materialsData)) { |
| 956 | const childTree = commonUtils.isNotEmptyArr(materialsData) ? materialsData.filter(item => item.sControlId === sParentId) : []; | 956 | const childTree = commonUtils.isNotEmptyArr(materialsData) ? materialsData.filter(item => item.sControlId === sParentId) : []; |
| 957 | if (commonUtils.isNotEmptyArr(childTree)) { | 957 | if (commonUtils.isNotEmptyArr(childTree)) { |
| 958 | childTree.forEach((child) => { | 958 | childTree.forEach((child) => { |
| @@ -968,11 +968,11 @@ class QuotationPackTableTree extends Component { | @@ -968,11 +968,11 @@ class QuotationPackTableTree extends Component { | ||
| 968 | } | 968 | } |
| 969 | } | 969 | } |
| 970 | /* 获取工序表 */ | 970 | /* 获取工序表 */ |
| 971 | - if(commonUtils.isNotEmptyArr(processData)){ | 971 | + if (commonUtils.isNotEmptyArr(processData)) { |
| 972 | const childTree = commonUtils.isNotEmptyArr(processData) ? processData.filter(item => item.sControlId === sParentId) : []; | 972 | const childTree = commonUtils.isNotEmptyArr(processData) ? processData.filter(item => item.sControlId === sParentId) : []; |
| 973 | if (commonUtils.isNotEmptyArr(childTree)) { | 973 | if (commonUtils.isNotEmptyArr(childTree)) { |
| 974 | childTree.forEach((child) => { | 974 | childTree.forEach((child) => { |
| 975 | - const { sId, sProcessName } = child; | 975 | + const { sId, sProcessName } = child; |
| 976 | const treeDataRow = {}; | 976 | const treeDataRow = {}; |
| 977 | treeDataRow.key = sId; | 977 | treeDataRow.key = sId; |
| 978 | // treeDataRow.showName = '部件工序-'+ sProcessName; | 978 | // treeDataRow.showName = '部件工序-'+ sProcessName; |
| @@ -989,7 +989,7 @@ class QuotationPackTableTree extends Component { | @@ -989,7 +989,7 @@ class QuotationPackTableTree extends Component { | ||
| 989 | }; | 989 | }; |
| 990 | 990 | ||
| 991 | /** 根据key查找树节点并改变属性 */ | 991 | /** 根据key查找树节点并改变属性 */ |
| 992 | - handleSearchNodes= (key, data, showNameNew) => { | 992 | + handleSearchNodes = (key, data, showNameNew) => { |
| 993 | if (commonUtils.isNotEmptyObject(showNameNew)) { | 993 | if (commonUtils.isNotEmptyObject(showNameNew)) { |
| 994 | data.forEach((item) => { | 994 | data.forEach((item) => { |
| 995 | if (item.key === key) { | 995 | if (item.key === key) { |
| @@ -1012,7 +1012,7 @@ class QuotationPackTableTree extends Component { | @@ -1012,7 +1012,7 @@ class QuotationPackTableTree extends Component { | ||
| 1012 | 1012 | ||
| 1013 | const masterReturn = (await commonServices.postValueService(token, values, url)).data; | 1013 | const masterReturn = (await commonServices.postValueService(token, values, url)).data; |
| 1014 | if (masterReturn.code === 1) { | 1014 | if (masterReturn.code === 1) { |
| 1015 | - if(commonUtils.isNotEmptyObject(masterReturn.dataset) && commonUtils.isNotEmptyArr(masterReturn.dataset.rows) ) { | 1015 | + if (commonUtils.isNotEmptyObject(masterReturn.dataset) && commonUtils.isNotEmptyArr(masterReturn.dataset.rows)) { |
| 1016 | const sBackProcessDataValue = masterReturn.dataset.rows; | 1016 | const sBackProcessDataValue = masterReturn.dataset.rows; |
| 1017 | if (isWait) { | 1017 | if (isWait) { |
| 1018 | return { sBackProcessData: sBackProcessDataValue }; | 1018 | return { sBackProcessData: sBackProcessDataValue }; |
| @@ -1182,7 +1182,7 @@ class QuotationPackTableTree extends Component { | @@ -1182,7 +1182,7 @@ class QuotationPackTableTree extends Component { | ||
| 1182 | } | 1182 | } |
| 1183 | const returnChange = await this.props.onChange(name, sFieldName, changeValue, sId, dropDownData, true, masterData); | 1183 | const returnChange = await this.props.onChange(name, sFieldName, changeValue, sId, dropDownData, true, masterData); |
| 1184 | const masterDataDefault = commonFunc.getDefaultData(masterConfig, {}); | 1184 | const masterDataDefault = commonFunc.getDefaultData(masterConfig, {}); |
| 1185 | - returnChange.masterData = { ...masterDataDefault, ...returnChange.masterData }; | 1185 | + returnChange.masterData = { ...masterDataDefault, ...returnChange.masterData }; |
| 1186 | if (isWait) { | 1186 | if (isWait) { |
| 1187 | return { | 1187 | return { |
| 1188 | ...returnChange, sBackProcessClassifyData, masterConfig, ...backProcessData, | 1188 | ...returnChange, sBackProcessClassifyData, masterConfig, ...backProcessData, |
| @@ -1209,7 +1209,7 @@ class QuotationPackTableTree extends Component { | @@ -1209,7 +1209,7 @@ class QuotationPackTableTree extends Component { | ||
| 1209 | }; | 1209 | }; |
| 1210 | 1210 | ||
| 1211 | /* 数据生成按钮 */ | 1211 | /* 数据生成按钮 */ |
| 1212 | - handleDataCreate= async () => { | 1212 | + handleDataCreate = async () => { |
| 1213 | let { checkProcessClassifyData } = this.props; | 1213 | let { checkProcessClassifyData } = this.props; |
| 1214 | const { | 1214 | const { |
| 1215 | masterData, slaveConfig, materialsConfig, processConfig, sModelsId, app, dispatch, | 1215 | masterData, slaveConfig, materialsConfig, processConfig, sModelsId, app, dispatch, |
| @@ -1650,7 +1650,7 @@ class QuotationPackTableTree extends Component { | @@ -1650,7 +1650,7 @@ class QuotationPackTableTree extends Component { | ||
| 1650 | }; | 1650 | }; |
| 1651 | 1651 | ||
| 1652 | /* 勾选工序分类 */ | 1652 | /* 勾选工序分类 */ |
| 1653 | - handleProcessChange=(e, value, sPartsName) => { | 1653 | + handleProcessChange = (e, value, sPartsName) => { |
| 1654 | let { checkProcessClassifyData } = this.props; | 1654 | let { checkProcessClassifyData } = this.props; |
| 1655 | let index = -1; | 1655 | let index = -1; |
| 1656 | if (commonUtils.isNotEmptyArr(checkProcessClassifyData)) { | 1656 | if (commonUtils.isNotEmptyArr(checkProcessClassifyData)) { |
| @@ -1750,7 +1750,7 @@ class QuotationPackTableTree extends Component { | @@ -1750,7 +1750,7 @@ class QuotationPackTableTree extends Component { | ||
| 1750 | data.push(commonBusiness.mergeData('materials', materialsConfig.sTbName, materialsData, materialsDelData)); | 1750 | data.push(commonBusiness.mergeData('materials', materialsConfig.sTbName, materialsData, materialsDelData)); |
| 1751 | data.push(commonBusiness.mergeData('process', processConfig.sTbName, processData, processDelData)); | 1751 | data.push(commonBusiness.mergeData('process', processConfig.sTbName, processData, processDelData)); |
| 1752 | 1752 | ||
| 1753 | - if(commonUtils.isNotEmptyObject(manyqtysConfig)) { | 1753 | + if (commonUtils.isNotEmptyObject(manyqtysConfig)) { |
| 1754 | data.push(commonBusiness.mergeData('manyqtys', manyqtysConfig.sTbName, manyqtysData, manyqtysDelData)); | 1754 | data.push(commonBusiness.mergeData('manyqtys', manyqtysConfig.sTbName, manyqtysData, manyqtysDelData)); |
| 1755 | } | 1755 | } |
| 1756 | 1756 | ||
| @@ -1760,19 +1760,19 @@ class QuotationPackTableTree extends Component { | @@ -1760,19 +1760,19 @@ class QuotationPackTableTree extends Component { | ||
| 1760 | if (commonUtils.isNotEmptyArr(data)) { | 1760 | if (commonUtils.isNotEmptyArr(data)) { |
| 1761 | for (const table of data) { | 1761 | for (const table of data) { |
| 1762 | for (const key of Object.keys(table)) { | 1762 | for (const key of Object.keys(table)) { |
| 1763 | - if( key.includes('column')) { /* 只要一个column有值 代表有更改 要走自动计算 */ | ||
| 1764 | - if(commonUtils.isNotEmptyArr(table[key])) { | 1763 | + if (key.includes('column')) { /* 只要一个column有值 代表有更改 要走自动计算 */ |
| 1764 | + if (commonUtils.isNotEmptyArr(table[key])) { | ||
| 1765 | skipFlag = 0; | 1765 | skipFlag = 0; |
| 1766 | break; | 1766 | break; |
| 1767 | } | 1767 | } |
| 1768 | } | 1768 | } |
| 1769 | } | 1769 | } |
| 1770 | - if(skipFlag === 0) { /* skipFlag=0 代表不自动计算 */ | 1770 | + if (skipFlag === 0) { /* skipFlag=0 代表不自动计算 */ |
| 1771 | break; | 1771 | break; |
| 1772 | } | 1772 | } |
| 1773 | } | 1773 | } |
| 1774 | } | 1774 | } |
| 1775 | - if(((skipFlag === 0) || masterData.bNoVerify) && !skipCalculation) { | 1775 | + if (((skipFlag === 0) || masterData.bNoVerify) && !skipCalculation) { |
| 1776 | this.handleCalculation(true); | 1776 | this.handleCalculation(true); |
| 1777 | } else { | 1777 | } else { |
| 1778 | this.props.onSaveData({ | 1778 | this.props.onSaveData({ |
| @@ -1819,7 +1819,7 @@ class QuotationPackTableTree extends Component { | @@ -1819,7 +1819,7 @@ class QuotationPackTableTree extends Component { | ||
| 1819 | addState.controlSelectedRowKeys = [tableData[iIndex].sControlId]; | 1819 | addState.controlSelectedRowKeys = [tableData[iIndex].sControlId]; |
| 1820 | } | 1820 | } |
| 1821 | } | 1821 | } |
| 1822 | - if(name === 'process') { | 1822 | + if (name === 'process') { |
| 1823 | addState.processSelectedData = [tableData[iIndex]]; | 1823 | addState.processSelectedData = [tableData[iIndex]]; |
| 1824 | addState.processSelectedRowKeys = selectedRowKeys; | 1824 | addState.processSelectedRowKeys = selectedRowKeys; |
| 1825 | } | 1825 | } |
| @@ -1888,8 +1888,8 @@ class QuotationPackTableTree extends Component { | @@ -1888,8 +1888,8 @@ class QuotationPackTableTree extends Component { | ||
| 1888 | /** 添加表格空行 */ | 1888 | /** 添加表格空行 */ |
| 1889 | handleTableAdd = (name, flag, bchild, bFinished, bModalAdd) => { | 1889 | handleTableAdd = (name, flag, bchild, bFinished, bModalAdd) => { |
| 1890 | const { masterConfig } = this.props; | 1890 | const { masterConfig } = this.props; |
| 1891 | - if(bModalAdd === true) { | ||
| 1892 | - if(name === 'materials') { | 1891 | + if (bModalAdd === true) { |
| 1892 | + if (name === 'materials') { | ||
| 1893 | let iIndex = -1; | 1893 | let iIndex = -1; |
| 1894 | if (bFinished) { | 1894 | if (bFinished) { |
| 1895 | iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === "BtnChooseProductMaterials"); | 1895 | iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === "BtnChooseProductMaterials"); |
| @@ -1903,7 +1903,7 @@ class QuotationPackTableTree extends Component { | @@ -1903,7 +1903,7 @@ class QuotationPackTableTree extends Component { | ||
| 1903 | } | 1903 | } |
| 1904 | } | 1904 | } |
| 1905 | } | 1905 | } |
| 1906 | - if(name === 'process') { | 1906 | + if (name === 'process') { |
| 1907 | let iIndex = -1; | 1907 | let iIndex = -1; |
| 1908 | if (bFinished) { | 1908 | if (bFinished) { |
| 1909 | iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === "BtnChooseProductProcess"); | 1909 | iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === "BtnChooseProductProcess"); |
| @@ -1925,7 +1925,7 @@ class QuotationPackTableTree extends Component { | @@ -1925,7 +1925,7 @@ class QuotationPackTableTree extends Component { | ||
| 1925 | } = this.props; | 1925 | } = this.props; |
| 1926 | let slaveSelectedRow = {}; | 1926 | let slaveSelectedRow = {}; |
| 1927 | let controlSelectedRow = {}; | 1927 | let controlSelectedRow = {}; |
| 1928 | - let { packData }=this.props; | 1928 | + let { packData } = this.props; |
| 1929 | if (name === 'control') { | 1929 | if (name === 'control') { |
| 1930 | /* 增加子部件 */ | 1930 | /* 增加子部件 */ |
| 1931 | const { | 1931 | const { |
| @@ -1969,20 +1969,20 @@ class QuotationPackTableTree extends Component { | @@ -1969,20 +1969,20 @@ class QuotationPackTableTree extends Component { | ||
| 1969 | } | 1969 | } |
| 1970 | } | 1970 | } |
| 1971 | 1971 | ||
| 1972 | - if(bchild !=='sameNode' && bchild !=='childNode') { /* 列头新增 */ | 1972 | + if (bchild !== 'sameNode' && bchild !== 'childNode') { /* 列头新增 */ |
| 1973 | tableDataRow.sAllId = tableDataRow.sId; | 1973 | tableDataRow.sAllId = tableDataRow.sId; |
| 1974 | } | 1974 | } |
| 1975 | 1975 | ||
| 1976 | let slaveSelectedRow = {}; | 1976 | let slaveSelectedRow = {}; |
| 1977 | - if(commonUtils.isNotEmptyArr(slaveSelectedRowKeys)){ /* 从表有选中行 */ | 1977 | + if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) { /* 从表有选中行 */ |
| 1978 | const iSlaveIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sId)); | 1978 | const iSlaveIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sId)); |
| 1979 | - if(iSlaveIndex > -1){ | 1979 | + if (iSlaveIndex > -1) { |
| 1980 | slaveSelectedRow = slaveData[iSlaveIndex]; | 1980 | slaveSelectedRow = slaveData[iSlaveIndex]; |
| 1981 | } | 1981 | } |
| 1982 | - }else{ /* 没有选中行 */ | ||
| 1983 | - if(slaveData.length ===1){ | ||
| 1984 | - slaveSelectedRow =slaveData[0]; | ||
| 1985 | - }else{ | 1982 | + } else { /* 没有选中行 */ |
| 1983 | + if (slaveData.length === 1) { | ||
| 1984 | + slaveSelectedRow = slaveData[0]; | ||
| 1985 | + } else { | ||
| 1986 | message.error('请选择从表!') | 1986 | message.error('请选择从表!') |
| 1987 | } | 1987 | } |
| 1988 | } | 1988 | } |
| @@ -1991,25 +1991,25 @@ class QuotationPackTableTree extends Component { | @@ -1991,25 +1991,25 @@ class QuotationPackTableTree extends Component { | ||
| 1991 | tableDataRow.sPartsName = slaveSelectedRow.sProductName; | 1991 | tableDataRow.sPartsName = slaveSelectedRow.sProductName; |
| 1992 | 1992 | ||
| 1993 | /* 部件表新增时,若合版表没有该sControlId 则默认取从表选中行,合拼1 作为一条packData数据 */ | 1993 | /* 部件表新增时,若合版表没有该sControlId 则默认取从表选中行,合拼1 作为一条packData数据 */ |
| 1994 | - if(commonUtils.isEmptyArr(packData)){ | ||
| 1995 | - packData =[]; | 1994 | + if (commonUtils.isEmptyArr(packData)) { |
| 1995 | + packData = []; | ||
| 1996 | } | 1996 | } |
| 1997 | - if(false){ | ||
| 1998 | - packData =[]; | ||
| 1999 | - } else{ | ||
| 2000 | - const iIndex =packData.findIndex(item=> item.sControlId === tableDataRow.sId); | ||
| 2001 | - if(iIndex ===-1){ | 1997 | + if (false) { |
| 1998 | + packData = []; | ||
| 1999 | + } else { | ||
| 2000 | + const iIndex = packData.findIndex(item => item.sControlId === tableDataRow.sId); | ||
| 2001 | + if (iIndex === -1) { | ||
| 2002 | 2002 | ||
| 2003 | - if(commonUtils.isEmptyObject(slaveSelectedRow.sProductId)) { | 2003 | + if (commonUtils.isEmptyObject(slaveSelectedRow.sProductId)) { |
| 2004 | message.error('请先选择产品!'); | 2004 | message.error('请先选择产品!'); |
| 2005 | return; | 2005 | return; |
| 2006 | } | 2006 | } |
| 2007 | - if(slaveSelectedRow){ | 2007 | + if (slaveSelectedRow) { |
| 2008 | const packDataRow = this.handlePackDataAdd(slaveSelectedRow, 0, tableDataRow.sId, 'add'); | 2008 | const packDataRow = this.handlePackDataAdd(slaveSelectedRow, 0, tableDataRow.sId, 'add'); |
| 2009 | packDataRow.dCombineQty = 1; /* 排版数 */ | 2009 | packDataRow.dCombineQty = 1; /* 排版数 */ |
| 2010 | - if(commonUtils.isNotEmptyObject(packDataRow) && commonUtils.isNotEmptyObject(packDataRow.sProductId)){ /* 从表要选择产品 */ | ||
| 2011 | - const { sId, sProductNo, dProductQty, dCombineQty, dFactProductQty,sCombinePartsName }= packDataRow; | ||
| 2012 | - const tableCombineSelectedData =[]; | 2010 | + if (commonUtils.isNotEmptyObject(packDataRow) && commonUtils.isNotEmptyObject(packDataRow.sProductId)) { /* 从表要选择产品 */ |
| 2011 | + const { sId, sProductNo, dProductQty, dCombineQty, dFactProductQty, sCombinePartsName } = packDataRow; | ||
| 2012 | + const tableCombineSelectedData = []; | ||
| 2013 | const jsonObj = {}; | 2013 | const jsonObj = {}; |
| 2014 | jsonObj.sId = sId; | 2014 | jsonObj.sId = sId; |
| 2015 | jsonObj.sProductNo = sProductNo; /* 产品编号 */ | 2015 | jsonObj.sProductNo = sProductNo; /* 产品编号 */ |
| @@ -2019,7 +2019,7 @@ class QuotationPackTableTree extends Component { | @@ -2019,7 +2019,7 @@ class QuotationPackTableTree extends Component { | ||
| 2019 | jsonObj.sCombinePartsName = sCombinePartsName; /* 合版部件名称 */ | 2019 | jsonObj.sCombinePartsName = sCombinePartsName; /* 合版部件名称 */ |
| 2020 | tableCombineSelectedData.push(jsonObj); | 2020 | tableCombineSelectedData.push(jsonObj); |
| 2021 | const sCombinedMemo = commonUtils.isNotEmptyArr(tableCombineSelectedData) ? JSON.stringify(tableCombineSelectedData) : ''; /* JSON对象转换为字符串存放到合版信息中 */ | 2021 | const sCombinedMemo = commonUtils.isNotEmptyArr(tableCombineSelectedData) ? JSON.stringify(tableCombineSelectedData) : ''; /* JSON对象转换为字符串存放到合版信息中 */ |
| 2022 | - tableDataRow.sCombinedMemo =commonUtils.isNotEmptyObject(sCombinedMemo)? sCombinedMemo: '合版信息'; | 2022 | + tableDataRow.sCombinedMemo = commonUtils.isNotEmptyObject(sCombinedMemo) ? sCombinedMemo : '合版信息'; |
| 2023 | } | 2023 | } |
| 2024 | packData.push(packDataRow); | 2024 | packData.push(packDataRow); |
| 2025 | 2025 | ||
| @@ -2055,43 +2055,43 @@ class QuotationPackTableTree extends Component { | @@ -2055,43 +2055,43 @@ class QuotationPackTableTree extends Component { | ||
| 2055 | }); | 2055 | }); |
| 2056 | } else if (name === 'materials' || name === 'process') { | 2056 | } else if (name === 'materials' || name === 'process') { |
| 2057 | let slaveSelectedRow = {}; | 2057 | let slaveSelectedRow = {}; |
| 2058 | - if(commonUtils.isNotEmptyArr(slaveData)){ | ||
| 2059 | - if(commonUtils.isNotEmptyArr(slaveSelectedRowKeys)){ /* 从表有选中行 */ | 2058 | + if (commonUtils.isNotEmptyArr(slaveData)) { |
| 2059 | + if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) { /* 从表有选中行 */ | ||
| 2060 | const iSlaveIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sId)); | 2060 | const iSlaveIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sId)); |
| 2061 | - if(iSlaveIndex > -1){ | 2061 | + if (iSlaveIndex > -1) { |
| 2062 | slaveSelectedRow = slaveData[iSlaveIndex]; | 2062 | slaveSelectedRow = slaveData[iSlaveIndex]; |
| 2063 | } | 2063 | } |
| 2064 | } else { /* 没有选中行 */ | 2064 | } else { /* 没有选中行 */ |
| 2065 | - slaveSelectedRow =slaveData[0]; | 2065 | + slaveSelectedRow = slaveData[0]; |
| 2066 | } | 2066 | } |
| 2067 | } | 2067 | } |
| 2068 | 2068 | ||
| 2069 | let controlSelectedRow = {}; | 2069 | let controlSelectedRow = {}; |
| 2070 | - if(commonUtils.isNotEmptyArr(controlData)) { | ||
| 2071 | - if(commonUtils.isNotEmptyArr(controlSelectedRowKeys)){ /* 从表有选中行 */ | 2070 | + if (commonUtils.isNotEmptyArr(controlData)) { |
| 2071 | + if (commonUtils.isNotEmptyArr(controlSelectedRowKeys)) { /* 从表有选中行 */ | ||
| 2072 | const iControlIndex = controlData.findIndex(item => controlSelectedRowKeys.includes(item.sId)); | 2072 | const iControlIndex = controlData.findIndex(item => controlSelectedRowKeys.includes(item.sId)); |
| 2073 | - if(iControlIndex > -1){ | 2073 | + if (iControlIndex > -1) { |
| 2074 | controlSelectedRow = controlData[iControlIndex]; | 2074 | controlSelectedRow = controlData[iControlIndex]; |
| 2075 | } | 2075 | } |
| 2076 | - } else{ /* 没有选中行 */ | ||
| 2077 | - controlSelectedRow =controlData[0]; | 2076 | + } else { /* 没有选中行 */ |
| 2077 | + controlSelectedRow = controlData[0]; | ||
| 2078 | } | 2078 | } |
| 2079 | } | 2079 | } |
| 2080 | 2080 | ||
| 2081 | let processSelectedRow = {}; | 2081 | let processSelectedRow = {}; |
| 2082 | - if(commonUtils.isNotEmptyArr(processData)) { | ||
| 2083 | - if(commonUtils.isNotEmptyArr(processSelectedRowKeys)){ /* 从表有选中行 */ | 2082 | + if (commonUtils.isNotEmptyArr(processData)) { |
| 2083 | + if (commonUtils.isNotEmptyArr(processSelectedRowKeys)) { /* 从表有选中行 */ | ||
| 2084 | const iProcessIndex = processData.findIndex(item => processSelectedRowKeys.includes(item.sId)); | 2084 | const iProcessIndex = processData.findIndex(item => processSelectedRowKeys.includes(item.sId)); |
| 2085 | - if(iProcessIndex > -1){ | 2085 | + if (iProcessIndex > -1) { |
| 2086 | processSelectedRow = processData[iProcessIndex]; | 2086 | processSelectedRow = processData[iProcessIndex]; |
| 2087 | } | 2087 | } |
| 2088 | - } else{ /* 没有选中行 */ | 2088 | + } else { /* 没有选中行 */ |
| 2089 | processSelectedRow = processData[0]; | 2089 | processSelectedRow = processData[0]; |
| 2090 | } | 2090 | } |
| 2091 | } | 2091 | } |
| 2092 | 2092 | ||
| 2093 | const tableDataRow = this.props.onDataRowAdd(name, true); | 2093 | const tableDataRow = this.props.onDataRowAdd(name, true); |
| 2094 | - if(bFinished) { | 2094 | + if (bFinished) { |
| 2095 | const iIndex = slaveData.findIndex(item => item.sId === slaveSelectedRow.sId); | 2095 | const iIndex = slaveData.findIndex(item => item.sId === slaveSelectedRow.sId); |
| 2096 | if (iIndex > -1) { | 2096 | if (iIndex > -1) { |
| 2097 | tableDataRow.sCombinePartsNameNew = `${slaveData[iIndex].sCustomerName}-${slaveData[iIndex].sProductName}`; | 2097 | tableDataRow.sCombinePartsNameNew = `${slaveData[iIndex].sCustomerName}-${slaveData[iIndex].sProductName}`; |
| @@ -2251,13 +2251,13 @@ class QuotationPackTableTree extends Component { | @@ -2251,13 +2251,13 @@ class QuotationPackTableTree extends Component { | ||
| 2251 | })); | 2251 | })); |
| 2252 | processReturnData.processDelData.concat(tableDelData); | 2252 | processReturnData.processDelData.concat(tableDelData); |
| 2253 | /* 删除工序对应的材料 */ | 2253 | /* 删除工序对应的材料 */ |
| 2254 | - const materialsFilterDelData = materialsData.filter(item => tableSelectedRowKeys.includes(item.sProcessTbId) && item.sProcessId === sProcessId ); | 2254 | + const materialsFilterDelData = materialsData.filter(item => tableSelectedRowKeys.includes(item.sProcessTbId) && item.sProcessId === sProcessId); |
| 2255 | let materialsSelectedDelRowKeys = []; | 2255 | let materialsSelectedDelRowKeys = []; |
| 2256 | - if(commonUtils.isNotEmptyArr(materialsFilterDelData)) { | ||
| 2257 | - materialsFilterDelData.forEach((item) =>{ | ||
| 2258 | - const materialsChildFilter = materialsData.filter(row => commonUtils.isNotEmptyObject(row.sParentMaterialsId ) && row.sParentMaterialsId === item.sId); /* 删除对应的替代料 */ | ||
| 2259 | - if(commonUtils.isNotEmptyArr(materialsChildFilter)) { | ||
| 2260 | - materialsChildFilter.forEach((child) =>{ | 2256 | + if (commonUtils.isNotEmptyArr(materialsFilterDelData)) { |
| 2257 | + materialsFilterDelData.forEach((item) => { | ||
| 2258 | + const materialsChildFilter = materialsData.filter(row => commonUtils.isNotEmptyObject(row.sParentMaterialsId) && row.sParentMaterialsId === item.sId); /* 删除对应的替代料 */ | ||
| 2259 | + if (commonUtils.isNotEmptyArr(materialsChildFilter)) { | ||
| 2260 | + materialsChildFilter.forEach((child) => { | ||
| 2261 | materialsSelectedDelRowKeys.push(child.sId); | 2261 | materialsSelectedDelRowKeys.push(child.sId); |
| 2262 | }) | 2262 | }) |
| 2263 | } | 2263 | } |
| @@ -2275,27 +2275,27 @@ class QuotationPackTableTree extends Component { | @@ -2275,27 +2275,27 @@ class QuotationPackTableTree extends Component { | ||
| 2275 | materialsSelectedRowKeys: [], | 2275 | materialsSelectedRowKeys: [], |
| 2276 | }); | 2276 | }); |
| 2277 | return true; | 2277 | return true; |
| 2278 | - } if(name ==='materials0'){ /* 删除油墨时 同时删除油墨子集 */ | 2278 | + } if (name === 'materials0') { /* 删除油墨时 同时删除油墨子集 */ |
| 2279 | /* 从全部材料里 找到对应数据 进行更改 */ | 2279 | /* 从全部材料里 找到对应数据 进行更改 */ |
| 2280 | const { | 2280 | const { |
| 2281 | sModelsId, [`${name}SelectedRowKeys`]: tableSelectedRowKeys, [`${name}Data`]: tableData, materialsConfig, materialsData: materials0Data, token, | 2281 | sModelsId, [`${name}SelectedRowKeys`]: tableSelectedRowKeys, [`${name}Data`]: tableData, materialsConfig, materialsData: materials0Data, token, |
| 2282 | } = this.props; | 2282 | } = this.props; |
| 2283 | - if(commonUtils.isEmptyArr(tableSelectedRowKeys)) { | 2283 | + if (commonUtils.isEmptyArr(tableSelectedRowKeys)) { |
| 2284 | message.error('请选择数据!'); | 2284 | message.error('请选择数据!'); |
| 2285 | - return ; | 2285 | + return; |
| 2286 | } | 2286 | } |
| 2287 | - if(commonUtils.isNotEmptyArr(materials0Data)) { | ||
| 2288 | - const iIndex = materials0Data.findIndex(item => tableSelectedRowKeys.includes(item.sId) ); | 2287 | + if (commonUtils.isNotEmptyArr(materials0Data)) { |
| 2288 | + const iIndex = materials0Data.findIndex(item => tableSelectedRowKeys.includes(item.sId)); | ||
| 2289 | let materials1Row = {}; | 2289 | let materials1Row = {}; |
| 2290 | - if(iIndex > -1) { | ||
| 2291 | - materials1Row = materials0Data[iIndex]; | 2290 | + if (iIndex > -1) { |
| 2291 | + materials1Row = materials0Data[iIndex]; | ||
| 2292 | } | 2292 | } |
| 2293 | 2293 | ||
| 2294 | - const materials0ChildData = materials0Data.filter(item => commonUtils.isNotEmptyObject(item.sInkBOMId) && item.sInkBOMId === materials1Row.sInkBOMId | ||
| 2295 | - && commonUtils.isNotEmptyObject(item.sInkBOMsSlaveId) && item.sInkBOMsSlaveId === materials1Row.sInkBOMsSlaveId && | 2294 | + const materials0ChildData = materials0Data.filter(item => commonUtils.isNotEmptyObject(item.sInkBOMId) && item.sInkBOMId === materials1Row.sInkBOMId |
| 2295 | + && commonUtils.isNotEmptyObject(item.sInkBOMsSlaveId) && item.sInkBOMsSlaveId === materials1Row.sInkBOMsSlaveId && | ||
| 2296 | commonUtils.isEmptyObject(item.sInkBOMsMaterialsId)); | 2296 | commonUtils.isEmptyObject(item.sInkBOMsMaterialsId)); |
| 2297 | 2297 | ||
| 2298 | - if(commonUtils.isNotEmptyArr(materials0ChildData)) { | 2298 | + if (commonUtils.isNotEmptyArr(materials0ChildData)) { |
| 2299 | materials0ChildData.forEach((item, index) => { | 2299 | materials0ChildData.forEach((item, index) => { |
| 2300 | tableSelectedRowKeys.push(item.sId); | 2300 | tableSelectedRowKeys.push(item.sId); |
| 2301 | }); | 2301 | }); |
| @@ -2305,14 +2305,14 @@ class QuotationPackTableTree extends Component { | @@ -2305,14 +2305,14 @@ class QuotationPackTableTree extends Component { | ||
| 2305 | this.props.onSaveState(addState); | 2305 | this.props.onSaveState(addState); |
| 2306 | 2306 | ||
| 2307 | } | 2307 | } |
| 2308 | - } else if(name === 'materials1' || name === 'materials2' || name === 'materials0Child'){ /* 删除电化铝、油墨子集 */ | 2308 | + } else if (name === 'materials1' || name === 'materials2' || name === 'materials0Child') { /* 删除电化铝、油墨子集 */ |
| 2309 | /* 从全部材料里 找到对应数据 进行删除 */ | 2309 | /* 从全部材料里 找到对应数据 进行删除 */ |
| 2310 | const { | 2310 | const { |
| 2311 | - sModelsId, [`${name}SelectedRowKeys`]: tableSelectedRowKeys, [`${name}Data`]: tableData, materialsConfig, materialsData : materials0Data, token, | 2311 | + sModelsId, [`${name}SelectedRowKeys`]: tableSelectedRowKeys, [`${name}Data`]: tableData, materialsConfig, materialsData: materials0Data, token, |
| 2312 | } = this.props; | 2312 | } = this.props; |
| 2313 | - if(commonUtils.isEmptyArr(tableSelectedRowKeys)) { | 2313 | + if (commonUtils.isEmptyArr(tableSelectedRowKeys)) { |
| 2314 | message.error('请选择数据!'); | 2314 | message.error('请选择数据!'); |
| 2315 | - return ; | 2315 | + return; |
| 2316 | } | 2316 | } |
| 2317 | const { materialsData, materialsDelData } = this.props.onDataRowDel('materials', true, tableSelectedRowKeys); | 2317 | const { materialsData, materialsDelData } = this.props.onDataRowDel('materials', true, tableSelectedRowKeys); |
| 2318 | const addState = { materialsData, materialsDelData }; | 2318 | const addState = { materialsData, materialsDelData }; |
| @@ -2325,9 +2325,9 @@ class QuotationPackTableTree extends Component { | @@ -2325,9 +2325,9 @@ class QuotationPackTableTree extends Component { | ||
| 2325 | handleCalculation = async (bSave, nextProps = this.props, isWait) => { | 2325 | handleCalculation = async (bSave, nextProps = this.props, isWait) => { |
| 2326 | const dataUrl = `${commonConfig.server_host}business/addQuotationsheet?sModelsId=${nextProps.sModelsId}`; | 2326 | const dataUrl = `${commonConfig.server_host}business/addQuotationsheet?sModelsId=${nextProps.sModelsId}`; |
| 2327 | const { | 2327 | const { |
| 2328 | - masterConfig, slaveConfig, slaveDelData, controlConfig, controlDelData, colorConfig, | ||
| 2329 | - colorData, colorDelData, materialsConfig, materialsDelData, processConfig, processDelData, | ||
| 2330 | - app, manyqtysConfig, manyqtysDelData, packConfig, packDelData, manyDataCache = [], dQuickQuoteProductQty, | 2328 | + masterConfig, slaveConfig, slaveDelData, controlConfig, controlDelData, colorConfig, |
| 2329 | + colorData, colorDelData, materialsConfig, materialsDelData, processConfig, processDelData, | ||
| 2330 | + app, manyqtysConfig, manyqtysDelData, packConfig, packDelData, manyDataCache = [], dQuickQuoteProductQty, | ||
| 2331 | } = nextProps; | 2331 | } = nextProps; |
| 2332 | let { | 2332 | let { |
| 2333 | slaveData, controlData, materialsData, processData, masterData, manyqtysData, packData, | 2333 | slaveData, controlData, materialsData, processData, masterData, manyqtysData, packData, |
| @@ -2340,7 +2340,7 @@ class QuotationPackTableTree extends Component { | @@ -2340,7 +2340,7 @@ class QuotationPackTableTree extends Component { | ||
| 2340 | data.push(commonBusiness.mergeData('materials', `${materialsConfig.sTbName.toLowerCase()}_tmp`, materialsData, [], true)); | 2340 | data.push(commonBusiness.mergeData('materials', `${materialsConfig.sTbName.toLowerCase()}_tmp`, materialsData, [], true)); |
| 2341 | data.push(commonBusiness.mergeData('process', `${processConfig.sTbName.toLowerCase()}_tmp`, processData, [], true)); | 2341 | data.push(commonBusiness.mergeData('process', `${processConfig.sTbName.toLowerCase()}_tmp`, processData, [], true)); |
| 2342 | 2342 | ||
| 2343 | - if(commonUtils.isNotEmptyObject(manyqtysConfig)) { | 2343 | + if (commonUtils.isNotEmptyObject(manyqtysConfig)) { |
| 2344 | data.push(commonBusiness.mergeData('manyqtys', `${manyqtysConfig.sTbName.toLowerCase()}_tmp`, manyqtysData?.map(item => { | 2344 | data.push(commonBusiness.mergeData('manyqtys', `${manyqtysConfig.sTbName.toLowerCase()}_tmp`, manyqtysData?.map(item => { |
| 2345 | delete item.manyData; | 2345 | delete item.manyData; |
| 2346 | item.handleType = item.handleType || 'update'; | 2346 | item.handleType = item.handleType || 'update'; |
| @@ -2357,9 +2357,9 @@ class QuotationPackTableTree extends Component { | @@ -2357,9 +2357,9 @@ class QuotationPackTableTree extends Component { | ||
| 2357 | if (cacheIndex === -1) { | 2357 | if (cacheIndex === -1) { |
| 2358 | message.warning(calculating); | 2358 | message.warning(calculating); |
| 2359 | } | 2359 | } |
| 2360 | - const dataReturn = cacheIndex === -1 ? | 2360 | + const dataReturn = cacheIndex === -1 ? |
| 2361 | (await commonServices.postValueService(this.props.app.token, value, dataUrl)).data | 2361 | (await commonServices.postValueService(this.props.app.token, value, dataUrl)).data |
| 2362 | - : manyDataCache[cacheIndex]; | 2362 | + : manyDataCache[cacheIndex]; |
| 2363 | if (dataReturn.code === 1) { /* 成功 */ | 2363 | if (dataReturn.code === 1) { /* 成功 */ |
| 2364 | const valueReturn = dataReturn.dataset.rows[0]; | 2364 | const valueReturn = dataReturn.dataset.rows[0]; |
| 2365 | const masterDataArr = valueReturn[`${masterConfig.sTbName.toLowerCase()}_tmp`]; | 2365 | const masterDataArr = valueReturn[`${masterConfig.sTbName.toLowerCase()}_tmp`]; |
| @@ -2372,7 +2372,7 @@ class QuotationPackTableTree extends Component { | @@ -2372,7 +2372,7 @@ class QuotationPackTableTree extends Component { | ||
| 2372 | masterData.sFormId = nextProps.masterData.sFormId; | 2372 | masterData.sFormId = nextProps.masterData.sFormId; |
| 2373 | masterData.sBillNo = nextProps.masterData.sBillNo; | 2373 | masterData.sBillNo = nextProps.masterData.sBillNo; |
| 2374 | } | 2374 | } |
| 2375 | - masterData.handleType = masterData.sBillNo ? "update": "add"; | 2375 | + masterData.handleType = masterData.sBillNo ? "update" : "add"; |
| 2376 | if (masterData.handleType === 'update' && !commonUtils.isEmpty(sMakePerson)) { | 2376 | if (masterData.handleType === 'update' && !commonUtils.isEmpty(sMakePerson)) { |
| 2377 | masterData.sMakePerson = sMakePerson; | 2377 | masterData.sMakePerson = sMakePerson; |
| 2378 | } | 2378 | } |
| @@ -2394,7 +2394,7 @@ class QuotationPackTableTree extends Component { | @@ -2394,7 +2394,7 @@ class QuotationPackTableTree extends Component { | ||
| 2394 | });; | 2394 | });; |
| 2395 | processData = this.sortData(controlData, processData); | 2395 | processData = this.sortData(controlData, processData); |
| 2396 | const addState = {}; | 2396 | const addState = {}; |
| 2397 | - if(commonUtils.isNotEmptyObject(manyqtysConfig)) { | 2397 | + if (commonUtils.isNotEmptyObject(manyqtysConfig)) { |
| 2398 | const manyqtysDataOld = cloneDeep(manyqtysData); | 2398 | const manyqtysDataOld = cloneDeep(manyqtysData); |
| 2399 | manyqtysData = valueReturn[`${manyqtysConfig.sTbName.toLowerCase()}_tmp`]?.map((item, index) => { | 2399 | manyqtysData = valueReturn[`${manyqtysConfig.sTbName.toLowerCase()}_tmp`]?.map((item, index) => { |
| 2400 | return { | 2400 | return { |
| @@ -2464,7 +2464,7 @@ class QuotationPackTableTree extends Component { | @@ -2464,7 +2464,7 @@ class QuotationPackTableTree extends Component { | ||
| 2464 | data.push(commonBusiness.mergeData('materials', materialsConfig.sTbName, materialsData, materialsDelData)); | 2464 | data.push(commonBusiness.mergeData('materials', materialsConfig.sTbName, materialsData, materialsDelData)); |
| 2465 | data.push(commonBusiness.mergeData('process', processConfig.sTbName, processData, processDelData)); | 2465 | data.push(commonBusiness.mergeData('process', processConfig.sTbName, processData, processDelData)); |
| 2466 | 2466 | ||
| 2467 | - if(commonUtils.isNotEmptyObject(manyqtysConfig)) { | 2467 | + if (commonUtils.isNotEmptyObject(manyqtysConfig)) { |
| 2468 | data.push(commonBusiness.mergeData('manyqtys', manyqtysConfig.sTbName, manyqtysData, manyqtysDelData)); | 2468 | data.push(commonBusiness.mergeData('manyqtys', manyqtysConfig.sTbName, manyqtysData, manyqtysDelData)); |
| 2469 | } | 2469 | } |
| 2470 | 2470 | ||
| @@ -2474,7 +2474,7 @@ class QuotationPackTableTree extends Component { | @@ -2474,7 +2474,7 @@ class QuotationPackTableTree extends Component { | ||
| 2474 | data, sClientType: '1', loading: false, sSysLogSrcId: masterData.sId, | 2474 | data, sClientType: '1', loading: false, sSysLogSrcId: masterData.sId, |
| 2475 | }); | 2475 | }); |
| 2476 | this.props.onSaveState({ | 2476 | this.props.onSaveState({ |
| 2477 | - slaveData, packData, controlData, materialsData, processData, masterData, manyqtysData, ...addState, | 2477 | + slaveData, packData, controlData, materialsData, processData, masterData, manyqtysData, ...addState, |
| 2478 | }); | 2478 | }); |
| 2479 | } else { | 2479 | } else { |
| 2480 | if (isWait) { | 2480 | if (isWait) { |
| @@ -2760,24 +2760,24 @@ class QuotationPackTableTree extends Component { | @@ -2760,24 +2760,24 @@ class QuotationPackTableTree extends Component { | ||
| 2760 | this.props.onSaveData({ | 2760 | this.props.onSaveData({ |
| 2761 | data, sClientType: '1', loading: false, sSysLogSrcId: masterData.sId, bIsUnCcg: false, | 2761 | data, sClientType: '1', loading: false, sSysLogSrcId: masterData.sId, bIsUnCcg: false, |
| 2762 | }); | 2762 | }); |
| 2763 | - } else if(name === 'BtnWorkFlow') { | 2763 | + } else if (name === 'BtnWorkFlow') { |
| 2764 | const dataUrl = `${commonConfig.server_host}workOrderFlow/getWorkOrderFlow/`; | 2764 | const dataUrl = `${commonConfig.server_host}workOrderFlow/getWorkOrderFlow/`; |
| 2765 | - let {token} = this.props.app | ||
| 2766 | - let { slaveData, controlData, materialsData, processData, packData} = this.props | 2765 | + let { token } = this.props.app |
| 2766 | + let { slaveData, controlData, materialsData, processData, packData } = this.props | ||
| 2767 | const value = { | 2767 | const value = { |
| 2768 | - slave:slaveData, | ||
| 2769 | - control:controlData, | ||
| 2770 | - materials:materialsData, | ||
| 2771 | - process:processData, | ||
| 2772 | - pack:packData | 2768 | + slave: slaveData, |
| 2769 | + control: controlData, | ||
| 2770 | + materials: materialsData, | ||
| 2771 | + process: processData, | ||
| 2772 | + pack: packData | ||
| 2773 | } | 2773 | } |
| 2774 | - let dataReturn = (await commonServices.postValueService(token,value,dataUrl)).data; | 2774 | + let dataReturn = (await commonServices.postValueService(token, value, dataUrl)).data; |
| 2775 | if (commonUtils.isNotEmptyObject(dataReturn)) { | 2775 | if (commonUtils.isNotEmptyObject(dataReturn)) { |
| 2776 | if (dataReturn.code === 1) { | 2776 | if (dataReturn.code === 1) { |
| 2777 | const flowData = dataReturn.dataset.rows[0]; | 2777 | const flowData = dataReturn.dataset.rows[0]; |
| 2778 | if (commonUtils.isNotEmptyObject(flowData)) { | 2778 | if (commonUtils.isNotEmptyObject(flowData)) { |
| 2779 | this.props.onSaveState({ | 2779 | this.props.onSaveState({ |
| 2780 | - flowData: flowData,workFlowVisible:true | 2780 | + flowData: flowData, workFlowVisible: true |
| 2781 | }); | 2781 | }); |
| 2782 | // localStorage.setItem('flow', JSON.stringify(flowData)); | 2782 | // localStorage.setItem('flow', JSON.stringify(flowData)); |
| 2783 | } | 2783 | } |
| @@ -2851,6 +2851,11 @@ class QuotationPackTableTree extends Component { | @@ -2851,6 +2851,11 @@ class QuotationPackTableTree extends Component { | ||
| 2851 | const dataUrl = `${commonConfig.server_host}bill/billCopyToCheck/?sModelsId=${sModelsId}&sActiveId=${sActiveId}&tbSuffix=${tbSuffix}&sName=${formRoute}`; | 2851 | const dataUrl = `${commonConfig.server_host}bill/billCopyToCheck/?sModelsId=${sModelsId}&sActiveId=${sActiveId}&tbSuffix=${tbSuffix}&sName=${formRoute}`; |
| 2852 | const values = { sSlaveId: sId }; | 2852 | const values = { sSlaveId: sId }; |
| 2853 | const dataReturn = (await commonServices.postValueService(token, values, dataUrl)).data; | 2853 | const dataReturn = (await commonServices.postValueService(token, values, dataUrl)).data; |
| 2854 | + if (copyTo.name === 'BtnCopyTo.quoquotation') { | ||
| 2855 | + const sId = commonUtils.createSid() | ||
| 2856 | + const newCopyTo = this.deepReplaceString(copyTo, copyTo?.masterData?.sId, sId); | ||
| 2857 | + copyTo = newCopyTo | ||
| 2858 | + } | ||
| 2854 | if (dataReturn.code === 1) { | 2859 | if (dataReturn.code === 1) { |
| 2855 | // eslint-disable-next-line no-underscore-dangle | 2860 | // eslint-disable-next-line no-underscore-dangle |
| 2856 | const _this = this; // 解决confirm中this指向问题; | 2861 | const _this = this; // 解决confirm中this指向问题; |
| @@ -2879,7 +2884,39 @@ class QuotationPackTableTree extends Component { | @@ -2879,7 +2884,39 @@ class QuotationPackTableTree extends Component { | ||
| 2879 | }, | 2884 | }, |
| 2880 | }); | 2885 | }); |
| 2881 | } | 2886 | } |
| 2887 | + deepReplaceString = (data, targetVal, newVal) => { | ||
| 2888 | + const isObj = v => v && typeof v === 'object' && !Array.isArray(v); | ||
| 2889 | + const isArr = v => Array.isArray(v); | ||
| 2882 | 2890 | ||
| 2891 | + const walk = item => { | ||
| 2892 | + if (typeof item === 'string') { | ||
| 2893 | + // 普通字符串直接替换 | ||
| 2894 | + if (item === targetVal) return newVal; | ||
| 2895 | + | ||
| 2896 | + //如果是 JSON 字符串,就解析→递归→再 stringify | ||
| 2897 | + if ((item.startsWith('{') && item.endsWith('}')) || (item.startsWith('[') && item.endsWith(']'))) { | ||
| 2898 | + try { | ||
| 2899 | + const parsed = JSON.parse(item); | ||
| 2900 | + const rebuilt = walk(parsed); | ||
| 2901 | + return JSON.stringify(rebuilt); | ||
| 2902 | + } catch (e) { | ||
| 2903 | + /* 不是合法 JSON,原样返回 */ | ||
| 2904 | + } | ||
| 2905 | + } | ||
| 2906 | + return item; | ||
| 2907 | + } | ||
| 2908 | + | ||
| 2909 | + if (isArr(item)) return item.map(walk); | ||
| 2910 | + if (isObj(item)) { | ||
| 2911 | + const tmp = {}; | ||
| 2912 | + for (const [k, v] of Object.entries(item)) tmp[k] = walk(v); | ||
| 2913 | + return tmp; | ||
| 2914 | + } | ||
| 2915 | + return item; // 数字、布尔、null 等 | ||
| 2916 | + }; | ||
| 2917 | + | ||
| 2918 | + return walk(data); | ||
| 2919 | + } | ||
| 2883 | /* 确定要删除 */ | 2920 | /* 确定要删除 */ |
| 2884 | handleOkDel = async (props) => { | 2921 | handleOkDel = async (props) => { |
| 2885 | /* 数据参数 */ | 2922 | /* 数据参数 */ |
| @@ -3000,7 +3037,7 @@ class QuotationPackTableTree extends Component { | @@ -3000,7 +3037,7 @@ class QuotationPackTableTree extends Component { | ||
| 3000 | } | 3037 | } |
| 3001 | const sId = sIdArray.toString(); | 3038 | const sId = sIdArray.toString(); |
| 3002 | onSendSocketMessage('copyfinish', 'noAction', sId, userinfo.sId, null, null); | 3039 | onSendSocketMessage('copyfinish', 'noAction', sId, userinfo.sId, null, null); |
| 3003 | - } else if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sSrcSlaveId)) { | 3040 | + } else if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sSrcSlaveId)) { |
| 3004 | const sIdArray = []; | 3041 | const sIdArray = []; |
| 3005 | /* 处理只有单主表解锁问题 */ | 3042 | /* 处理只有单主表解锁问题 */ |
| 3006 | sIdArray.push(masterData.sSrcSlaveId); | 3043 | sIdArray.push(masterData.sSrcSlaveId); |
| @@ -3081,7 +3118,7 @@ class QuotationPackTableTree extends Component { | @@ -3081,7 +3118,7 @@ class QuotationPackTableTree extends Component { | ||
| 3081 | app, sModelsId, token, sModelsType, | 3118 | app, sModelsId, token, sModelsType, |
| 3082 | } = this.props; | 3119 | } = this.props; |
| 3083 | const bCkxCopyFromTechnology = app.systemData.filter(item => item.sName === 'CkxCopyFromTechnology')[0].sValue; | 3120 | const bCkxCopyFromTechnology = app.systemData.filter(item => item.sName === 'CkxCopyFromTechnology')[0].sValue; |
| 3084 | - const bCopyFromProcessCard = (commonUtils.isNotEmptyObject(copyTo.oldFormId) && copyTo.oldFormId === copyTo.newFormId); | 3121 | + const bCopyFromProcessCard = (commonUtils.isNotEmptyObject(copyTo.oldFormId) && copyTo.oldFormId === copyTo.newFormId); |
| 3085 | if (bCkxCopyFromTechnology === '1' && !bCopyFromProcessCard) { | 3122 | if (bCkxCopyFromTechnology === '1' && !bCopyFromProcessCard) { |
| 3086 | if (slaveData.length > 1) { | 3123 | if (slaveData.length > 1) { |
| 3087 | const dataUrl = `${commonConfig.server_host}business/getCopyToQuotationData/?sModelsId=${sModelsId}`; | 3124 | const dataUrl = `${commonConfig.server_host}business/getCopyToQuotationData/?sModelsId=${sModelsId}`; |
| @@ -4040,7 +4077,7 @@ class QuotationPackTableTree extends Component { | @@ -4040,7 +4077,7 @@ class QuotationPackTableTree extends Component { | ||
| 4040 | tableDataRow.sSlaveId = ' '; | 4077 | tableDataRow.sSlaveId = ' '; |
| 4041 | tableDataRow.sCombinedMemo = '合版信息'; | 4078 | tableDataRow.sCombinedMemo = '合版信息'; |
| 4042 | tableDataRow.sAllId = tableDataRow.sId; | 4079 | tableDataRow.sAllId = tableDataRow.sId; |
| 4043 | - if(commonUtils.isEmptyObject(tableDataRow.sPartsName)) { | 4080 | + if (commonUtils.isEmptyObject(tableDataRow.sPartsName)) { |
| 4044 | tableDataRow.sPartsName = commonUtils.isNotEmptyArr(slaveData) ? slaveData[0].sProductName : ''; | 4081 | tableDataRow.sPartsName = commonUtils.isNotEmptyArr(slaveData) ? slaveData[0].sProductName : ''; |
| 4045 | } | 4082 | } |
| 4046 | let dProductQty = 0; | 4083 | let dProductQty = 0; |
| @@ -4053,7 +4090,7 @@ class QuotationPackTableTree extends Component { | @@ -4053,7 +4090,7 @@ class QuotationPackTableTree extends Component { | ||
| 4053 | }); | 4090 | }); |
| 4054 | tableDataRow.dPartsQty = dProductQty; | 4091 | tableDataRow.dPartsQty = dProductQty; |
| 4055 | /* 点击新增按钮 控制表自动默认增一条 同时默认新增一条合版表 */ | 4092 | /* 点击新增按钮 控制表自动默认增一条 同时默认新增一条合版表 */ |
| 4056 | - if(commonUtils.isNotEmptyArr(slaveData) && slaveData.length === 1 && commonUtils.isEmptyArr(packData)){ | 4093 | + if (commonUtils.isNotEmptyArr(slaveData) && slaveData.length === 1 && commonUtils.isEmptyArr(packData)) { |
| 4057 | const packDataRow = this.handlePackDataAdd(slaveData[0], 0, tableDataRow.sId, 'add'); | 4094 | const packDataRow = this.handlePackDataAdd(slaveData[0], 0, tableDataRow.sId, 'add'); |
| 4058 | packDataRow.dCombineQty = 1; | 4095 | packDataRow.dCombineQty = 1; |
| 4059 | packData.push(packDataRow); | 4096 | packData.push(packDataRow); |
| @@ -4099,7 +4136,7 @@ class QuotationPackTableTree extends Component { | @@ -4099,7 +4136,7 @@ class QuotationPackTableTree extends Component { | ||
| 4099 | const { | 4136 | const { |
| 4100 | [`${name}Data`]: tableData, [`${name}Config`]: tableConfig, masterConfig, controlSelectedRowKeys, sModelsId, token, slaveSelectedRowKeys, processSelectedRowKeys, | 4137 | [`${name}Data`]: tableData, [`${name}Config`]: tableConfig, masterConfig, controlSelectedRowKeys, sModelsId, token, slaveSelectedRowKeys, processSelectedRowKeys, |
| 4101 | slaveConfig, controlConfig, materialsConfig, processConfig, colorConfig, packConfig, slaveData, controlData, materialsData: materialsDataOld, processData: processDataOld, colorData: colorDataOld, | 4138 | slaveConfig, controlConfig, materialsConfig, processConfig, colorConfig, packConfig, slaveData, controlData, materialsData: materialsDataOld, processData: processDataOld, colorData: colorDataOld, |
| 4102 | - controlDelData: controlDelDataOld, materialsDelData: materialsDelDataOld, processDelData: processDelDataOld, colorDelData: colorDelDataOld,slaveDelData: slaveDelDataOld | 4139 | + controlDelData: controlDelDataOld, materialsDelData: materialsDelDataOld, processDelData: processDelDataOld, colorDelData: colorDelDataOld, slaveDelData: slaveDelDataOld |
| 4103 | } = this.props; | 4140 | } = this.props; |
| 4104 | const controlDataOld = controlData.slice(0); | 4141 | const controlDataOld = controlData.slice(0); |
| 4105 | let { masterData } = this.props; | 4142 | let { masterData } = this.props; |
| @@ -4121,7 +4158,7 @@ class QuotationPackTableTree extends Component { | @@ -4121,7 +4158,7 @@ class QuotationPackTableTree extends Component { | ||
| 4121 | const dataUrl = `${commonConfig.server_host}salesorder/getTmpInfoBySql/?sModelsId=${sModelsId}`; | 4158 | const dataUrl = `${commonConfig.server_host}salesorder/getTmpInfoBySql/?sModelsId=${sModelsId}`; |
| 4122 | const sConfigformId = commonUtils.isEmpty(selectConfig) ? '' : selectConfig.sParentId; | 4159 | const sConfigformId = commonUtils.isEmpty(selectConfig) ? '' : selectConfig.sParentId; |
| 4123 | const sRowData = selectData; | 4160 | const sRowData = selectData; |
| 4124 | - const sControlName = selectConfig.sControlName; /* 按钮名称 */ | 4161 | + const sControlName = selectConfig.sControlName; /* 按钮名称 */ |
| 4125 | // const sSqlCondition = { sId: selectData[0].sSlaveId }; /* 后台根据rowData自己取 */ | 4162 | // const sSqlCondition = { sId: selectData[0].sSlaveId }; /* 后台根据rowData自己取 */ |
| 4126 | const condition = { sConfigformId, sControlName, sRowData }; | 4163 | const condition = { sConfigformId, sControlName, sRowData }; |
| 4127 | const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data; | 4164 | const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data; |
| @@ -4130,10 +4167,10 @@ class QuotationPackTableTree extends Component { | @@ -4130,10 +4167,10 @@ class QuotationPackTableTree extends Component { | ||
| 4130 | const returnDataSet = dataReturn.dataset.rows[0]; | 4167 | const returnDataSet = dataReturn.dataset.rows[0]; |
| 4131 | const returnData = {}; | 4168 | const returnData = {}; |
| 4132 | const copyToMasterDetailConfig = copyTo.config.filter(item => item.sControlName.toLowerCase() === `${copyTo.name}`.toLowerCase()); | 4169 | const copyToMasterDetailConfig = copyTo.config.filter(item => item.sControlName.toLowerCase() === `${copyTo.name}`.toLowerCase()); |
| 4133 | - const copyToSlaveDetailConfig = copyTo.config.filter(item => item.sControlName.toLowerCase().replace('_add','').replace('_edit','').trim() === `${copyTo.name}.slave`.toLowerCase()); | ||
| 4134 | - const copyToControlConfig = copyTo.config.filter(item => item.sControlName.toLowerCase().replace('_add','').replace('_edit','').trim() === `${copyTo.name}.control`.toLowerCase()); | ||
| 4135 | - const copyToMaterialsConfig = copyTo.config.filter(item => item.sControlName.toLowerCase().replace('_add','').replace('_edit','').trim() === `${copyTo.name}.materials`.toLowerCase()); | ||
| 4136 | - const copyToProcessConfig = copyTo.config.filter(item => item.sControlName.toLowerCase().replace('_add','').replace('_edit','').trim() === `${copyTo.name}.process`.toLowerCase()); | 4170 | + const copyToSlaveDetailConfig = copyTo.config.filter(item => item.sControlName.toLowerCase().replace('_add', '').replace('_edit', '').trim() === `${copyTo.name}.slave`.toLowerCase()); |
| 4171 | + const copyToControlConfig = copyTo.config.filter(item => item.sControlName.toLowerCase().replace('_add', '').replace('_edit', '').trim() === `${copyTo.name}.control`.toLowerCase()); | ||
| 4172 | + const copyToMaterialsConfig = copyTo.config.filter(item => item.sControlName.toLowerCase().replace('_add', '').replace('_edit', '').trim() === `${copyTo.name}.materials`.toLowerCase()); | ||
| 4173 | + const copyToProcessConfig = copyTo.config.filter(item => item.sControlName.toLowerCase().replace('_add', '').replace('_edit', '').trim() === `${copyTo.name}.process`.toLowerCase()); | ||
| 4137 | const masterDetailAssignField = commonUtils.isNotEmptyArr(copyToMasterDetailConfig) ? copyToMasterDetailConfig[0].sAssignField : ''; | 4174 | const masterDetailAssignField = commonUtils.isNotEmptyArr(copyToMasterDetailConfig) ? copyToMasterDetailConfig[0].sAssignField : ''; |
| 4138 | const slaveDetailAssignField = commonUtils.isNotEmptyArr(copyToSlaveDetailConfig) ? copyToSlaveDetailConfig[0].sAssignField : ''; | 4175 | const slaveDetailAssignField = commonUtils.isNotEmptyArr(copyToSlaveDetailConfig) ? copyToSlaveDetailConfig[0].sAssignField : ''; |
| 4139 | const copyToColorConfig = copyTo.config.filter(item => item.sControlName.toLowerCase() === `${copyTo.name}.param`.toLowerCase()); | 4176 | const copyToColorConfig = copyTo.config.filter(item => item.sControlName.toLowerCase() === `${copyTo.name}.param`.toLowerCase()); |
| @@ -4143,13 +4180,13 @@ class QuotationPackTableTree extends Component { | @@ -4143,13 +4180,13 @@ class QuotationPackTableTree extends Component { | ||
| 4143 | const colorAssignField = commonUtils.isNotEmptyArr(copyToColorConfig) ? copyToColorConfig[0].sAssignField : ''; | 4180 | const colorAssignField = commonUtils.isNotEmptyArr(copyToColorConfig) ? copyToColorConfig[0].sAssignField : ''; |
| 4144 | 4181 | ||
| 4145 | /* 判断是插入 还是删除 */ | 4182 | /* 判断是插入 还是删除 */ |
| 4146 | - if(commonUtils.isNotEmptyArr(copyToControlConfig)) { | ||
| 4147 | - if(commonUtils.isNotEmptyArr(controlSelectedRowKeys)) { | ||
| 4148 | - if(!copyToControlConfig[0].sControlName.includes('_add') && !copyToControlConfig[0].sControlName.includes('_edit')) { /* 删除 */ | 4183 | + if (commonUtils.isNotEmptyArr(copyToControlConfig)) { |
| 4184 | + if (commonUtils.isNotEmptyArr(controlSelectedRowKeys)) { | ||
| 4185 | + if (!copyToControlConfig[0].sControlName.includes('_add') && !copyToControlConfig[0].sControlName.includes('_edit')) { /* 删除 */ | ||
| 4149 | controlData = []; | 4186 | controlData = []; |
| 4150 | const controlDelData = commonUtils.isEmptyArr(controlDelDataOld) ? [] : controlDelDataOld; | 4187 | const controlDelData = commonUtils.isEmptyArr(controlDelDataOld) ? [] : controlDelDataOld; |
| 4151 | const controlDataFilterData = controlDataOld.filter(obj => controlSelectedRowKeys.includes(obj.sId)); | 4188 | const controlDataFilterData = controlDataOld.filter(obj => controlSelectedRowKeys.includes(obj.sId)); |
| 4152 | - if(commonUtils.isNotEmptyArr(controlDataFilterData)) { | 4189 | + if (commonUtils.isNotEmptyArr(controlDataFilterData)) { |
| 4153 | controlDataFilterData.forEach((item) => { | 4190 | controlDataFilterData.forEach((item) => { |
| 4154 | item.handleType = 'del'; | 4191 | item.handleType = 'del'; |
| 4155 | controlDelData.push(item); | 4192 | controlDelData.push(item); |
| @@ -4162,12 +4199,12 @@ class QuotationPackTableTree extends Component { | @@ -4162,12 +4199,12 @@ class QuotationPackTableTree extends Component { | ||
| 4162 | } | 4199 | } |
| 4163 | } | 4200 | } |
| 4164 | 4201 | ||
| 4165 | - if(commonUtils.isNotEmptyArr(copyToMaterialsConfig)) { | ||
| 4166 | - if(!copyToMaterialsConfig[0].sControlName.includes('_add') && !copyToMaterialsConfig[0].sControlName.includes('_edit')) { /* 删除 */ | 4202 | + if (commonUtils.isNotEmptyArr(copyToMaterialsConfig)) { |
| 4203 | + if (!copyToMaterialsConfig[0].sControlName.includes('_add') && !copyToMaterialsConfig[0].sControlName.includes('_edit')) { /* 删除 */ | ||
| 4167 | materialsData = []; | 4204 | materialsData = []; |
| 4168 | const materialsDelData = commonUtils.isEmptyArr(materialsDelDataOld) ? [] : materialsDelDataOld; | 4205 | const materialsDelData = commonUtils.isEmptyArr(materialsDelDataOld) ? [] : materialsDelDataOld; |
| 4169 | const materialsDataFilterData = materialsDataOld.filter(obj => controlSelectedRowKeys.includes(obj.sControlId)); | 4206 | const materialsDataFilterData = materialsDataOld.filter(obj => controlSelectedRowKeys.includes(obj.sControlId)); |
| 4170 | - if(commonUtils.isNotEmptyArr(materialsDataFilterData)) { | 4207 | + if (commonUtils.isNotEmptyArr(materialsDataFilterData)) { |
| 4171 | materialsDataFilterData.forEach((item) => { | 4208 | materialsDataFilterData.forEach((item) => { |
| 4172 | item.handleType = 'del'; | 4209 | item.handleType = 'del'; |
| 4173 | materialsDelData.push(item); | 4210 | materialsDelData.push(item); |
| @@ -4177,12 +4214,12 @@ class QuotationPackTableTree extends Component { | @@ -4177,12 +4214,12 @@ class QuotationPackTableTree extends Component { | ||
| 4177 | } | 4214 | } |
| 4178 | } | 4215 | } |
| 4179 | 4216 | ||
| 4180 | - if(commonUtils.isNotEmptyArr(copyToProcessConfig)) { | ||
| 4181 | - if(!copyToProcessConfig[0].sControlName.includes('_add') && !copyToProcessConfig[0].sControlName.includes('_edit')) { /* 删除 */ | 4217 | + if (commonUtils.isNotEmptyArr(copyToProcessConfig)) { |
| 4218 | + if (!copyToProcessConfig[0].sControlName.includes('_add') && !copyToProcessConfig[0].sControlName.includes('_edit')) { /* 删除 */ | ||
| 4182 | processData = []; | 4219 | processData = []; |
| 4183 | const processDelData = commonUtils.isEmptyArr(processDelDataOld) ? [] : processDelDataOld; | 4220 | const processDelData = commonUtils.isEmptyArr(processDelDataOld) ? [] : processDelDataOld; |
| 4184 | const processDataFilterData = processDataOld.filter(obj => controlSelectedRowKeys.includes(obj.sControlId)); | 4221 | const processDataFilterData = processDataOld.filter(obj => controlSelectedRowKeys.includes(obj.sControlId)); |
| 4185 | - if(commonUtils.isNotEmptyArr(processDataFilterData)) { | 4222 | + if (commonUtils.isNotEmptyArr(processDataFilterData)) { |
| 4186 | processDataFilterData.forEach((item) => { | 4223 | processDataFilterData.forEach((item) => { |
| 4187 | item.handleType = 'del'; | 4224 | item.handleType = 'del'; |
| 4188 | processDelData.push(item); | 4225 | processDelData.push(item); |
| @@ -4192,8 +4229,8 @@ class QuotationPackTableTree extends Component { | @@ -4192,8 +4229,8 @@ class QuotationPackTableTree extends Component { | ||
| 4192 | } | 4229 | } |
| 4193 | } | 4230 | } |
| 4194 | 4231 | ||
| 4195 | - if(commonUtils.isNotEmptyArr(colorAssignField)) { | ||
| 4196 | - if(!colorAssignField[0].sControlName.includes('_add') && !colorAssignField[0].sControlName.includes('_edit')) { /* 删除 */ | 4232 | + if (commonUtils.isNotEmptyArr(colorAssignField)) { |
| 4233 | + if (!colorAssignField[0].sControlName.includes('_add') && !colorAssignField[0].sControlName.includes('_edit')) { /* 删除 */ | ||
| 4197 | colorData = []; | 4234 | colorData = []; |
| 4198 | const colorDelData = commonUtils.isEmptyArr(colorDelDataOld) ? [] : colorDelDataOld; | 4235 | const colorDelData = commonUtils.isEmptyArr(colorDelDataOld) ? [] : colorDelDataOld; |
| 4199 | if (commonUtils.isNotEmptyArr(colorDataOld) && colorDataOld.length > 0) { | 4236 | if (commonUtils.isNotEmptyArr(colorDataOld) && colorDataOld.length > 0) { |
| @@ -4219,7 +4256,7 @@ class QuotationPackTableTree extends Component { | @@ -4219,7 +4256,7 @@ class QuotationPackTableTree extends Component { | ||
| 4219 | let iControlIndex = -1; | 4256 | let iControlIndex = -1; |
| 4220 | if (!commonUtils.isEmpty(controlSelectedRowKeys)) { | 4257 | if (!commonUtils.isEmpty(controlSelectedRowKeys)) { |
| 4221 | iControlIndex = controlData.findIndex(item => controlSelectedRowKeys.includes(item.sId)); | 4258 | iControlIndex = controlData.findIndex(item => controlSelectedRowKeys.includes(item.sId)); |
| 4222 | - if(iControlIndex > -1) { | 4259 | + if (iControlIndex > -1) { |
| 4223 | controlSelectedRow = controlData[iControlIndex]; | 4260 | controlSelectedRow = controlData[iControlIndex]; |
| 4224 | } | 4261 | } |
| 4225 | } | 4262 | } |
| @@ -4241,7 +4278,7 @@ class QuotationPackTableTree extends Component { | @@ -4241,7 +4278,7 @@ class QuotationPackTableTree extends Component { | ||
| 4241 | } | 4278 | } |
| 4242 | } | 4279 | } |
| 4243 | } | 4280 | } |
| 4244 | - if(commonUtils.isNotEmptyObject(returnDataSet)) { | 4281 | + if (commonUtils.isNotEmptyObject(returnDataSet)) { |
| 4245 | /* 数据塞到Data中 */ | 4282 | /* 数据塞到Data中 */ |
| 4246 | for (const key of Object.keys(returnDataSet)) { | 4283 | for (const key of Object.keys(returnDataSet)) { |
| 4247 | const sName = `${key}Data`; | 4284 | const sName = `${key}Data`; |
| @@ -4262,7 +4299,7 @@ class QuotationPackTableTree extends Component { | @@ -4262,7 +4299,7 @@ class QuotationPackTableTree extends Component { | ||
| 4262 | masterData = { ...masterData, ...commonFunc.getAssignFieldValue(masterDetailAssignField, returnData.slaveData[0], newCopyTo) }; // 取赋值字段 | 4299 | masterData = { ...masterData, ...commonFunc.getAssignFieldValue(masterDetailAssignField, returnData.slaveData[0], newCopyTo) }; // 取赋值字段 |
| 4263 | } | 4300 | } |
| 4264 | 4301 | ||
| 4265 | - if(commonUtils.isNotEmptyObject(copyToSlaveDetailConfig)) { | 4302 | + if (commonUtils.isNotEmptyObject(copyToSlaveDetailConfig)) { |
| 4266 | slaveData.forEach((item, iSlaveIndex) => { | 4303 | slaveData.forEach((item, iSlaveIndex) => { |
| 4267 | if (commonUtils.isNotEmptyArr(returnData.slaveData)) { | 4304 | if (commonUtils.isNotEmptyArr(returnData.slaveData)) { |
| 4268 | item = { ...item, ...commonFunc.getAssignFieldValue(slaveDetailAssignField, returnData.slaveData[0], newCopyTo) }; // 取赋值字段 | 4305 | item = { ...item, ...commonFunc.getAssignFieldValue(slaveDetailAssignField, returnData.slaveData[0], newCopyTo) }; // 取赋值字段 |
| @@ -4279,12 +4316,12 @@ class QuotationPackTableTree extends Component { | @@ -4279,12 +4316,12 @@ class QuotationPackTableTree extends Component { | ||
| 4279 | returnData.controlData.forEach((controlItem) => { | 4316 | returnData.controlData.forEach((controlItem) => { |
| 4280 | newCopyTo.control = controlItem; | 4317 | newCopyTo.control = controlItem; |
| 4281 | let controlRow = commonFunc.getDefaultData(config.controlConfig, newCopyTo); // 取默认值 | 4318 | let controlRow = commonFunc.getDefaultData(config.controlConfig, newCopyTo); // 取默认值 |
| 4282 | - if(copyToControlConfig[0].sControlName.includes('_edit')) { | 4319 | + if (copyToControlConfig[0].sControlName.includes('_edit')) { |
| 4283 | controlRow = { ...controlSelectedRow, ...commonFunc.getAssignFieldValue(controlAssignField, controlItem, newCopyTo) }; // 取赋值字段 | 4320 | controlRow = { ...controlSelectedRow, ...commonFunc.getAssignFieldValue(controlAssignField, controlItem, newCopyTo) }; // 取赋值字段 |
| 4284 | - if(iControlIndex > -1) { | ||
| 4285 | - controlData[iControlIndex] = { ...controlSelectedRow, ...controlRow}; | 4321 | + if (iControlIndex > -1) { |
| 4322 | + controlData[iControlIndex] = { ...controlSelectedRow, ...controlRow }; | ||
| 4286 | } | 4323 | } |
| 4287 | - } else { | 4324 | + } else { |
| 4288 | controlRow = { ...controlRow, ...commonFunc.getAssignFieldValue(controlAssignField, controlItem, newCopyTo) }; // 取赋值字段 | 4325 | controlRow = { ...controlRow, ...commonFunc.getAssignFieldValue(controlAssignField, controlItem, newCopyTo) }; // 取赋值字段 |
| 4289 | controlRow.handleType = 'add'; | 4326 | controlRow.handleType = 'add'; |
| 4290 | controlRow.sId = commonUtils.createSid(); | 4327 | controlRow.sId = commonUtils.createSid(); |
| @@ -4505,7 +4542,7 @@ class QuotationPackTableTree extends Component { | @@ -4505,7 +4542,7 @@ class QuotationPackTableTree extends Component { | ||
| 4505 | config.colorConfig = colorConfig; | 4542 | config.colorConfig = colorConfig; |
| 4506 | config.packConfig = packConfig; | 4543 | config.packConfig = packConfig; |
| 4507 | 4544 | ||
| 4508 | - const condition = { sCardId: selectData[0].sId, sRowData:selectData }; | 4545 | + const condition = { sCardId: selectData[0].sId, sRowData: selectData }; |
| 4509 | const dataUrl = `${commonConfig.server_host}salesorder/getProcessCardDataByCustomIdProductId/?sModelsId=${sModelsId}`; | 4546 | const dataUrl = `${commonConfig.server_host}salesorder/getProcessCardDataByCustomIdProductId/?sModelsId=${sModelsId}`; |
| 4510 | const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data; | 4547 | const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data; |
| 4511 | if (dataReturn.code === 1) { | 4548 | if (dataReturn.code === 1) { |
| @@ -4576,20 +4613,20 @@ class QuotationPackTableTree extends Component { | @@ -4576,20 +4613,20 @@ class QuotationPackTableTree extends Component { | ||
| 4576 | if (commonUtils.isNotEmptyArr(returnData.slaveData)) { | 4613 | if (commonUtils.isNotEmptyArr(returnData.slaveData)) { |
| 4577 | returnData.slaveData.forEach((slaveItem, iIndex) => { | 4614 | returnData.slaveData.forEach((slaveItem, iIndex) => { |
| 4578 | /* 从工艺卡数据集 找到从表相同产品ID,客户ID */ | 4615 | /* 从工艺卡数据集 找到从表相同产品ID,客户ID */ |
| 4579 | - const iSameIndex = slaveData.findIndex(itemCurrent => itemCurrent.sProductId === slaveItem.sProductId && itemCurrent.sCustomerId === slaveItem.sCustomerId); | ||
| 4580 | - if(iSameIndex > -1){ | 4616 | + const iSameIndex = slaveData.findIndex(itemCurrent => itemCurrent.sProductId === slaveItem.sProductId && itemCurrent.sCustomerId === slaveItem.sCustomerId); |
| 4617 | + if (iSameIndex > -1) { | ||
| 4581 | // masterData = { ...masterData, ...commonFunc.getAssignFieldValue(masterDetailAssignField, slaveItem, newCopyTo) }; // 取赋值字段 | 4618 | // masterData = { ...masterData, ...commonFunc.getAssignFieldValue(masterDetailAssignField, slaveItem, newCopyTo) }; // 取赋值字段 |
| 4582 | slaveData[iSameIndex].sOriginalId = commonUtils.isNotEmptyObject(slaveItem.sSlaveId) ? slaveItem.sSlaveId : slaveItem.sId; /* 原始sId */ | 4619 | slaveData[iSameIndex].sOriginalId = commonUtils.isNotEmptyObject(slaveItem.sSlaveId) ? slaveItem.sSlaveId : slaveItem.sId; /* 原始sId */ |
| 4583 | - slaveData[iSameIndex] = { ...slaveData[iSameIndex], ...commonFunc.getAssignFieldValue(slaveDetailAssignField,slaveItem, newCopyTo) }; // 取赋值字段 | 4620 | + slaveData[iSameIndex] = { ...slaveData[iSameIndex], ...commonFunc.getAssignFieldValue(slaveDetailAssignField, slaveItem, newCopyTo) }; // 取赋值字段 |
| 4584 | if (bProductQtySelf) { | 4621 | if (bProductQtySelf) { |
| 4585 | dProductQty += commonUtils.isNull(slaveItem.dProductQty, 0); | 4622 | dProductQty += commonUtils.isNull(slaveItem.dProductQty, 0); |
| 4586 | } else { | 4623 | } else { |
| 4587 | dProductQty += commonUtils.isNull(slaveItem.dProductQty, 0) + commonUtils.isNull(slaveItem.dGiveQty, 0) + commonUtils.isNull(slaveItem.dStockupQty, 0); | 4624 | dProductQty += commonUtils.isNull(slaveItem.dProductQty, 0) + commonUtils.isNull(slaveItem.dGiveQty, 0) + commonUtils.isNull(slaveItem.dStockupQty, 0); |
| 4588 | } | 4625 | } |
| 4589 | - } else if(commonUtils.isNotEmptyObject(slaveDetailAssignField)){ /* 其他数据 新增 */ | 4626 | + } else if (commonUtils.isNotEmptyObject(slaveDetailAssignField)) { /* 其他数据 新增 */ |
| 4590 | newCopyTo.slave = slaveItem; | 4627 | newCopyTo.slave = slaveItem; |
| 4591 | - let slaveRow ={}; | ||
| 4592 | - slaveRow = { ...slaveRow, ...commonFunc.getAssignFieldValue(slaveDetailAssignField,slaveItem, newCopyTo) }; // 取赋值字段 | 4628 | + let slaveRow = {}; |
| 4629 | + slaveRow = { ...slaveRow, ...commonFunc.getAssignFieldValue(slaveDetailAssignField, slaveItem, newCopyTo) }; // 取赋值字段 | ||
| 4593 | slaveRow.handleType = 'add'; | 4630 | slaveRow.handleType = 'add'; |
| 4594 | slaveRow.sId = commonUtils.createSid(); | 4631 | slaveRow.sId = commonUtils.createSid(); |
| 4595 | slaveRow.sParentId = masterData.sId; | 4632 | slaveRow.sParentId = masterData.sId; |
| @@ -4875,8 +4912,8 @@ class QuotationPackTableTree extends Component { | @@ -4875,8 +4912,8 @@ class QuotationPackTableTree extends Component { | ||
| 4875 | const treeState = this.handleGetControlTreeData(controlData, true); | 4912 | const treeState = this.handleGetControlTreeData(controlData, true); |
| 4876 | /* 因全部材料对应的是materials0 */ | 4913 | /* 因全部材料对应的是materials0 */ |
| 4877 | const materials0Data = materialsData; | 4914 | const materials0Data = materialsData; |
| 4878 | - addState.materials0Data = materials0Data; | ||
| 4879 | - addState.materials0DelData = addState.materialsDelData; | 4915 | + addState.materials0Data = materials0Data; |
| 4916 | + addState.materials0DelData = addState.materialsDelData; | ||
| 4880 | this.props.onSaveState({ | 4917 | this.props.onSaveState({ |
| 4881 | [`${name}ChooseVisible`]: false, | 4918 | [`${name}ChooseVisible`]: false, |
| 4882 | processData, | 4919 | processData, |
| @@ -4894,7 +4931,7 @@ class QuotationPackTableTree extends Component { | @@ -4894,7 +4931,7 @@ class QuotationPackTableTree extends Component { | ||
| 4894 | this.props.getServiceError(dataReturn.msg); | 4931 | this.props.getServiceError(dataReturn.msg); |
| 4895 | } | 4932 | } |
| 4896 | } | 4933 | } |
| 4897 | - }else if (name === 'productProcessInfo' && commonUtils.isNotEmptyObject(selectConfig) && selectConfig.sControlName.includes('mainproductProcessInfo')) { /* 复制从主产品工艺卡 */ | 4934 | + } else if (name === 'productProcessInfo' && commonUtils.isNotEmptyObject(selectConfig) && selectConfig.sControlName.includes('mainproductProcessInfo')) { /* 复制从主产品工艺卡 */ |
| 4898 | if (commonUtils.isNotEmptyArr(selectData)) { | 4935 | if (commonUtils.isNotEmptyArr(selectData)) { |
| 4899 | const { slaveData: slaveDataOld } = this.props; | 4936 | const { slaveData: slaveDataOld } = this.props; |
| 4900 | const slaveData = []; | 4937 | const slaveData = []; |
| @@ -4946,7 +4983,7 @@ class QuotationPackTableTree extends Component { | @@ -4946,7 +4983,7 @@ class QuotationPackTableTree extends Component { | ||
| 4946 | config.colorConfig = colorConfig; | 4983 | config.colorConfig = colorConfig; |
| 4947 | config.packConfig = packConfig; | 4984 | config.packConfig = packConfig; |
| 4948 | 4985 | ||
| 4949 | - const condition = { sCardId: selectData[0].sId, sRowData:selectData }; | 4986 | + const condition = { sCardId: selectData[0].sId, sRowData: selectData }; |
| 4950 | const dataUrl = `${commonConfig.server_host}salesorder/getProcessCardDataByCustomIdProductId/?sModelsId=${sModelsId}`; | 4987 | const dataUrl = `${commonConfig.server_host}salesorder/getProcessCardDataByCustomIdProductId/?sModelsId=${sModelsId}`; |
| 4951 | const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data; | 4988 | const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data; |
| 4952 | if (dataReturn.code === 1) { | 4989 | if (dataReturn.code === 1) { |
| @@ -5267,16 +5304,16 @@ class QuotationPackTableTree extends Component { | @@ -5267,16 +5304,16 @@ class QuotationPackTableTree extends Component { | ||
| 5267 | this.props.getServiceError(dataReturn.msg); | 5304 | this.props.getServiceError(dataReturn.msg); |
| 5268 | } | 5305 | } |
| 5269 | } | 5306 | } |
| 5270 | - }else if (name === 'productProcessInfo' && commonUtils.isNotEmptyObject(selectConfig) && selectConfig.sControlName.includes('subproductProcessInfo')) { /* 复制从子工艺卡*/ | 5307 | + } else if (name === 'productProcessInfo' && commonUtils.isNotEmptyObject(selectConfig) && selectConfig.sControlName.includes('subproductProcessInfo')) { /* 复制从子工艺卡*/ |
| 5271 | if (commonUtils.isNotEmptyArr(selectData)) { | 5308 | if (commonUtils.isNotEmptyArr(selectData)) { |
| 5272 | - const {slaveSelectedRowKeys, packData}=this.props; | 5309 | + const { slaveSelectedRowKeys, packData } = this.props; |
| 5273 | let iSlaveIndex = -1; | 5310 | let iSlaveIndex = -1; |
| 5274 | if (!commonUtils.isEmpty(slaveSelectedRowKeys)) { | 5311 | if (!commonUtils.isEmpty(slaveSelectedRowKeys)) { |
| 5275 | iSlaveIndex = slaveData.findIndex(item => item.sId === slaveSelectedRowKeys.toString()); | 5312 | iSlaveIndex = slaveData.findIndex(item => item.sId === slaveSelectedRowKeys.toString()); |
| 5276 | } | 5313 | } |
| 5277 | - let {controlData} = this.props; | ||
| 5278 | - if(commonUtils.isEmptyArr(controlData)){ | ||
| 5279 | - controlData=[] | 5314 | + let { controlData } = this.props; |
| 5315 | + if (commonUtils.isEmptyArr(controlData)) { | ||
| 5316 | + controlData = [] | ||
| 5280 | } | 5317 | } |
| 5281 | const materialsData = []; | 5318 | const materialsData = []; |
| 5282 | const processData = []; | 5319 | const processData = []; |
| @@ -5288,20 +5325,20 @@ class QuotationPackTableTree extends Component { | @@ -5288,20 +5325,20 @@ class QuotationPackTableTree extends Component { | ||
| 5288 | const colorDelData = commonUtils.isEmptyArr(colorDelDataOld) ? [] : colorDelDataOld; | 5325 | const colorDelData = commonUtils.isEmptyArr(colorDelDataOld) ? [] : colorDelDataOld; |
| 5289 | /* 选择子产品工艺卡 如果选择的从表的packData合拼的其他的 则不删除 没有合拼产品的 或是合拼产品为1的删除 */ | 5326 | /* 选择子产品工艺卡 如果选择的从表的packData合拼的其他的 则不删除 没有合拼产品的 或是合拼产品为1的删除 */ |
| 5290 | controlDataOld.forEach((item) => { | 5327 | controlDataOld.forEach((item) => { |
| 5291 | - const jsonArr =commonUtils.isEmptyObject(item.sCombinedMemo)? []: JSON.parse(item.sCombinedMemo); | ||
| 5292 | - if((jsonArr.length ===1 && jsonArr[0].sProductNo === slaveData[iSlaveIndex].sProductNo)){ | 5328 | + const jsonArr = commonUtils.isEmptyObject(item.sCombinedMemo) ? [] : JSON.parse(item.sCombinedMemo); |
| 5329 | + if ((jsonArr.length === 1 && jsonArr[0].sProductNo === slaveData[iSlaveIndex].sProductNo)) { | ||
| 5293 | item.handleType = 'del'; | 5330 | item.handleType = 'del'; |
| 5294 | controlDelData.push(item); | 5331 | controlDelData.push(item); |
| 5295 | let tableDataIndex = controlData.findIndex(itemOld => itemOld.sId === item.sId); | 5332 | let tableDataIndex = controlData.findIndex(itemOld => itemOld.sId === item.sId); |
| 5296 | - if(tableDataIndex > -1){ | 5333 | + if (tableDataIndex > -1) { |
| 5297 | controlData.splice(tableDataIndex, 1); | 5334 | controlData.splice(tableDataIndex, 1); |
| 5298 | } | 5335 | } |
| 5299 | } | 5336 | } |
| 5300 | }); | 5337 | }); |
| 5301 | addState.controlDelData = controlDelData; | 5338 | addState.controlDelData = controlDelData; |
| 5302 | materialsDataOld.forEach((item) => { | 5339 | materialsDataOld.forEach((item) => { |
| 5303 | - const filterData= controlDelData.filter(itemControl => itemControl.sId.includes(item.sControlId)); | ||
| 5304 | - if(commonUtils.isNotEmptyArr(filterData)){ | 5340 | + const filterData = controlDelData.filter(itemControl => itemControl.sId.includes(item.sControlId)); |
| 5341 | + if (commonUtils.isNotEmptyArr(filterData)) { | ||
| 5305 | item.handleType = 'del'; | 5342 | item.handleType = 'del'; |
| 5306 | materialsDelData.push(item); | 5343 | materialsDelData.push(item); |
| 5307 | } | 5344 | } |
| @@ -5309,8 +5346,8 @@ class QuotationPackTableTree extends Component { | @@ -5309,8 +5346,8 @@ class QuotationPackTableTree extends Component { | ||
| 5309 | }); | 5346 | }); |
| 5310 | addState.materialsDelData = materialsDelData; | 5347 | addState.materialsDelData = materialsDelData; |
| 5311 | processDataOld.forEach((item) => { | 5348 | processDataOld.forEach((item) => { |
| 5312 | - const filterData= controlDelData.filter(itemControl => itemControl.sId.includes(item.sControlId )); | ||
| 5313 | - if(commonUtils.isNotEmptyArr(filterData)){ | 5349 | + const filterData = controlDelData.filter(itemControl => itemControl.sId.includes(item.sControlId)); |
| 5350 | + if (commonUtils.isNotEmptyArr(filterData)) { | ||
| 5314 | item.handleType = 'del'; | 5351 | item.handleType = 'del'; |
| 5315 | processDelData.push(item); | 5352 | processDelData.push(item); |
| 5316 | } | 5353 | } |
| @@ -5332,7 +5369,7 @@ class QuotationPackTableTree extends Component { | @@ -5332,7 +5369,7 @@ class QuotationPackTableTree extends Component { | ||
| 5332 | config.colorConfig = colorConfig; | 5369 | config.colorConfig = colorConfig; |
| 5333 | config.packConfig = packConfig; | 5370 | config.packConfig = packConfig; |
| 5334 | 5371 | ||
| 5335 | - const condition = { sCardId: selectData[0].sId, sRowData:selectData }; | 5372 | + const condition = { sCardId: selectData[0].sId, sRowData: selectData }; |
| 5336 | const dataUrl = `${commonConfig.server_host}salesorder/getProcessCardDataByCustomIdProductId/?sModelsId=${sModelsId}`; | 5373 | const dataUrl = `${commonConfig.server_host}salesorder/getProcessCardDataByCustomIdProductId/?sModelsId=${sModelsId}`; |
| 5337 | const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data; | 5374 | const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data; |
| 5338 | if (dataReturn.code === 1) { | 5375 | if (dataReturn.code === 1) { |
| @@ -5753,7 +5790,7 @@ class QuotationPackTableTree extends Component { | @@ -5753,7 +5790,7 @@ class QuotationPackTableTree extends Component { | ||
| 5753 | } | 5790 | } |
| 5754 | })); | 5791 | })); |
| 5755 | } | 5792 | } |
| 5756 | - } else if(name ==='materials') { | 5793 | + } else if (name === 'materials') { |
| 5757 | /* 将工序选中行 作为对应工序给材料 */ | 5794 | /* 将工序选中行 作为对应工序给材料 */ |
| 5758 | const iProcessIndex = commonUtils.isNotEmptyArr(processSelectedRowKeys) ? processDataOld.findIndex(item => item.sId === processSelectedRowKeys[0]) : -1; | 5795 | const iProcessIndex = commonUtils.isNotEmptyArr(processSelectedRowKeys) ? processDataOld.findIndex(item => item.sId === processSelectedRowKeys[0]) : -1; |
| 5759 | let processRow = {}; | 5796 | let processRow = {}; |
| @@ -5790,7 +5827,7 @@ class QuotationPackTableTree extends Component { | @@ -5790,7 +5827,7 @@ class QuotationPackTableTree extends Component { | ||
| 5790 | name = 'materials'; | 5827 | name = 'materials'; |
| 5791 | } | 5828 | } |
| 5792 | const { | 5829 | const { |
| 5793 | - [`${name}Data`]: tableData, [`${name}Config`]: tableConfig, controlSelectedRowKeys, materialsConfig,masterConfig, | 5830 | + [`${name}Data`]: tableData, [`${name}Config`]: tableConfig, controlSelectedRowKeys, materialsConfig, masterConfig, |
| 5794 | } = this.props; | 5831 | } = this.props; |
| 5795 | const { masterData } = this.props; | 5832 | const { masterData } = this.props; |
| 5796 | const { controlData } = this.props; | 5833 | const { controlData } = this.props; |
| @@ -5853,7 +5890,7 @@ class QuotationPackTableTree extends Component { | @@ -5853,7 +5890,7 @@ class QuotationPackTableTree extends Component { | ||
| 5853 | const targetname = 'process'; | 5890 | const targetname = 'process'; |
| 5854 | const { | 5891 | const { |
| 5855 | [`${targetname}Data`]: tableData, [`${targetname}Config`]: tableConfig, controlSelectedRowKeys, sModelsId, token, | 5892 | [`${targetname}Data`]: tableData, [`${targetname}Config`]: tableConfig, controlSelectedRowKeys, sModelsId, token, |
| 5856 | - materialsConfig, processConfig,masterConfig, | 5893 | + materialsConfig, processConfig, masterConfig, |
| 5857 | } = this.props; | 5894 | } = this.props; |
| 5858 | const { masterData } = this.props; | 5895 | const { masterData } = this.props; |
| 5859 | if (name === 'chooseProductProcess') { | 5896 | if (name === 'chooseProductProcess') { |
| @@ -5998,7 +6035,7 @@ class QuotationPackTableTree extends Component { | @@ -5998,7 +6035,7 @@ class QuotationPackTableTree extends Component { | ||
| 5998 | } | 6035 | } |
| 5999 | 6036 | ||
| 6000 | 6037 | ||
| 6001 | - handleViewChoose= (name, sName, record) => { | 6038 | + handleViewChoose = (name, sName, record) => { |
| 6002 | const { sId } = record; /* 控制表主键 */ | 6039 | const { sId } = record; /* 控制表主键 */ |
| 6003 | const { enabled, slaveData } = this.props; | 6040 | const { enabled, slaveData } = this.props; |
| 6004 | let { packData } = this.props; | 6041 | let { packData } = this.props; |
| @@ -6168,11 +6205,11 @@ class QuotationPackTableTree extends Component { | @@ -6168,11 +6205,11 @@ class QuotationPackTableTree extends Component { | ||
| 6168 | }); | 6205 | }); |
| 6169 | } else if (name === 'process' && sName === 'sColorSerialMemo') { | 6206 | } else if (name === 'process' && sName === 'sColorSerialMemo') { |
| 6170 | this.props.onViewChoose(name, sName, record); | 6207 | this.props.onViewChoose(name, sName, record); |
| 6171 | - } else if(name === 'process' && (sName === 'sParams' || sName ==='sQuoParams')) { | 6208 | + } else if (name === 'process' && (sName === 'sParams' || sName === 'sQuoParams')) { |
| 6172 | this.props.onViewClick(name, sName, record); | 6209 | this.props.onViewClick(name, sName, record); |
| 6173 | } | 6210 | } |
| 6174 | } | 6211 | } |
| 6175 | - handlePackDataAdd= (item, index, sControlId, handleType) => { | 6212 | + handlePackDataAdd = (item, index, sControlId, handleType) => { |
| 6176 | const tableDataRow = {}; | 6213 | const tableDataRow = {}; |
| 6177 | if (handleType === 'add') { | 6214 | if (handleType === 'add') { |
| 6178 | tableDataRow.sId = commonUtils.createSid(); | 6215 | tableDataRow.sId = commonUtils.createSid(); |
| @@ -6404,7 +6441,7 @@ class QuotationPackTableTree extends Component { | @@ -6404,7 +6441,7 @@ class QuotationPackTableTree extends Component { | ||
| 6404 | tableDataRow.dProfitMoney = commonUtils.convertFixNum(commonUtils.isNull(dProductMoney, 0) - commonUtils.isNull(tableDataRow.dProductTaxMoney, 0) - commonUtils.isNull(tableDataRow.dStandardMoney, 0) - commonUtils.isNull(masterData.dPackMoney, 0) - commonUtils.isNull(masterData.dTransportMoney, 0), dNetMoney); | 6441 | tableDataRow.dProfitMoney = commonUtils.convertFixNum(commonUtils.isNull(dProductMoney, 0) - commonUtils.isNull(tableDataRow.dProductTaxMoney, 0) - commonUtils.isNull(tableDataRow.dStandardMoney, 0) - commonUtils.isNull(masterData.dPackMoney, 0) - commonUtils.isNull(masterData.dTransportMoney, 0), dNetMoney); |
| 6405 | } | 6442 | } |
| 6406 | // eslint-disable-next-line no-mixed-operators | 6443 | // eslint-disable-next-line no-mixed-operators |
| 6407 | - tableDataRow.dProfitRate = commonUtils.isNull(tableDataRow.dStandardMoney, 0) !== 0 ? commonUtils.convertFixNum(commonUtils.isNull(tableDataRow.dProfitMoney, 0) / commonUtils.isNull(tableDataRow.dStandardMoney, 0) * 100, 2) : 0; | 6444 | + tableDataRow.dProfitRate = commonUtils.isNull(tableDataRow.dStandardMoney, 0) !== 0 ? commonUtils.convertFixNum(commonUtils.isNull(tableDataRow.dProfitMoney, 0) / commonUtils.isNull(tableDataRow.dStandardMoney, 0) * 100, 2) : 0; |
| 6408 | } else if ((sFieldName === 'dProfitRate') && !commonUtils.isEmpty(tableDataRow.dStandardMoney)) { | 6445 | } else if ((sFieldName === 'dProfitRate') && !commonUtils.isEmpty(tableDataRow.dStandardMoney)) { |
| 6409 | /* 利润 = 标准金额 dStandMoney * 利润率 dProfitRate */ | 6446 | /* 利润 = 标准金额 dStandMoney * 利润率 dProfitRate */ |
| 6410 | tableDataRow.dProfitMoney = commonUtils.convertFixNum((commonUtils.isNull(tableDataRow.dStandardMoney, 0)) * (commonUtils.isNull(tableDataRow.dProfitRate, 0) / 100), dNetMoney); | 6447 | tableDataRow.dProfitMoney = commonUtils.convertFixNum((commonUtils.isNull(tableDataRow.dStandardMoney, 0)) * (commonUtils.isNull(tableDataRow.dProfitRate, 0) / 100), dNetMoney); |
| @@ -6516,27 +6553,27 @@ class QuotationPackTableTree extends Component { | @@ -6516,27 +6553,27 @@ class QuotationPackTableTree extends Component { | ||
| 6516 | packDataRow = this.handlePackDataAdd(tableDataRow, 0, sControlId); | 6553 | packDataRow = this.handlePackDataAdd(tableDataRow, 0, sControlId); |
| 6517 | // packDataRow.dCombineQty = 1; | 6554 | // packDataRow.dCombineQty = 1; |
| 6518 | const pIndex = packData.findIndex(item => item.sId === itemPack.sId); | 6555 | const pIndex = packData.findIndex(item => item.sId === itemPack.sId); |
| 6519 | - if (pIndex > -1){ | ||
| 6520 | - packData[pIndex] = { ...packData[pIndex], ...packDataRow}; /* 根据选中的从表 找到所有的合版数据,将合版数据中的产品换成切换后的产品 */ | 6556 | + if (pIndex > -1) { |
| 6557 | + packData[pIndex] = { ...packData[pIndex], ...packDataRow }; /* 根据选中的从表 找到所有的合版数据,将合版数据中的产品换成切换后的产品 */ | ||
| 6521 | let sCombinedMemoStr = ''; /* 将控制表合版信息中的产品换成新选择的产品 */ | 6558 | let sCombinedMemoStr = ''; /* 将控制表合版信息中的产品换成新选择的产品 */ |
| 6522 | - if(commonUtils.isNotEmptyArr(controlDataNew)) { | 6559 | + if (commonUtils.isNotEmptyArr(controlDataNew)) { |
| 6523 | const iControlIndex = controlDataNew.findIndex(item => item.sId === sControlId); | 6560 | const iControlIndex = controlDataNew.findIndex(item => item.sId === sControlId); |
| 6524 | if (iControlIndex > -1) { | 6561 | if (iControlIndex > -1) { |
| 6525 | sCombinedMemoStr = controlDataNew[iControlIndex].sCombinedMemo; | 6562 | sCombinedMemoStr = controlDataNew[iControlIndex].sCombinedMemo; |
| 6526 | - if(sCombinedMemoStr) { | ||
| 6527 | - const sCombinedMemoArr = commonUtils.isNotEmptyObject(sCombinedMemoStr) ? JSON.parse(sCombinedMemoStr): {}; | ||
| 6528 | - if(commonUtils.isNotEmptyArr(sCombinedMemoArr)) { | 6563 | + if (sCombinedMemoStr) { |
| 6564 | + const sCombinedMemoArr = commonUtils.isNotEmptyObject(sCombinedMemoStr) ? JSON.parse(sCombinedMemoStr) : {}; | ||
| 6565 | + if (commonUtils.isNotEmptyArr(sCombinedMemoArr)) { | ||
| 6529 | const iIndex = sCombinedMemoArr.findIndex(item => item.sId === itemPack.sId); | 6566 | const iIndex = sCombinedMemoArr.findIndex(item => item.sId === itemPack.sId); |
| 6530 | - if(iIndex > -1){ | ||
| 6531 | - const addState ={}; | 6567 | + if (iIndex > -1) { |
| 6568 | + const addState = {}; | ||
| 6532 | addState.sProductId = tableDataRow.sProductId; /* 产品id */ | 6569 | addState.sProductId = tableDataRow.sProductId; /* 产品id */ |
| 6533 | addState.sCustomerId = tableDataRow.sCustomerId; /* 客户id */ | 6570 | addState.sCustomerId = tableDataRow.sCustomerId; /* 客户id */ |
| 6534 | addState.sCustomerName = tableDataRow.sCustomerName; /* 客户名称 */ | 6571 | addState.sCustomerName = tableDataRow.sCustomerName; /* 客户名称 */ |
| 6535 | addState.sProductName = tableDataRow.sProductName; /* 产品名称 */ | 6572 | addState.sProductName = tableDataRow.sProductName; /* 产品名称 */ |
| 6536 | addState.sProductNo = tableDataRow.sProductNo; /* 产品编号 */ | 6573 | addState.sProductNo = tableDataRow.sProductNo; /* 产品编号 */ |
| 6537 | - sCombinedMemoArr[iIndex] ={...sCombinedMemoArr[iIndex], ...addState}; | 6574 | + sCombinedMemoArr[iIndex] = { ...sCombinedMemoArr[iIndex], ...addState }; |
| 6538 | const sCombinedMemo = commonUtils.isNotEmptyArr(sCombinedMemoArr) ? JSON.stringify(sCombinedMemoArr) : ''; /* JSON对象转换为字符串存放到合版信息中 */ | 6575 | const sCombinedMemo = commonUtils.isNotEmptyArr(sCombinedMemoArr) ? JSON.stringify(sCombinedMemoArr) : ''; /* JSON对象转换为字符串存放到合版信息中 */ |
| 6539 | - controlDataNew[iControlIndex].sCombinedMemo =sCombinedMemo; | 6576 | + controlDataNew[iControlIndex].sCombinedMemo = sCombinedMemo; |
| 6540 | controlDataNew[iControlIndex].sPartsName = tableDataRow.sProductName; | 6577 | controlDataNew[iControlIndex].sPartsName = tableDataRow.sProductName; |
| 6541 | } | 6578 | } |
| 6542 | } | 6579 | } |
| @@ -6608,19 +6645,19 @@ class QuotationPackTableTree extends Component { | @@ -6608,19 +6645,19 @@ class QuotationPackTableTree extends Component { | ||
| 6608 | tableDataRow.iOppositeColor = tableDataRow.iPositiveColor; | 6645 | tableDataRow.iOppositeColor = tableDataRow.iPositiveColor; |
| 6609 | tableDataRow.iOppositeSpecialColor = tableDataRow.iPositiveSpecialColor; | 6646 | tableDataRow.iOppositeSpecialColor = tableDataRow.iPositiveSpecialColor; |
| 6610 | } | 6647 | } |
| 6611 | - } else if ( sFieldName === 'dSinglePQty' ) { /* 排版数改变时 如果该控制表合版数据只有一条 则改变packData该条的拼版数 改变备注 */ | ||
| 6612 | - if(commonUtils.isNotEmptyArr(packData)){ | 6648 | + } else if (sFieldName === 'dSinglePQty') { /* 排版数改变时 如果该控制表合版数据只有一条 则改变packData该条的拼版数 改变备注 */ |
| 6649 | + if (commonUtils.isNotEmptyArr(packData)) { | ||
| 6613 | const packFilterData = packData.filter(item => item.sControlId === tableDataRow.sId); | 6650 | const packFilterData = packData.filter(item => item.sControlId === tableDataRow.sId); |
| 6614 | - if (commonUtils.isNotEmptyArr(packFilterData) && packFilterData.length ===1 ) { | 6651 | + if (commonUtils.isNotEmptyArr(packFilterData) && packFilterData.length === 1) { |
| 6615 | const iIndex = packData.findIndex(itemPack => itemPack.sId === packFilterData[0].sId); | 6652 | const iIndex = packData.findIndex(itemPack => itemPack.sId === packFilterData[0].sId); |
| 6616 | - const addState ={}; | ||
| 6617 | - if(tableDataRow.dSinglePQty > 0){ | 6653 | + const addState = {}; |
| 6654 | + if (tableDataRow.dSinglePQty > 0) { | ||
| 6618 | addState.dCombineQty = tableDataRow.dSinglePQty; | 6655 | addState.dCombineQty = tableDataRow.dSinglePQty; |
| 6619 | addState.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? 'update' : tableDataRow.handleType; | 6656 | addState.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? 'update' : tableDataRow.handleType; |
| 6620 | - if(iIndex > -1) { | ||
| 6621 | - packData[iIndex] ={ ...packData[iIndex] , ...addState}; | ||
| 6622 | - const { sId, sProductNo, dProductQty, dCombineQty, dFactProductQty,sCombinePartsName }= packData[iIndex]; | ||
| 6623 | - const tableCombineSelectedData =[]; | 6657 | + if (iIndex > -1) { |
| 6658 | + packData[iIndex] = { ...packData[iIndex], ...addState }; | ||
| 6659 | + const { sId, sProductNo, dProductQty, dCombineQty, dFactProductQty, sCombinePartsName } = packData[iIndex]; | ||
| 6660 | + const tableCombineSelectedData = []; | ||
| 6624 | const jsonObj = {}; | 6661 | const jsonObj = {}; |
| 6625 | jsonObj.sId = sId; | 6662 | jsonObj.sId = sId; |
| 6626 | jsonObj.sProductNo = sProductNo; /* 产品编号 */ | 6663 | jsonObj.sProductNo = sProductNo; /* 产品编号 */ |
| @@ -6630,7 +6667,7 @@ class QuotationPackTableTree extends Component { | @@ -6630,7 +6667,7 @@ class QuotationPackTableTree extends Component { | ||
| 6630 | jsonObj.sCombinePartsName = sCombinePartsName; /* 合版部件名称 */ | 6667 | jsonObj.sCombinePartsName = sCombinePartsName; /* 合版部件名称 */ |
| 6631 | tableCombineSelectedData.push(jsonObj); | 6668 | tableCombineSelectedData.push(jsonObj); |
| 6632 | const sCombinedMemo = commonUtils.isNotEmptyArr(tableCombineSelectedData) ? JSON.stringify(tableCombineSelectedData) : ''; /* JSON对象转换为字符串存放到合版信息中 */ | 6669 | const sCombinedMemo = commonUtils.isNotEmptyArr(tableCombineSelectedData) ? JSON.stringify(tableCombineSelectedData) : ''; /* JSON对象转换为字符串存放到合版信息中 */ |
| 6633 | - tableDataRow.sCombinedMemo =commonUtils.isNotEmptyObject(sCombinedMemo)? sCombinedMemo: '合版信息'; | 6670 | + tableDataRow.sCombinedMemo = commonUtils.isNotEmptyObject(sCombinedMemo) ? sCombinedMemo : '合版信息'; |
| 6634 | } | 6671 | } |
| 6635 | } | 6672 | } |
| 6636 | } | 6673 | } |
| @@ -6648,8 +6685,8 @@ class QuotationPackTableTree extends Component { | @@ -6648,8 +6685,8 @@ class QuotationPackTableTree extends Component { | ||
| 6648 | } | 6685 | } |
| 6649 | }); | 6686 | }); |
| 6650 | } | 6687 | } |
| 6651 | - if(sFieldName === 'dPartsLength' || sFieldName === 'dPartsWidth' || sFieldName === 'dMachineLength' || sFieldName === 'dMachineWidth' | ||
| 6652 | - || sFieldName === 'sPrintingPlate' || sFieldName === 'sCutMethod' || sFieldName === 'sSpineDirection' || sFieldName === 'iPrintMode' || sFieldName === 'dBite' || sFieldName === 'dBlood' ) { | 6688 | + if (sFieldName === 'dPartsLength' || sFieldName === 'dPartsWidth' || sFieldName === 'dMachineLength' || sFieldName === 'dMachineWidth' |
| 6689 | + || sFieldName === 'sPrintingPlate' || sFieldName === 'sCutMethod' || sFieldName === 'sSpineDirection' || sFieldName === 'iPrintMode' || sFieldName === 'dBite' || sFieldName === 'dBlood') { | ||
| 6653 | /* 计算材料开数 */ | 6690 | /* 计算材料开数 */ |
| 6654 | if (true) { | 6691 | if (true) { |
| 6655 | // if (commonUtils.isNotEmptyArr(slaveData)) { | 6692 | // if (commonUtils.isNotEmptyArr(slaveData)) { |
| @@ -6663,7 +6700,7 @@ class QuotationPackTableTree extends Component { | @@ -6663,7 +6700,7 @@ class QuotationPackTableTree extends Component { | ||
| 6663 | 6700 | ||
| 6664 | 6701 | ||
| 6665 | let slaveDataRow = {}; | 6702 | let slaveDataRow = {}; |
| 6666 | - if(commonUtils.isNotEmptyArr(slaveData)) { | 6703 | + if (commonUtils.isNotEmptyArr(slaveData)) { |
| 6667 | if (commonUtils.isEmptyArr(slaveSelectedRowKeys)) { | 6704 | if (commonUtils.isEmptyArr(slaveSelectedRowKeys)) { |
| 6668 | slaveDataRow = slaveData[0]; | 6705 | slaveDataRow = slaveData[0]; |
| 6669 | } else if (commonUtils.isEmptyObject(tableDataRow.sCombinedMemo) || tableDataRow.sCombinedMemo === '合版信息') { | 6706 | } else if (commonUtils.isEmptyObject(tableDataRow.sCombinedMemo) || tableDataRow.sCombinedMemo === '合版信息') { |
| @@ -6678,16 +6715,16 @@ class QuotationPackTableTree extends Component { | @@ -6678,16 +6715,16 @@ class QuotationPackTableTree extends Component { | ||
| 6678 | } | 6715 | } |
| 6679 | } | 6716 | } |
| 6680 | } | 6717 | } |
| 6681 | - if(commonUtils.isNotEmptyObject(slaveDataRow)) { | 6718 | + if (commonUtils.isNotEmptyObject(slaveDataRow)) { |
| 6682 | /* 如果有展开尺寸 则取展开尺寸 否则取产品规格 */ | 6719 | /* 如果有展开尺寸 则取展开尺寸 否则取产品规格 */ |
| 6683 | let sProductStyle = ''; | 6720 | let sProductStyle = ''; |
| 6684 | - if(slaveDataRow.sPartsStyle) { | 6721 | + if (slaveDataRow.sPartsStyle) { |
| 6685 | sProductStyle = slaveDataRow.sPartsStyle; | 6722 | sProductStyle = slaveDataRow.sPartsStyle; |
| 6686 | - }else if(slaveDataRow.sProductStyle) { | 6723 | + } else if (slaveDataRow.sProductStyle) { |
| 6687 | sProductStyle = slaveDataRow.sProductStyle; | 6724 | sProductStyle = slaveDataRow.sProductStyle; |
| 6688 | } | 6725 | } |
| 6689 | if (sProductStyle) { | 6726 | if (sProductStyle) { |
| 6690 | - let dProductLength = !commonUtils.isEmpty(sProductStyle) && sProductStyle.split('*').length > 1 ? sProductStyle.split('*')[0] : 0; | 6727 | + let dProductLength = !commonUtils.isEmpty(sProductStyle) && sProductStyle.split('*').length > 1 ? sProductStyle.split('*')[0] : 0; |
| 6691 | dProductLength = commonUtils.convertStrToNumber(commonUtils.isNull(dProductLength, 0)); /* 产品长 */ | 6728 | dProductLength = commonUtils.convertStrToNumber(commonUtils.isNull(dProductLength, 0)); /* 产品长 */ |
| 6692 | dProductLength = (typeof dProductLength === 'number' && !isNaN(dProductLength)) ? dProductLength : 0; /* 产品长 */ | 6729 | dProductLength = (typeof dProductLength === 'number' && !isNaN(dProductLength)) ? dProductLength : 0; /* 产品长 */ |
| 6693 | let dProductWidth = !commonUtils.isEmpty(sProductStyle) && sProductStyle.split('*').length > 1 ? sProductStyle.split('*')[1] : 0; | 6730 | let dProductWidth = !commonUtils.isEmpty(sProductStyle) && sProductStyle.split('*').length > 1 ? sProductStyle.split('*')[1] : 0; |
| @@ -6736,18 +6773,18 @@ class QuotationPackTableTree extends Component { | @@ -6736,18 +6773,18 @@ class QuotationPackTableTree extends Component { | ||
| 6736 | // } | 6773 | // } |
| 6737 | // } | 6774 | // } |
| 6738 | 6775 | ||
| 6739 | - if(commonUtils.isNotEmptyArr(packData)){ | 6776 | + if (commonUtils.isNotEmptyArr(packData)) { |
| 6740 | const packFilterData = packData.filter(item => item.sControlId === tableDataRow.sId); | 6777 | const packFilterData = packData.filter(item => item.sControlId === tableDataRow.sId); |
| 6741 | - if (commonUtils.isNotEmptyArr(packFilterData) && packFilterData.length ===1 ) { | 6778 | + if (commonUtils.isNotEmptyArr(packFilterData) && packFilterData.length === 1) { |
| 6742 | const iIndex = packData.findIndex(itemPack => itemPack.sId === packFilterData[0].sId); | 6779 | const iIndex = packData.findIndex(itemPack => itemPack.sId === packFilterData[0].sId); |
| 6743 | - const addState ={}; | ||
| 6744 | - if(tableDataRow.dSinglePQty > 0){ | 6780 | + const addState = {}; |
| 6781 | + if (tableDataRow.dSinglePQty > 0) { | ||
| 6745 | addState.dCombineQty = tableDataRow.dSinglePQty; | 6782 | addState.dCombineQty = tableDataRow.dSinglePQty; |
| 6746 | addState.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? 'update' : tableDataRow.handleType; | 6783 | addState.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? 'update' : tableDataRow.handleType; |
| 6747 | - if(iIndex > -1) { | ||
| 6748 | - packData[iIndex] ={ ...packData[iIndex] , ...addState}; | ||
| 6749 | - const { sId, sProductNo, dProductQty, dCombineQty, dFactProductQty,sCombinePartsName }= packData[iIndex]; | ||
| 6750 | - const tableCombineSelectedData =[]; | 6784 | + if (iIndex > -1) { |
| 6785 | + packData[iIndex] = { ...packData[iIndex], ...addState }; | ||
| 6786 | + const { sId, sProductNo, dProductQty, dCombineQty, dFactProductQty, sCombinePartsName } = packData[iIndex]; | ||
| 6787 | + const tableCombineSelectedData = []; | ||
| 6751 | const jsonObj = {}; | 6788 | const jsonObj = {}; |
| 6752 | jsonObj.sId = sId; | 6789 | jsonObj.sId = sId; |
| 6753 | jsonObj.sProductNo = sProductNo; /* 产品编号 */ | 6790 | jsonObj.sProductNo = sProductNo; /* 产品编号 */ |
| @@ -6757,17 +6794,17 @@ class QuotationPackTableTree extends Component { | @@ -6757,17 +6794,17 @@ class QuotationPackTableTree extends Component { | ||
| 6757 | jsonObj.sCombinePartsName = sCombinePartsName; /* 合版部件名称 */ | 6794 | jsonObj.sCombinePartsName = sCombinePartsName; /* 合版部件名称 */ |
| 6758 | tableCombineSelectedData.push(jsonObj); | 6795 | tableCombineSelectedData.push(jsonObj); |
| 6759 | const sCombinedMemo = commonUtils.isNotEmptyArr(tableCombineSelectedData) ? JSON.stringify(tableCombineSelectedData) : ''; /* JSON对象转换为字符串存放到合版信息中 */ | 6796 | const sCombinedMemo = commonUtils.isNotEmptyArr(tableCombineSelectedData) ? JSON.stringify(tableCombineSelectedData) : ''; /* JSON对象转换为字符串存放到合版信息中 */ |
| 6760 | - tableDataRow.sCombinedMemo =commonUtils.isNotEmptyObject(sCombinedMemo)? sCombinedMemo: '合版信息'; | 6797 | + tableDataRow.sCombinedMemo = commonUtils.isNotEmptyObject(sCombinedMemo) ? sCombinedMemo : '合版信息'; |
| 6761 | } | 6798 | } |
| 6762 | } | 6799 | } |
| 6763 | } | 6800 | } |
| 6764 | } else { /* packData没数据时 */ | 6801 | } else { /* packData没数据时 */ |
| 6765 | const packDataRow = this.handlePackDataAdd(slaveDataRow, 0, tableDataRow.sId, 'add'); | 6802 | const packDataRow = this.handlePackDataAdd(slaveDataRow, 0, tableDataRow.sId, 'add'); |
| 6766 | packDataRow.dCombineQty = tableDataRow.dSinglePQty; | 6803 | packDataRow.dCombineQty = tableDataRow.dSinglePQty; |
| 6767 | - packDataRow.dFactProductQty = commonUtils.isNull(slaveDataRow.dProductQty, 0); /* 排版数为1时,实际生产数 = 产品数 */ | 6804 | + packDataRow.dFactProductQty = commonUtils.isNull(slaveDataRow.dProductQty, 0); /* 排版数为1时,实际生产数 = 产品数 */ |
| 6768 | if (tableDataRow.dSinglePQty > 0) { | 6805 | if (tableDataRow.dSinglePQty > 0) { |
| 6769 | - const { sId, sProductNo, dProductQty, dCombineQty, dFactProductQty,sCombinePartsName }= packDataRow; | ||
| 6770 | - const tableCombineSelectedData =[]; | 6806 | + const { sId, sProductNo, dProductQty, dCombineQty, dFactProductQty, sCombinePartsName } = packDataRow; |
| 6807 | + const tableCombineSelectedData = []; | ||
| 6771 | const jsonObj = {}; | 6808 | const jsonObj = {}; |
| 6772 | jsonObj.sId = sId; | 6809 | jsonObj.sId = sId; |
| 6773 | jsonObj.sProductNo = sProductNo; /* 产品编号 */ | 6810 | jsonObj.sProductNo = sProductNo; /* 产品编号 */ |
| @@ -6777,7 +6814,7 @@ class QuotationPackTableTree extends Component { | @@ -6777,7 +6814,7 @@ class QuotationPackTableTree extends Component { | ||
| 6777 | jsonObj.sCombinePartsName = sCombinePartsName; /* 合版部件名称 */ | 6814 | jsonObj.sCombinePartsName = sCombinePartsName; /* 合版部件名称 */ |
| 6778 | tableCombineSelectedData.push(jsonObj); | 6815 | tableCombineSelectedData.push(jsonObj); |
| 6779 | const sCombinedMemo = commonUtils.isNotEmptyArr(tableCombineSelectedData) ? JSON.stringify(tableCombineSelectedData) : ''; /* JSON对象转换为字符串存放到合版信息中 */ | 6816 | const sCombinedMemo = commonUtils.isNotEmptyArr(tableCombineSelectedData) ? JSON.stringify(tableCombineSelectedData) : ''; /* JSON对象转换为字符串存放到合版信息中 */ |
| 6780 | - tableDataRow.sCombinedMemo =commonUtils.isNotEmptyObject(sCombinedMemo)? sCombinedMemo: '合版信息'; | 6817 | + tableDataRow.sCombinedMemo = commonUtils.isNotEmptyObject(sCombinedMemo) ? sCombinedMemo : '合版信息'; |
| 6781 | packData.push(packDataRow); | 6818 | packData.push(packDataRow); |
| 6782 | } | 6819 | } |
| 6783 | } | 6820 | } |
| @@ -6911,20 +6948,20 @@ class QuotationPackTableTree extends Component { | @@ -6911,20 +6948,20 @@ class QuotationPackTableTree extends Component { | ||
| 6911 | } | 6948 | } |
| 6912 | } | 6949 | } |
| 6913 | this.props.onSaveState({ [`${name}Data`]: tableData }); | 6950 | this.props.onSaveState({ [`${name}Data`]: tableData }); |
| 6914 | - }else if (name === 'materials0' || name === 'materials1' || name === 'materials2' || name === 'materials0Child') { | 6951 | + } else if (name === 'materials0' || name === 'materials1' || name === 'materials2' || name === 'materials0Child') { |
| 6915 | name = 'materials'; | 6952 | name = 'materials'; |
| 6916 | const { | 6953 | const { |
| 6917 | [`${name}Data`]: tableData, controlData, controlSelectedRowKeys, materials0Data, materials0SelectedRowKeys, | 6954 | [`${name}Data`]: tableData, controlData, controlSelectedRowKeys, materials0Data, materials0SelectedRowKeys, |
| 6918 | } = this.props; | 6955 | } = this.props; |
| 6919 | let oldRowMap = {}; | 6956 | let oldRowMap = {}; |
| 6920 | - if(sFieldName === 'sInkBOM') { | 6957 | + if (sFieldName === 'sInkBOM') { |
| 6921 | const iOldIndex = tableData.findIndex(item => item.sId === sId); | 6958 | const iOldIndex = tableData.findIndex(item => item.sId === sId); |
| 6922 | - if(iOldIndex > -1) { | 6959 | + if (iOldIndex > -1) { |
| 6923 | const tableDataOldRow = JSON.parse(JSON.stringify(tableData[iOldIndex])); | 6960 | const tableDataOldRow = JSON.parse(JSON.stringify(tableData[iOldIndex])); |
| 6924 | - oldRowMap ={ | ||
| 6925 | - sInkBOMId : tableDataOldRow.sInkBOMId, | ||
| 6926 | - sInkBOMsSlaveId : tableDataOldRow.sInkBOMsSlaveId, | ||
| 6927 | - sInkBOMsMaterialsId : tableDataOldRow.sInkBOMsMaterialsId, | 6961 | + oldRowMap = { |
| 6962 | + sInkBOMId: tableDataOldRow.sInkBOMId, | ||
| 6963 | + sInkBOMsSlaveId: tableDataOldRow.sInkBOMsSlaveId, | ||
| 6964 | + sInkBOMsMaterialsId: tableDataOldRow.sInkBOMsMaterialsId, | ||
| 6928 | } | 6965 | } |
| 6929 | } | 6966 | } |
| 6930 | } | 6967 | } |
| @@ -6938,7 +6975,7 @@ class QuotationPackTableTree extends Component { | @@ -6938,7 +6975,7 @@ class QuotationPackTableTree extends Component { | ||
| 6938 | tableData[iIndex] = tableDataRow; | 6975 | tableData[iIndex] = tableDataRow; |
| 6939 | } | 6976 | } |
| 6940 | this.props.onSaveState({ [`${name}Data`]: tableData }); | 6977 | this.props.onSaveState({ [`${name}Data`]: tableData }); |
| 6941 | - }else if ( name === 'materialsChild') { /* 替代料 */ | 6978 | + } else if (name === 'materialsChild') { /* 替代料 */ |
| 6942 | name = 'materials'; | 6979 | name = 'materials'; |
| 6943 | const { | 6980 | const { |
| 6944 | [`${name}Data`]: tableData, controlData, controlSelectedRowKeys, materials0Data, materials0SelectedRowKeys, | 6981 | [`${name}Data`]: tableData, controlData, controlSelectedRowKeys, materials0Data, materials0SelectedRowKeys, |
| @@ -7183,7 +7220,7 @@ class QuotationPackTableTree extends Component { | @@ -7183,7 +7220,7 @@ class QuotationPackTableTree extends Component { | ||
| 7183 | handleCancelProductCombinationChooseModal = () => { | 7220 | handleCancelProductCombinationChooseModal = () => { |
| 7184 | this.props.onSaveState({ productCombinationVisible: false }); | 7221 | this.props.onSaveState({ productCombinationVisible: false }); |
| 7185 | }; | 7222 | }; |
| 7186 | - handleSelectProductCombination= () => { | 7223 | + handleSelectProductCombination = () => { |
| 7187 | const { | 7224 | const { |
| 7188 | controlData, sCombinationsControlId, packData, enabled, app, | 7225 | controlData, sCombinationsControlId, packData, enabled, app, |
| 7189 | } = this.props; | 7226 | } = this.props; |
| @@ -7409,7 +7446,7 @@ class QuotationPackTableTree extends Component { | @@ -7409,7 +7446,7 @@ class QuotationPackTableTree extends Component { | ||
| 7409 | }); | 7446 | }); |
| 7410 | } | 7447 | } |
| 7411 | this.props.onSaveState({ | 7448 | this.props.onSaveState({ |
| 7412 | - [`${name}Data`]: tableData, [`${name}Pagination`]: { ...tablePagination, total: tableData.length, current: 9999 }, [`${name}SelectedRowKeys`]: tableSelectedNewRowKeys, treeSelectedKeys: tableSelectedNewRowKeys, packData,...treeState, | 7449 | + [`${name}Data`]: tableData, [`${name}Pagination`]: { ...tablePagination, total: tableData.length, current: 9999 }, [`${name}SelectedRowKeys`]: tableSelectedNewRowKeys, treeSelectedKeys: tableSelectedNewRowKeys, packData, ...treeState, |
| 7413 | }); | 7450 | }); |
| 7414 | } | 7451 | } |
| 7415 | } | 7452 | } |
| @@ -7588,12 +7625,12 @@ class QuotationPackTableTree extends Component { | @@ -7588,12 +7625,12 @@ class QuotationPackTableTree extends Component { | ||
| 7588 | commonUtils.isNull(tableDataRow.iOppositeSpecialColor, 0)); | 7625 | commonUtils.isNull(tableDataRow.iOppositeSpecialColor, 0)); |
| 7589 | } else { | 7626 | } else { |
| 7590 | if (tableDataRow.iPrintModePo !== 2) { // 单面样本 | 7627 | if (tableDataRow.iPrintModePo !== 2) { // 单面样本 |
| 7591 | - tableDataRow.dPlateQty = Math.ceil( (commonUtils.isNull(tableDataRow.dSumPQty, 0) * 0.5) / tableDataRow.dSinglePQty); | 7628 | + tableDataRow.dPlateQty = Math.ceil((commonUtils.isNull(tableDataRow.dSumPQty, 0) * 0.5) / tableDataRow.dSinglePQty); |
| 7592 | tableDataRow.iStick = Math.ceil(tableDataRow.dPlateQty); | 7629 | tableDataRow.iStick = Math.ceil(tableDataRow.dPlateQty); |
| 7593 | tableDataRow.dSumPlateQty = tableDataRow.iStick * (commonUtils.isNull(tableDataRow.iPositiveColor, 0) + | 7630 | tableDataRow.dSumPlateQty = tableDataRow.iStick * (commonUtils.isNull(tableDataRow.iPositiveColor, 0) + |
| 7594 | commonUtils.isNull(tableDataRow.iPositiveSpecialColor, 0)); | 7631 | commonUtils.isNull(tableDataRow.iPositiveSpecialColor, 0)); |
| 7595 | } else { | 7632 | } else { |
| 7596 | - tableDataRow.dPlateQty = Math.ceil(commonUtils.isNull(tableDataRow.dSumPQty, 0) / commonUtils.isNull(commonUtils.nullIf(tableDataRow.dSinglePQty, 0), 1)); | 7633 | + tableDataRow.dPlateQty = Math.ceil(commonUtils.isNull(tableDataRow.dSumPQty, 0) / commonUtils.isNull(commonUtils.nullIf(tableDataRow.dSinglePQty, 0), 1)); |
| 7597 | tableDataRow.iStick = Math.ceil(tableDataRow.dPlateQty / 2); | 7634 | tableDataRow.iStick = Math.ceil(tableDataRow.dPlateQty / 2); |
| 7598 | } | 7635 | } |
| 7599 | tableDataRow.dSumPlateQty = tableDataRow.iStick * ( | 7636 | tableDataRow.dSumPlateQty = tableDataRow.iStick * ( |
| @@ -7786,12 +7823,12 @@ class QuotationPackTableTree extends Component { | @@ -7786,12 +7823,12 @@ class QuotationPackTableTree extends Component { | ||
| 7786 | 7823 | ||
| 7787 | /* 主产品选中时 清除所有表格选中 */ | 7824 | /* 主产品选中时 清除所有表格选中 */ |
| 7788 | handleTotalTreeSelect = (name, checkedKeys, e) => { | 7825 | handleTotalTreeSelect = (name, checkedKeys, e) => { |
| 7789 | - const bMainProduct = (e && e.node && e.node.treeNode) ? e.node.treeNode.isRoot: false; /* 主产品 */ | 7826 | + const bMainProduct = (e && e.node && e.node.treeNode) ? e.node.treeNode.isRoot : false; /* 主产品 */ |
| 7790 | this.props.onTreeSelect(name, checkedKeys, e); | 7827 | this.props.onTreeSelect(name, checkedKeys, e); |
| 7791 | - if(bMainProduct){ | 7828 | + if (bMainProduct) { |
| 7792 | this.props.onSaveState({ | 7829 | this.props.onSaveState({ |
| 7793 | - slaveSelectedRowKeys:[], | ||
| 7794 | - controlSelectedRowKeys:[], | 7830 | + slaveSelectedRowKeys: [], |
| 7831 | + controlSelectedRowKeys: [], | ||
| 7795 | }); | 7832 | }); |
| 7796 | } | 7833 | } |
| 7797 | }; | 7834 | }; |
| @@ -7845,15 +7882,15 @@ class QuotationPackTableTree extends Component { | @@ -7845,15 +7882,15 @@ class QuotationPackTableTree extends Component { | ||
| 7845 | 7882 | ||
| 7846 | handleDrag = (data) => { | 7883 | handleDrag = (data) => { |
| 7847 | let { controlSelectedRowKeys } = this.props; | 7884 | let { controlSelectedRowKeys } = this.props; |
| 7848 | - if(this.props.enabled && controlSelectedRowKeys.length) { | ||
| 7849 | - if(true) { | 7885 | + if (this.props.enabled && controlSelectedRowKeys.length) { |
| 7886 | + if (true) { | ||
| 7850 | // process : 0-1-2 部品工序 : 3成品工序; | 7887 | // process : 0-1-2 部品工序 : 3成品工序; |
| 7851 | let processData = this.props.processData.slice(0); | 7888 | let processData = this.props.processData.slice(0); |
| 7852 | 7889 | ||
| 7853 | let preDataIndex = 0; | 7890 | let preDataIndex = 0; |
| 7854 | let preData = data.filter(item => item.sControlId === this.props.controlSelectedRowKeys[0]).map((item) => { | 7891 | let preData = data.filter(item => item.sControlId === this.props.controlSelectedRowKeys[0]).map((item) => { |
| 7855 | preDataIndex = preDataIndex + 1; | 7892 | preDataIndex = preDataIndex + 1; |
| 7856 | - return {...item, iOrder: preDataIndex} | 7893 | + return { ...item, iOrder: preDataIndex } |
| 7857 | }); | 7894 | }); |
| 7858 | 7895 | ||
| 7859 | // let afterDataIndex = 0; | 7896 | // let afterDataIndex = 0; |
| @@ -7863,56 +7900,56 @@ class QuotationPackTableTree extends Component { | @@ -7863,56 +7900,56 @@ class QuotationPackTableTree extends Component { | ||
| 7863 | // }); | 7900 | // }); |
| 7864 | let allData = preData; //.concat(afterData); | 7901 | let allData = preData; //.concat(afterData); |
| 7865 | allData.forEach((item, index) => { | 7902 | allData.forEach((item, index) => { |
| 7866 | - if(item.sControlId === this.props.controlSelectedRowKeys[0]) { | ||
| 7867 | - if(!allData[index].handleType) { | 7903 | + if (item.sControlId === this.props.controlSelectedRowKeys[0]) { |
| 7904 | + if (!allData[index].handleType) { | ||
| 7868 | allData[index].handleType = 'update'; | 7905 | allData[index].handleType = 'update'; |
| 7869 | } | 7906 | } |
| 7870 | } | 7907 | } |
| 7871 | }); | 7908 | }); |
| 7872 | processData = processData.filter(item => item.sControlId !== this.props.controlSelectedRowKeys[0]); | 7909 | processData = processData.filter(item => item.sControlId !== this.props.controlSelectedRowKeys[0]); |
| 7873 | processData = processData.concat(allData); | 7910 | processData = processData.concat(allData); |
| 7874 | - this.props.onSaveState({ processData}); | 7911 | + this.props.onSaveState({ processData }); |
| 7875 | } else { | 7912 | } else { |
| 7876 | // process : 0-1-2 部品工序 : 3成品工序; | 7913 | // process : 0-1-2 部品工序 : 3成品工序; |
| 7877 | let processData = this.props.processData.slice(0); | 7914 | let processData = this.props.processData.slice(0); |
| 7878 | let preDataIndex = 0; | 7915 | let preDataIndex = 0; |
| 7879 | let preData = data.filter(item => item.sType === '0' && item.sControlId === this.props.controlSelectedRowKeys[0]).map((item) => { | 7916 | let preData = data.filter(item => item.sType === '0' && item.sControlId === this.props.controlSelectedRowKeys[0]).map((item) => { |
| 7880 | preDataIndex = preDataIndex + 1; | 7917 | preDataIndex = preDataIndex + 1; |
| 7881 | - return {...item, iOrder: preDataIndex} | 7918 | + return { ...item, iOrder: preDataIndex } |
| 7882 | }); | 7919 | }); |
| 7883 | let inDataIndex = 0; | 7920 | let inDataIndex = 0; |
| 7884 | let inData = data.filter(item => item.sType === '1' && item.sControlId === this.props.controlSelectedRowKeys[0]).map((item) => { | 7921 | let inData = data.filter(item => item.sType === '1' && item.sControlId === this.props.controlSelectedRowKeys[0]).map((item) => { |
| 7885 | inDataIndex = inDataIndex + 1; | 7922 | inDataIndex = inDataIndex + 1; |
| 7886 | - return {...item, iOrder: inDataIndex} | 7923 | + return { ...item, iOrder: inDataIndex } |
| 7887 | }); | 7924 | }); |
| 7888 | let afterDataIndex = 0; | 7925 | let afterDataIndex = 0; |
| 7889 | let afterData = data.filter(item => item.sType === '2' && item.sControlId === this.props.controlSelectedRowKeys[0]).map((item) => { | 7926 | let afterData = data.filter(item => item.sType === '2' && item.sControlId === this.props.controlSelectedRowKeys[0]).map((item) => { |
| 7890 | afterDataIndex = afterDataIndex + 1; | 7927 | afterDataIndex = afterDataIndex + 1; |
| 7891 | - return {...item, iOrder: afterDataIndex} | 7928 | + return { ...item, iOrder: afterDataIndex } |
| 7892 | }); | 7929 | }); |
| 7893 | let allData = preData.concat(inData, afterData); | 7930 | let allData = preData.concat(inData, afterData); |
| 7894 | allData.forEach((item, index) => { | 7931 | allData.forEach((item, index) => { |
| 7895 | - if(item.sControlId === this.props.controlSelectedRowKeys[0]) { | ||
| 7896 | - if(!allData[index].handleType) { | 7932 | + if (item.sControlId === this.props.controlSelectedRowKeys[0]) { |
| 7933 | + if (!allData[index].handleType) { | ||
| 7897 | allData[index].handleType = 'update'; | 7934 | allData[index].handleType = 'update'; |
| 7898 | } | 7935 | } |
| 7899 | } | 7936 | } |
| 7900 | }); | 7937 | }); |
| 7901 | processData = processData.filter(item => item.sControlId !== this.props.controlSelectedRowKeys[0]); | 7938 | processData = processData.filter(item => item.sControlId !== this.props.controlSelectedRowKeys[0]); |
| 7902 | processData = processData.concat(allData); | 7939 | processData = processData.concat(allData); |
| 7903 | - this.props.onSaveState({ processData}); | 7940 | + this.props.onSaveState({ processData }); |
| 7904 | } | 7941 | } |
| 7905 | } | 7942 | } |
| 7906 | } | 7943 | } |
| 7907 | 7944 | ||
| 7908 | handleProductDrag = (data) => { | 7945 | handleProductDrag = (data) => { |
| 7909 | - if(this.props.enabled) { | 7946 | + if (this.props.enabled) { |
| 7910 | // process : 0-1-2 部品工序 : 3成品工序; | 7947 | // process : 0-1-2 部品工序 : 3成品工序; |
| 7911 | let processData = this.props.processData.slice(0); | 7948 | let processData = this.props.processData.slice(0); |
| 7912 | let dataIndex = 0; | 7949 | let dataIndex = 0; |
| 7913 | const allData = data.filter(item => item.sType === '3' && item.sCombinePartsName === this.props.slaveSelectedRowKeys[0]).map((item) => { | 7950 | const allData = data.filter(item => item.sType === '3' && item.sCombinePartsName === this.props.slaveSelectedRowKeys[0]).map((item) => { |
| 7914 | dataIndex = dataIndex + 1; | 7951 | dataIndex = dataIndex + 1; |
| 7915 | - return {...item, iOrder: dataIndex, handleType: item.handleType ? item.handleType : 'update'}; | 7952 | + return { ...item, iOrder: dataIndex, handleType: item.handleType ? item.handleType : 'update' }; |
| 7916 | }); | 7953 | }); |
| 7917 | processData = processData.filter(item => item.sCombinePartsName !== this.props.slaveSelectedRowKeys[0]); | 7954 | processData = processData.filter(item => item.sCombinePartsName !== this.props.slaveSelectedRowKeys[0]); |
| 7918 | processData = processData.concat(allData); | 7955 | processData = processData.concat(allData); |
| @@ -8010,7 +8047,7 @@ const QuotationComponent = Form.create({ | @@ -8010,7 +8047,7 @@ const QuotationComponent = Form.create({ | ||
| 8010 | })((props) => { | 8047 | })((props) => { |
| 8011 | const { | 8048 | const { |
| 8012 | form, onReturnForm, masterConfig: masterConfigOld, slaveData, slavePagination, sModelsId, sTabId, app, Loading, colorConfigGrdVisible, productCombinationVisible, combinePartsChooseVisible, | 8049 | form, onReturnForm, masterConfig: masterConfigOld, slaveData, slavePagination, sModelsId, sTabId, app, Loading, colorConfigGrdVisible, productCombinationVisible, combinePartsChooseVisible, |
| 8013 | - sisColorChooseVisible, finishedMaterialsColumn, finishedMaterialsConfig, finishedProcessColumn, finishedProcessConfig, isLayout, isLayout2,visible, checkConditions, checkPersonData, sModelsType, | 8050 | + sisColorChooseVisible, finishedMaterialsColumn, finishedMaterialsConfig, finishedProcessColumn, finishedProcessConfig, isLayout, isLayout2, visible, checkConditions, checkPersonData, sModelsType, |
| 8014 | formData, | 8051 | formData, |
| 8015 | materialsInfoList, | 8052 | materialsInfoList, |
| 8016 | materialsChildInfoList, | 8053 | materialsChildInfoList, |
| @@ -8020,12 +8057,12 @@ const QuotationComponent = Form.create({ | @@ -8020,12 +8057,12 @@ const QuotationComponent = Form.create({ | ||
| 8020 | } = props; | 8057 | } = props; |
| 8021 | // 关联slave合版进行筛选control的数据 | 8058 | // 关联slave合版进行筛选control的数据 |
| 8022 | let controlTableData = []; | 8059 | let controlTableData = []; |
| 8023 | - if(commonBusiness.getTableTypes('control', props).data && commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.slaveData)) { | 8060 | + if (commonBusiness.getTableTypes('control', props).data && commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.slaveData)) { |
| 8024 | const iSlaveIndex = props.slaveData.findIndex(item => item.sId === props.slaveSelectedRowKeys[0]); | 8061 | const iSlaveIndex = props.slaveData.findIndex(item => item.sId === props.slaveSelectedRowKeys[0]); |
| 8025 | - const slaveSelectedRow = props.slaveData[iSlaveIndex] || {sProductNo: 0}; | ||
| 8026 | - if(iSlaveIndex !== -1) { | 8062 | + const slaveSelectedRow = props.slaveData[iSlaveIndex] || { sProductNo: 0 }; |
| 8063 | + if (iSlaveIndex !== -1) { | ||
| 8027 | commonBusiness.getTableTypes('control', props).data.forEach(item => { | 8064 | commonBusiness.getTableTypes('control', props).data.forEach(item => { |
| 8028 | - if(item.sCombinedMemo && item.sCombinedMemo !== '' && item.sCombinedMemo !== '合版信息') { | 8065 | + if (item.sCombinedMemo && item.sCombinedMemo !== '' && item.sCombinedMemo !== '合版信息') { |
| 8029 | const sCombinedMemoArr = commonUtils.isJSON(item.sCombinedMemo) ? JSON.parse(item.sCombinedMemo) : []; | 8066 | const sCombinedMemoArr = commonUtils.isJSON(item.sCombinedMemo) ? JSON.parse(item.sCombinedMemo) : []; |
| 8030 | const getSlaveSelectedRowChildren = (allData, sId) => { | 8067 | const getSlaveSelectedRowChildren = (allData, sId) => { |
| 8031 | let result = []; | 8068 | let result = []; |
| @@ -8040,7 +8077,7 @@ const QuotationComponent = Form.create({ | @@ -8040,7 +8077,7 @@ const QuotationComponent = Form.create({ | ||
| 8040 | const slaveSelectedRowChildren = getSlaveSelectedRowChildren(props.slaveData, slaveSelectedRow.sId); | 8077 | const slaveSelectedRowChildren = getSlaveSelectedRowChildren(props.slaveData, slaveSelectedRow.sId); |
| 8041 | const slaveRows = [slaveSelectedRow, ...slaveSelectedRowChildren]; | 8078 | const slaveRows = [slaveSelectedRow, ...slaveSelectedRowChildren]; |
| 8042 | const len = sCombinedMemoArr.filter(item => item.sProductNo && slaveRows.some(slaveRow => slaveRow.sProductNo === item.sProductNo)).length; | 8079 | const len = sCombinedMemoArr.filter(item => item.sProductNo && slaveRows.some(slaveRow => slaveRow.sProductNo === item.sProductNo)).length; |
| 8043 | - if(len) { | 8080 | + if (len) { |
| 8044 | controlTableData.push(item); | 8081 | controlTableData.push(item); |
| 8045 | } | 8082 | } |
| 8046 | } else { | 8083 | } else { |
| @@ -8052,8 +8089,8 @@ const QuotationComponent = Form.create({ | @@ -8052,8 +8089,8 @@ const QuotationComponent = Form.create({ | ||
| 8052 | } | 8089 | } |
| 8053 | } | 8090 | } |
| 8054 | // 之前代码默认会选中第一行,第一行可能已经被筛选掉,需要判断 | 8091 | // 之前代码默认会选中第一行,第一行可能已经被筛选掉,需要判断 |
| 8055 | - if(controlTableData.length && props.controlSelectedRowKeys[0] !== controlTableData[0].sId && controlTableData.map(item => item.sId).indexOf(props.controlSelectedRowKeys[0]) === -1) { | ||
| 8056 | - if(commonUtils.isNotEmptyArr(props.slaveSelectedRowKeys)) { | 8092 | + if (controlTableData.length && props.controlSelectedRowKeys[0] !== controlTableData[0].sId && controlTableData.map(item => item.sId).indexOf(props.controlSelectedRowKeys[0]) === -1) { |
| 8093 | + if (commonUtils.isNotEmptyArr(props.slaveSelectedRowKeys)) { | ||
| 8057 | props.onSaveState({ | 8094 | props.onSaveState({ |
| 8058 | controlSelectedRowKeys: [controlTableData[0].sId] | 8095 | controlSelectedRowKeys: [controlTableData[0].sId] |
| 8059 | }); | 8096 | }); |
| @@ -8066,7 +8103,7 @@ const QuotationComponent = Form.create({ | @@ -8066,7 +8103,7 @@ const QuotationComponent = Form.create({ | ||
| 8066 | const slaveLen = props.slaveData ? props.slaveData.length : 0; | 8103 | const slaveLen = props.slaveData ? props.slaveData.length : 0; |
| 8067 | let stickyHeight = 0; | 8104 | let stickyHeight = 0; |
| 8068 | let stickyTabHeight = 0; | 8105 | let stickyTabHeight = 0; |
| 8069 | - if(layoutChange) { | 8106 | + if (layoutChange) { |
| 8070 | if (controlLen && controlLen < 5) { | 8107 | if (controlLen && controlLen < 5) { |
| 8071 | stickyTabHeight += (slaveLen * 29) + 40; | 8108 | stickyTabHeight += (slaveLen * 29) + 40; |
| 8072 | stickyHeight += (controlLen * 29) + 40 + 30 - 4; | 8109 | stickyHeight += (controlLen * 29) + 40 + 30 - 4; |
| @@ -8075,7 +8112,7 @@ const QuotationComponent = Form.create({ | @@ -8075,7 +8112,7 @@ const QuotationComponent = Form.create({ | ||
| 8075 | } | 8112 | } |
| 8076 | stickyHeight += 40; | 8113 | stickyHeight += 40; |
| 8077 | } else { | 8114 | } else { |
| 8078 | - if(props.currentTab === 1) { | 8115 | + if (props.currentTab === 1) { |
| 8079 | if (controlLen && controlLen < 5) { | 8116 | if (controlLen && controlLen < 5) { |
| 8080 | stickyHeight = (controlLen * 29) + 40 + 30 - 4; // 153 | 8117 | stickyHeight = (controlLen * 29) + 40 + 30 - 4; // 153 |
| 8081 | } else { | 8118 | } else { |
| @@ -8284,11 +8321,11 @@ const QuotationComponent = Form.create({ | @@ -8284,11 +8321,11 @@ const QuotationComponent = Form.create({ | ||
| 8284 | bRowClick: true | 8321 | bRowClick: true |
| 8285 | }; | 8322 | }; |
| 8286 | 8323 | ||
| 8287 | - let bShowMaterials = true; | 8324 | + let bShowMaterials = true; |
| 8288 | const iMaterialsIndex = props && props.masterConfig ? props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnChooseMaterials') : -1; | 8325 | const iMaterialsIndex = props && props.masterConfig ? props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnChooseMaterials') : -1; |
| 8289 | bShowMaterials = iMaterialsIndex > -1; | 8326 | bShowMaterials = iMaterialsIndex > -1; |
| 8290 | 8327 | ||
| 8291 | - let bShowProcess = true; | 8328 | + let bShowProcess = true; |
| 8292 | const iProcessIndex = props && props.masterConfig ? props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnChooseProcess') : -1; | 8329 | const iProcessIndex = props && props.masterConfig ? props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnChooseProcess') : -1; |
| 8293 | bShowProcess = iProcessIndex > -1; | 8330 | bShowProcess = iProcessIndex > -1; |
| 8294 | 8331 | ||
| @@ -8373,7 +8410,7 @@ const QuotationComponent = Form.create({ | @@ -8373,7 +8410,7 @@ const QuotationComponent = Form.create({ | ||
| 8373 | showLine: true, | 8410 | showLine: true, |
| 8374 | }; | 8411 | }; |
| 8375 | 8412 | ||
| 8376 | - /* 整体树结构 */ | 8413 | + /* 整体树结构 */ |
| 8377 | const totalname = 'totalTree'; | 8414 | const totalname = 'totalTree'; |
| 8378 | const totalTreeProps = { | 8415 | const totalTreeProps = { |
| 8379 | ...commonBusiness.getTreeTypes('totalTree', props), | 8416 | ...commonBusiness.getTreeTypes('totalTree', props), |
| @@ -8455,7 +8492,7 @@ const QuotationComponent = Form.create({ | @@ -8455,7 +8492,7 @@ const QuotationComponent = Form.create({ | ||
| 8455 | return val.sType !== '3'; | 8492 | return val.sType !== '3'; |
| 8456 | }); | 8493 | }); |
| 8457 | } | 8494 | } |
| 8458 | - if(isQianCai) { | 8495 | + if (isQianCai) { |
| 8459 | const pre = res.filter(item => item.sType == '0').sort((a, b) => a.iOrder - b.iOrder); | 8496 | const pre = res.filter(item => item.sType == '0').sort((a, b) => a.iOrder - b.iOrder); |
| 8460 | const after = res.filter(item => (item.sType == '1' || item.sType == '2')).sort((a, b) => a.iOrder - b.iOrder); | 8497 | const after = res.filter(item => (item.sType == '1' || item.sType == '2')).sort((a, b) => a.iOrder - b.iOrder); |
| 8461 | res = pre.concat(after); | 8498 | res = pre.concat(after); |
| @@ -8478,37 +8515,37 @@ const QuotationComponent = Form.create({ | @@ -8478,37 +8515,37 @@ const QuotationComponent = Form.create({ | ||
| 8478 | // materials : 0-1部件材料 : 2成品材料; | 8515 | // materials : 0-1部件材料 : 2成品材料; |
| 8479 | // process : 0-1-2 部品工序 : 3成品工序; | 8516 | // process : 0-1-2 部品工序 : 3成品工序; |
| 8480 | // bfinal: 是否成品 | 8517 | // bfinal: 是否成品 |
| 8481 | - const { materialsData, materials0Data, processSelectedRowKeys, processData, controlSelectedRowKeys, controlData } = props; | 8518 | + const { materialsData, materials0Data, processSelectedRowKeys, processData, controlSelectedRowKeys, controlData } = props; |
| 8482 | let oriData = commonUtils.isNotEmptyArr(data.data) ? data.data : []; | 8519 | let oriData = commonUtils.isNotEmptyArr(data.data) ? data.data : []; |
| 8483 | let res = []; | 8520 | let res = []; |
| 8484 | let newData = []; | 8521 | let newData = []; |
| 8485 | let processRow = {}; | 8522 | let processRow = {}; |
| 8486 | let controlRow = {}; | 8523 | let controlRow = {}; |
| 8487 | 8524 | ||
| 8488 | - if(commonUtils.isNotEmptyArr(controlData) && commonUtils.isNotEmptyArr(controlSelectedRowKeys)){ /* 没有工序选中行 则不进行数据过滤 */ | 8525 | + if (commonUtils.isNotEmptyArr(controlData) && commonUtils.isNotEmptyArr(controlSelectedRowKeys)) { /* 没有工序选中行 则不进行数据过滤 */ |
| 8489 | const iIndex = controlData.findIndex(item => controlSelectedRowKeys.includes(item.sId)); | 8526 | const iIndex = controlData.findIndex(item => controlSelectedRowKeys.includes(item.sId)); |
| 8490 | - if(iIndex > -1) { | 8527 | + if (iIndex > -1) { |
| 8491 | controlRow = controlData[iIndex]; | 8528 | controlRow = controlData[iIndex]; |
| 8492 | } | 8529 | } |
| 8493 | } | 8530 | } |
| 8494 | 8531 | ||
| 8495 | - if(commonUtils.isNotEmptyArr(processData) && commonUtils.isNotEmptyArr(processSelectedRowKeys)){ /* 没有工序选中行 则不进行数据过滤 */ | 8532 | + if (commonUtils.isNotEmptyArr(processData) && commonUtils.isNotEmptyArr(processSelectedRowKeys)) { /* 没有工序选中行 则不进行数据过滤 */ |
| 8496 | const iIndex = processData.findIndex(item => processSelectedRowKeys.includes(item.sId)); | 8533 | const iIndex = processData.findIndex(item => processSelectedRowKeys.includes(item.sId)); |
| 8497 | - if(iIndex > -1) { | 8534 | + if (iIndex > -1) { |
| 8498 | processRow = processData[iIndex]; | 8535 | processRow = processData[iIndex]; |
| 8499 | } | 8536 | } |
| 8500 | } | 8537 | } |
| 8501 | if (type === 'materials') { | 8538 | if (type === 'materials') { |
| 8502 | /* 根据工序表选中行的部件id +工序id 过滤全部材料数据 */ | 8539 | /* 根据工序表选中行的部件id +工序id 过滤全部材料数据 */ |
| 8503 | - if(commonUtils.isNotEmptyObject(processRow)){ | ||
| 8504 | - const filterData = oriData.filter(item => item.sControlId === processRow.sControlId && item.sProcessId === processRow.sProcessId && item.sProcessTbId === processRow.sId | 8540 | + if (commonUtils.isNotEmptyObject(processRow)) { |
| 8541 | + const filterData = oriData.filter(item => item.sControlId === processRow.sControlId && item.sProcessId === processRow.sProcessId && item.sProcessTbId === processRow.sId | ||
| 8505 | && commonUtils.isEmptyObject(item.sParentMaterialsId)); | 8542 | && commonUtils.isEmptyObject(item.sParentMaterialsId)); |
| 8506 | if (commonUtils.isNotEmptyArr(filterData)) { | 8543 | if (commonUtils.isNotEmptyArr(filterData)) { |
| 8507 | newData = filterData; | 8544 | newData = filterData; |
| 8508 | } | 8545 | } |
| 8509 | res = newData; | 8546 | res = newData; |
| 8510 | - } else if(commonUtils.isNotEmptyObject(controlRow)){ | ||
| 8511 | - const filterData = oriData.filter(item => item.sControlId === controlRow.sId && commonUtils.isEmptyObject(item.sParentMaterialsId) ); | 8547 | + } else if (commonUtils.isNotEmptyObject(controlRow)) { |
| 8548 | + const filterData = oriData.filter(item => item.sControlId === controlRow.sId && commonUtils.isEmptyObject(item.sParentMaterialsId)); | ||
| 8512 | if (commonUtils.isNotEmptyArr(filterData)) { | 8549 | if (commonUtils.isNotEmptyArr(filterData)) { |
| 8513 | newData = filterData; | 8550 | newData = filterData; |
| 8514 | } | 8551 | } |
| @@ -8517,17 +8554,17 @@ const QuotationComponent = Form.create({ | @@ -8517,17 +8554,17 @@ const QuotationComponent = Form.create({ | ||
| 8517 | res = oriData; | 8554 | res = oriData; |
| 8518 | } | 8555 | } |
| 8519 | 8556 | ||
| 8520 | - } else if (type === 'materials0' || type ==='materials1' || type === 'materials2') { | 8557 | + } else if (type === 'materials0' || type === 'materials1' || type === 'materials2') { |
| 8521 | /* 根据工序表选中行的部件id +工序id 过滤全部材料数据 */ | 8558 | /* 根据工序表选中行的部件id +工序id 过滤全部材料数据 */ |
| 8522 | - if(commonUtils.isNotEmptyObject(processRow)){ | ||
| 8523 | - const filterData = materialsData.filter(item => item.sControlId === processRow.sControlId && item.sProcessId === processRow.sProcessId && item.sProcessTbId === processRow.sId | 8559 | + if (commonUtils.isNotEmptyObject(processRow)) { |
| 8560 | + const filterData = materialsData.filter(item => item.sControlId === processRow.sControlId && item.sProcessId === processRow.sProcessId && item.sProcessTbId === processRow.sId | ||
| 8524 | && commonUtils.isEmptyObject(item.sParentMaterialsId)); | 8561 | && commonUtils.isEmptyObject(item.sParentMaterialsId)); |
| 8525 | if (commonUtils.isNotEmptyArr(filterData)) { | 8562 | if (commonUtils.isNotEmptyArr(filterData)) { |
| 8526 | newData = filterData; | 8563 | newData = filterData; |
| 8527 | } | 8564 | } |
| 8528 | res = newData; | 8565 | res = newData; |
| 8529 | - } else if(commonUtils.isNotEmptyObject(controlRow)){ | ||
| 8530 | - const filterData = materialsData.filter(item => item.sControlId === controlRow.sId && commonUtils.isEmptyObject(item.sParentMaterialsId) ); | 8566 | + } else if (commonUtils.isNotEmptyObject(controlRow)) { |
| 8567 | + const filterData = materialsData.filter(item => item.sControlId === controlRow.sId && commonUtils.isEmptyObject(item.sParentMaterialsId)); | ||
| 8531 | if (commonUtils.isNotEmptyArr(filterData)) { | 8568 | if (commonUtils.isNotEmptyArr(filterData)) { |
| 8532 | newData = filterData; | 8569 | newData = filterData; |
| 8533 | } | 8570 | } |
| @@ -8541,16 +8578,16 @@ const QuotationComponent = Form.create({ | @@ -8541,16 +8578,16 @@ const QuotationComponent = Form.create({ | ||
| 8541 | const sSqlCondition = config ? config.sSqlCondition : 'materials0.sBclassifyName.油墨'; | 8578 | const sSqlCondition = config ? config.sSqlCondition : 'materials0.sBclassifyName.油墨'; |
| 8542 | if (sSqlCondition) { | 8579 | if (sSqlCondition) { |
| 8543 | let targetTbName = sSqlCondition.split('.')[0]; /* 1.表名 control */ | 8580 | let targetTbName = sSqlCondition.split('.')[0]; /* 1.表名 control */ |
| 8544 | - if(commonUtils.isEmptyObject(targetTbName)) { | 8581 | + if (commonUtils.isEmptyObject(targetTbName)) { |
| 8545 | targetTbName = 'materials0'; | 8582 | targetTbName = 'materials0'; |
| 8546 | } | 8583 | } |
| 8547 | let filteredValue = sSqlCondition.split('.')[1]; /* 2.解析filterValue: controlSelectedRowKeys */ | 8584 | let filteredValue = sSqlCondition.split('.')[1]; /* 2.解析filterValue: controlSelectedRowKeys */ |
| 8548 | let sParentKey = sSqlCondition.split('.')[2]; /* 2.解析本身表对应的值,如控制表筛选材料表 则材料表的sControlId = 控制表的controlSelectedRowKeys[0] */ | 8585 | let sParentKey = sSqlCondition.split('.')[2]; /* 2.解析本身表对应的值,如控制表筛选材料表 则材料表的sControlId = 控制表的controlSelectedRowKeys[0] */ |
| 8549 | - if(commonUtils.isEmptyObject(targetTbName)){ | ||
| 8550 | - if(type === 'materials1') { /* materials0.sBclassifyName.油墨 */ | 8586 | + if (commonUtils.isEmptyObject(targetTbName)) { |
| 8587 | + if (type === 'materials1') { /* materials0.sBclassifyName.油墨 */ | ||
| 8551 | filteredValue = 'sBclassifyName'; | 8588 | filteredValue = 'sBclassifyName'; |
| 8552 | sParentKey = '油墨'; | 8589 | sParentKey = '油墨'; |
| 8553 | - } else if(type ==='materials2') { /* materials0.sBclassifyName.电化铝 */ | 8590 | + } else if (type === 'materials2') { /* materials0.sBclassifyName.电化铝 */ |
| 8554 | filteredValue = 'sBclassifyName'; | 8591 | filteredValue = 'sBclassifyName'; |
| 8555 | sParentKey = '电化铝'; | 8592 | sParentKey = '电化铝'; |
| 8556 | } | 8593 | } |
| @@ -8571,12 +8608,12 @@ const QuotationComponent = Form.create({ | @@ -8571,12 +8608,12 @@ const QuotationComponent = Form.create({ | ||
| 8571 | } else if (type === 'materials2') { | 8608 | } else if (type === 'materials2') { |
| 8572 | /* 过滤后的 materials0Data */ | 8609 | /* 过滤后的 materials0Data */ |
| 8573 | let materials0FilterData = []; | 8610 | let materials0FilterData = []; |
| 8574 | - if(commonUtils.isNotEmptyObject(processRow) && commonUtils.isNotEmptyArr(materials0Data)){ | 8611 | + if (commonUtils.isNotEmptyObject(processRow) && commonUtils.isNotEmptyArr(materials0Data)) { |
| 8575 | const filterData = materials0Data.filter(item => item.sControlId === processRow.sControlId && item.sProcessId === processRow.sProcessId && item.sProcessTbId === processRow.sId && commonUtils.isEmptyObject(item.sParentMaterialsId)); | 8612 | const filterData = materials0Data.filter(item => item.sControlId === processRow.sControlId && item.sProcessId === processRow.sProcessId && item.sProcessTbId === processRow.sId && commonUtils.isEmptyObject(item.sParentMaterialsId)); |
| 8576 | if (commonUtils.isNotEmptyArr(filterData)) { | 8613 | if (commonUtils.isNotEmptyArr(filterData)) { |
| 8577 | materials0FilterData = filterData; | 8614 | materials0FilterData = filterData; |
| 8578 | } | 8615 | } |
| 8579 | - }else if(commonUtils.isNotEmptyObject(controlRow) && commonUtils.isNotEmptyArr(materials0Data)){ | 8616 | + } else if (commonUtils.isNotEmptyObject(controlRow) && commonUtils.isNotEmptyArr(materials0Data)) { |
| 8580 | const filterData = materials0Data.filter(item => item.sControlId === controlRow.sId && commonUtils.isEmptyObject(item.sParentMaterialsId)); | 8617 | const filterData = materials0Data.filter(item => item.sControlId === controlRow.sId && commonUtils.isEmptyObject(item.sParentMaterialsId)); |
| 8581 | if (commonUtils.isNotEmptyArr(filterData)) { | 8618 | if (commonUtils.isNotEmptyArr(filterData)) { |
| 8582 | materials0FilterData = filterData; | 8619 | materials0FilterData = filterData; |
| @@ -8589,16 +8626,16 @@ const QuotationComponent = Form.create({ | @@ -8589,16 +8626,16 @@ const QuotationComponent = Form.create({ | ||
| 8589 | const sSqlCondition = config ? config.sSqlCondition : 'materials0.sBclassifyName.油墨'; | 8626 | const sSqlCondition = config ? config.sSqlCondition : 'materials0.sBclassifyName.油墨'; |
| 8590 | if (sSqlCondition) { | 8627 | if (sSqlCondition) { |
| 8591 | let targetTbName = sSqlCondition.split('.')[0]; /* 1.表名 control */ | 8628 | let targetTbName = sSqlCondition.split('.')[0]; /* 1.表名 control */ |
| 8592 | - if(commonUtils.isEmptyObject(targetTbName)) { | 8629 | + if (commonUtils.isEmptyObject(targetTbName)) { |
| 8593 | targetTbName = 'materials0'; | 8630 | targetTbName = 'materials0'; |
| 8594 | } | 8631 | } |
| 8595 | let filteredValue = sSqlCondition.split('.')[1]; /* 2.解析filterValue: controlSelectedRowKeys */ | 8632 | let filteredValue = sSqlCondition.split('.')[1]; /* 2.解析filterValue: controlSelectedRowKeys */ |
| 8596 | let sParentKey = sSqlCondition.split('.')[2]; /* 2.解析本身表对应的值,如控制表筛选材料表 则材料表的sControlId = 控制表的controlSelectedRowKeys[0] */ | 8633 | let sParentKey = sSqlCondition.split('.')[2]; /* 2.解析本身表对应的值,如控制表筛选材料表 则材料表的sControlId = 控制表的controlSelectedRowKeys[0] */ |
| 8597 | - if(commonUtils.isEmptyObject(targetTbName)){ | ||
| 8598 | - if(type === 'materials1') { /* materials0.sBclassifyName.油墨 */ | 8634 | + if (commonUtils.isEmptyObject(targetTbName)) { |
| 8635 | + if (type === 'materials1') { /* materials0.sBclassifyName.油墨 */ | ||
| 8599 | filteredValue = 'sBclassifyName'; | 8636 | filteredValue = 'sBclassifyName'; |
| 8600 | sParentKey = '油墨'; | 8637 | sParentKey = '油墨'; |
| 8601 | - } else if(type ==='materials2') { /* materials0.sBclassifyName.电化铝 */ | 8638 | + } else if (type === 'materials2') { /* materials0.sBclassifyName.电化铝 */ |
| 8602 | filteredValue = 'sBclassifyName'; | 8639 | filteredValue = 'sBclassifyName'; |
| 8603 | sParentKey = '电化铝'; | 8640 | sParentKey = '电化铝'; |
| 8604 | } | 8641 | } |
| @@ -8613,15 +8650,15 @@ const QuotationComponent = Form.create({ | @@ -8613,15 +8650,15 @@ const QuotationComponent = Form.create({ | ||
| 8613 | 8650 | ||
| 8614 | } | 8651 | } |
| 8615 | res = newData; | 8652 | res = newData; |
| 8616 | - } else if( type === 'materials1Child') { | 8653 | + } else if (type === 'materials1Child') { |
| 8617 | /* 过滤后的 materials0Data */ | 8654 | /* 过滤后的 materials0Data */ |
| 8618 | let materials0FilterData = []; | 8655 | let materials0FilterData = []; |
| 8619 | - if(commonUtils.isNotEmptyObject(processRow) && commonUtils.isNotEmptyArr(materials0Data)){ | ||
| 8620 | - const filterData = materials0Data.filter(item => item.sControlId === processRow.sControlId && item.sProcessId === processRow.sProcessId && item.sProcessTbId === processRow.sId ); | 8656 | + if (commonUtils.isNotEmptyObject(processRow) && commonUtils.isNotEmptyArr(materials0Data)) { |
| 8657 | + const filterData = materials0Data.filter(item => item.sControlId === processRow.sControlId && item.sProcessId === processRow.sProcessId && item.sProcessTbId === processRow.sId); | ||
| 8621 | if (commonUtils.isNotEmptyArr(filterData)) { | 8658 | if (commonUtils.isNotEmptyArr(filterData)) { |
| 8622 | materials0FilterData = filterData; | 8659 | materials0FilterData = filterData; |
| 8623 | } | 8660 | } |
| 8624 | - }else if(commonUtils.isNotEmptyObject(controlRow) && commonUtils.isNotEmptyArr(materials0Data)){ | 8661 | + } else if (commonUtils.isNotEmptyObject(controlRow) && commonUtils.isNotEmptyArr(materials0Data)) { |
| 8625 | const filterData = materials0Data.filter(item => item.sControlId === controlRow.sId); | 8662 | const filterData = materials0Data.filter(item => item.sControlId === controlRow.sId); |
| 8626 | if (commonUtils.isNotEmptyArr(filterData)) { | 8663 | if (commonUtils.isNotEmptyArr(filterData)) { |
| 8627 | materials0FilterData = filterData; | 8664 | materials0FilterData = filterData; |
| @@ -8634,16 +8671,16 @@ const QuotationComponent = Form.create({ | @@ -8634,16 +8671,16 @@ const QuotationComponent = Form.create({ | ||
| 8634 | const sSqlCondition = config && commonUtils.isNotEmptyObject(config.sSqlCondition) ? config.sSqlCondition : 'materials0.sBclassifyName.油墨'; | 8671 | const sSqlCondition = config && commonUtils.isNotEmptyObject(config.sSqlCondition) ? config.sSqlCondition : 'materials0.sBclassifyName.油墨'; |
| 8635 | if (sSqlCondition) { | 8672 | if (sSqlCondition) { |
| 8636 | let targetTbName = sSqlCondition.split('.')[0]; /* 1.表名 control */ | 8673 | let targetTbName = sSqlCondition.split('.')[0]; /* 1.表名 control */ |
| 8637 | - if(commonUtils.isEmptyObject(targetTbName)) { | 8674 | + if (commonUtils.isEmptyObject(targetTbName)) { |
| 8638 | targetTbName = 'materials0'; | 8675 | targetTbName = 'materials0'; |
| 8639 | } | 8676 | } |
| 8640 | let filteredValue = sSqlCondition.split('.')[1]; /* 2.解析filterValue: controlSelectedRowKeys */ | 8677 | let filteredValue = sSqlCondition.split('.')[1]; /* 2.解析filterValue: controlSelectedRowKeys */ |
| 8641 | let sParentKey = sSqlCondition.split('.')[2]; /* 2.解析本身表对应的值,如控制表筛选材料表 则材料表的sControlId = 控制表的controlSelectedRowKeys[0] */ | 8678 | let sParentKey = sSqlCondition.split('.')[2]; /* 2.解析本身表对应的值,如控制表筛选材料表 则材料表的sControlId = 控制表的controlSelectedRowKeys[0] */ |
| 8642 | - if(commonUtils.isEmptyObject(targetTbName)){ | ||
| 8643 | - if(type === 'materials1') { /* materials0.sBclassifyName.油墨 */ | 8679 | + if (commonUtils.isEmptyObject(targetTbName)) { |
| 8680 | + if (type === 'materials1') { /* materials0.sBclassifyName.油墨 */ | ||
| 8644 | filteredValue = 'sBclassifyName'; | 8681 | filteredValue = 'sBclassifyName'; |
| 8645 | sParentKey = '油墨'; | 8682 | sParentKey = '油墨'; |
| 8646 | - } else if(type ==='materials2') { /* materials0.sBclassifyName.电化铝 */ | 8683 | + } else if (type === 'materials2') { /* materials0.sBclassifyName.电化铝 */ |
| 8647 | filteredValue = 'sBclassifyName'; | 8684 | filteredValue = 'sBclassifyName'; |
| 8648 | sParentKey = '电化铝'; | 8685 | sParentKey = '电化铝'; |
| 8649 | } | 8686 | } |
| @@ -8658,12 +8695,12 @@ const QuotationComponent = Form.create({ | @@ -8658,12 +8695,12 @@ const QuotationComponent = Form.create({ | ||
| 8658 | 8695 | ||
| 8659 | } | 8696 | } |
| 8660 | 8697 | ||
| 8661 | - if( type ==='materials1Child') { /* 油墨过滤子集 */ | 8698 | + if (type === 'materials1Child') { /* 油墨过滤子集 */ |
| 8662 | const { materials1Data, materials1SelectedRowKeys } = props; | 8699 | const { materials1Data, materials1SelectedRowKeys } = props; |
| 8663 | - let materials1Row ={}; /* 油墨子级 */ | ||
| 8664 | - if(commonUtils.isNotEmptyArr(materials1Data) && commonUtils.isNotEmptyArr(materials1SelectedRowKeys)){ /* 没有工序选中行 则不进行数据过滤 */ | 8700 | + let materials1Row = {}; /* 油墨子级 */ |
| 8701 | + if (commonUtils.isNotEmptyArr(materials1Data) && commonUtils.isNotEmptyArr(materials1SelectedRowKeys)) { /* 没有工序选中行 则不进行数据过滤 */ | ||
| 8665 | const iIndex = materials1Data.findIndex(item => materials1SelectedRowKeys.includes(item.sId)); | 8702 | const iIndex = materials1Data.findIndex(item => materials1SelectedRowKeys.includes(item.sId)); |
| 8666 | - if(iIndex > -1) { | 8703 | + if (iIndex > -1) { |
| 8667 | materials1Row = materials1Data[iIndex]; | 8704 | materials1Row = materials1Data[iIndex]; |
| 8668 | } | 8705 | } |
| 8669 | } | 8706 | } |
| @@ -8671,21 +8708,21 @@ const QuotationComponent = Form.create({ | @@ -8671,21 +8708,21 @@ const QuotationComponent = Form.create({ | ||
| 8671 | } | 8708 | } |
| 8672 | 8709 | ||
| 8673 | 8710 | ||
| 8674 | - } else if(type ==='materials0Child') { /* 全部材料 过滤替代料 */ | 8711 | + } else if (type === 'materials0Child') { /* 全部材料 过滤替代料 */ |
| 8675 | const { materials0Data, materials0SelectedRowKeys } = props; | 8712 | const { materials0Data, materials0SelectedRowKeys } = props; |
| 8676 | - let materials0Row ={}; /* 油墨子级 */ | ||
| 8677 | - if(commonUtils.isNotEmptyArr(materials0Data) && commonUtils.isNotEmptyArr(materials0SelectedRowKeys)){ /* 没有工序选中行 则不进行数据过滤 */ | 8713 | + let materials0Row = {}; /* 油墨子级 */ |
| 8714 | + if (commonUtils.isNotEmptyArr(materials0Data) && commonUtils.isNotEmptyArr(materials0SelectedRowKeys)) { /* 没有工序选中行 则不进行数据过滤 */ | ||
| 8678 | const iIndex = materials0Data.findIndex(item => materials0SelectedRowKeys.includes(item.sId)); | 8715 | const iIndex = materials0Data.findIndex(item => materials0SelectedRowKeys.includes(item.sId)); |
| 8679 | - if(iIndex > -1) { | 8716 | + if (iIndex > -1) { |
| 8680 | materials0Row = materials0Data[iIndex]; | 8717 | materials0Row = materials0Data[iIndex]; |
| 8681 | } | 8718 | } |
| 8682 | } | 8719 | } |
| 8683 | - if(commonUtils.isNotEmptyObject(materials0Row)) { /* 根据工序过滤所有替代料 */ | 8720 | + if (commonUtils.isNotEmptyObject(materials0Row)) { /* 根据工序过滤所有替代料 */ |
| 8684 | res = oriData.filter(item => item.sParentMaterialsId === materials0Row.sId); | 8721 | res = oriData.filter(item => item.sParentMaterialsId === materials0Row.sId); |
| 8685 | - } else if(commonUtils.isNotEmptyObject(processRow)) { /* 根据工序过滤所有替代料 */ | 8722 | + } else if (commonUtils.isNotEmptyObject(processRow)) { /* 根据工序过滤所有替代料 */ |
| 8686 | res = oriData.filter(item => item.sProcessId === processRow.sProcessId && item.sProcessTbId === processRow.sId); | 8723 | res = oriData.filter(item => item.sProcessId === processRow.sProcessId && item.sProcessTbId === processRow.sId); |
| 8687 | - } else if(commonUtils.isNotEmptyObject(controlRow)){ | ||
| 8688 | - res = oriData.filter(item => item.sControlId=== controlRow.sId && commonUtils.isNotEmptyObject(item.sParentMaterialsId)); | 8724 | + } else if (commonUtils.isNotEmptyObject(controlRow)) { |
| 8725 | + res = oriData.filter(item => item.sControlId === controlRow.sId && commonUtils.isNotEmptyObject(item.sParentMaterialsId)); | ||
| 8689 | } | 8726 | } |
| 8690 | 8727 | ||
| 8691 | } else { | 8728 | } else { |
| @@ -8738,8 +8775,8 @@ const QuotationComponent = Form.create({ | @@ -8738,8 +8775,8 @@ const QuotationComponent = Form.create({ | ||
| 8738 | materialsInfoList.forEach((item, index) => { | 8775 | materialsInfoList.forEach((item, index) => { |
| 8739 | 8776 | ||
| 8740 | 8777 | ||
| 8741 | - const tableNameProps = index === 0 ? `materialsTable` : `materialsTable${index -1}`; | ||
| 8742 | - const tableName = index === 0 ? `materials` : `materials${index -1}`; | 8778 | + const tableNameProps = index === 0 ? `materialsTable` : `materialsTable${index - 1}`; |
| 8779 | + const tableName = index === 0 ? `materials` : `materials${index - 1}`; | ||
| 8743 | materialsTablePropsList[`${tableNameProps}Props`] = { | 8780 | materialsTablePropsList[`${tableNameProps}Props`] = { |
| 8744 | ...commonBusiness.getTableTypes(tableName, props), | 8781 | ...commonBusiness.getTableTypes(tableName, props), |
| 8745 | // tableBelone: 'list', | 8782 | // tableBelone: 'list', |
| @@ -8991,7 +9028,7 @@ const QuotationComponent = Form.create({ | @@ -8991,7 +9028,7 @@ const QuotationComponent = Form.create({ | ||
| 8991 | chooseProdutProcessConfig = props.masterConfig.gdsconfigformslave[iIndex]; | 9028 | chooseProdutProcessConfig = props.masterConfig.gdsconfigformslave[iIndex]; |
| 8992 | } | 9029 | } |
| 8993 | let slaveFinalData = []; | 9030 | let slaveFinalData = []; |
| 8994 | - let slaveFinalSelectedRowKeys =[]; | 9031 | + let slaveFinalSelectedRowKeys = []; |
| 8995 | if (commonUtils.isNotEmptyArr(props.slaveData)) { | 9032 | if (commonUtils.isNotEmptyArr(props.slaveData)) { |
| 8996 | slaveFinalData = JSON.parse(JSON.stringify(props.slaveData)); | 9033 | slaveFinalData = JSON.parse(JSON.stringify(props.slaveData)); |
| 8997 | if (commonUtils.isNotEmptyArr(slaveFinalData) && slaveFinalData.length > 0) { | 9034 | if (commonUtils.isNotEmptyArr(slaveFinalData) && slaveFinalData.length > 0) { |
| @@ -9000,7 +9037,7 @@ const QuotationComponent = Form.create({ | @@ -9000,7 +9037,7 @@ const QuotationComponent = Form.create({ | ||
| 9000 | }); | 9037 | }); |
| 9001 | } | 9038 | } |
| 9002 | /* 选择成品工序 只有一条从表 则默认选中 */ | 9039 | /* 选择成品工序 只有一条从表 则默认选中 */ |
| 9003 | - if(slaveFinalData.length ===1){ | 9040 | + if (slaveFinalData.length === 1) { |
| 9004 | slaveFinalSelectedRowKeys.push(slaveFinalData[0].sSlaveId); | 9041 | slaveFinalSelectedRowKeys.push(slaveFinalData[0].sSlaveId); |
| 9005 | } | 9042 | } |
| 9006 | } | 9043 | } |
| @@ -9047,7 +9084,7 @@ const QuotationComponent = Form.create({ | @@ -9047,7 +9084,7 @@ const QuotationComponent = Form.create({ | ||
| 9047 | chooseProductMaterialsConfig = props.masterConfig.gdsconfigformslave[iIndex]; | 9084 | chooseProductMaterialsConfig = props.masterConfig.gdsconfigformslave[iIndex]; |
| 9048 | } | 9085 | } |
| 9049 | let slaveFinalData = []; | 9086 | let slaveFinalData = []; |
| 9050 | - let slaveFinalSelectedRowKeys =[]; | 9087 | + let slaveFinalSelectedRowKeys = []; |
| 9051 | if (commonUtils.isNotEmptyArr(props.slaveData)) { | 9088 | if (commonUtils.isNotEmptyArr(props.slaveData)) { |
| 9052 | slaveFinalData = JSON.parse(JSON.stringify(props.slaveData)); | 9089 | slaveFinalData = JSON.parse(JSON.stringify(props.slaveData)); |
| 9053 | if (commonUtils.isNotEmptyArr(slaveFinalData) && slaveFinalData.length > 0) { | 9090 | if (commonUtils.isNotEmptyArr(slaveFinalData) && slaveFinalData.length > 0) { |
| @@ -9056,7 +9093,7 @@ const QuotationComponent = Form.create({ | @@ -9056,7 +9093,7 @@ const QuotationComponent = Form.create({ | ||
| 9056 | }); | 9093 | }); |
| 9057 | } | 9094 | } |
| 9058 | /* 选择成品材料 只有一条从表 则默认选中 */ | 9095 | /* 选择成品材料 只有一条从表 则默认选中 */ |
| 9059 | - if(slaveFinalData.length ===1){ | 9096 | + if (slaveFinalData.length === 1) { |
| 9060 | slaveFinalSelectedRowKeys.push(slaveFinalData[0].sSlaveId); | 9097 | slaveFinalSelectedRowKeys.push(slaveFinalData[0].sSlaveId); |
| 9061 | } | 9098 | } |
| 9062 | } | 9099 | } |
| @@ -9210,10 +9247,10 @@ const QuotationComponent = Form.create({ | @@ -9210,10 +9247,10 @@ const QuotationComponent = Form.create({ | ||
| 9210 | const setTop = commonFunc.showMessage(app.commonConst, 'setTop');/* 置顶 */ | 9247 | const setTop = commonFunc.showMessage(app.commonConst, 'setTop');/* 置顶 */ |
| 9211 | const setBottom = commonFunc.showMessage(app.commonConst, 'setBottom');/* 置底 */ | 9248 | const setBottom = commonFunc.showMessage(app.commonConst, 'setBottom');/* 置底 */ |
| 9212 | let sProcessParams = commonFunc.showMessage(app.commonConst, 'sProcessParams');/* 选择工艺参数标题 */ | 9249 | let sProcessParams = commonFunc.showMessage(app.commonConst, 'sProcessParams');/* 选择工艺参数标题 */ |
| 9213 | - if(commonUtils.isNotEmptyObject(props) && props.sParamModalType) { | ||
| 9214 | - if(props.sParamModalType === 'sQuo') { | ||
| 9215 | - sProcessParams = commonFunc.showMessage(app.commonConst, 'sQuoParams');/* 选择报价参数标题 */ | ||
| 9216 | - if(commonUtils.isEmpty(sProcessParams)) { | 9250 | + if (commonUtils.isNotEmptyObject(props) && props.sParamModalType) { |
| 9251 | + if (props.sParamModalType === 'sQuo') { | ||
| 9252 | + sProcessParams = commonFunc.showMessage(app.commonConst, 'sQuoParams');/* 选择报价参数标题 */ | ||
| 9253 | + if (commonUtils.isEmpty(sProcessParams)) { | ||
| 9217 | sProcessParams = '报价参数标准'; | 9254 | sProcessParams = '报价参数标准'; |
| 9218 | } | 9255 | } |
| 9219 | } | 9256 | } |
| @@ -9221,11 +9258,11 @@ const QuotationComponent = Form.create({ | @@ -9221,11 +9258,11 @@ const QuotationComponent = Form.create({ | ||
| 9221 | // eslint-disable-next-line jsx-a11y/anchor-is-valid | 9258 | // eslint-disable-next-line jsx-a11y/anchor-is-valid |
| 9222 | const operateAdd = <a title="添加同级" alt="" onClick={props.enabled ? props.onDataRowAdd.bind(this, 'control', true, 'sameNode') : null}>{props.enabled ? setAdd.img : setAdd.disableimg} </a>; | 9259 | const operateAdd = <a title="添加同级" alt="" onClick={props.enabled ? props.onDataRowAdd.bind(this, 'control', true, 'sameNode') : null}>{props.enabled ? setAdd.img : setAdd.disableimg} </a>; |
| 9223 | // eslint-disable-next-line jsx-a11y/anchor-is-valid | 9260 | // eslint-disable-next-line jsx-a11y/anchor-is-valid |
| 9224 | - const operateAddChild = <a title="添加子级" onClick={props.enabled ? props.onDataRowAdd.bind(this, 'control', true, 'childNode') : null}>{props.enabled ? setAddChild.img : setAddChild.disableimg }</a>; | 9261 | + const operateAddChild = <a title="添加子级" onClick={props.enabled ? props.onDataRowAdd.bind(this, 'control', true, 'childNode') : null}>{props.enabled ? setAddChild.img : setAddChild.disableimg}</a>; |
| 9225 | // eslint-disable-next-line jsx-a11y/anchor-is-valid | 9262 | // eslint-disable-next-line jsx-a11y/anchor-is-valid |
| 9226 | const operateCopy = <a title="复制" onClick={props.enabled ? props.onDataRowCopy.bind(this, 'control', false, 'isChild') : null}>{props.enabled ? setCopy.img : setCopy.disableimg}</a>; | 9263 | const operateCopy = <a title="复制" onClick={props.enabled ? props.onDataRowCopy.bind(this, 'control', false, 'isChild') : null}>{props.enabled ? setCopy.img : setCopy.disableimg}</a>; |
| 9227 | // eslint-disable-next-line jsx-a11y/anchor-is-valid | 9264 | // eslint-disable-next-line jsx-a11y/anchor-is-valid |
| 9228 | - const operateUpdate = <a title="复制全部" onClick={props.enabled ? props.onDataRowCopyAll.bind(this, 'control', false, 'isChild') : null}>{props.enabled ? setCopyAll.img : setCopyAll.disableimg }</a>; | 9265 | + const operateUpdate = <a title="复制全部" onClick={props.enabled ? props.onDataRowCopyAll.bind(this, 'control', false, 'isChild') : null}>{props.enabled ? setCopyAll.img : setCopyAll.disableimg}</a>; |
| 9229 | // eslint-disable-next-line jsx-a11y/anchor-is-valid | 9266 | // eslint-disable-next-line jsx-a11y/anchor-is-valid |
| 9230 | const operateDel = <a title="删除" onClick={props.enabled ? props.onDataRowDel.bind(this, 'control', true, '') : null}>{props.enabled ? setDelete.img : setDelete.disableimg}</a>; | 9267 | const operateDel = <a title="删除" onClick={props.enabled ? props.onDataRowDel.bind(this, 'control', true, '') : null}>{props.enabled ? setDelete.img : setDelete.disableimg}</a>; |
| 9231 | 9268 | ||
| @@ -9251,7 +9288,7 @@ const QuotationComponent = Form.create({ | @@ -9251,7 +9288,7 @@ const QuotationComponent = Form.create({ | ||
| 9251 | } | 9288 | } |
| 9252 | } | 9289 | } |
| 9253 | 9290 | ||
| 9254 | - const bFinalMaterialsTabShow = commonUtils.isEmptyObject(finishedMaterialsConfig) ? false :(bSplitMaterials ? true : false); /* 没有成品材料配置 则材料Tab不展示 */ | 9291 | + const bFinalMaterialsTabShow = commonUtils.isEmptyObject(finishedMaterialsConfig) ? false : (bSplitMaterials ? true : false); /* 没有成品材料配置 则材料Tab不展示 */ |
| 9255 | const bFinalProcessTabShow = commonUtils.isEmptyObject(finishedProcessConfig) ? false : (bSplitProcess ? true : false); /* 没有成品工序配置 则工序Tab不展示 */ | 9292 | const bFinalProcessTabShow = commonUtils.isEmptyObject(finishedProcessConfig) ? false : (bSplitProcess ? true : false); /* 没有成品工序配置 则工序Tab不展示 */ |
| 9256 | 9293 | ||
| 9257 | const panelExtra = (type) => { | 9294 | const panelExtra = (type) => { |
| @@ -9259,9 +9296,9 @@ const QuotationComponent = Form.create({ | @@ -9259,9 +9296,9 @@ const QuotationComponent = Form.create({ | ||
| 9259 | /* 根据materials找到其组所有配置头 */ | 9296 | /* 根据materials找到其组所有配置头 */ |
| 9260 | 9297 | ||
| 9261 | let radioConfigArr = []; | 9298 | let radioConfigArr = []; |
| 9262 | - if(commonUtils.isNotEmptyArr(formData)) { | 9299 | + if (commonUtils.isNotEmptyArr(formData)) { |
| 9263 | // radioConfigArr = formData.filter(item => commonUtils.isNotEmptyObject(item.sGrd) && item.sGrd.includes(type) ); | 9300 | // radioConfigArr = formData.filter(item => commonUtils.isNotEmptyObject(item.sGrd) && item.sGrd.includes(type) ); |
| 9264 | - radioConfigArr = formData.filter(item => commonUtils.isNotEmptyObject(item.sGrd) && item.sGrd.includes(type) && item.bGrdVisible ); | 9301 | + radioConfigArr = formData.filter(item => commonUtils.isNotEmptyObject(item.sGrd) && item.sGrd.includes(type) && item.bGrdVisible); |
| 9265 | // console.log('radioConfigArr:', radioConfigArr); | 9302 | // console.log('radioConfigArr:', radioConfigArr); |
| 9266 | } | 9303 | } |
| 9267 | if (type === 'material') { | 9304 | if (type === 'material') { |
| @@ -9274,10 +9311,10 @@ const QuotationComponent = Form.create({ | @@ -9274,10 +9311,10 @@ const QuotationComponent = Form.create({ | ||
| 9274 | {/*<Radio value={6}>{materialsFlInfo}</Radio>*/} | 9311 | {/*<Radio value={6}>{materialsFlInfo}</Radio>*/} |
| 9275 | { | 9312 | { |
| 9276 | radioConfigArr.map((child, index) => { | 9313 | radioConfigArr.map((child, index) => { |
| 9277 | - const radioTitle = child.showName; | ||
| 9278 | - const radioValue = index + 2 + 10; | 9314 | + const radioTitle = child.showName; |
| 9315 | + const radioValue = index + 2 + 10; | ||
| 9279 | // console.log('radioValue', radioTitle, radioValue); | 9316 | // console.log('radioValue', radioTitle, radioValue); |
| 9280 | - return( | 9317 | + return ( |
| 9281 | <Radio value={radioValue}>{radioTitle}</Radio> | 9318 | <Radio value={radioValue}>{radioTitle}</Radio> |
| 9282 | ) | 9319 | ) |
| 9283 | }) | 9320 | }) |
| @@ -9333,14 +9370,14 @@ const QuotationComponent = Form.create({ | @@ -9333,14 +9370,14 @@ const QuotationComponent = Form.create({ | ||
| 9333 | props.onActiveKey(e); | 9370 | props.onActiveKey(e); |
| 9334 | }; | 9371 | }; |
| 9335 | 9372 | ||
| 9336 | - const okButtonStyle ={ | ||
| 9337 | - style:{ | ||
| 9338 | - display:"none", | ||
| 9339 | - backgroundColor:"red" | 9373 | + const okButtonStyle = { |
| 9374 | + style: { | ||
| 9375 | + display: "none", | ||
| 9376 | + backgroundColor: "red" | ||
| 9340 | } | 9377 | } |
| 9341 | } | 9378 | } |
| 9342 | const cancelButtonStyle = { | 9379 | const cancelButtonStyle = { |
| 9343 | - htmlType:"退出", | 9380 | + htmlType: "退出", |
| 9344 | style: { | 9381 | style: { |
| 9345 | width: 70, | 9382 | width: 70, |
| 9346 | height: 50, | 9383 | height: 50, |
| @@ -9405,15 +9442,15 @@ const QuotationComponent = Form.create({ | @@ -9405,15 +9442,15 @@ const QuotationComponent = Form.create({ | ||
| 9405 | res = ( | 9442 | res = ( |
| 9406 | <div> | 9443 | <div> |
| 9407 | <Tabs className={styles.slaveTabs} | 9444 | <Tabs className={styles.slaveTabs} |
| 9408 | - style={{ paddingTop: '10px', marginRight: '10px', marginTop: '-10px', backgroundColor: '#fff' }} | ||
| 9409 | - onChange={tabChange}> | 9445 | + style={{ paddingTop: '10px', marginRight: '10px', marginTop: '-10px', backgroundColor: '#fff' }} |
| 9446 | + onChange={tabChange}> | ||
| 9410 | <TabPane tab="部件材料" key={4} ></TabPane> | 9447 | <TabPane tab="部件材料" key={4} ></TabPane> |
| 9411 | <TabPane tab="部件工序" key={5} ></TabPane> | 9448 | <TabPane tab="部件工序" key={5} ></TabPane> |
| 9412 | - {bFinalMaterialsTabShow ? <TabPane tab="成品材料" key={2} ></TabPane> :''} | ||
| 9413 | - {bFinalProcessTabShow? <TabPane tab="成品工序" key={3} ></TabPane> :''} | 9449 | + {bFinalMaterialsTabShow ? <TabPane tab="成品材料" key={2} ></TabPane> : ''} |
| 9450 | + {bFinalProcessTabShow ? <TabPane tab="成品工序" key={3} ></TabPane> : ''} | ||
| 9414 | </Tabs> | 9451 | </Tabs> |
| 9415 | {props.currentTab === 4 && bMaterialShow ? | 9452 | {props.currentTab === 4 && bMaterialShow ? |
| 9416 | - <StaticEditTable {...materialsPropsType} setOpterationColumn="Y" bModalAdd noVlist selfTableHeight={82}/> : '' | 9453 | + <StaticEditTable {...materialsPropsType} setOpterationColumn="Y" bModalAdd noVlist selfTableHeight={82} /> : '' |
| 9417 | } | 9454 | } |
| 9418 | {finishedMaterialsColumn && props.currentTab === 2 ? | 9455 | {finishedMaterialsColumn && props.currentTab === 2 ? |
| 9419 | <StaticEditTable {...finishedMaterialsPropsType} bFinished bModalAdd setOpterationColumn="Y" selfTableHeight={82} noVlist /> : '' | 9456 | <StaticEditTable {...finishedMaterialsPropsType} bFinished bModalAdd setOpterationColumn="Y" selfTableHeight={82} noVlist /> : '' |
| @@ -9421,7 +9458,7 @@ const QuotationComponent = Form.create({ | @@ -9421,7 +9458,7 @@ const QuotationComponent = Form.create({ | ||
| 9421 | {props.currentTab === 5 && bProcessShow ? | 9458 | {props.currentTab === 5 && bProcessShow ? |
| 9422 | <StaticEditTable {...processPropsType} setOpterationColumn="Y" bModalAdd dragHandle selfTableHeight={330} noVlist /> : '' | 9459 | <StaticEditTable {...processPropsType} setOpterationColumn="Y" bModalAdd dragHandle selfTableHeight={330} noVlist /> : '' |
| 9423 | } | 9460 | } |
| 9424 | - {finishedProcessColumn && props.currentTab === 3? | 9461 | + {finishedProcessColumn && props.currentTab === 3 ? |
| 9425 | <StaticEditTable {...finishedProcessPropsType} bFinished bModalAdd setOpterationColumn="Y" dragHandle selfTableHeight={330} noVlist /> : '' | 9462 | <StaticEditTable {...finishedProcessPropsType} bFinished bModalAdd setOpterationColumn="Y" dragHandle selfTableHeight={330} noVlist /> : '' |
| 9426 | } | 9463 | } |
| 9427 | <Layout className="processList"> | 9464 | <Layout className="processList"> |
| @@ -9438,48 +9475,48 @@ const QuotationComponent = Form.create({ | @@ -9438,48 +9475,48 @@ const QuotationComponent = Form.create({ | ||
| 9438 | res = ( | 9475 | res = ( |
| 9439 | <Collapse defaultActiveKey={props.activeKey} onChange={activeKeyChange} className="custom-collapse"> | 9476 | <Collapse defaultActiveKey={props.activeKey} onChange={activeKeyChange} className="custom-collapse"> |
| 9440 | <Panel collapsible="header" | 9477 | <Panel collapsible="header" |
| 9441 | - header={(<RightOutlined style={{fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('1') !== -1)? '90deg' : '0deg'})`}} />)} | ||
| 9442 | - showArrow={false} | ||
| 9443 | - extra={materialsInfo} | ||
| 9444 | - key="1" | 9478 | + header={(<RightOutlined style={{ fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('1') !== -1) ? '90deg' : '0deg'})` }} />)} |
| 9479 | + showArrow={false} | ||
| 9480 | + extra={materialsInfo} | ||
| 9481 | + key="1" | ||
| 9445 | > | 9482 | > |
| 9446 | - <StaticEditTable {...materialsPropsType} setOpterationColumn="Y" bModalAdd noVlist selfTableHeight={82}/> | 9483 | + <StaticEditTable {...materialsPropsType} setOpterationColumn="Y" bModalAdd noVlist selfTableHeight={82} /> |
| 9447 | </Panel> | 9484 | </Panel> |
| 9448 | { | 9485 | { |
| 9449 | bSplitMaterials ? | 9486 | bSplitMaterials ? |
| 9450 | <Panel collapsible="header" | 9487 | <Panel collapsible="header" |
| 9451 | - header={(<RightOutlined style={{fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('3') !== -1)? '90deg' : '0deg'})`}} />)} | ||
| 9452 | - showArrow={false} | ||
| 9453 | - extra={productMaterialsInfo} | ||
| 9454 | - key="3" | 9488 | + header={(<RightOutlined style={{ fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('3') !== -1) ? '90deg' : '0deg'})` }} />)} |
| 9489 | + showArrow={false} | ||
| 9490 | + extra={productMaterialsInfo} | ||
| 9491 | + key="3" | ||
| 9455 | > | 9492 | > |
| 9456 | <StaticEditTable {...finishedMaterialsPropsType} bFinished bModalAdd setOpterationColumn="Y" selfTableHeight={82} noVlist /> | 9493 | <StaticEditTable {...finishedMaterialsPropsType} bFinished bModalAdd setOpterationColumn="Y" selfTableHeight={82} noVlist /> |
| 9457 | </Panel> : '' | 9494 | </Panel> : '' |
| 9458 | } | 9495 | } |
| 9459 | <Panel collapsible="header" | 9496 | <Panel collapsible="header" |
| 9460 | - header={(<RightOutlined style={{fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('2') !== -1)? '90deg' : '0deg'})`}} />)} | ||
| 9461 | - showArrow={false} | ||
| 9462 | - extra={processInfo} | ||
| 9463 | - key="2" | 9497 | + header={(<RightOutlined style={{ fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('2') !== -1) ? '90deg' : '0deg'})` }} />)} |
| 9498 | + showArrow={false} | ||
| 9499 | + extra={processInfo} | ||
| 9500 | + key="2" | ||
| 9464 | > | 9501 | > |
| 9465 | <StaticEditTable {...processPropsType} setOpterationColumn="Y" bModalAdd dragHandle selfTableHeight={330} noVlist /> | 9502 | <StaticEditTable {...processPropsType} setOpterationColumn="Y" bModalAdd dragHandle selfTableHeight={330} noVlist /> |
| 9466 | </Panel> | 9503 | </Panel> |
| 9467 | { | 9504 | { |
| 9468 | bSplitProcess ? | 9505 | bSplitProcess ? |
| 9469 | <Panel collapsible="header" | 9506 | <Panel collapsible="header" |
| 9470 | - header={(<RightOutlined style={{fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('4') !== -1)? '90deg' : '0deg'})`}} />)} | ||
| 9471 | - showArrow={false} | ||
| 9472 | - extra={productProcessInfo} | ||
| 9473 | - key="4" | 9507 | + header={(<RightOutlined style={{ fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('4') !== -1) ? '90deg' : '0deg'})` }} />)} |
| 9508 | + showArrow={false} | ||
| 9509 | + extra={productProcessInfo} | ||
| 9510 | + key="4" | ||
| 9474 | > | 9511 | > |
| 9475 | <StaticEditTable {...finishedProcessPropsType} bFinished bModalAdd setOpterationColumn="Y" dragHandle selfTableHeight={330} noVlist /> | 9512 | <StaticEditTable {...finishedProcessPropsType} bFinished bModalAdd setOpterationColumn="Y" dragHandle selfTableHeight={330} noVlist /> |
| 9476 | </Panel> : '' | 9513 | </Panel> : '' |
| 9477 | } | 9514 | } |
| 9478 | <Panel collapsible="header" | 9515 | <Panel collapsible="header" |
| 9479 | - header={(<RightOutlined style={{fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('5') !== -1)? '90deg' : '0deg'})`}} />)} | ||
| 9480 | - showArrow={false} | ||
| 9481 | - extra={manyqtysInfo} | ||
| 9482 | - key="5" | 9516 | + header={(<RightOutlined style={{ fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('5') !== -1) ? '90deg' : '0deg'})` }} />)} |
| 9517 | + showArrow={false} | ||
| 9518 | + extra={manyqtysInfo} | ||
| 9519 | + key="5" | ||
| 9483 | > | 9520 | > |
| 9484 | <StaticEditTable {...manyqtysPropsType} setOpterationColumn="Y" selfTableHeight={82} noVlist /> | 9521 | <StaticEditTable {...manyqtysPropsType} setOpterationColumn="Y" selfTableHeight={82} noVlist /> |
| 9485 | </Panel> | 9522 | </Panel> |
| @@ -9489,12 +9526,12 @@ const QuotationComponent = Form.create({ | @@ -9489,12 +9526,12 @@ const QuotationComponent = Form.create({ | ||
| 9489 | res = ( | 9526 | res = ( |
| 9490 | <Collapse defaultActiveKey={props.activeKey} onChange={activeKeyChange} className="custom-collapse"> | 9527 | <Collapse defaultActiveKey={props.activeKey} onChange={activeKeyChange} className="custom-collapse"> |
| 9491 | <Panel collapsible="header" | 9528 | <Panel collapsible="header" |
| 9492 | - header={(<RightOutlined style={{fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('2') !== -1)? '90deg' : '0deg'})`}} />)} | ||
| 9493 | - showArrow={false} | ||
| 9494 | - extra={panelExtra('process')} | ||
| 9495 | - key="2" | 9529 | + header={(<RightOutlined style={{ fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('2') !== -1) ? '90deg' : '0deg'})` }} />)} |
| 9530 | + showArrow={false} | ||
| 9531 | + extra={panelExtra('process')} | ||
| 9532 | + key="2" | ||
| 9496 | > | 9533 | > |
| 9497 | - { props.currentTab2 === 1 && commonUtils.isNotEmptyObject(processShowLeft) ? | 9534 | + {props.currentTab2 === 1 && commonUtils.isNotEmptyObject(processShowLeft) ? |
| 9498 | <div> | 9535 | <div> |
| 9499 | <Row gutter={[8, 0]}> | 9536 | <Row gutter={[8, 0]}> |
| 9500 | <Col span={processShowLeft.iColValue} order={1} id={props.processTableId}> | 9537 | <Col span={processShowLeft.iColValue} order={1} id={props.processTableId}> |
| @@ -9530,28 +9567,28 @@ const QuotationComponent = Form.create({ | @@ -9530,28 +9567,28 @@ const QuotationComponent = Form.create({ | ||
| 9530 | </Row> | 9567 | </Row> |
| 9531 | </div> : props.currentTab2 === 1 && <StaticEditTable {...processPropsType} setOpterationColumn="Y" bModalAdd dragHandle selfTableHeight={330} noVlist /> | 9568 | </div> : props.currentTab2 === 1 && <StaticEditTable {...processPropsType} setOpterationColumn="Y" bModalAdd dragHandle selfTableHeight={330} noVlist /> |
| 9532 | } | 9569 | } |
| 9533 | - { props.currentTab2 === 3 && bSplitProcess && <StaticEditTable {...finishedProcessPropsType} bFinished bModalAdd setOpterationColumn="Y" dragHandle selfTableHeight={330} noVlist /> } | 9570 | + {props.currentTab2 === 3 && bSplitProcess && <StaticEditTable {...finishedProcessPropsType} bFinished bModalAdd setOpterationColumn="Y" dragHandle selfTableHeight={330} noVlist />} |
| 9534 | </Panel> | 9571 | </Panel> |
| 9535 | 9572 | ||
| 9536 | <Panel collapsible="header" | 9573 | <Panel collapsible="header" |
| 9537 | - header={(<RightOutlined style={{fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('1') !== -1)? '90deg' : '0deg'})`}} />)} | ||
| 9538 | - showArrow={false} | ||
| 9539 | - extra={panelExtra('material')} | ||
| 9540 | - key="1" | 9574 | + header={(<RightOutlined style={{ fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('1') !== -1) ? '90deg' : '0deg'})` }} />)} |
| 9575 | + showArrow={false} | ||
| 9576 | + extra={panelExtra('material')} | ||
| 9577 | + key="1" | ||
| 9541 | > | 9578 | > |
| 9542 | {/*{ props.currentTab === 11 && <StaticEditTable {...materialsPropsType} setOpterationColumn="Y" bModalAdd noVlist selfTableHeight={82}/> }*/} | 9579 | {/*{ props.currentTab === 11 && <StaticEditTable {...materialsPropsType} setOpterationColumn="Y" bModalAdd noVlist selfTableHeight={82}/> }*/} |
| 9543 | 9580 | ||
| 9544 | - { props.materialsInfoList?.map((item, index) => { | 9581 | + {props.materialsInfoList?.map((item, index) => { |
| 9545 | let num = 12 + index; | 9582 | let num = 12 + index; |
| 9546 | - const tablePropsName = index ===0 ? `materialsTableProps` : `materialsTable${index - 1}Props`; | 9583 | + const tablePropsName = index === 0 ? `materialsTableProps` : `materialsTable${index - 1}Props`; |
| 9547 | const materialsOtherPropsType = materialsTablePropsList[tablePropsName]; | 9584 | const materialsOtherPropsType = materialsTablePropsList[tablePropsName]; |
| 9548 | let sWidth = '100%'; | 9585 | let sWidth = '100%'; |
| 9549 | /* 找到子级 左右列 */ | 9586 | /* 找到子级 左右列 */ |
| 9550 | - let materialsChildTableProps ={}; | ||
| 9551 | - if(commonUtils.isNotEmptyArr(materialsChildInfoList)) { | 9587 | + let materialsChildTableProps = {}; |
| 9588 | + if (commonUtils.isNotEmptyArr(materialsChildInfoList)) { | ||
| 9552 | const iIndex = materialsChildInfoList.findIndex(child => child.includes(item)); | 9589 | const iIndex = materialsChildInfoList.findIndex(child => child.includes(item)); |
| 9553 | - if(iIndex > -1) { | ||
| 9554 | - materialsChildTableProps = materialsChildTablePropsList[`${item}ChildTableProps`]; | 9590 | + if (iIndex > -1) { |
| 9591 | + materialsChildTableProps = materialsChildTablePropsList[`${item}ChildTableProps`]; | ||
| 9555 | sWidth = '50%'; | 9592 | sWidth = '50%'; |
| 9556 | } else { | 9593 | } else { |
| 9557 | sWidth = '100%'; | 9594 | sWidth = '100%'; |
| @@ -9562,15 +9599,15 @@ const QuotationComponent = Form.create({ | @@ -9562,15 +9599,15 @@ const QuotationComponent = Form.create({ | ||
| 9562 | return ( | 9599 | return ( |
| 9563 | props.currentTab === num && | 9600 | props.currentTab === num && |
| 9564 | <div className='dlhStyle'> | 9601 | <div className='dlhStyle'> |
| 9565 | - <div style={{width:sWidth}}> <StaticEditTable {...materialsOtherPropsType} setOpterationColumn="Y" noVlist selfTableHeight={82}/> </div> | 9602 | + <div style={{ width: sWidth }}> <StaticEditTable {...materialsOtherPropsType} setOpterationColumn="Y" noVlist selfTableHeight={82} /> </div> |
| 9566 | { | 9603 | { |
| 9567 | - commonUtils.isNotEmptyObject(materialsChildTableProps)? | ||
| 9568 | - <div style={{width:sWidth}}> <StaticEditTable {...materialsChildTableProps} setOpterationColumn="Y" noVlist selfTableHeight={82}/> </div> | 9604 | + commonUtils.isNotEmptyObject(materialsChildTableProps) ? |
| 9605 | + <div style={{ width: sWidth }}> <StaticEditTable {...materialsChildTableProps} setOpterationColumn="Y" noVlist selfTableHeight={82} /> </div> | ||
| 9569 | : '' | 9606 | : '' |
| 9570 | } | 9607 | } |
| 9571 | </div> | 9608 | </div> |
| 9572 | ) | 9609 | ) |
| 9573 | - }) } | 9610 | + })} |
| 9574 | 9611 | ||
| 9575 | {/*{ props.currentTab === 13 &&*/} | 9612 | {/*{ props.currentTab === 13 &&*/} |
| 9576 | {/*<div className='dlhStyle'>*/} | 9613 | {/*<div className='dlhStyle'>*/} |
| @@ -9584,10 +9621,10 @@ const QuotationComponent = Form.create({ | @@ -9584,10 +9621,10 @@ const QuotationComponent = Form.create({ | ||
| 9584 | { | 9621 | { |
| 9585 | commonUtils.isNotEmptyObject(manyqtysConfig) ? | 9622 | commonUtils.isNotEmptyObject(manyqtysConfig) ? |
| 9586 | <Panel collapsible="header" | 9623 | <Panel collapsible="header" |
| 9587 | - header={(<RightOutlined style={{fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('3') !== -1)? '90deg' : '0deg'})`}} />)} | ||
| 9588 | - showArrow={false} | ||
| 9589 | - extra={panelExtra('manyQty')} | ||
| 9590 | - key="3" | 9624 | + header={(<RightOutlined style={{ fontSize: '12px', transition: 'ease 0.3s', transform: `rotate(${(props.activeKey.indexOf('3') !== -1) ? '90deg' : '0deg'})` }} />)} |
| 9625 | + showArrow={false} | ||
| 9626 | + extra={panelExtra('manyQty')} | ||
| 9627 | + key="3" | ||
| 9591 | > | 9628 | > |
| 9592 | <StaticEditTable {...manyqtysPropsType} setOpterationColumn="Y" selfTableHeight={330} noVlist /> | 9629 | <StaticEditTable {...manyqtysPropsType} setOpterationColumn="Y" selfTableHeight={330} noVlist /> |
| 9593 | </Panel> : '' | 9630 | </Panel> : '' |
| @@ -9647,13 +9684,13 @@ const QuotationComponent = Form.create({ | @@ -9647,13 +9684,13 @@ const QuotationComponent = Form.create({ | ||
| 9647 | <div | 9684 | <div |
| 9648 | className="workerOrderControlTable" | 9685 | className="workerOrderControlTable" |
| 9649 | style={{ | 9686 | style={{ |
| 9650 | - marginLeft: '10px', display: bControlShow ? 'block' : 'none', top: props.currentTab === 1 ? 0 : `${stickyTabHeight}px`, | ||
| 9651 | - }} | 9687 | + marginLeft: '10px', display: bControlShow ? 'block' : 'none', top: props.currentTab === 1 ? 0 : `${stickyTabHeight}px`, |
| 9688 | + }} | ||
| 9652 | > | 9689 | > |
| 9653 | - <div className="processList" style={{ marginBottom: '0px', position: 'sticky', top: '0px', zIndex: 99 }}> | 9690 | + <div className="processList" style={{ marginBottom: '0px', position: 'sticky', top: '0px', zIndex: 99 }}> |
| 9654 | <StaticEditTable {...controlPropsType} setOpterationColumn="Y" selfTableHeight={82} noVlist /> | 9691 | <StaticEditTable {...controlPropsType} setOpterationColumn="Y" selfTableHeight={82} noVlist /> |
| 9655 | </div> | 9692 | </div> |
| 9656 | - { renderByLayout() } | 9693 | + {renderByLayout()} |
| 9657 | </div> | 9694 | </div> |
| 9658 | { | 9695 | { |
| 9659 | colorConfigGrdVisible ? | 9696 | colorConfigGrdVisible ? |
| @@ -9686,7 +9723,7 @@ const QuotationComponent = Form.create({ | @@ -9686,7 +9723,7 @@ const QuotationComponent = Form.create({ | ||
| 9686 | <div style={{ float: 'left', width: '60%' }}> | 9723 | <div style={{ float: 'left', width: '60%' }}> |
| 9687 | <Checkbox.Group style={{ width: '100%' }} onChange={props.onChange1}> | 9724 | <Checkbox.Group style={{ width: '100%' }} onChange={props.onChange1}> |
| 9688 | <Row> | 9725 | <Row> |
| 9689 | - { commonUtils.isNotEmptyObject(checkPersonData) ? | 9726 | + {commonUtils.isNotEmptyObject(checkPersonData) ? |
| 9690 | checkPersonData.map((item) => { | 9727 | checkPersonData.map((item) => { |
| 9691 | return ( | 9728 | return ( |
| 9692 | <Col span={8}> | 9729 | <Col span={8}> |
| @@ -9818,7 +9855,7 @@ const QuotationComponent = Form.create({ | @@ -9818,7 +9855,7 @@ const QuotationComponent = Form.create({ | ||
| 9818 | <AntdDraggableModal | 9855 | <AntdDraggableModal |
| 9819 | width={1000} | 9856 | width={1000} |
| 9820 | bodyStyle={{ | 9857 | bodyStyle={{ |
| 9821 | - display:'flex',justifyContent:'center', minHeight: 500, overflow: 'auto', | 9858 | + display: 'flex', justifyContent: 'center', minHeight: 500, overflow: 'auto', |
| 9822 | }} | 9859 | }} |
| 9823 | title="查看开版图" | 9860 | title="查看开版图" |
| 9824 | visible={props.showSinglePQtyPictureVisible} | 9861 | visible={props.showSinglePQtyPictureVisible} |
| @@ -9827,11 +9864,11 @@ const QuotationComponent = Form.create({ | @@ -9827,11 +9864,11 @@ const QuotationComponent = Form.create({ | ||
| 9827 | footer={null} | 9864 | footer={null} |
| 9828 | forbidResize | 9865 | forbidResize |
| 9829 | > | 9866 | > |
| 9830 | - <div style={{ display:'flex', width:'100%' }}> | ||
| 9831 | - <div style={{ display:'flex', width:'50%', 'justifyContent': 'center' }}> | 9867 | + <div style={{ display: 'flex', width: '100%' }}> |
| 9868 | + <div style={{ display: 'flex', width: '50%', 'justifyContent': 'center' }}> | ||
| 9832 | <ShowImgPQty {...props} /> | 9869 | <ShowImgPQty {...props} /> |
| 9833 | </div> | 9870 | </div> |
| 9834 | - <div style={{ display:'flex', width:'50%'}}> | 9871 | + <div style={{ display: 'flex', width: '50%' }}> |
| 9835 | <ShowImgM {...props} /> | 9872 | <ShowImgM {...props} /> |
| 9836 | </div> | 9873 | </div> |
| 9837 | </div> | 9874 | </div> |
| @@ -9897,10 +9934,10 @@ const QuotationComponent = Form.create({ | @@ -9897,10 +9934,10 @@ const QuotationComponent = Form.create({ | ||
| 9897 | cancelButtonProps={cancelButtonStyle} | 9934 | cancelButtonProps={cancelButtonStyle} |
| 9898 | onCancel={props.onCancelModal.bind(this, 'workFlowVisible')} | 9935 | onCancel={props.onCancelModal.bind(this, 'workFlowVisible')} |
| 9899 | closable | 9936 | closable |
| 9900 | - style={{ backgroundColor:'#ffffff', top: 0 }} | ||
| 9901 | - // footer={null} | 9937 | + style={{ backgroundColor: '#ffffff', top: 0 }} |
| 9938 | + // footer={null} | ||
| 9902 | > | 9939 | > |
| 9903 | - <WorkFlow {...props} /> | 9940 | + <WorkFlow {...props} /> |
| 9904 | </AntdDraggableModal> | 9941 | </AntdDraggableModal> |
| 9905 | 9942 | ||
| 9906 | : '' | 9943 | : '' |
| @@ -9930,10 +9967,10 @@ const QuotationComponent = Form.create({ | @@ -9930,10 +9967,10 @@ const QuotationComponent = Form.create({ | ||
| 9930 | onCancel={props.onCancelProcessParamsModalVisible} | 9967 | onCancel={props.onCancelProcessParamsModalVisible} |
| 9931 | onSaveState={props.onSaveState} | 9968 | onSaveState={props.onSaveState} |
| 9932 | forbidResize | 9969 | forbidResize |
| 9933 | - // footer={null} | 9970 | + // footer={null} |
| 9934 | > | 9971 | > |
| 9935 | <div className="sProcessParamsModal" style={{ height: '80%', overflowY: 'auto' }}> | 9972 | <div className="sProcessParamsModal" style={{ height: '80%', overflowY: 'auto' }}> |
| 9936 | - { commonUtils.isNotEmptyArr(props.sProcessParamsSelects) ? | 9973 | + {commonUtils.isNotEmptyArr(props.sProcessParamsSelects) ? |
| 9937 | props.sProcessParamsSelects.map((child) => { | 9974 | props.sProcessParamsSelects.map((child) => { |
| 9938 | const sMemo = child.sName.toLowerCase().endsWith('memo'); | 9975 | const sMemo = child.sName.toLowerCase().endsWith('memo'); |
| 9939 | let enabledNew = !child.bReadonly; | 9976 | let enabledNew = !child.bReadonly; |
| @@ -9982,7 +10019,7 @@ const QuotationComponent = Form.create({ | @@ -9982,7 +10019,7 @@ const QuotationComponent = Form.create({ | ||
| 9982 | visible={props.sParamsModalVisible} | 10019 | visible={props.sParamsModalVisible} |
| 9983 | onOk={props.onParamsOk} | 10020 | onOk={props.onParamsOk} |
| 9984 | onCancel={props.onCancelModal.bind(this, 'sParamsModalVisible')} | 10021 | onCancel={props.onCancelModal.bind(this, 'sParamsModalVisible')} |
| 9985 | - // footer={null} | 10022 | + // footer={null} |
| 9986 | > | 10023 | > |
| 9987 | <div className="xly-bill-list" > | 10024 | <div className="xly-bill-list" > |
| 9988 | <StaticEditTable {...sParamProps} footer="hidden" noVlist /> | 10025 | <StaticEditTable {...sParamProps} footer="hidden" noVlist /> |
| @@ -10065,13 +10102,13 @@ const QuotationComponent = Form.create({ | @@ -10065,13 +10102,13 @@ const QuotationComponent = Form.create({ | ||
| 10065 | </> | 10102 | </> |
| 10066 | )} | 10103 | )} |
| 10067 | 10104 | ||
| 10068 | - { true ? '' : <AntdDraggableDiv draggableDivClassName="xly-eject"> <a onClick={props.onEjectRight}> <img src={EjectRight} alt="eject" /></a> </AntdDraggableDiv>} | ||
| 10069 | - { true ? '' : | 10105 | + {true ? '' : <AntdDraggableDiv draggableDivClassName="xly-eject"> <a onClick={props.onEjectRight}> <img src={EjectRight} alt="eject" /></a> </AntdDraggableDiv>} |
| 10106 | + {true ? '' : | ||
| 10070 | <div className="xly-filter-tree"> | 10107 | <div className="xly-filter-tree"> |
| 10071 | <StaticEditTree {...totalTreeProps} /> | 10108 | <StaticEditTree {...totalTreeProps} /> |
| 10072 | <div className="xly-tree-close"> | 10109 | <div className="xly-tree-close"> |
| 10073 | {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} | 10110 | {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} |
| 10074 | - <a onClick={props.onEjectRight}> <img src={CloseRight} alt="close"/></a> | 10111 | + <a onClick={props.onEjectRight}> <img src={CloseRight} alt="close" /></a> |
| 10075 | </div> | 10112 | </div> |
| 10076 | </div> | 10113 | </div> |
| 10077 | } | 10114 | } |