Commit 69d20bd6 authored by miaojiale's avatar miaojiale

增加groupId

parent 077d3f07
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
ref="form" ref="form"
:label-position="'right'" :label-position="'right'"
:forms="searchList" :forms="searchList"
:loading="loading"
:style="{ textAlign: 'left' }" :style="{ textAlign: 'left' }"
@handleSearch="handleFormSearch" @handleSearch="handleFormSearch"
/> />
...@@ -24,7 +25,7 @@ ...@@ -24,7 +25,7 @@
width="450px" width="450px"
:close-modal="false" :close-modal="false"
ref="dialog" ref="dialog"
title="分配用户用户" title="分配用户"
:form-edit="formEdit" :form-edit="formEdit"
:form-data="formData" :form-data="formData"
@handleConfirm="handleConfirm" @handleConfirm="handleConfirm"
...@@ -49,19 +50,6 @@ export default { ...@@ -49,19 +50,6 @@ export default {
groupId: String, groupId: String,
}, },
data() { data() {
const userList = []
getUserPage({ current: 1, size: 1000 }).then((res) => {
if (res.code === 1) {
const d = res.data
d.records &&
d.records.forEach((item) => {
userList.push({
label: item.name,
value: item.id,
})
})
}
})
return { return {
isDepart: false, isDepart: false,
orgMap: {}, orgMap: {},
...@@ -84,6 +72,7 @@ export default { ...@@ -84,6 +72,7 @@ export default {
color: "primary", color: "primary",
icon: "el-icon-plus", icon: "el-icon-plus",
value: "分配用户", value: "分配用户",
loading: false,
func: this.handleAdd, func: this.handleAdd,
}, },
], ],
...@@ -137,7 +126,7 @@ export default { ...@@ -137,7 +126,7 @@ export default {
placeholder: "请选择用户", placeholder: "请选择用户",
prop: "userId", prop: "userId",
multiple: true, multiple: true,
opts: userList, opts: [],
rules: [{ required: true, message: "请选择用户" }], rules: [{ required: true, message: "请选择用户" }],
}, },
], ],
...@@ -171,7 +160,26 @@ export default { ...@@ -171,7 +160,26 @@ export default {
this.$message.error("请先选择/分配协作组") this.$message.error("请先选择/分配协作组")
return return
} }
this.searchList[2].loading = true
// 获取用户列表
const userList = []
getUserPage({ groupId: this.groupId, current: 1, size: 1000 }).then(
(res) => {
if (res.code === 1) {
const d = res.data
d.records &&
d.records.forEach((item) => {
userList.push({
label: item.name,
value: item.id,
})
})
this.formData[0].opts = userList
this.$refs.dialog.open() this.$refs.dialog.open()
this.searchList[2].loading = false
}
}
)
}, },
handleConfirm(form) { handleConfirm(form) {
const data = form.userId.map((_) => { const data = form.userId.map((_) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment