From 2c71f29aded2e3885e210d82dc0d74b834500163 Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期三, 06 九月 2023 14:13:13 +0800
Subject: [PATCH] 基础数据

---
 src/components/view/mbom.vue |   71 ++++++++++++++++++++++++++---------
 1 files changed, 53 insertions(+), 18 deletions(-)

diff --git a/src/components/view/mbom.vue b/src/components/view/mbom.vue
index 985a9fd..155fb78 100644
--- a/src/components/view/mbom.vue
+++ b/src/components/view/mbom.vue
@@ -77,7 +77,7 @@
 						label="渚涘簲鍟嗗悕绉�"
 						width="180">
 						<template slot-scope="scope">
-							<el-input v-model="scope.row.input" placeholder="" ></el-input>
+							<el-input v-model="scope.row.supplier" placeholder="" ></el-input>
 						</template>
 					</el-table-column>
 					<el-table-column
@@ -85,7 +85,7 @@
 						label="璐ㄩ噺杩芥函鍙�"
 						width="180">
 						<template slot-scope="scope">
-							<el-input v-model="scope.row.input" placeholder="" ></el-input>
+							<el-input v-model="scope.row.qualityTraceability" placeholder="" ></el-input>
 						</template>
 					</el-table-column>
 					<el-table-column
@@ -99,7 +99,7 @@
 						prop="address"
 						label="瑙勬牸鍨嬪彿">
 						<template slot-scope="scope">
-							<el-input v-model="scope.row.input" placeholder="" ></el-input>
+							<el-input v-model="scope.row.specifications" placeholder="" ></el-input>
 						</template>
 					</el-table-column>
 					<el-table-column
@@ -186,10 +186,16 @@
 				process:{},
 				// handleClose:[],
 				checkTreeNode:{
-					name:'鍓ョ紗'
+					id:2,
 				},
 				tableData:[],
-				tableapi:[],
+				tableapi:[{
+					supplier:'',
+					qualityTraceability:'',
+					name:'',
+					specifications:'',
+					unit:'',
+					}],
 				search:{
 					type:'',
 					work:'',
@@ -201,7 +207,6 @@
 				form:{},
 				dialogVisible:false,
 				typeselect:0,
-                tableData: [],
 				input:'',
 				craftapi:[],
             }
@@ -229,14 +234,37 @@
               		}
             })
 			},
-			//鍒犻櫎
-			material() {
-				this.$axios.post(this.$api.url.material,{
-					id:this.upData.id
-				}, {
+			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);
+					this.$message.success('娣诲姞瀹屾垚')
+					this.selectAllMbom()
+					this.tableapi = [{}]
+				})
+			},
+			//鍒犻櫎
+			material(index) {
+				console.log(this.upData.id);
+				this.$axios.post(this.$api.url.material,{
+					id:this.upData.id
+				}).then(res =>{
+					this.$message.success(res.message)
+					this.tableData.splice(index,1)
+
+					// console.log(res);
 				})
 			},
 			TYpe(val) {
@@ -262,6 +290,7 @@
 				params:{id:this.checkTreeNode.id}
 			}).then(res => {
 				this.tableData = res.data;
+				console.log(this.tableData);
 			}, {
 				headers: {
                 		"Content-Type": "application/json"
@@ -285,17 +314,22 @@
 				this.chooseTechFath()
             },
 			 Addrow() {
-			if (this.tableData == undefined) {
-				this.tableData = new Array();
+			if (this.tableapi == undefined) {
+				this.tableapi = new Array();
 			}
 			let obj = [];
 			
-			this.tableData.push(obj);
+			this.tableapi.push(obj);
 			},
 			skipshow(){
 				console.log('666');
-				const data = this.tableData.at(-1)
-				console.log(data);
+				let data = this.tableapi.at(-1)
+				// this.addMbom()
+				data.techTemId = this.search.craft
+				// console.log(this.search.craft);
+				// console.log(data);
+
+				this.addMbom(data)
 				
 				this.dialogVisible = false
 			},
@@ -315,9 +349,10 @@
 			},
 			deleteRow(index, rows) {
 				console.log(rows);
-				this.tableData.splice(index,1)
+				// this.tableData.splice(index,1)
 				this.upData.id = rows.id
-				this.material()
+				console.log(this.upData);
+				this.material(index)
 			},
 
         }

--
Gitblit v1.9.3