From c7ccbc6510a9350e0a0a5a39a84f46c382d080b3 Mon Sep 17 00:00:00 2001 From: Fixiaobai <fixiaobai@163.com> Date: 星期五, 15 九月 2023 15:00:26 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.0.22:9001/r/mom-before --- src/components/view/mbom.vue | 130 +++++++++++++++++++++++------------------- 1 files changed, 71 insertions(+), 59 deletions(-) diff --git a/src/components/view/mbom.vue b/src/components/view/mbom.vue index b608179..b7a850d 100644 --- a/src/components/view/mbom.vue +++ b/src/components/view/mbom.vue @@ -141,9 +141,9 @@ </div> <!-- <el-dialog title="缂栬緫璁板綍鍐呭" :visible.sync="upDia" width="500px"> <div class="body"> - + </div> - + </el-dialog> --> </div> </template> @@ -158,8 +158,8 @@ list: [], process: {}, // handleClose:[], - checkTreeNode: { - id: 2, + checkTreeNode:{ + id:'', }, tableData: [], tableapi: [{ @@ -219,22 +219,17 @@ } }) }, - addMbom(data) { - this.$axios.post(this.$api.url.addMbom, data - // { - // name:this.tableapi.name, - // qualityTraceability:this.tableapi.qualityTraceability, - // specifications:this.tableapi.specifications, - // supplier:this.tableapi.supplier, - // techTemId:this.craftapi.id, - // unit:this.tableapi.unit, - // } - , { - headers: { - "Content-Type": "application/json" - } - }).then(res => { - console.log(res); + addMbom(data,cc) { + this.$axios.post(this.$api.url.addMbom,{ + mbomModelDto2List:data, + techTemId:cc, + + }, { + headers: { + "Content-Type": "application/json" + } + }).then(res =>{ + // console.log(res); this.$message.success('娣诲姞瀹屾垚') this.selectAllMbom() this.tableapi = [{}] @@ -261,23 +256,43 @@ }, //宸﹁竟 selectAllleft() { - this.$axios.get(this.$api.url.selectAllleft, { - params: { - type: this.typeselect, - message: this.search.technology - } - }).then(res => { - this.list = res.data; - console.log(this.list); - this.selectDataList() - this.$nextTick(() => { - this.$refs.tree.setCurrentKey(this.list[0].children[0].name) // 榛樿閫変腑鑺傜偣绗竴涓� - }) - }, { - headers: { - "Content-Type": "application/json" - } - }) + this.$axios.get(this.$api.url.selectAllleft,{ + params:{type:this.typeselect, + message:this.search.technology + } + }).then(res => { + this.list = res.data; + console.log(this.list); + this.selectDataList() + this.$nextTick(() => { + this.$refs.tree.setCurrentKey(this.list[0].children[0].name) // 榛樿閫変腑鑺傜偣绗竴涓� + }) + let one=this.list.filter(item=>{ + return item.children.length>0 + })[0] + console.log(one); + let name=one.children[0].id + console.log(name); + this.checkTreeNode.id = name + this.selectAllMbomStart(name) + this.selectDataList(); + }, { + headers: { + "Content-Type": "application/json" + } + }) + }, + selectAllMbomStart(name) { + this.$axios.get(this.$api.url.selectAllMbom,{ + params:{id:name} + }).then(res => { + this.tableData = res.data; + console.log(this.tableData); + }, { + headers: { + "Content-Type": "application/json" + } + }) }, //鍙宠竟 selectAllMbom() { @@ -294,8 +309,9 @@ } }) }, - handleNodeClick(data) { - this.checkTreeNode = data + handleNodeClick(data){ + this.checkTreeNode = data + console.log(data); console.log(this.checkTreeNode.id); this.selectAllMbom() }, @@ -306,28 +322,24 @@ }) .catch(_ => {}); }, - event() { - this.dialogVisible = true + //鏂板 + event(){ + this.dialogVisible = true this.chooseTechFath() - }, - Addrow() { - if (this.tableapi == undefined) { - this.tableapi = new Array(); - } - let obj = []; - - this.tableapi.push(obj); + }, + //娣诲姞琛� + Addrow() { + if (this.tableapi == undefined) { + this.tableapi = new Array(); + } + let obj = {}; + this.tableapi.push(obj); }, skipshow() { - console.log('666'); - let data = this.tableapi.at(-1) - // this.addMbom() - data.techTemId = this.search.craft - // console.log(this.search.craft); - // console.log(data); - - this.addMbom(data) - + // let data = this.tableapi.at(-1) + // console.log(this.tableapi); + let cc = this.search.craft + this.addMbom(this.tableapi,cc) this.dialogVisible = false }, //delAllMbom 鎵归噺鍒犻櫎 @@ -485,4 +497,4 @@ height: 30px; border-radius: 2px; } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.3