| | |
| | | height: calc(100% - 20px); |
| | | border-right: 3px solid rgb(245, 247, 251); |
| | | padding: 16px; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .thing .left .custom-tree-node span { |
| | |
| | | :data="towTree" |
| | | ref="tree" |
| | | :props="{ children: 'children', label: 'father' }" |
| | | node-key="id" |
| | | node-key="name" |
| | | default-expand-all |
| | | @node-click="handleNodeClick" |
| | | :key="upIndex" |
| | | highlight-current |
| | | > |
| | | <div class="custom-tree-node" slot-scope="{ node, data }"> |
| | | <span |
| | |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <el-dialog title="编辑记录内容" :visible.sync="upDia" width="500px"> |
| | | <div class="body"> |
| | | <el-row style="line-height: 46px"> |
| | |
| | | <el-select |
| | | v-model="edit.type" |
| | | placeholder="请选择" |
| | | disabled |
| | | style="width: 310px" |
| | | > |
| | | <el-option label="橡胶连接器" :value="0"></el-option> |
| | |
| | | <el-select |
| | | v-model="edit.father" |
| | | style="width: 310px" |
| | | disabled |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in procedure" |
| | | :key="item" |
| | | :label="item" |
| | | disabled |
| | | :value="item" |
| | | > |
| | | </el-option> |
| | |
| | | > |
| | | <el-col :span="16" :offset="1"> |
| | | <el-select |
| | | v-model="AAA.id" |
| | | v-model="cell" |
| | | style="width: 310px" |
| | | disabled |
| | | multiple |
| | | placeholder="请选择" |
| | | > |
| | |
| | | <el-input v-model="edit.name" size="small" clearable></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row style="line-height: 46px"> |
| | | <el-col :span="4" style="font-size: 14px; text-align: right" |
| | | >设备组:</el-col |
| | | > |
| | | <el-col :span="16" :offset="1"> |
| | | <el-input |
| | | <!-- <el-input |
| | | v-model="upData.device_group" |
| | | size="small" |
| | | clearable |
| | | ></el-input> |
| | | ></el-input> --> |
| | | <template> |
| | | <el-select |
| | | v-model="upData.device_group" |
| | | placeholder="请选择" |
| | | style="width: 306px" |
| | | > |
| | | <el-option |
| | | v-for="item in equipment" |
| | | :key="item.index" |
| | | :label="item.father" |
| | | :value="item.father" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitUpData">确 定</el-button> |
| | |
| | | v-model="form.type" |
| | | placeholder="请选择" |
| | | style="width: 480px" |
| | | @change="edittype" |
| | | > |
| | | <el-option label="橡胶连接器" :value="0"></el-option> |
| | | <el-option label="金属连接器" :value="1"></el-option> |
| | |
| | | <template> |
| | | <el-select |
| | | v-model="form.father" |
| | | allow-create |
| | | filterable |
| | | placeholder="请选择" |
| | | style="width: 480px" |
| | | > |
| | |
| | | <template> |
| | | <el-select |
| | | v-model="form.elementId" |
| | | multiple |
| | | placeholder="请选择" |
| | | style="width: 200px" |
| | | > |
| | | <el-option |
| | | v-for="item in element" |
| | | :key="item.value" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | |
| | | upDia: false, |
| | | element: [], |
| | | equipment: [0], |
| | | cell:[], |
| | | AAA: [ |
| | | { |
| | | id: "", |
| | |
| | | ], |
| | | edit: { |
| | | deviceGroup: "", |
| | | elementId: "", |
| | | father: "", |
| | | name: "", |
| | | type: "", |
| | | // children:[], |
| | | children:[], |
| | | }, |
| | | upData: { |
| | | name: "", |
| | |
| | | Neworder() { |
| | | this.dialogVisible = false; |
| | | this.addTechTemp(); |
| | | // this.form = ''; |
| | | this.form = {}; |
| | | }, |
| | | Deleteapi() { |
| | | this.dialogVisible = false; |
| | | this.form = ""; |
| | | this.form = {}; |
| | | }, |
| | | addTechTemp() { |
| | | // console.log(this.$api.url.addTechTemp); |
| | |
| | | |
| | | { |
| | | deviceGroup: this.form.deviceGroup, |
| | | elementId: this.form.elementId, |
| | | elementId: JSON.stringify(this.form.elementId).replace("[","").replace("]",""), |
| | | father: this.form.father, |
| | | name: this.form.name, |
| | | type: this.form.type, |
| | |
| | | |
| | | //工序 |
| | | chooseTech() { |
| | | this.$axios.get(this.$api.url.chooseTech).then((res) => { |
| | | this.procedure = res.data; |
| | | console.log(this.procedure); |
| | | }); |
| | | this.$axios.get(this.$api.url.chooseTech,{ |
| | | params:{ |
| | | type:this.typeselect |
| | | } |
| | | }).then(res =>{ |
| | | console.log(res); |
| | | this.procedure = res.data |
| | | }) |
| | | }, |
| | | edittype(val) { |
| | | this.typeselect = val |
| | | this.chooseTech() |
| | | }, |
| | | //批量删除 |
| | | delAllTech() { |
| | | console.log(this.delete); |
| | |
| | | }, |
| | | //编辑 |
| | | writeTechById() { |
| | | // console.log(JSON.stringify(this.edit.children)); |
| | | // console.log(JSON.stringify(this.edit.children)); |
| | | // var str = '' |
| | | // this.edit.children.forEach((a,ai)=>{ |
| | | // str += a.id |
| | | // if(ai!=this.edit.children.length-1) str+=',' |
| | | // }) |
| | | this.$axios |
| | | .post( |
| | | this.$api.url.writeTechById, |
| | | { |
| | | params: { |
| | | id: this.upData.id, |
| | | technologyTemplateDto: { |
| | | this.$api.url.writeTechById + `?id=${this.upData.id}`, |
| | | { |
| | | deviceGroup: this.upData.device_group, |
| | | elementId: this.edit.elementId, |
| | | elementId:this.cell.join(','), |
| | | father: this.edit.father, |
| | | name: this.edit.name, |
| | | type: this.edit.type, |
| | | }, |
| | | // id:this.upData.id, |
| | | }, |
| | | type: this.edit.type |
| | | }, |
| | | { |
| | | headers: { |
| | |
| | | } |
| | | ) |
| | | .then((res) => { |
| | | console.log(res); |
| | | this.selectAllTechNam() |
| | | }); |
| | | }, |
| | | |
| | | query(val) { |
| | | this.selectAllTechTem(); |
| | | }, |
| | | selectAllTechTem() { |
| | | selectAllTechTem() { |
| | | this.$axios |
| | | .get(this.$api.url.selectAllTechTem, { |
| | | params: { type: this.typeselect, message: this.search.technology }, |
| | | }) |
| | | .then((res) => { |
| | | this.towTree = res.data; |
| | | console.log(this.towTree); |
| | | console.log(this.towTree); |
| | | this.$nextTick(() => { |
| | | this.$refs.tree.setCurrentKey(this.towTree[0].children[0].name) // 默认选中节点第一个 |
| | | }) |
| | | let one=this.towTree.filter(item=>{ |
| | | return item.children.length>0 |
| | | })[0] |
| | |
| | | }) |
| | | .then((res) => { |
| | | this.edit = res.data[0]; |
| | | this.AAA = res.data[0].children; |
| | | console.log(this.edit); |
| | | console.log(this.AAA); |
| | | // this.edit.forEach(el => { |
| | | // // el.children.forEach(ele =>{ |
| | | // // this.AAA.push(ele) |
| | | // console.log(el); |
| | | // }) |
| | | // console.log(this.AAA.id); |
| | | // }) |
| | | // console.log(this.edit); |
| | | console.log(this.edit.children); |
| | | this.cell = this.edit.children.map(el => { |
| | | return el.id |
| | | }) |
| | | // this.cell = this.cell.join(',') |
| | | // this.cell = nn |
| | | // console.log(this.cell); |
| | | |
| | | }); |
| | | }, |
| | | //编辑内容 |
| | | upContent(ob) { |
| | | this.upData = ob; |
| | | this.selecTechById(); |
| | | this.selecTechById(); |
| | | console.log(this.upData); |
| | | this.selecTechById() |
| | | this.upDia = true; |
| | | }, |
| | | |
| | |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | </script> |