马宇豪
2023-07-19 0bab85897653f65df1932edb829f2af2bf58b846
src/views/Admin/notice.vue
@@ -93,6 +93,7 @@
            <a-form-model-item prop="receiver" style="margin-bottom: 6px">
              <a-tree-select
                  show-search
                  :maxTagCount="3"
                  tree-checkable
                  treeCheckStrictly
                  style="width: 100%"
@@ -121,7 +122,7 @@
              </a-checkbox>
            </div>
            <a-form-model-item prop="recipient">
              <a-select mode="multiple" placeholder="选择平级接收单位" v-model="form.recipient" @change="handle">
              <a-select mode="multiple" placeholder="选择平级接收单位" v-model="form.recipient" @change="handle" :maxTagCount="3">
                <a-select-option v-for="item in filteredOptions" :key="item.id" :value="item.id">
                  {{ item.recipientName }}({{item.company}} {{item.phone}})
                </a-select-option>
@@ -355,25 +356,27 @@
      fileChange(info) {
        let fileList = [...info.fileList];
        fileList = fileList.map(file => {
          if(file.status == 'done'){
            if (file.response) {
              const res = file.response
              if(res.code == 100){
                this.$message.success('文件上传成功')
              }else{
                this.$message.error('文件上传失败')
          if (file.uid === info.file.uid) {
            if (file.status == 'done') {
              if (file.response) {
                const res = file.response
                if (res.code == 100) {
                  this.$message.success('文件上传成功')
                } else {
                  this.$message.error('文件上传失败')
                }
                // Component will show file.url as link
                file.url = res.data.fileUrl
              }
              // Component will show file.url as link
              file.url = res.data.fileUrl
            }
          }
          return file;
          return file
        });
        this.fileList = fileList;
      },
      removeFile(file){
        this.delList.push(file.uid)
        this.delList.push(file.response.data.id)
      },
      async deleteFile(){
@@ -401,9 +404,9 @@
            }
            const newAList = [].concat(...aList)
            for(let i of newAList){
              const {realName,...data} = i
              const {id:recipienterId,name: recipienterName,phone: recipienterPhone,company: receiveUnit,...rest} = data
              const obj = { recipienterId, recipienterName, recipienterPhone, receiveUnit,...rest}
              // const {realName,...data} = i
              const {id:recipienterId,name: recipienterName,phone: recipienterPhone,company: receiveUnit,realName: recipienterRealName,...rest} = i
              const obj = { recipienterId, recipienterName,recipienterRealName, recipienterPhone, receiveUnit,...rest}
              this.form.acceptingUnitIds.push(obj)
            }
            this.form.acceptingUnitIds = [...this.form.acceptingUnitIds,...this.sendLeaders]
@@ -411,7 +414,7 @@
              const bList = this.form.recipient.map(item => this.filteredOptions.find(i=>i.id == item))
              for(let i of bList){
                const {id:recipienterId,recipientName: recipienterName,phone: recipienterPhone, company: receiveUnit,...rest} = i
                const obj = {recipienterId, recipienterName,recipienterPhone,receiveUnit,unittype:this.unittype,...rest}
                const obj = {recipienterId, recipienterName,recipienterPhone,receiveUnit,unittype:this.unittype,recipienterRealName:recipienterName,...rest}
                this.form.peerRecipientIds.push(obj)
              }
            }