| | |
| | | @row-save="addInspectHandler" |
| | | @row-del="delInspectHandler" |
| | | :page="page"> |
| | | <template slot="inspectNameForm" slot-scope="scope"> |
| | | <el-input |
| | | placeholder="请输入检验项目名称" |
| | | type="textarea" |
| | | v-model="scope.row.inspectName" |
| | | :rows="2" /> |
| | | </template> |
| | | <template slot="inspectRequiredForm" slot-scope="scope"> |
| | | <el-input |
| | | placeholder="请输入检验标准" |
| | | type="textarea" |
| | | v-model="scope.row.inspectRequired" |
| | | :rows="2" /> |
| | | </template> |
| | | <template #menu="{size,row,index}"> |
| | | <el-button v-if="row.children!=null" class="menu-button" :size="size" @click="addChildren(size,row,index)" type="text" icon="el-icon-circle-plus-outline">添加子项目</el-button> |
| | | <el-button v-if="row.children==null" class="menu-button" :size="size" @click="showUpdateDialog(size,row,index)" type="text" icon="el-icon-edit">编辑</el-button> |
| | |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addChildrenVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="addInspectHandler">确 定</el-button> |
| | | <el-button type="primary" @click="addChildrenHandler">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | }, |
| | | methods:{ |
| | | addChildren(size,row,index){ |
| | | console.log(row); |
| | | this.addChildrenForm.inspectName = row.inspectName |
| | | this.addChildrenVisible = true |
| | | }, |
| | | addInspectHandler(row,done,loading){ |
| | | const _than = this |
| | | let obj = { |
| | | parentId: this.paramObj.id, |
| | | ...row |
| | | } |
| | | addInspect(obj).then(res=>{ |
| | | if(res.status===200){ |
| | | _than.getData() |
| | | _than.$message.success("添加成功") |
| | | } |
| | | }).catch(error=>{ |
| | | console.error(error) |
| | | }) |
| | | done() |
| | | }, |
| | | delInspectHandler(size,row,index){ |
| | | const _than = this |
| | |
| | | } |
| | | }) |
| | | }, |
| | | addInspectHandler(){ |
| | | addChildrenHandler(){ |
| | | const _than = this |
| | | this.$refs.addChildrenForm.validate(valid=>{ |
| | | if(valid){ |