From 71137b436469142dcd0a0ed748fb3ceb6050a8f2 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Thu, 22 Sep 2022 15:23:03 +0800
Subject: [PATCH] 巡检计划巡检人员添加时过滤
---
src/api/system/user.js | 7 +++++++
src/views/taskinfo/taskplanUser.vue | 27 +++++++++++++++++++++++++--
src/const/taskinfo/taskplanUser.js | 9 ++++++++-
src/views/taskinfo/taskinfoPlan.vue | 7 +++++--
4 files changed, 45 insertions(+), 5 deletions(-)
diff --git a/src/api/system/user.js b/src/api/system/user.js
index c8a8101..74d68a7 100644
--- a/src/api/system/user.js
+++ b/src/api/system/user.js
@@ -13,6 +13,13 @@
})
}
+export const getUserList = () => {
+ return request({
+ url: '/api/blade-user/user-list',
+ method: 'get',
+ })
+}
+
export const remove = (ids) => {
return request({
url: '/api/blade-user/remove',
diff --git a/src/const/taskinfo/taskplanUser.js b/src/const/taskinfo/taskplanUser.js
index 6fa0dc0..1f8cf86 100644
--- a/src/const/taskinfo/taskplanUser.js
+++ b/src/const/taskinfo/taskplanUser.js
@@ -34,9 +34,16 @@
},
{
label: "用户",
+ prop: "name",
+ display:false,
+ },
+ {
+ label: "用户",
prop: "userId",
type: "select",
- dicUrl: "/api/blade-user/user-list",
+ hide:true,
+ dicData:[],
+ // dicUrl: "/api/blade-user/user-list",
props: {
label: "name",
value: "id"
diff --git a/src/views/taskinfo/taskinfoPlan.vue b/src/views/taskinfo/taskinfoPlan.vue
index 2312b09..600d30f 100644
--- a/src/views/taskinfo/taskinfoPlan.vue
+++ b/src/views/taskinfo/taskinfoPlan.vue
@@ -235,8 +235,11 @@
},
goToTaskplanUser(planId) {
// this.$router.push({ path: "/taskinfo/taskplanUser", query: {planId:planId} });
- this.$refs.taskplanUser.getUserList();
- this.$refs.taskplanUser.onLoad();
+ var page = {
+ currentPage:1,
+ pageSize:this.page.pageSize
+ }
+ this.$refs.taskplanUser.onLoad(page,{planId:planId});
this.setPlanUser()
},
setPlanUser() {
diff --git a/src/views/taskinfo/taskplanUser.vue b/src/views/taskinfo/taskplanUser.vue
index 0b4f97d..0231a22 100644
--- a/src/views/taskinfo/taskplanUser.vue
+++ b/src/views/taskinfo/taskplanUser.vue
@@ -16,7 +16,7 @@
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
- @on-load="onLoad">
+ >
<template slot="menuLeft">
<el-button
size="small"
@@ -43,6 +43,7 @@
import {getList, getDetail, add, update, remove} from "@/api/taskinfo/taskplanUser";
import option from "@/const/taskinfo/taskplanUser";
import {mapGetters} from "vuex";
+ import {getUserList} from "@/api/system/user";
export default {
name: "taskplanUser",
@@ -58,7 +59,8 @@
},
selectionList: [],
option: option,
- data: []
+ data: [],
+ planId:"",
};
},
computed: {
@@ -84,6 +86,7 @@
},
methods: {
rowSave(row, done, loading) {
+ row['planId'] = this.planId
add(row).then(() => {
this.onLoad(this.page);
this.$message({
@@ -186,6 +189,10 @@
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
+ if (params.planId){
+ this.planId = params.planId
+ }
+ Object.assign(params,{planId:this.planId})
this.loading = true;
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
@@ -193,7 +200,23 @@
this.data = data.records;
this.loading = false;
this.selectionClear();
+ this.getUserList();
});
+ },
+ getUserList(){
+ getUserList().then(res=>{
+ var data = res.data.data;
+ var dicData = [];
+ var userColumn = this.findObject(this.option.column,"userId");
+ if (this.data.length>0){
+ dicData = data.filter((chose) => {
+ return !this.data.some(ele=>ele.userId ==chose.id)
+ })
+ }else {
+ dicData = data
+ }
+ userColumn.dicData = dicData
+ })
}
}
};
--
Gitblit v1.9.3