| | |
| | | </el-table-column> |
| | | <el-table-column fixed="right" style="background-color: white;" v-if="dataForm.id == null" label="操作" width="150"> |
| | | <template slot-scope="scope"> |
| | | <div v-if="scope.row.father!=null"> |
| | | <div v-if="scope.row.fId!=null"> |
| | | <el-button type="text" @click="addChildren(scope.row)">添加项目</el-button> |
| | | <el-button type="text" @click="delChildren(scope.row,scope.$index,true)">删除行</el-button> |
| | | </div> |
| | |
| | | }, |
| | | // 添加行 |
| | | clickAddLine(row) { |
| | | console.log(row); |
| | | let ele = { |
| | | father: row.father?row.father:null, |
| | | fId: Math.random(), |
| | | father: null, |
| | | iid: Math.random(), |
| | | children:[] |
| | | } |
| | | if(row){ |
| | | ele.father = row.father?row.father:null |
| | | row.children.forEach(item => { |
| | | ele.children.push({ |
| | | deviceId: null, |
| | |
| | | this.list.push(ele) |
| | | }) |
| | | }else{ |
| | | ele.push({ |
| | | ele.children.push({ |
| | | deviceId: null, |
| | | deviceName: null, |
| | | iid: Math.random(), |
| | |
| | | row.children.push(obj) |
| | | }, |
| | | save(){ |
| | | |
| | | let data = this.dataForm |
| | | console.log('--------',data); |
| | | console.log("-----",this.list); |
| | | this.list.forEach(item=>{ |
| | | item.children.forEach(c=>{ |
| | | let arr=c.testValueList |
| | | let val='' |
| | | arr.forEach(a=>{ |
| | | val+=a+"," |
| | | }) |
| | | let end=val.substring(0,val.length-1) |
| | | c.testValue=end |
| | | }) |
| | | }) |
| | | data.rawInsProducts = this.list |
| | | addRawInspects(data).then(res=>{ |
| | | this.$message.success("保存成功") |