Commit 69d20bd6 authored by miaojiale's avatar miaojiale

增加groupId

parent 077d3f07
......@@ -5,6 +5,7 @@
ref="form"
:label-position="'right'"
:forms="searchList"
:loading="loading"
:style="{ textAlign: 'left' }"
@handleSearch="handleFormSearch"
/>
......@@ -24,7 +25,7 @@
width="450px"
:close-modal="false"
ref="dialog"
title="分配用户用户"
title="分配用户"
:form-edit="formEdit"
:form-data="formData"
@handleConfirm="handleConfirm"
......@@ -49,19 +50,6 @@ export default {
groupId: String,
},
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 {
isDepart: false,
orgMap: {},
......@@ -84,6 +72,7 @@ export default {
color: "primary",
icon: "el-icon-plus",
value: "分配用户",
loading: false,
func: this.handleAdd,
},
],
......@@ -137,7 +126,7 @@ export default {
placeholder: "请选择用户",
prop: "userId",
multiple: true,
opts: userList,
opts: [],
rules: [{ required: true, message: "请选择用户" }],
},
],
......@@ -171,7 +160,26 @@ export default {
this.$message.error("请先选择/分配协作组")
return
}
this.$refs.dialog.open()
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.searchList[2].loading = false
}
}
)
},
handleConfirm(form) {
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