From 67da82f0b0c24df5f19bbfcfec63801d9ae902d8 Mon Sep 17 00:00:00 2001 From: 王震 <10952869+daywangzhen@user.noreply.gitee.com> Date: 星期三, 13 十二月 2023 16:22:05 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/technology/completeproductstructure/completeproductstructure-form.vue | 319 +++++++++++++++++++++++++++-------------------------- 1 files changed, 162 insertions(+), 157 deletions(-) diff --git a/src/views/technology/completeproductstructure/completeproductstructure-form.vue b/src/views/technology/completeproductstructure/completeproductstructure-form.vue index 760d492..93e1376 100644 --- a/src/views/technology/completeproductstructure/completeproductstructure-form.vue +++ b/src/views/technology/completeproductstructure/completeproductstructure-form.vue @@ -25,17 +25,17 @@ <el-row> <el-col :span="24"> <el-form-item label="BOM缂栧彿"> - <el-input v-model="treeForm.number" placeholder="BOM缂栧彿"> + <el-input v-model="treeForm.number" disabled placeholder="BOM缂栧彿"> </el-input> </el-form-item> <el-form-item label="闆朵欢鍙�" prop="partNo"> - <el-input v-model="treeForm.partNo" placeholder="闆朵欢" readonly> - <el-button + <el-input v-model="treeForm.partNo" placeholder="闆朵欢" disabled> + <!-- <el-button slot="append" icon="el-icon-search" @click="showProductStructure = true" - ></el-button> + ></el-button> --> </el-input> </el-form-item> @@ -75,32 +75,26 @@ </el-input> </el-form-item> - <el-form-item label="鏇夸唬鍙�" prop="alternativeNo"> + <!-- <el-form-item label="鏇夸唬鍙�" prop="alternativeNo"> <el-input v-model="treeForm.alternativeNo" placeholder="鏇夸唬鍙�" disabled > </el-input> - </el-form-item> + </el-form-item> --> - <el-form-item label="鏇夸唬鎻忚堪" prop="alternativeDesc"> + <!-- <el-form-item label="鏇夸唬鎻忚堪" prop="alternativeDesc"> <el-input v-model="treeForm.alternativeDesc" placeholder="鏇夸唬鎻忚堪" disabled > </el-input> - </el-form-item> + </el-form-item> --> - <el-form-item label="缁濈紭棰滆壊"> - <el-input - v-model="treeForm.insulationColor" - placeholder="缁濈紭棰滆壊" - > - </el-input> - </el-form-item> - <el-form-item label="鎶ゅ棰滆壊"> + <!-- --> + <!-- <el-form-item label="鎶ゅ棰滆壊"> <el-input v-model="treeForm.sheathColor" placeholder="鎶ゅ棰滆壊"> </el-input> </el-form-item> @@ -110,15 +104,33 @@ placeholder="鐗规��1" > </el-input> - </el-form-item> + </el-form-item> --> </el-col> </el-row> </el-form> </div> <div class="completeProductStructure-detail"> <div class="completeProductStructure-design"> - <div class="completeProductStructure-design-title">鏋勫缓BOM</div> + <div class="completeProductStructure-design-title">BOM</div> <el-table + class="tree-select-table" + ref="tableRef" + :data="tableData" + style="width: 100%;" + row-key="id" + border + height="720" + default-expand-all + @expand-change="expandChange" + :row-class-name="tableRowClassName" + > + <el-table-column label="闆朵欢缂栧彿" prop="partNo"></el-table-column> + <el-table-column label="闆朵欢鍚嶇О" prop="partName"></el-table-column> + <el-table-column label="鍗曚綅" prop="unit"></el-table-column> + <el-table-column label="鏁伴噺" prop="qpa"></el-table-column> + <!-- <el-table-column label="鐩樻暟" prop="discNum"></el-table-column> --> + </el-table> + <!-- <el-table class="tree-select-table" ref="tableRef" :data="tableData" @@ -155,10 +167,10 @@ </el-table-column> <el-table-column prop="operationName" label="娑堣�楀伐搴�"> </el-table-column> - </el-table> + </el-table> --> </div> - <div class="completeProductStructure-queryPreview"></div> - <div class="completeProductStructure-preview"> + <!-- <div class="completeProductStructure-queryPreview"></div> --> + <!-- <div class="completeProductStructure-preview"> <div class="completeProductStructure-preview-title">缁撴灉棰勮</div> <el-table :data="preViewData" @@ -200,7 +212,7 @@ <el-table-column prop="operationName" label="娑堣�楀伐搴�"> </el-table-column> </el-table> - </div> + </div> --> </div> </div> <productStructureDialog @@ -221,7 +233,8 @@ getPartAllStructureExt, addObj, getObj, - putObj + putObj, + updateObj } from '@/api/technology/completeproductstructure' import { remote } from '@/api/admin/dict' import productStructureDialog from '@/views/common/productstructure.vue' @@ -281,7 +294,6 @@ }, computed: { editable: function() { - console.log() if (!this.dataForm.id) { return true } @@ -322,27 +334,11 @@ if (this.dataForm.id) { getObj(this.dataForm.id).then((response) => { var resultData = response.data.data - this.treeForm.partId = resultData.partId - this.treeForm.partNo = resultData.partNo - this.treeForm.partName = resultData.partName - this.treeForm.number = resultData.number - this.treeForm.insulationColor = resultData.insulationColor - this.treeForm.sheathColor = resultData.sheathColor - this.treeForm.characteristicOne = resultData.characteristicOne - this.treeForm.version = resultData.version - this.treeForm.alternativeNo = resultData.alternativeNo - this.treeForm.alternativeDesc = resultData.alternativeDesc - this.treeForm.bomTypeDb = resultData.bomTypeDb + this.treeForm = resultData this.dataForm.state = resultData.state this.preViewData = [] this.preViewData.push(resultData.tree) - this.tableData = [] - getPartAllStructureExt(this.treeForm).then((res) => { - const result = res.data - if (result.code === 0) { - this.tableData.push(result.data) - } - }) + this.tableData = resultData.bomComponentVOS }) } else { this.initDefaultForm() @@ -395,110 +391,119 @@ } }, dataFormSubmit() { - const mapTree = (org) => { - const haveChildren = - Array.isArray(org.children) && org.children.length > 0 - return { - checked: org.checked, - compId: org.compId, - discNum: org.discNum || 1, - expand: org.expand, - id: org.id, - operationId: org.operationId, - operationName: org.operationName, - operationNo: org.operationNo, - originalQpa: org.originalQpa, - parentId: org.parentId, - partId: org.partId, - partName: org.partName, - partNo: org.partNo, - version: org.version, - alternativeNo: org.alternativeNo, - alternativeDesc: org.alternativeDesc, - qpa: org.qpa, - structureId: org.structureId, - unit: org.unit, - color: org.color, - planningMethod: org.planningMethod, - children: haveChildren ? org.children.map((i) => mapTree(i)) : [] - } + let data = this.treeForm + if(data.id != null){ + updateObj(data).then(res=>{ + this.$message.success("淇濆瓨鎴愬姛") + + }).catch(error=>{ + this.$message.error("淇濆瓨澶辫触") + }) } + // const mapTree = (org) => { + // const haveChildren = + // Array.isArray(org.children) && org.children.length > 0 + // return { + // checked: org.checked, + // compId: org.compId, + // discNum: org.discNum || 1, + // expand: org.expand, + // id: org.id, + // operationId: org.operationId, + // operationName: org.operationName, + // operationNo: org.operationNo, + // originalQpa: org.originalQpa, + // parentId: org.parentId, + // partId: org.partId, + // partName: org.partName, + // partNo: org.partNo, + // version: org.version, + // alternativeNo: org.alternativeNo, + // alternativeDesc: org.alternativeDesc, + // qpa: org.qpa, + // structureId: org.structureId, + // unit: org.unit, + // color: org.color, + // planningMethod: org.planningMethod, + // children: haveChildren ? org.children.map((i) => mapTree(i)) : [] + // } + // } - this.isSubmit = true - this.generateStructure() - if (this.preViewData != null && this.preViewData.length > 0) { - if (this.preViewData.length === 1) { - if (this.dataForm.id) { - var updateObj = {} - updateObj.id = this.dataForm.id - updateObj.partId = this.treeForm.partId - updateObj.number = this.treeForm.number - updateObj.insulationColor = this.treeForm.insulationColor - updateObj.sheathColor = this.treeForm.sheathColor - updateObj.characteristicOne = this.treeForm.characteristicOne - updateObj.version = this.treeForm.version - updateObj.alternativeNo = this.treeForm.alternativeNo - updateObj.alternativeDesc = this.treeForm.alternativeDesc - updateObj.bomTypeDb = this.treeForm.bomTypeDb + // this.isSubmit = true + // this.generateStructure() + // if (this.preViewData != null && this.preViewData.length > 0) { + // if (this.preViewData.length === 1) { + // if (this.dataForm.id) { + // var updateObj = {} + // updateObj.id = this.dataForm.id + // updateObj.partId = this.treeForm.partId + // updateObj.number = this.treeForm.number + // updateObj.insulationColor = this.treeForm.insulationColor + // updateObj.sheathColor = this.treeForm.sheathColor + // updateObj.characteristicOne = this.treeForm.characteristicOne + // updateObj.version = this.treeForm.version + // updateObj.alternativeNo = this.treeForm.alternativeNo + // updateObj.alternativeDesc = this.treeForm.alternativeDesc + // updateObj.bomTypeDb = this.treeForm.bomTypeDb - // const tree = this.preViewData[0]; - const gxqTree = this.preViewData.map((org) => mapTree(org)) - // this.setDefaultDiscNum(gxqTree); - updateObj.tree = gxqTree[0] - putObj(updateObj) - .then((response) => { - var data = response.data - if (data.code === 0) { - this.$message.success('淇敼鎴愬姛') - } else { - this.$message.error('淇敼澶辫触') - } - this.isSubmit = false - }) - .catch((error) => { - this.isSubmit = false - console.log(error) - }) - } else { - var newObj = {} - newObj.id = null - newObj.partId = this.treeForm.partId - newObj.number = this.treeForm.number - newObj.insulationColor = this.treeForm.insulationColor - newObj.sheathColor = this.treeForm.sheathColor - newObj.characteristicOne = this.treeForm.characteristicOne - newObj.version = this.treeForm.version - newObj.alternativeNo = this.treeForm.alternativeNo - newObj.alternativeDesc = this.treeForm.alternativeDesc - newObj.bomTypeDb = this.treeForm.bomTypeDb - const gxqTree = this.preViewData.map((org) => mapTree(org)) + // // const tree = this.preViewData[0]; + // const gxqTree = this.preViewData.map((org) => mapTree(org)) + // // this.setDefaultDiscNum(gxqTree); + // updateObj.tree = gxqTree[0] + // putObj(updateObj) + // .then((response) => { + // var data = response.data + // if (data.code === 0) { + // this.$message.success('淇敼鎴愬姛') + // } else { + // this.$message.error('淇敼澶辫触') + // } + // this.isSubmit = false + // }) + // .catch((error) => { + // this.isSubmit = false + // console.log(error) + // }) + // } else { + // var newObj = {} + // newObj.id = null + // newObj.partId = this.treeForm.partId + // newObj.number = this.treeForm.number + // newObj.insulationColor = this.treeForm.insulationColor + // newObj.sheathColor = this.treeForm.sheathColor + // newObj.characteristicOne = this.treeForm.characteristicOne + // newObj.version = this.treeForm.version + // newObj.alternativeNo = this.treeForm.alternativeNo + // newObj.alternativeDesc = this.treeForm.alternativeDesc + // newObj.bomTypeDb = this.treeForm.bomTypeDb + // const gxqTree = this.preViewData.map((org) => mapTree(org)) - newObj.tree = gxqTree[0] - addObj(newObj) - .then((response) => { - var data = response.data - if (data.code === 0) { - this.dataForm.id = data.data.id - this.treeForm.number = data.data.number - this.$message.success('淇濆瓨鎴愬姛') - } else { - this.$message.error('淇濆瓨澶辫触') - } - this.isSubmit = false - }) - .catch((error) => { - this.isSubmit = false - console.log(error) - }) - } - } else { - this.isSubmit = false - this.$message.error('瀛樺湪澶氫釜鏍硅妭鐐癸紝鏃犳硶杩涜淇濆瓨') - } - } else { - this.isSubmit = false - this.$message.error('璇峰厛鏋勫缓BOM锛屽啀杩涜淇濆瓨') - } + // newObj.tree = gxqTree[0] + // addObj(newObj) + // .then((response) => { + // var data = response.data + // if (data.code === 0) { + // this.dataForm.id = data.data.id + // this.treeForm.number = data.data.number + // this.$message.success('淇濆瓨鎴愬姛') + // } else { + // this.$message.error('淇濆瓨澶辫触') + // } + // this.isSubmit = false + // }) + // .catch((error) => { + // this.isSubmit = false + // console.log(error) + // }) + // } + // } else { + // this.isSubmit = false + // this.$message.error('瀛樺湪澶氫釜鏍硅妭鐐癸紝鏃犳硶杩涜淇濆瓨') + // } + // } else { + // this.isSubmit = false + // this.$message.error('璇峰厛鏋勫缓BOM锛屽啀杩涜淇濆瓨') + // } }, // 鐢熸垚鏈�缁堢殑缁撴瀯 generateStructure() { @@ -924,19 +929,19 @@ } }, bomTypeDbChange(e) { - if (e) { - this.before = this.treeForm.bomTypeDb - } else { - if (this.before !== this.treeForm.bomTypeDb) { - this.treeForm.partId = null - this.treeForm.partNo = null - this.treeForm.partName = null - this.treeForm.version = null - this.treeForm.alternativeNo = null - this.treeForm.alternativeDesc = null - this.tableData = [] - } - } + // if (e) { + // this.before = this.treeForm.bomTypeDb + // } else { + // if (this.before !== this.treeForm.bomTypeDb) { + // this.treeForm.partId = null + // this.treeForm.partNo = null + // this.treeForm.partName = null + // this.treeForm.version = null + // this.treeForm.alternativeNo = null + // this.treeForm.alternativeDesc = null + // this.tableData = [] + // } + // } }, // table璁剧疆琛屾牱寮� tableRowClassName({ row, rowIndex }) { @@ -989,7 +994,7 @@ .completeProductStructure-design { float: left; - width: 48%; + width: 100%; height: 800px; padding: 10px 20px; border: 1px solid #ddd; @@ -1026,7 +1031,7 @@ color: #006eff; } .forbid-row .cell { - color: #c0c4cc; + color: #000; } .tree-select-table th.gutter { -- Gitblit v1.9.3