From 4fa97f6b365035a1f811833b54ada53a9a1a35da Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期五, 08 九月 2023 16:45:48 +0800
Subject: [PATCH] 设备维护,标准Bom
---
src/components/view/technology.vue | 135 ++++++++++++++++++++++++++++++++++++--------
1 files changed, 110 insertions(+), 25 deletions(-)
diff --git a/src/components/view/technology.vue b/src/components/view/technology.vue
index 4bd43a6..e9ffa98 100644
--- a/src/components/view/technology.vue
+++ b/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)">缂栬緫 </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>
@@ -182,7 +186,7 @@
<el-col :span="4" style="font-size: 14px;text-align: right;">绫诲瀷:</el-col>
<el-col :span="16" :offset="1">
<template>
- <el-select v-model="upData.type" placeholder="璇烽�夋嫨绫诲瀷" style="width: 310px;">
+ <el-select v-model="edit.type" placeholder="璇烽�夋嫨绫诲瀷" style="width: 310px;">
<el-option label="姗¤兌杩炴帴鍣�" :value="0"></el-option>
<el-option label="閲戝睘杩炴帴鍣�" :value="1"></el-option>
<el-option label="婀挎彃鎷旂數杩炴帴鍣�" :value="2"></el-option>
@@ -194,7 +198,7 @@
<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-select v-model="upData.father" style="width: 310px;" placeholder="璇烽�夋嫨">
+ <el-select v-model="edit.father" style="width: 310px;" placeholder="璇烽�夋嫨">
<el-option
v-for="item in procedure"
:key="item"
@@ -207,10 +211,10 @@
<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-select v-model="upData.ele" style="width: 310px;" multiple placeholder="璇烽�夋嫨">
+ <el-select v-model="AAA.id" style="width: 310px;" multiple placeholder="璇烽�夋嫨">
<el-option
v-for="item in element"
- :key="item.index"
+ :key="item.id"
:label="item.name"
:value="item.id">
</el-option>
@@ -220,7 +224,7 @@
<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 v-model="upData.name" size="small" clearable></el-input>
+ <el-input v-model="edit.name" size="small" clearable></el-input>
</el-col>
</el-row>
<el-row style="line-height: 46px;">
@@ -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,29 +391,43 @@
search:{
type:'',
},
+ delete:[],
treetrunk:[],
process: [],
product: [],
procedure:[],
- checkTreeNode:'',
+ checkTreeNode:{
+ name:'涓嬫枡'
+ },
towTree:[],
value:"",
modifyevent:false,
dialogVisible:false,
- checkTreeNode: {},
tableData: [],
upIndex: 0,
selects: [],
upDia: false,
element:[],
equipment:[0],
+ AAA:[{
+ id:'',
+ }],
+ edit:{
+ deviceGroup:'',
+ elementId:'',
+ father:'',
+ name:'',
+ type:'',
+ // children:[],
+ },
upData: {
name:'',
- device_group:'',
+ deviceGroup:'',
ele:'',
father:'',
type:'',
},
+ typeselect:0,
newdata:{
type:''
}
@@ -420,12 +438,25 @@
this.chooseTech()
this.chooseDevGroup()
this.chooseElement()
+ this.selectAllTechNam()
},
methods: {
+ type(val){
+ this.typeselect = val
+ this.upData.type = val
+ console.log(this.typeselect);
+ this.selectAllTechTem()
+ },
Neworder() {
this.dialogVisible = false
this.addTechTemp()
+ // this.form = '';
+
+ },
+ Deleteapi() {
+ this.dialogVisible = false
+ this.form = '';
},
addTechTemp() {
// console.log(this.$api.url.addTechTemp);
@@ -445,6 +476,8 @@
}
).then(res=>{
console.log(res);
+ this.selectAllTechNam()
+ this.form = {}
})
},
@@ -470,30 +503,51 @@
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.edit.elementId,
+ father:this.edit.father,
+ name:this.edit.name,
+ type:this.edit.type
+ }
+ // id:this.upData.id,
+ }
}, {
headers: {
"Content-Type": "application/json"
}
+ }).then(res =>{
+ console.log(res);
+
})
},
+
+ 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 +626,44 @@
}
}
})
+ let cc = this.selects.map(el => {
+ return el.id
+ })
+ this.delete = cc.join(',')
+ console.log(this.delete);
+ this.delAllTech()
this.$message.success('鍒犻櫎瀹屾垚')
},
deleteRow(index, 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,
+ }
+ }).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);
+ })
+ },
+ //缂栬緫鍐呭
upContent(ob) {
this.upData = ob
+ this.selecTechById()
+ this.selecTechById()
console.log(this.upData);
this.upDia = true
},
@@ -593,7 +678,7 @@
// }
// })
this.writeTechById()
-
+
this.$message.success('淇敼鎴愬姛')
this.upIndex++
this.upDia = false
--
Gitblit v1.9.3