| | |
| | | <template> |
| | | <div> |
| | | <el-row> |
| | | <el-col :span="12" class="top_left_name">实验室管理</el-col> |
| | | <el-col :span="12" class="top_left_name">设备维护</el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <el-button |
| | | @click="testItem()" |
| | |
| | | placeholder="请选择设备组" |
| | | > |
| | | <el-option |
| | | v-for="list in equip" |
| | | v-for="list in equaip" |
| | | :key="list" |
| | | :label="list" |
| | | :value="list" |
| | |
| | | <el-radio-button label="1">生产设备</el-radio-button> |
| | | <el-radio-button label="2">检验设备</el-radio-button> |
| | | </el-radio-group> |
| | | <el-input |
| | | <!-- <el-input |
| | | class="frame_input" |
| | | v-model="search_class" |
| | | placeholder="请输入分类名称" |
| | |
| | | style="font-size: 23px; padding: 5px 0;cursor:pointer;" |
| | | @click="handlerDeptList" |
| | | ></i> |
| | | </el-input> |
| | | </el-input> --> |
| | | <el-tree |
| | | :data="towTree" |
| | | ref="tree" |
| | | :props="{ children: 'children', label: 'father' }" |
| | | node-key="id" |
| | | default-expand-all |
| | | highlight-current |
| | | style="margin-top: 20px;" |
| | | @node-click="handleNodeClick" |
| | | |
| | | > |
| | | <div class="custom-tree-node" slot-scope="{ node, data }"> |
| | | <span |
| | |
| | | ></i> |
| | | {{ data.father }}</span |
| | | > |
| | | <el-button type="text" size="mini" @click.stop="remove(node, data)"> |
| | | <!-- <el-button type="text" size="mini" @click.stop="remove(node, data)"> |
| | | <i class="el-icon-delete"></i> |
| | | </el-button> |
| | | </el-button> --> |
| | | </div> |
| | | </el-tree> |
| | | </div> |
| | |
| | | // BOM树数据结构 |
| | | towTree: [], |
| | | equipment: '', |
| | | equip:'', |
| | | equaip:'', |
| | | ruleForm: { |
| | | // 新增仪器表单 |
| | | code: "", |
| | |
| | | treedata:{ |
| | | father:'设备组1', |
| | | }, |
| | | equr:1, |
| | | equr:'', |
| | | }, |
| | | delete:{}, |
| | | equip:[], |
| | | equip:1, |
| | | rules: { |
| | | name: [ |
| | | { required: true, message: "请输入仪器设备编号", trigger: "blur" }, |
| | |
| | | } |
| | | }; |
| | | }, |
| | | mounted() { |
| | | // 初始化调用二级树 |
| | | this.twoTreeApi(); |
| | | // 初始化调用表格数据 |
| | | // this.tableDataApi(); |
| | | this.selectDevice()//右边 |
| | | }, |
| | | methods: { |
| | | selectDevice() {//右边数据 |
| | | console.log(this.$api.url.selectDevice); |
| | | console.log(this.ruleForm.treedata.father); |
| | | console.log(this.equip); |
| | | this.$axios.get(this.$api.url.selectDevice,{ |
| | | params:{ |
| | | father:this.treedata.father, |
| | | father:this.ruleForm.treedata.father, |
| | | type:this.equip, |
| | | } |
| | | }).then(res =>{ |
| | |
| | | .catch(_ => {}); |
| | | }, |
| | | testItem() { |
| | | this.listgroup() |
| | | this.dialogVisible = true; |
| | | this.$axios.get(this.$api.url.addDeviceKeeper).then(res => { |
| | | this.keeperList = res.data; |
| | | }); |
| | | this.listgroup() |
| | | }, |
| | | listgroup() { |
| | | this.$axios.get(this.$api.url.listgroup).then(res =>{ |
| | | this.equip = res.data |
| | | this.equaip = res.data |
| | | console.log(this.equip); |
| | | }) |
| | | }, |
| | | RadioChange(val){ |
| | |
| | | keeper:this.ruleForm.keeper, |
| | | name:this.ruleForm.name, |
| | | type:this.ruleForm.type, |
| | | }, {headers: {"Content-Type": "application/json"}}) |
| | | }, {headers: {"Content-Type": "application/json"} |
| | | }).then(res =>{ |
| | | this.selectDevice() |
| | | this.$message.success('新增成功') |
| | | this.ruleForm = {} |
| | | }) |
| | | }, |
| | | // tableDataApi() { |
| | | // this.$axios.get(this.$api.url.tableDeviceList).then(res => { |
| | |
| | | }, |
| | | handleNodeClick(data) { |
| | | console.log(data); |
| | | this.treedata = data |
| | | // this.treedata = data |
| | | this.selectDevice() |
| | | }, |
| | | handlerDeptList() { |
| | |
| | | }); |
| | | } |
| | | }, |
| | | mounted() { |
| | | // 初始化调用二级树 |
| | | this.twoTreeApi(); |
| | | // 初始化调用表格数据 |
| | | this.tableDataApi(); |
| | | this.selectDevice()//右边 |
| | | }, |
| | | |
| | | watch: { |
| | | "ruleForm.rawInsProductId": { |
| | | //监听ruleForm.rawInsProductId |