From 18d02e7db16cf5a21f8d5a152dd7ab27212d8eb6 Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期一, 23 十月 2023 16:44:27 +0800 Subject: [PATCH] modified: src/views/admin/menu/index.vue modified: src/views/admin/menu/menu-form.vue modified: src/views/plan/customerorder/customerorder-form.vue modified: src/views/technology/completeproductstructure/completeproductstructure-form.vue modified: src/views/technology/completeproductstructure/index.vue modified: src/views/technology/document/document-form.vue modified: src/views/technology/operation/operation-form.vue modified: src/views/technology/structure/index.vue modified: vue.config.js --- src/views/technology/completeproductstructure/completeproductstructure-form.vue | 284 ++++++++++++++++++++++++++++++-------------------------- 1 files changed, 151 insertions(+), 133 deletions(-) diff --git a/src/views/technology/completeproductstructure/completeproductstructure-form.vue b/src/views/technology/completeproductstructure/completeproductstructure-form.vue index 760d492..d0bdc16 100644 --- a/src/views/technology/completeproductstructure/completeproductstructure-form.vue +++ b/src/views/technology/completeproductstructure/completeproductstructure-form.vue @@ -1,5 +1,5 @@ <template> - <div style="height: 100%"> + <div> <div class="page-header"> <div class="header-left"> <a @click="$router.go(-1)"><i class="icon-btn-back"></i></a> @@ -30,12 +30,12 @@ </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> @@ -117,8 +117,25 @@ </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="580" + 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> + <!-- <el-table class="tree-select-table" ref="tableRef" :data="tableData" @@ -155,10 +172,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 +217,7 @@ <el-table-column prop="operationName" label="娑堣�楀伐搴�"> </el-table-column> </el-table> - </div> + </div> --> </div> </div> <productStructureDialog @@ -336,13 +353,13 @@ 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 + // getPartAllStructureExt(this.treeForm).then((res) => { + // const result = res.data + // if (result.code === 0) { + // this.tableData.push(result.data) + // } + // }) }) } else { this.initDefaultForm() @@ -395,110 +412,111 @@ } }, 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)) : [] - } - } + console.log(this.treeForm) + // 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 +942,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,8 +1007,8 @@ .completeProductStructure-design { float: left; - width: 48%; - height: 800px; + width: 100%; + height: 650px; padding: 10px 20px; border: 1px solid #ddd; background-color: #fff; @@ -1026,7 +1044,7 @@ color: #006eff; } .forbid-row .cell { - color: #c0c4cc; + color: #000; } .tree-select-table th.gutter { -- Gitblit v1.9.3