| | |
| | | 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="father" |
| | | default-expand-all |
| | | @node-click="handleNodeClick" |
| | | style="height: 500px;overflow-y: auto;" |
| | | :key="upIndex" |
| | | highlight-current |
| | | > |
| | |
| | | : 'el-icon-tickets' |
| | | }`" |
| | | ></i> |
| | | {{ data.name }}{{ data.father }}</span |
| | | {{ data.father }}</span |
| | | > |
| | | <!-- <el-button type="text" size="mini" @click.stop="remove(node, data)"> |
| | | <i class="el-icon-delete"></i> |
| | |
| | | <el-table-column prop="name" label="工艺名称"> </el-table-column> |
| | | <el-table-column prop="device_group" label="设备组"> |
| | | </el-table-column> |
| | | <el-table-column label="元件"> |
| | | <template slot-scope="scope"> |
| | | <el-tag type="info" style="margin-right: 10px;" v-for="(a, index) in JSON.parse(scope.row.element)" :key="index">{{ a }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="130"> |
| | | <template slot-scope="scope"> |
| | | <span class="table_do" @click="upContent(scope.row)" |
| | |
| | | </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 |
| | | > |
| | | <el-col :span="16" :offset="1"> |
| | | <el-select |
| | | v-model="AAA.id" |
| | | <el-input v-model="cell" |
| | | placeholder="请输入元件名称" |
| | | style="width: 200px"> |
| | | </el-input> |
| | | <!-- <el-select |
| | | v-model="cell" |
| | | style="width: 310px" |
| | | disabled |
| | | multiple |
| | | placeholder="请选择" |
| | | > |
| | |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-select> --> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 46px"> |
| | |
| | | <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> |
| | |
| | | v-model="form.father" |
| | | allow-create |
| | | filterable |
| | | @create="" |
| | | |
| | | placeholder="请选择" |
| | | style="width: 480px" |
| | | > |
| | |
| | | <el-col :span="10"> |
| | | <el-form-item label="元件"> |
| | | <template> |
| | | <el-select |
| | | <el-input v-model="form.elementId" placeholder="请输入元件名称" style="width: 200px"></el-input> |
| | | <!-- <el-select |
| | | v-model="form.elementId" |
| | | multiple |
| | | placeholder="请选择" |
| | |
| | | > |
| | | <el-option |
| | | v-for="item in element" |
| | | :key="item.value" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-select> --> |
| | | </template> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | elementId: "", |
| | | deviceGroup: "", |
| | | }, |
| | | search: { |
| | | type: "", |
| | | }, |
| | | // search: { |
| | | // type: "", |
| | | // }, |
| | | delete: [], |
| | | treetrunk: [], |
| | | process: [], |
| | |
| | | upDia: false, |
| | | element: [], |
| | | equipment: [0], |
| | | cell:[], |
| | | AAA: [ |
| | | { |
| | | id: "", |
| | |
| | | ], |
| | | edit: { |
| | | deviceGroup: "", |
| | | elementId: "", |
| | | father: "", |
| | | name: "", |
| | | type: "", |
| | | // children:[], |
| | | children:[], |
| | | }, |
| | | upData: { |
| | | name: "", |
| | |
| | | type: "", |
| | | }, |
| | | upIndex: 0, |
| | | treeList:[] |
| | | treeList:[], |
| | | elerow:{}, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.selectAllTechTem(); |
| | | this.chooseTech(); |
| | | this.chooseDevGroup(); |
| | | this.chooseElement(); |
| | | |
| | | this.selectAllTechNam(); |
| | | console.log(this.treeList); |
| | | |
| | | }, |
| | | methods: { |
| | | selectDataList() { |
| | |
| | | }, |
| | | Deleteapi() { |
| | | this.dialogVisible = false; |
| | | this.form = ""; |
| | | this.form = {}; |
| | | }, |
| | | addTechTemp() { |
| | | // console.log(this.$api.url.addTechTemp); |
| | | console.log(this.form.elementId.split(',')); |
| | | |
| | | this.$axios |
| | | .post( |
| | | this.$api.url.addTechTemp, |
| | | |
| | | { |
| | | deviceGroup: this.form.deviceGroup, |
| | | elementId: JSON.stringify(this.form.elementId).replace("[","").replace("]",""), |
| | | // elementId: JSON.stringify(this.form.elementId).replace("[","").replace("]",""), |
| | | // element:this.form.elementId.split(','), |
| | | element:JSON.stringify(this.form.elementId.split(',')), |
| | | father: this.form.father, |
| | | name: this.form.name, |
| | | type: this.form.type, |
| | |
| | | ) |
| | | .then((res) => { |
| | | console.log(res); |
| | | this.selectAllTechNam(); |
| | | /* this.selectAllTechNam(); */ |
| | | this.form = {}; |
| | | this.$parent.removeAllTab() |
| | | }); |
| | | }, |
| | | |
| | | //元件 |
| | | chooseElement() { |
| | | this.$axios.get(this.$api.url.chooseElement).then((res) => { |
| | | this.element = res.data; |
| | | console.log(this.element); |
| | | }); |
| | | }, |
| | | // chooseElement() { |
| | | // this.$axios.get(this.$api.url.chooseElement).then((res) => { |
| | | // this.element = res.data; |
| | | // console.log(this.element); |
| | | // }); |
| | | // }, |
| | | //设备 |
| | | chooseDevGroup() { |
| | | this.$axios.get(this.$api.url.chooseDevGroup).then((res) => { |
| | |
| | | // console.log(this.equipment); |
| | | }); |
| | | }, |
| | | |
| | | // onTypeBlur(e) { |
| | | // if (e.target.value) { |
| | | // this.type = e.target.value;}}, |
| | | //工序 |
| | | 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); |
| | | this.$axios.post(this.$api.url.delAllTech, { |
| | | ids: this.delete, |
| | | }).then(res=>{ |
| | | this.$parent.removeAllTab() |
| | | }); |
| | | }, |
| | | //删除 |
| | |
| | | console.log(this.$api.url.delTechById, this.upData.id); |
| | | this.$axios.post(this.$api.url.delTechById, { |
| | | id: this.upData.id, |
| | | }).then(res=>{ |
| | | this.$parent.removeAllTab() |
| | | }); |
| | | }, |
| | | //编辑 |
| | | 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, |
| | | element:JSON.stringify(this.cell.split(',')), |
| | | // element:JSON.stringify(this.form.elementId.split(',')) |
| | | 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(), */ |
| | | this.$parent.removeAllTab() |
| | | }); |
| | | }, |
| | | |
| | | 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); |
| | | let one=this.towTree.filter(item=>{ |
| | | return item.children.length>0 |
| | | })[0] |
| | | let name=one.children[0].name |
| | | this.selectAllTechNamStart(name) |
| | | this.selectDataList(); |
| | | console.log(this.towTree); |
| | | this.$nextTick(() => { |
| | | this.$refs.tree.setCurrentKey(this.towTree[0].father) // 默认选中节点第一个 |
| | | }) |
| | | // let one=this.towTree.filter(item=>{ |
| | | // return item.children.length>0 |
| | | // })[0] |
| | | // let name=one.children[0].name |
| | | // this.checkTreeNode.name=name |
| | | // this.selectAllTechNamStart(name) |
| | | // this.selectDataList(); |
| | | let one=this.towTree[0] |
| | | let name =one.father |
| | | this.checkTreeNode.father = name |
| | | console.log(name); |
| | | this.selectAllTechNamStart(name) |
| | | }); |
| | | }, |
| | | handleNodeClick(data, node) { |
| | | console.log(data); |
| | | this.checkTreeNode = data; |
| | | this.treetrunk = node; |
| | | console.log(this.treetrunk); |
| | | console.log(this.checkTreeNode); |
| | | // this.treetrunk = node; |
| | | // console.log(this.treetrunk); |
| | | // console.log(this.checkTreeNode); |
| | | this.selectAllTechNam(); |
| | | |
| | | }, |
| | | selectAllTechNam() { |
| | | this.$axios |
| | | .get(this.$api.url.selectAllTechNam, { |
| | | params: { father: this.checkTreeNode.name }, |
| | | params: { father: this.checkTreeNode.father }, |
| | | }) |
| | | .then((res) => { |
| | | this.tableData = res.data; |
| | | |
| | | let kk =this.tableData.map(el =>{ |
| | | console.log(el); |
| | | return el.element |
| | | })[0] |
| | | // console.log(kk.replace('[','').replace(']','') ); |
| | | // console.log(kk.split(',')); |
| | | this.elerow = kk |
| | | |
| | | }); |
| | | }, |
| | | selectAllTechNamStart(name) { |
| | |
| | | }, |
| | | addend() { |
| | | this.dialogVisible = true; |
| | | this.chooseTech(); |
| | | this.chooseDevGroup(); |
| | | // this.chooseElement(); |
| | | }, |
| | | modify() { |
| | | this.modifyevent = true; |
| | |
| | | }) |
| | | .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); |
| | | this.cell = this.edit.element |
| | | console.log(this.cell); |
| | | let cc = JSON.parse(this.cell).join(",") |
| | | console.log(cc); |
| | | this.cell = cc |
| | | console.log(this.cell); |
| | | // this.cell = this.edit.children.map(el => { |
| | | // return el.id |
| | | // }) |
| | | // this.cell = this.cell.join(',') |
| | | // this.cell = nn |
| | | // console.log(this.cell); |
| | | |
| | | |
| | | |
| | | // let cc = this.edit.element.join(", ") |
| | | // let str = cc.join(", "); |
| | | // let cc = JSON.parse(this.edit.element) |
| | | // console.log(cc); |
| | | // console.log(gg); |
| | | // console.log(json.parse(gg)); |
| | | |
| | | }); |
| | | }, |
| | | //编辑内容 |
| | | upContent(ob) { |
| | | this.upData = ob; |
| | | this.selecTechById(); |
| | | this.selecTechById(); |
| | | console.log(this.upData); |
| | | this.selecTechById() |
| | | this.upDia = true; |
| | | }, |
| | | |
| | |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | </script> |