From 998b75f0d4aaed03001ec4246cd4f3b4b0743b7e Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Wed, 23 Nov 2022 10:14:28 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/taskinfo/taskplanUser.vue | 44 ++++++++++++++++++++++++++++++++++++++++----
1 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/src/views/taskinfo/taskplanUser.vue b/src/views/taskinfo/taskplanUser.vue
index b16c1a3..a1f0f6e 100644
--- a/src/views/taskinfo/taskplanUser.vue
+++ b/src/views/taskinfo/taskplanUser.vue
@@ -1,5 +1,4 @@
<template>
- <basic-container>
<avue-crud :option="option"
:table-loading="loading"
:data="data"
@@ -17,8 +16,20 @@
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
- @on-load="onLoad">
+ >
<template slot="menuLeft">
+ <el-button
+ size="small"
+ icon="el-icon-back"
+ plain
+ type="success"
+ @click="handleBack">返 回
+ </el-button>
+ <el-button type="primary"
+ size="small"
+ icon="el-icon-plus"
+ @click.native="$refs.crud.rowAdd">新 增
+ </el-button>
<el-button type="danger"
size="small"
icon="el-icon-delete"
@@ -27,13 +38,13 @@
</el-button>
</template>
</avue-crud>
- </basic-container>
</template>
<script>
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",
@@ -49,7 +60,8 @@
},
selectionList: [],
option: option,
- data: []
+ data: [],
+ planId:"",
};
},
computed: {
@@ -75,6 +87,7 @@
},
methods: {
rowSave(row, done, loading) {
+ row['planId'] = this.planId
add(row).then(() => {
this.onLoad(this.page);
this.$message({
@@ -117,6 +130,9 @@
});
});
},
+ handleBack() {
+ this.$emit('setPlanUser');
+ },
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
@@ -145,6 +161,7 @@
this.form = res.data.data;
});
}
+ this.getUserList();
done();
},
searchReset() {
@@ -174,6 +191,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;
@@ -182,6 +203,21 @@
this.loading = false;
this.selectionClear();
});
+ },
+ 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