From 4d8049330f1378c87115a7fcb66265f815b49801 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 13 九月 2023 16:52:06 +0800
Subject: [PATCH] modified: src/assets/api/controller.js modified: src/components/view/standard-table/material.vue modified: src/components/view/standard-table/product.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 | 339 +++++++++++++++++++++++++++++---------------------------
1 files changed, 174 insertions(+), 165 deletions(-)
diff --git a/src/components/view/laboratoryManagement.vue b/src/components/view/laboratoryManagement.vue
index 2f2ac7e..5fb48be 100644
--- a/src/components/view/laboratoryManagement.vue
+++ b/src/components/view/laboratoryManagement.vue
@@ -1,7 +1,7 @@
<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()"
@@ -49,19 +49,16 @@
</el-row>
<el-row>
<el-col :span="12">
- <el-form-item label="鐖剁骇鍒嗙被">
+ <el-form-item label="璁惧缁�" prop="name">
<el-select
- v-model="value"
- @blur="productSelect"
- filterable
- allow-create
- placeholder="璇烽�夋嫨鐖剁骇鍒嗙被"
+ v-model="ruleForm.equr"
+ placeholder="璇烽�夋嫨璁惧缁�"
>
<el-option
- v-for="list in parentClassificationList"
- :key="list.index"
- :label="list.father"
- :value="list.father"
+ v-for="list in equaip"
+ :key="list"
+ :label="list"
+ :value="list"
>
</el-option>
</el-select>
@@ -153,38 +150,7 @@
</el-form-item>
</el-col>
</el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="妫�娴嬮」鐩�" prop="rawInsProductId" required>
- <el-select
- v-model="ruleForm.rawInsProductId"
- placeholder="璇烽�夋嫨妫�娴嬮」鐩�"
- >
- <el-option
- v-for="item in inspectionList"
- :key="item.index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="妫�娴嬫牱鍝�" required>
- <el-form-item>
- <el-input
- placeholder="妫�娴嬫牱鍝�"
- :disabled="true"
- style="width: 206px"
- v-model="showCodeNameModel.name"
- >
- </el-input>
- </el-form-item>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
+ <!-- <el-row>
<el-col :span="12">
<el-form-item label="瑙勬牸鍨嬪彿">
<el-input
@@ -196,18 +162,8 @@
</el-input>
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="妫�娴嬩汉">
- <el-input
- placeholder="妫�娴嬩汉"
- :disabled="true"
- style="width: 206px"
- v-model="showCodeNameModel.user_name"
- >
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
+
+ </el-row> -->
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">鍙� 娑�</el-button>
@@ -228,16 +184,13 @@
<el-radio-group
class="ai-tab-change"
style="width: 270px; margin-top: 5px"
- v-model="radio1"
+ v-model="equipment"
+ @input="RadioChange"
>
- <el-radio-button size="small" label="true">
- <div>鐢熶骇璁惧</div>
- </el-radio-button>
- <el-radio-button size="small" label="false">
- <div>妫�娴嬭澶�</div>
- </el-radio-button>
+ <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="璇疯緭鍏ュ垎绫诲悕绉�"
@@ -249,14 +202,17 @@
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
@@ -269,11 +225,11 @@
}`
"
></i>
- {{ data.name }}</span
+ {{ 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>
@@ -365,9 +321,9 @@
</el-table-column>
<el-table-column prop="name" label="浠櫒璁惧鍚嶇О" width="125">
</el-table-column>
- <el-table-column prop="keeper" label="淇濈浜�"> </el-table-column>
+ <el-table-column prop="userName" label="淇濈浜�"> </el-table-column>
<el-table-column
- prop="end_measure"
+ prop="DATE_FORMAT(end_measure, '%Y-%m-%d')"
label="璁¢噺鎴嚦鏈夋晥鏈�"
width="147"
>
@@ -414,15 +370,15 @@
:show-overflow-tooltip="true"
>
</el-table-column>
- <el-table-column prop="inspectProject" label="妫�娴嬮」鐩�">
+ <!-- <el-table-column prop="inspectProject" label="妫�娴嬮」鐩�">
</el-table-column>
<el-table-column prop="testSample" label="妫�楠屾牱鍝�">
</el-table-column>
- <el-table-column prop="user_name" label="妫�娴嬩汉"> </el-table-column>
+ <el-table-column prop="user_name" label="妫�娴嬩汉"> </el-table-column> -->
<el-table-column prop="name" label="鎿嶄綔">
<template v-slot="scope">
<el-button
- @click="handleClick(scope.$index, tableData, scope.row)"
+ @click="handleClick(scope.row)"
type="text"
size="small"
>鍒犻櫎</el-button
@@ -455,6 +411,8 @@
staue_value: "", // 涓婚〉琛ㄦ牸涓婃柟鐨勭姸鎬侀�夋嫨
// BOM鏍戞暟鎹粨鏋�
towTree: [],
+ equipment: '',
+ equaip:'',
ruleForm: {
// 鏂板浠櫒琛ㄥ崟
code: "",
@@ -465,8 +423,14 @@
keeper: "",
name: "",
rawInsProductId: "",
- type: ""
+ type: "",
+ treedata:{
+ father:'璁惧缁�1',
+ },
+ equr:'',
},
+ delete:{},
+ equip:1,
rules: {
name: [
{ required: true, message: "璇疯緭鍏ヤ华鍣ㄨ澶囩紪鍙�", trigger: "blur" },
@@ -504,7 +468,31 @@
}
};
},
+ mounted() {
+ // 鍒濆鍖栬皟鐢ㄤ簩绾ф爲
+ this.twoTreeApi();
+ // 鍒濆鍖栬皟鐢ㄨ〃鏍兼暟鎹�
+ // this.tableDataApi();
+ this.selectDevice()//鍙宠竟
+ },
methods: {
+ selectDevice() {//鍙宠竟鏁版嵁
+ console.log(this.ruleForm.treedata.father);
+ console.log(this.equip);
+ this.$axios.get(this.$api.url.selectDevice,{
+ params:{
+ father:this.ruleForm.treedata.father,
+ type:this.equip,
+ }
+ }).then(res =>{
+ console.log(res);
+ this.tableData = res.data
+ }, {
+ headers: {
+ "Content-Type": "application/json"
+ }
+ })
+ },
// 鍔ㄦ�佹帶鍒跺睍寮�涓庢敹璧峰拰鍒囨崲瀵瑰簲鍥炬爣
isC() {
this.isCollapse = !this.isCollapse;
@@ -517,25 +505,27 @@
}
},
submitForm() {
- this.$refs.ruleForm.validate(valid => {
- if (valid) {
- this.ruleForm.father = this.value;
- this.$axios
- .post(this.$api.url.addDeviceInstrument, this.ruleForm, {
- headers: {
- "Content-Type": "application/json"
- }
- })
- .then(res => {
- this.keeperList = res.data;
- // 鎴愬姛鍏抽棴鏂板寮瑰嚭妗�
- this.dialogVisible = false;
- });
- } else {
- console.log("error submit!!");
- return false;
- }
- });
+ // this.$refs.ruleForm.validate(valid => {
+ // if (valid) {
+ // this.ruleForm.father = this.value;
+ // this.$axios
+ // .post(this.$api.url.addDeviceInstrument, this.ruleForm, {
+ // headers: {
+ // "Content-Type": "application/json"
+ // }
+ // })
+ // .then(res => {
+ // this.keeperList = res.data;
+ // // 鎴愬姛鍏抽棴鏂板寮瑰嚭妗�
+ // this.dialogVisible = false;
+ // });
+ // } else {
+ // console.log("error submit!!");
+ // return false;
+ // }
+ // });
+ this.addApi()
+ this.dialogVisible = false;
},
handleClose(done) {
this.$confirm("纭鍏抽棴锛�")
@@ -545,35 +535,62 @@
.catch(_ => {});
},
testItem() {
+ this.listgroup()
this.dialogVisible = true;
this.$axios.get(this.$api.url.addDeviceKeeper).then(res => {
this.keeperList = res.data;
});
- this.$axios.get(this.$api.url.addDeviceInspectDownBox).then(res => {
- this.inspectionList = res.data;
- });
- this.$axios.get(this.$api.url.addDeviceParentClassification).then(res => {
- this.parentClassificationList = res.data;
- });
+ },
+ listgroup() {
+ this.$axios.get(this.$api.url.listgroup).then(res =>{
+ this.equaip = res.data
+ console.log(this.equip);
+ })
+ },
+ RadioChange(val){
+ console.log(val);
+ this.equip = val
+ this.twoTreeApi()
},
twoTreeApi() {
- this.$axios.get(this.$api.url.towTree).then(res => {
- let list = res.data;
- list.forEach(i => {
- if (i.name === undefined) {
- i.name = i.children[0].name;
- i.id = i.children[0].id;
- i.children = undefined;
- }
- });
+ this.$axios.get(this.$api.url.towTree,{
+ params:{
+ type:this.equip,
+ }
+ }).then(res => {
+ // let list = res.data;
+ // list.forEach(i => {
+ // if (i.name === undefined) {
+ // i.name = i.children[0].name;
+ // i.id = i.children[0].id;
+ // i.children = undefined;
+ // }
+ // });
this.towTree = res.data;
});
},
- tableDataApi() {
- this.$axios.get(this.$api.url.tableDeviceList).then(res => {
- this.tableData = res.data;
- });
+ addApi() {
+ this.$axios.post(this.$api.url.addApi,{
+ code:this.ruleForm.code,
+ deviceStatus:this.ruleForm.deviceStatus,
+ endMeasure:this.ruleForm.endMeasure,
+ factory:this.ruleForm.factory,
+ father:this.ruleForm.equr,
+ keeper:this.ruleForm.keeper,
+ name:this.ruleForm.name,
+ type:this.ruleForm.type,
+ }, {headers: {"Content-Type": "application/json"}
+ }).then(res =>{
+ this.selectDevice()
+ this.$message.success('鏂板鎴愬姛')
+ this.ruleForm = {}
+ })
},
+ // tableDataApi() {
+ // this.$axios.get(this.$api.url.tableDeviceList).then(res => {
+ // this.tableData = res.data;
+ // });
+ // },
reset() {
this.tableDataApi();
this.radio1 = "true";
@@ -581,21 +598,9 @@
this.staue_value = "";
},
handleNodeClick(data) {
- if (data.id === undefined) {
- this.$axios
- .get(this.$api.url.tableDeviceList, {
- params: { fatherName: data.name }
- })
- .then(res => {
- this.tableData = res.data;
- });
- } else if (data.id !== undefined) {
- this.$axios
- .get(this.$api.url.tableDeviceList, { params: { deviceId: data.id } })
- .then(res => {
- this.tableData = res.data;
- });
- }
+ console.log(data);
+ // this.treedata = data
+ this.selectDevice()
},
handlerDeptList() {
this.towTree = [];
@@ -631,28 +636,37 @@
});
}
},
- handleClick(index, datas, row) {
- this.$confirm("姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ヨ澶�, 鏄惁缁х画?", "鎻愮ず", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }).then(() => {
- this.$axios
- .delete(this.$api.url.deleteDevice, { params: { deviceId: row.id } })
- .then(res => {
- this.$message({
- message: res.message,
- type: "success"
- });
- datas.splice(index, 1);
- })
- .catch(err => {
- this.$message({
- message: err.message,
- type: "warning"
- });
- });
- });
+ delDeviceById() {
+ this.$axios.post(this.$api.url.delDeviceById,{
+ id:this.delete.id
+ })
+ },
+ handleClick(row) {
+ console.log(row);
+ this.delete = row
+ this.delDeviceById()
+ this.selectDevice()
+ // this.$confirm("姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ヨ澶�, 鏄惁缁х画?", "鎻愮ず", {
+ // confirmButtonText: "纭畾",
+ // cancelButtonText: "鍙栨秷",
+ // type: "warning"
+ // }).then(() => {
+ // this.$axios
+ // .delete(this.$api.url.deleteDevice, { params: { deviceId: row.id } })
+ // .then(res => {
+ // this.$message({
+ // message: res.message,
+ // type: "success"
+ // });
+ // datas.splice(index, 1);
+ // })
+ // .catch(err => {
+ // this.$message({
+ // message: err.message,
+ // type: "warning"
+ // });
+ // });
+ // });
},
remove(node, data) {
this.$confirm("姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ヨ澶�, 鏄惁缁х画?", "鎻愮ず", {
@@ -723,12 +737,7 @@
});
}
},
- mounted() {
- // 鍒濆鍖栬皟鐢ㄤ簩绾ф爲
- this.twoTreeApi();
- // 鍒濆鍖栬皟鐢ㄨ〃鏍兼暟鎹�
- this.tableDataApi();
- },
+
watch: {
"ruleForm.rawInsProductId": {
//鐩戝惉ruleForm.rawInsProductId
@@ -744,17 +753,17 @@
}
}
},
- dialogVisible: {
- handler: function(newVal, oldVal) {
- if (newVal) {
- // 鎴愬姛娓呯┖杈撳叆鍐呭
- this.ruleForm = {};
- this.value = "";
- this.showCodeNameModel = {};
- this.$refs.ruleForm.resetFields();
- }
- }
- },
+ // dialogVisible: {
+ // handler: function(newVal, oldVal) {
+ // if (newVal) {
+ // // 鎴愬姛娓呯┖杈撳叆鍐呭
+ // this.ruleForm = {};
+ // this.value = "";
+ // this.showCodeNameModel = {};
+ // this.$refs.ruleForm.resetFields();
+ // }
+ // }
+ // },
radio1: {
handler: function(newVal, oldVal) {
this.towTree = [];
--
Gitblit v1.9.3