From e0ac51ff9a3369e118c449fcc8cefca4302b41b6 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期六, 18 十一月 2023 17:19:52 +0800
Subject: [PATCH] modified: src/api/product/personboard.js modified: src/views/product/workbench/batchproductout-form-new.vue
---
src/views/technology/completeproductstructure/completeproductstructure-form.vue | 319 +++++++++++++++++++++++++++++-----------------------
1 files changed, 176 insertions(+), 143 deletions(-)
diff --git a/src/views/technology/completeproductstructure/completeproductstructure-form.vue b/src/views/technology/completeproductstructure/completeproductstructure-form.vue
index 760d492..74b5c07 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>
@@ -117,8 +117,26 @@
</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 +173,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 +218,7 @@
<el-table-column prop="operationName" label="娑堣�楀伐搴�">
</el-table-column>
</el-table>
- </div>
+ </div> -->
</div>
</div>
<productStructureDialog
@@ -221,7 +239,8 @@
getPartAllStructureExt,
addObj,
getObj,
- putObj
+ putObj,
+ updateObj
} from '@/api/technology/completeproductstructure'
import { remote } from '@/api/admin/dict'
import productStructureDialog from '@/views/common/productstructure.vue'
@@ -322,27 +341,32 @@
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
+ console.log(resultData)
+ this.treeForm = resultData
+ // this.treeForm.id = resultData.id
+ // 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.state = resultData.state
+ // this.treeForm.remark = resultData.remark
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 +419,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 +957,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 +1022,7 @@
.completeProductStructure-design {
float: left;
- width: 48%;
+ width: 100%;
height: 800px;
padding: 10px 20px;
border: 1px solid #ddd;
@@ -1026,7 +1059,7 @@
color: #006eff;
}
.forbid-row .cell {
- color: #c0c4cc;
+ color: #000;
}
.tree-select-table th.gutter {
--
Gitblit v1.9.3