| | |
| | | }) |
| | | } |
| | | |
| | | export const getUserList = () => { |
| | | return request({ |
| | | url: '/api/blade-user/user-list', |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
| | | export const remove = (ids) => { |
| | | return request({ |
| | | url: '/api/blade-user/remove', |
| | |
| | | }, |
| | | { |
| | | 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" |
| | |
| | | }, |
| | | 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() { |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | size="small" |
| | |
| | | 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", |
| | |
| | | }, |
| | | selectionList: [], |
| | | option: option, |
| | | data: [] |
| | | data: [], |
| | | planId:"", |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | row['planId'] = this.planId |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | |
| | | 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; |
| | |
| | | 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 |
| | | }) |
| | | } |
| | | } |
| | | }; |