From 27e0f5db64f77584a86f753f245ac4c6eb048a71 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期二, 07 五月 2024 22:41:42 +0800
Subject: [PATCH] 选择
---
src/views/tpm/MachineTab.vue | 8 +++++---
src/views/tpm/machine/Dialog.vue | 42 ++++++++++++++++++++++++++++++++++++------
2 files changed, 41 insertions(+), 9 deletions(-)
diff --git a/src/views/tpm/MachineTab.vue b/src/views/tpm/MachineTab.vue
index 13edf48..6c02bcb 100644
--- a/src/views/tpm/MachineTab.vue
+++ b/src/views/tpm/MachineTab.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-04-27 20:04:34
* @LastEditors: Sneed
- * @LastEditTime: 2024-05-07 22:23:47
+ * @LastEditTime: 2024-05-07 22:40:21
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/tpm/MachineTab.vue
-->
<template>
@@ -138,10 +138,12 @@
this.$refs.table.reload(this.params)
},
table_add() {
- this.$refs.dialog.open('add')
+ this.$refs.dialog.open('add', {
+ groupId: this.params.groupId
+ })
},
table_edit(row) {
- this.$refs.dialog.open('add', { id: row.id })
+ this.$refs.dialog.open('edit', { id: row.id })
},
success() {
this.getTreeData()
diff --git a/src/views/tpm/machine/Dialog.vue b/src/views/tpm/machine/Dialog.vue
index c81c2c8..ff909eb 100644
--- a/src/views/tpm/machine/Dialog.vue
+++ b/src/views/tpm/machine/Dialog.vue
@@ -107,7 +107,9 @@
</el-col>
<el-col :span="8">
<el-form-item label="鎵�灞炴満鍣ㄧ粍" prop="groupId">
- <el-input style="width: 240px" v-model="form.groupId" placeholder="鎵�灞炴満鍣ㄧ粍" clearable></el-input>
+ <!-- <el-input style="width: 240px" v-model="form.groupId" placeholder="鎵�灞炴満鍣ㄧ粍" clearable></el-input> -->
+ <el-tree-select v-model="form.groupId" node-key="id" :props="props" :data="options.groupId"
+ filterable style="width: 240px" />
</el-form-item>
</el-col>
<el-col :span="8">
@@ -219,8 +221,8 @@
</el-col>
<el-col :span="8">
<el-form-item label="浣跨敤閮ㄩ棬" prop="organizationId">
- <el-input style="width: 240px" v-model="form.organizationId" placeholder="浣跨敤閮ㄩ棬"
- clearable></el-input>
+ <el-tree-select v-model="form.organizationId" node-key="id" :props="props"
+ :data="options.organizationId" filterable style="width: 240px" />
</el-form-item>
</el-col>
<el-col :span="8">
@@ -247,7 +249,9 @@
</el-col>
<el-col :span="8">
<el-form-item label="璐d换浜�" prop="employeeId">
- <el-input style="width: 240px" v-model="form.employeeId" placeholder="璐d换浜�" clearable></el-input>
+ <!-- <el-input style="width: 240px" v-model="form.employeeId" placeholder="璐d换浜�" clearable></el-input> -->
+ <el-tree-select v-model="form.employeeId" node-key="id" :props="props"
+ :data="options.employeeId" filterable style="width: 240px" />
</el-form-item>
</el-col>
<el-col :span="8">
@@ -294,6 +298,9 @@
},
data() {
return {
+ props: {
+ label: 'name',
+ },
options: {
machineTypeId: [],
machineLifeStatus: [],
@@ -317,7 +324,10 @@
value: 0
}
],
- machineUseStatus: []
+ machineUseStatus: [],
+ employeeId: [],
+ groupId: [],
+ organizationId: []
},
mode: "add",
titleMap: {
@@ -476,6 +486,21 @@
}))
}
})
+ this.$HTTP.get('/api/blade-cps/employee/tree').then(res => {
+ if (res.code === 200) {
+ this.options.employeeId = res.data
+ }
+ })
+ this.$HTTP.get('/api/blade-cps/group/tree?groupCategory=1&groupType=group_machine').then(res => {
+ if (res.code === 200) {
+ this.options.groupId = res.data
+ }
+ })
+ this.$HTTP.get('/api/blade-cps/organization/tree?groupType=group_organization&groupCategory=1').then(res => {
+ if (res.code === 200) {
+ this.options.organizationId = res.data
+ }
+ })
},
//鏄剧ず
open(mode = 'add', params) {
@@ -486,7 +511,7 @@
Object.keys(this.form).forEach(item => {
this.form[item] = ''
})
- if (params) {
+ if (params.id) {
this.$HTTP.get(`/api/blade-cps/machine/detail/${params.id}`).then(res => {
if (res.code === 200) {
this.form = {
@@ -495,6 +520,11 @@
}
}
})
+ } else {
+ this.form = {
+ ...this.form,
+ ...params
+ }
}
return this
--
Gitblit v1.9.3