zouyu
2023-09-13 27dd70096d181051200ec5febf11c99d1940f835
src/components/view/mbom.vue
@@ -159,7 +159,7 @@
            process: {},
            // handleClose:[],
            checkTreeNode: {
               id: 2,
               id:'',
            },
            tableData: [],
            tableapi: [{
@@ -220,16 +220,18 @@
            })
         },
         addMbom(data) {
            this.$axios.post(this.$api.url.addMbom, data
               // {
            this.$axios.post(this.$api.url.addMbom,data,{
               // params:{
               //    techTemId:this.craftapi.id,
               //    mbomModelDto2List:[{
               // 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"
                  }
@@ -262,8 +264,7 @@
         //左边
         selectAllleft() {
            this.$axios.get(this.$api.url.selectAllleft, {
               params: {
                  type: this.typeselect,
            params:{type:this.typeselect,
                  message: this.search.technology
               }
            }).then(res => {
@@ -273,6 +274,26 @@
               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.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"
@@ -296,6 +317,7 @@
         },
         handleNodeClick(data) {
            this.checkTreeNode = data
            console.log(data);
            console.log(this.checkTreeNode.id);
            this.selectAllMbom()
         },
@@ -306,28 +328,24 @@
               })
               .catch(_ => {});
         },
         //新增
         event() {
            this.dialogVisible = true
            this.chooseTechFath()
         },
         //添加行
         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)
            this.dialogVisible = false
         },
         //delAllMbom 批量删除