|
@@ -1,10 +1,11 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
|
|
+
|
|
|
<van-field
|
|
<van-field
|
|
|
readonly
|
|
readonly
|
|
|
clickable
|
|
clickable
|
|
|
name="datetimePicker"
|
|
name="datetimePicker"
|
|
|
- :value="peoples"
|
|
|
|
|
|
|
+ v-model="peoples"
|
|
|
:required="isRequired"
|
|
:required="isRequired"
|
|
|
:label="inpitLabel"
|
|
:label="inpitLabel"
|
|
|
placeholder="请选择人员"
|
|
placeholder="请选择人员"
|
|
@@ -57,8 +58,7 @@ export default {
|
|
|
props: {
|
|
props: {
|
|
|
organizationId: {
|
|
organizationId: {
|
|
|
//机构ID
|
|
//机构ID
|
|
|
- type: Number,
|
|
|
|
|
- default: 0
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
userList: {
|
|
userList: {
|
|
|
type: Array,
|
|
type: Array,
|
|
@@ -109,9 +109,18 @@ export default {
|
|
|
this.orgId = val + ''
|
|
this.orgId = val + ''
|
|
|
this.getpeople()
|
|
this.getpeople()
|
|
|
},
|
|
},
|
|
|
|
|
+ //监听弹框是否打开
|
|
|
|
|
+ show(val){
|
|
|
|
|
+ if(val){
|
|
|
|
|
+ this.getpeople()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
//监听人员数组变化
|
|
//监听人员数组变化
|
|
|
userList(val) {
|
|
userList(val) {
|
|
|
- this.peoples = val.map(item => item.userName).join(',')
|
|
|
|
|
|
|
+ this.$set(this.$data,'peoples',val.map(item => item.userName).join(','))
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
this.peoplesId = [val.map(item => item.userId).join(',')]
|
|
this.peoplesId = [val.map(item => item.userId).join(',')]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -123,9 +132,15 @@ export default {
|
|
|
onLoad() {},
|
|
onLoad() {},
|
|
|
getpeople() {
|
|
getpeople() {
|
|
|
getOrgPeople(this.orgId).then(res => {
|
|
getOrgPeople(this.orgId).then(res => {
|
|
|
|
|
+
|
|
|
let { code, data, msg } = res
|
|
let { code, data, msg } = res
|
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
|
this.peopleList = data
|
|
this.peopleList = data
|
|
|
|
|
+ this.peopleList.forEach(item=>{
|
|
|
|
|
+ item.userName=item.name
|
|
|
|
|
+ item.username=item.name
|
|
|
|
|
+ item.userId=item.id
|
|
|
|
|
+ })
|
|
|
this.peopleListCpoy = JSON.parse(JSON.stringify(this.peopleList))
|
|
this.peopleListCpoy = JSON.parse(JSON.stringify(this.peopleList))
|
|
|
|
|
|
|
|
this.peopleListCpoy.forEach(item => {
|
|
this.peopleListCpoy.forEach(item => {
|
|
@@ -161,11 +176,13 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
- this.show = false
|
|
|
|
|
- this.peoples = list.map(item => item.name).join(',')
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // this.peoples = list.map(item => item.name).join(',')
|
|
|
|
|
+
|
|
|
|
|
+ this.$set(this.$data,'peoples',list.map(item => item.name).join(','))
|
|
|
// 抛出已选择人员信息
|
|
// 抛出已选择人员信息
|
|
|
this.$emit('userList', list)
|
|
this.$emit('userList', list)
|
|
|
|
|
+ this.show = false
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|