王震
2023-09-15 5c76f242b20281b51d01ce2266e8beaafe8ae5a6
src/components/view/self-inspection.vue
@@ -141,7 +141,7 @@
      <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-tree :data="list" ref="tree" :props="{children: 'children',label: 'name'}" node-key="id" default-expand-all
            <el-tree :data="list" ref="tree" :props="{children: 'children',label: 'name'}" node-key="name" default-expand-all
               @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen" @node-collapse="nodeClose" :filter-node-method="filterNode"
               :key="upIndex">
               <div class="custom-tree-node" slot-scope="{ node, data }">
@@ -216,7 +216,7 @@
            <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="类型">
               <template>
                        <el-select v-model="form.value" placeholder="请选择" style="width: 480px;">
                        <el-select v-model="form.value" placeholder="请选择" @change="edittype" style="width: 480px;">
                     <el-option label="橡胶连接器" :value="0"></el-option>
                     <el-option label="金属连接器" :value="1"></el-option>
                     <el-option label="湿插拔电连接器" :value="2"></el-option>
@@ -382,7 +382,7 @@
            product: [],
            list: [],
            checkTreeNode: {
               id:1,
               id:'',
            },
            tableData: [],
            upIndex: 0,
@@ -442,13 +442,21 @@
               ids:this.delete
            })
         },
         //编辑
         writeRecordById() {
         },
         //新增
         add() {
            this.dialogVisible = false
            if (this.form.standard[0] !== "<" && this.form.standard[0] !== "<=" && this.form.standard[0] !== ">"){
            this.$message({
                  message: '输入的第一个字符必须是 '<' 或 '<='!',
                  type: 'warning'
               });
               return;
            }
            this.addSelfcheck()
            this.dialogVisible = false
         },
         addSelfcheck() {
                this.$axios.post(this.$api.url.addSelfcheck,{
@@ -489,6 +497,11 @@
                console.log(this.typeselect);
                this.selectAllleft()
            },
         edittype(val) {
            // this.typeselect = ''
            this.typeselect = val
            this.chooseTechFath()
         },
            //主体左
            selectAllleft() {
         this.$axios.get(this.$api.url.selectAllleft,{
@@ -497,9 +510,33 @@
            this.list = res.data;
                console.log(this.list);
            this.selectDataList()
            this.$nextTick(() => {
            this.$refs.tree.setCurrentKey(this.list[0].children[0].name) // 默认选中节点第一个
         })
         console.log("===========");
         console.log(this.list);
         let one=this.list.filter(item=>{
         return item.children.length>0
         })[0]
         console.log(one);
         let id =one.children[0].id
         this.checkTreeNode.id = id
         console.log(id);
         this.selectAllSelfStart(id)
         this.selectDataList();
         console.log("===========");
         })
         },
         //selectAllSelf   checkTreeNode
         //默认
         selectAllSelfStart(id) {
         this.$axios.get(this.$api.url.selectAllSelf,{
            params:{id:id}
         }).then(res => {
            this.tableData = res.data;
                console.log(this.tableData);
         })
         },
         //右
         selectAllSelf() {
         this.$axios.get(this.$api.url.selectAllSelf,{
            params:{id:this.checkTreeNode.id}