马宇豪
2023-07-11 2aa05e09b21af76f4803f0f33174453db72b9433
src/views/Admin/notice.vue
@@ -65,7 +65,7 @@
                :file-list="fileList"
                @change="fileChange"
                :headers="header"
                accept=".doc, .docx, .word, .pdf, .zip, .xlsx, .rar"
                accept=".doc, .docx, .word, .pdf, .zip, .xlsx, .rar, .jpg, .jpeg, .png"
                :data="{module: 'naturalDisasterPath'}"
                :remove="(file)=>{removeFile(file)}"
            >
@@ -114,7 +114,12 @@
            </a-checkbox>
          </a-col>
          <a-col :span="12">
            <b style="margin-bottom: 6px">平级接收人选择:</b>
            <div style="display:flex;justify-content: space-between;align-items: center;">
              <b>平级接收人选择:</b>
              <a-checkbox :checked="checkSlAll" @change="checkSlChange">
                全选
              </a-checkbox>
            </div>
            <a-form-model-item prop="recipient">
              <a-select mode="multiple" placeholder="选择平级接收单位" v-model="form.recipient" @change="handle">
                <a-select-option v-for="item in filteredOptions" :key="item.id" :value="item.id">
@@ -186,6 +191,7 @@
        sendLeaders: [],
        leaders: [],
        checkAll: false,
        checkSlAll: false,
        withLeaders: false,
        areaUsers: [],
        replaceFields: {
@@ -217,7 +223,7 @@
          timeout: [{ required: true, message: '请输入超时时间', trigger: 'blur'}],
          receiver: [{ required: true, message: '请选择接收单位', trigger: 'change'}],
          reviewId: [{ required: true, message: '请选择审批人', trigger: 'change'}],
          recipient: [{ required: true, message: '请选择平级接收人', trigger: 'change'}]
          // recipient: [{ required: true, message: '请选择平级接收人', trigger: 'change'}]
          // acceptingUnitIds: [{ required: true, message: '请选择接收单位', trigger: 'change'}],
          // peerRecipientIds: [{ required: true, message: '请选择平级接收人', trigger: 'change'}]
        },
@@ -312,6 +318,26 @@
        }
      },
      //选择平级部门部分
      handle(selectedItems) {
        const t = this
        if(t.form.recipient.length == t.filteredOptions.length){
          t.checkSlAll = true
        }else{
          t.checkSlAll = false
        }
      },
      checkSlChange(e) {
        const t = this
        t.checkSlAll = !t.checkSlAll
        if(t.checkSlAll == true){
          t.form.recipient = t.filteredOptions.map(i=>i.id)
        }else{
          t.form.recipient = []
        }
      },
      isAddLeaders(e) {
        const t = this
        t.withLeaders = !t.withLeaders
@@ -329,16 +355,18 @@
      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;
@@ -347,7 +375,7 @@
      },
      removeFile(file){
        this.delList.push(file.uid)
        this.delList.push(file.response.data.id)
      },
      async deleteFile(){
@@ -375,9 +403,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]
@@ -385,7 +413,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)
              }
            }
@@ -482,10 +510,7 @@
      onSelect() {
        console.log(...arguments);
      },
         //选择平级部门部分
         handle(selectedItems) {
            this.selectedItems = selectedItems;
         },
      handleRisk(selectedItems) {
        // this.selectedItems = selectedItems;
      },