智慧保安互联网APP
shuishen
2021-11-25 19f8e45ad02f51dd058455e3013b53d6885db5e7
pages/dispatch/imgissue.vue
@@ -11,7 +11,10 @@
            <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">
@@ -77,11 +80,11 @@
         return {
            recipientShow: false,
            recipientList: [],
            form: {
               content: '',
               recipient: '',
               recipientData: []
               recipientData: [],
               recipientPeople: ''
            },
            rules: {
@@ -106,6 +109,11 @@
      },
      methods: {
         recipientClick() {
            if (this.recipientList.length > 0) {
               this.recipientShow = true;
               return;
            }
            uni.request({
               url: this.$store.state.piAPI + "/blade-user/seleL",
               method: "get",
@@ -118,12 +126,21 @@
                  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)
                        }
                     }
                  })
@@ -246,9 +263,30 @@
            });
         },
         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
         },
      }