王震
2023-09-04 785fd3a05f38d3b3f98698497294866447880a28
src/components/view/technology.vue
@@ -120,7 +120,7 @@
      </div>
      <div class="choose">
         <span>类型:</span>
         <el-select v-model="search.type" size="small" placeholder="请选择" style="width: 224px;margin-right: 30px;">
         <el-select v-model="search.type" size="small" placeholder="请选择" @change="type" style="width: 224px;margin-right: 30px;">
            <el-option label="橡胶连接器" :value="0"></el-option>
            <el-option label="金属连接器" :value="1"></el-option>
            <el-option label="湿插拔电连接器" :value="2"></el-option>
@@ -134,13 +134,17 @@
         <el-select v-model="search.name" size="small" placeholder="请选择" style="width: 224px;margin-right: 30px;">
            <el-option v-for="(a, ai) in product" key="ai" :label="a.name" :value="a.id"></el-option>
         </el-select> -->
         <el-button size="mini" @click="clean()"><span>重 置</span></el-button>
         <!-- <el-button size="mini" @click="clean()"><span>重 置</span></el-button>
         <el-button size="mini" type="primary" style="background: #004EA2;"><span>查
               询</span></el-button>
               询</span></el-button> -->
      </div>
      <div class="thing">
         <div class="left">
            <el-input v-model="search.technology" suffix-icon="el-icon-search" placeholder="请输入搜索内容" size="small" clearable @input="(val)=>$refs.tree.filter(val)"></el-input>
            <el-input v-model="search.technology" suffix-icon="el-icon-search"
            placeholder="请输入搜索内容" size="small"
            clearable @input="query">
            <!-- clearable @input="(val)=>$refs.tree.filter(val)"> -->
            </el-input>
            <el-tree 
            :data="towTree" ref="tree" 
            :props="{children: 'children',label: 'father'}" 
@@ -170,7 +174,7 @@
               <el-table-column label="操作" width="130">
                  <template slot-scope="scope">
                     <span class="table_do" @click="upContent(scope.row)">编辑&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                     <span class="table_do" @click="deleteRow(scope.$index, tableData)">删除</span>
                     <span class="table_do" @click="deleteRow(scope.$index, scope.row)">删除</span>
                  </template>
               </el-table-column>
            </el-table>
@@ -278,7 +282,7 @@
            <el-col :span="10">
            <el-form-item label="元件">
               <template>
                        <el-select v-model="form.elementId" placeholder="请选择类型" style="width: 200px;" >
                        <el-select v-model="form.elementId" placeholder="请选择类型"  style="width: 200px;" >
                            <el-option
                            v-for="item in element"
                            :key="item.value"
@@ -300,7 +304,7 @@
         </div>
         <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="Neworder">确 定</el-button>
            <el-button @click="dialogVisible = false">取 消</el-button>
            <el-button @click="Deleteapi">取 消</el-button>
         </span>
      </el-dialog>
      <!-- 工艺路线修改 -->
@@ -387,11 +391,12 @@
            search:{
               type:'',
            },
            delete:[],
            treetrunk:[],
            process: [],
            product: [],
            procedure:[],
            checkTreeNode:'',
            checkTreeNode:'下料',
            towTree:[],
            value:"",
            modifyevent:false,
@@ -403,6 +408,7 @@
            upDia: false,
            element:[],
            equipment:[0],
            edit:[],
            upData: {
               name:'',
               device_group:'',
@@ -410,6 +416,7 @@
               father:'',
               type:'',
            },
            typeselect:0,
            newdata:{
               type:''
            }
@@ -422,10 +429,21 @@
         this.chooseElement()
      },
      methods: {
         type(val){
            this.typeselect = val
            console.log(this.typeselect);
            this.selectAllTechTem()
         },
         
         Neworder() {
            this.dialogVisible = false
            this.addTechTemp()
            this.selectAllTechNam()
            // this.form = '';
         },
         Deleteapi() {
            this.dialogVisible = false
             this.form = '';
         },
         addTechTemp() {
            // console.log(this.$api.url.addTechTemp);
@@ -470,30 +488,48 @@
               console.log(this.procedure);
            })
         },
         //批量删除
         delAllTech() {
            console.log(this.delete);
            this.$axios.post(this.$api.url.delAllTech,{
                  ids:this.delete
            })
         },
         //删除
         delTechById() {
            console.log(this.$api.url.delTechById,this.upData.id);
            this.$axios.post(this.$api.url.delTechById,{
               id:this.upData.id
                  id:this.upData.id
            })
         },
         //编辑
         writeTechById() {
            this.$axios.post(this.$api.url.writeTechById,{
               deviceGroup:this.upData.device_group,
               elementId:this.upData.ele[0],
               father:this.upData.father,
               name:this.upData.name,
               type:this.upData.type,
               // id:this.this.upData.id,
               params:{
               id:this.upData.id,
               technologyTemplateDto:{
                  deviceGroup:this.upData.device_group,
                  elementId:this.upData.ele[0],
                  father:this.upData.father,
                  name:this.upData.name,
                  type:this.upData.type
               }
               // id:this.upData.id,
            }
            }, {
               headers: {
                      "Content-Type": "application/json"
                    }
            })
         },
         query(val){
            this.selectAllTechTem()
         },
         selectAllTechTem() {
            console.log(this.typeselect,'222');
         this.$axios.get(this.$api.url.selectAllTechTem,{
            params:{type: 0}
            params:{type: this.typeselect,message:this.search.technology}
         }).then(res => {
            // let list = res.data;
            // list.forEach(i => {
@@ -572,13 +608,46 @@
                  }
               }
            })
            // console.log(this.selects);
            let cc = this.selects.map(el => {
               // console.log(el.id);
               return el.id
            })
            // console.log(this.delete);
            this.delete = cc.join(',')
            console.log(this.delete);
            this.delAllTech()
            // this.delete =
            // console.log('444');
            this.$message.success('删除完成')
         },
         deleteRow(index, rows) {
            rows.splice(index, 1);
            // console.log(rows);
            // rows.splice(index, 1);
            this.tableData.splice(index,1)
            this.upData.id = rows.id
            this.delTechById()
         },
         selecTechById() {
            this.$axios.get(this.$api.url.selecTechById,{
               params:{
               id:this.upData.id,
               }
            }
            // , {
            //    headers: {
                //       "Content-Type": "application/json"
                 //    }
            // }
            ).then(res =>{
               this.edit = res.data
               console.log(this.edit);
            })
         },
         //编辑内容
         upContent(ob) {
            this.upData = ob
            this.selecTechById()
            console.log(this.upData);
            this.upDia = true
         },
@@ -593,7 +662,7 @@
            //    }
            // })
               this.writeTechById()
            this.$message.success('修改成功')
            this.upIndex++
            this.upDia = false