王震
2023-09-06 2c71f29aded2e3885e210d82dc0d74b834500163
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)
         },
        }