From 5702e02e6c31fd972d7a00042cce8ca4c4777166 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 14 九月 2023 13:01:42 +0800
Subject: [PATCH] modified: src/App.vue modified: src/components/view/standard-table/material.vue modified: src/components/view/standard-table/target.vue modified: src/components/view/standard-table/technology.vue modified: src/components/view/standard.vue
---
src/components/view/laboratoryManagement.vue | 245 ++++++++++++++++++++++++++++++++----------------
1 files changed, 161 insertions(+), 84 deletions(-)
diff --git a/src/components/view/laboratoryManagement.vue b/src/components/view/laboratoryManagement.vue
index 55d2727..38548d3 100644
--- a/src/components/view/laboratoryManagement.vue
+++ b/src/components/view/laboratoryManagement.vue
@@ -1,8 +1,8 @@
<template>
- <div>
+ <div class="laboratoryMangement">
<el-row>
- <el-col :span="12" class="top_left_name">瀹為獙瀹ょ鐞�</el-col>
- <el-col :span="12" style="text-align: right;">
+ <el-col :span="12" class="top_left_name">璁惧缁存姢</el-col>
+ <el-col :span="12" style="text-align: right;" class="title">
<el-button
@click="testItem()"
type="primary"
@@ -39,6 +39,7 @@
<el-form-item label="璁惧鐢ㄩ��" prop="type">
<el-select
v-model="ruleForm.type"
+ @change="selectinstall"
placeholder="璇烽�夋嫨璁惧鐢ㄩ��"
>
<el-option label="鐢熶骇璁惧" value="1"></el-option>
@@ -55,7 +56,7 @@
placeholder="璇烽�夋嫨璁惧缁�"
>
<el-option
- v-for="list in equip"
+ v-for="list in equaip"
:key="list"
:label="list"
:value="list"
@@ -190,7 +191,7 @@
<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="璇疯緭鍏ュ垎绫诲悕绉�"
@@ -202,13 +203,15 @@
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"
+ node-key="father"
default-expand-all
+ highlight-current
+ style="margin-top: 20px;"
@node-click="handleNodeClick"
>
<div class="custom-tree-node" slot-scope="{ node, data }">
@@ -224,9 +227,9 @@
></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>
@@ -394,8 +397,10 @@
name: "LaboratoryManagement",
data() {
return {
+
value: "",
dialogVisible: false,
+ checkTreeNode:{},
isCollapse: true, //榛樿涓哄睍寮�
radio1: "true", // 鍒嗙被鍒囨崲
tableData: [], // 涓婚〉琛ㄦ牸鏁版嵁
@@ -408,8 +413,8 @@
staue_value: "", // 涓婚〉琛ㄦ牸涓婃柟鐨勭姸鎬侀�夋嫨
// BOM鏍戞暟鎹粨鏋�
towTree: [],
- equipment: '',
- equip:'',
+ equipment: '1',
+ equaip:'',
ruleForm: {
// 鏂板浠櫒琛ㄥ崟
code: "",
@@ -421,13 +426,14 @@
name: "",
rawInsProductId: "",
type: "",
- treedata:{
- father:'璁惧缁�1',
- },
- equr:1,
+ // treedata:{
+ // father:'璁惧缁�1',
+ // },
+ equr:'',
+
},
delete:{},
- equip:[],
+ equip:1,
rules: {
name: [
{ required: true, message: "璇疯緭鍏ヤ华鍣ㄨ澶囩紪鍙�", trigger: "blur" },
@@ -465,22 +471,34 @@
}
};
},
+ mounted() {
+ // 鍒濆鍖栬皟鐢ㄤ簩绾ф爲
+ this.twoTreeApi();
+ // 鍒濆鍖栬皟鐢ㄨ〃鏍兼暟鎹�
+ // this.tableDataApi();
+ // this.selectDevice()
+ },
methods: {
- selectDevice() {//鍙宠竟鏁版嵁
- console.log(this.$api.url.selectDevice);
- this.$axios.get(this.$api.url.selectDevice,{
- params:{
- father:this.treedata.father,
- type:this.equip,
- }
- }).then(res =>{
- console.log(res);
- this.tableData = res.data
- }, {
- headers: {
- "Content-Type": "application/json"
- }
- })
+ handleNodeClick(val) {
+ this.checkTreeNode = val
+ console.log(this.checkTreeNode);
+ this.selectDevice()
+ },
+
+ staueValueChange() {
+ this.selectDevice()
+ // this.tableData = [];
+ // let val = 1;
+ // if (this.radio1 === "false") {
+ // val = 2;
+ // }
+ // this.$axios
+ // .get(this.$api.url.tableDeviceList, {
+ // params: { type: val, deviceStatue: this.staue_value }
+ // })
+ // .then(res => {
+ // this.tableData = res.data;
+ // });
},
// 鍔ㄦ�佹帶鍒跺睍寮�涓庢敹璧峰拰鍒囨崲瀵瑰簲鍥炬爣
isC() {
@@ -528,11 +546,19 @@
this.$axios.get(this.$api.url.addDeviceKeeper).then(res => {
this.keeperList = res.data;
});
+ },
+ selectinstall(val) {
+ this.equip = val
this.listgroup()
},
listgroup() {
- this.$axios.get(this.$api.url.listgroup).then(res =>{
- this.equip = res.data
+ this.$axios.get(this.$api.url.listgroup,{
+ params:{
+ type:this.equip
+ }
+ }).then(res =>{
+ this.equaip = res.data
+ console.log(this.equip);
})
},
RadioChange(val){
@@ -543,7 +569,7 @@
twoTreeApi() {
this.$axios.get(this.$api.url.towTree,{
params:{
- type:this.equip
+ type:this.equip,
}
}).then(res => {
// let list = res.data;
@@ -555,7 +581,51 @@
// }
// });
this.towTree = res.data;
- });
+ this.$nextTick(() => {
+ this.$refs.tree.setCurrentKey(this.towTree[0].father) // 榛樿閫変腑鑺傜偣绗竴涓�
+ })
+ console.log(this.towTree);
+ let one=this.towTree[0]
+ console.log(one);
+ let name =one.father
+ console.log(name);
+ this.selectDeviceStart(name)
+ });
+ },
+ selectDeviceStart(name,) {//鍙宠竟鏁版嵁
+ this.$axios.get(this.$api.url.selectDevice,{
+ params:{
+ father:name,
+ type:this.equip,
+ deviceStatus:this.staue_value,
+ message:this.codeNameModel,
+ }
+ }).then(res =>{
+ console.log(res);
+ this.tableData = res.data
+ }, {
+ headers: {
+ "Content-Type": "application/json"
+ }
+ })
+ },
+
+ selectDevice() {//鍙宠竟鏁版嵁
+ this.$axios.get(this.$api.url.selectDevice,{
+ params:{
+ father:this.checkTreeNode.father,
+ type:this.equip,
+ deviceStatus:this.staue_value,
+ message:this.codeNameModel,
+ }
+ }).then(res =>{
+ console.log(res);
+ this.tableData = res.data
+ }, {
+ headers: {
+ "Content-Type": "application/json"
+ }
+ })
},
addApi() {
this.$axios.post(this.$api.url.addApi,{
@@ -567,7 +637,12 @@
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.$message.success('鏂板鎴愬姛')
+ this.ruleForm = {}
+ this.selectDevice()
+ })
},
// tableDataApi() {
// this.$axios.get(this.$api.url.tableDeviceList).then(res => {
@@ -575,15 +650,13 @@
// });
// },
reset() {
- this.tableDataApi();
- this.radio1 = "true";
- this.codeNameModel = "";
- this.staue_value = "";
- },
- handleNodeClick(data) {
- console.log(data);
- this.treedata = data
- this.selectDevice()
+ // this.tableDataApi();
+ // this.radio1 = "true";
+ // this.codeNameModel = "";
+ // this.staue_value = "";
+ this.staue_value = ""
+ this.codeNameModel = ""
+ this.selectDevice()
},
handlerDeptList() {
this.towTree = [];
@@ -600,24 +673,25 @@
});
},
selectSearch() {
- this.tableData = [];
- if (this.radio1 === "false") {
- this.$axios
- .get(this.$api.url.tableDeviceList, {
- params: { type: 1, codeNameModel: this.codeNameModel }
- })
- .then(res => {
- this.tableData = res.data;
- });
- } else if (this.radio1 === "true") {
- this.$axios
- .get(this.$api.url.tableDeviceList, {
- params: { type: 2, codeNameModel: this.codeNameModel }
- })
- .then(res => {
- this.tableData = res.data;
- });
- }
+ this.selectDevice()
+ // this.tableData = [];
+ // if (this.radio1 === "false") {
+ // this.$axios
+ // .get(this.$api.url.tableDeviceList, {
+ // params: { type: 1, codeNameModel: this.codeNameModel }
+ // })
+ // .then(res => {
+ // this.tableData = res.data;
+ // });
+ // } else if (this.radio1 === "true") {
+ // this.$axios
+ // .get(this.$api.url.tableDeviceList, {
+ // params: { type: 2, codeNameModel: this.codeNameModel }
+ // })
+ // .then(res => {
+ // this.tableData = res.data;
+ // });
+ // }
},
delDeviceById() {
this.$axios.post(this.$api.url.delDeviceById,{
@@ -705,28 +779,9 @@
}
});
},
- staueValueChange() {
- this.tableData = [];
- let val = 1;
- if (this.radio1 === "false") {
- val = 2;
- }
- this.$axios
- .get(this.$api.url.tableDeviceList, {
- params: { type: val, deviceStatue: this.staue_value }
- })
- .then(res => {
- this.tableData = res.data;
- });
- }
+
},
- mounted() {
- // 鍒濆鍖栬皟鐢ㄤ簩绾ф爲
- this.twoTreeApi();
- // 鍒濆鍖栬皟鐢ㄨ〃鏍兼暟鎹�
- this.tableDataApi();
- this.selectDevice()//鍙宠竟
- },
+
watch: {
"ruleForm.rawInsProductId": {
//鐩戝惉ruleForm.rawInsProductId
@@ -940,3 +995,25 @@
line-height: 14px;
}
</style>
+<style>
+ .laboratoryMangement .title *{
+ font-size: 14px;
+ }
+
+ .laboratoryMangement .table_top_div *{
+ font-size: 14px;
+ }
+
+ .laboratoryMangement .title .el-button {
+ height: 32px;
+ border: 1px solid rgba(190, 190, 190, 0.44);
+ box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
+ padding: 0 12px;
+ }
+ .laboratoryMangement .table_top_div .el-button {
+ height: 32px;
+ border: 1px solid rgba(190, 190, 190, 0.44);
+ box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
+ padding: 0 12px;
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.3