| | |
| | | |
| | | <u-form-item label-width='158' prop="recipientText" label="指令接收人" :required="true"> |
| | | |
| | | <u-button slot="right" type="success" size="mini" @click="recipientClick">选择接收人</u-button> |
| | | <u-input type='textarea' v-model="form.recipientPeople" placeholder="请选择指令接收人" |
| | | @click="recipientClick" autoHeight /> |
| | | |
| | | <!-- <u-button slot="right" type="success" size="mini" @click="recipientClick">选择接收人</u-button> --> |
| | | |
| | | <u-popup :closeable="true" v-model="recipientShow" mode="bottom" height="50%" border-radius="14"> |
| | | |
| | |
| | | return { |
| | | recipientShow: false, |
| | | recipientList: [], |
| | | |
| | | form: { |
| | | content: '', |
| | | recipient: '', |
| | | recipientData: [] |
| | | recipientData: [], |
| | | recipientPeople: '' |
| | | }, |
| | | rules: { |
| | | |
| | |
| | | }, |
| | | methods: { |
| | | recipientClick() { |
| | | if (this.recipientList.length > 0) { |
| | | this.recipientShow = true; |
| | | return; |
| | | } |
| | | |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + "/blade-user/seleL", |
| | | method: "get", |
| | |
| | | this.recipientList = [] |
| | | |
| | | res.data.data.forEach(item => { |
| | | var flag = true |
| | | |
| | | if (item.id != this.$store.state |
| | | .UserData.user_id |
| | | ) { |
| | | item.checked = false; |
| | | this.recipientList.push(item) |
| | | if (this.recipientList.length > 0) { |
| | | this.recipientList.forEach(it => { |
| | | if (item.id == it.id) flag = false |
| | | }) |
| | | } |
| | | |
| | | if (flag == true) { |
| | | if (item.id != this.$store.state |
| | | .UserData.user_id |
| | | ) { |
| | | item.checked = false; |
| | | this.recipientList.push(item) |
| | | } |
| | | } |
| | | |
| | | }) |
| | |
| | | }); |
| | | }, |
| | | checkboxGroupChange(e) { |
| | | var that = this |
| | | |
| | | this.form.recipientData = e |
| | | |
| | | var str = "" |
| | | var num = 0 |
| | | |
| | | that.form.recipientData.forEach((item, index) => { |
| | | that.recipientList.forEach((it, index) => { |
| | | if (item == it.id) { |
| | | if (num > 0) { |
| | | str += '、'; |
| | | str += it.real_name; |
| | | } else { |
| | | str += it.real_name |
| | | } |
| | | num += 1 |
| | | return |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | this.form.recipientPeople = str |
| | | |
| | | }, |
| | | |
| | | } |