浏览代码

feat: 调整协议归档弹窗

zhangyuhan 3 月之前
父节点
当前提交
93d3b5e8ea

+ 12 - 14
src/components/uploadFile.vue

@@ -2,7 +2,7 @@
     <div class="upload-file">
         <Input type="text" v-model="payHtml" :placeholder="placeholdered" readonly></Input>
         <Input type="text" v-model="validateVar" style="display:none"></Input>
-        <Upload 
+        <Upload
             ref="uploadRef"
             :multiple="multipled"
             :action="action"
@@ -38,6 +38,10 @@
                 type: String,
                 default: '/filemanage/upload'
             },
+            newApi: {
+              type: Boolean,
+              default: false
+            },
             placeholdered: String,
             accepted: String,
             formated: Array,
@@ -59,26 +63,20 @@
             },
             handleSuccess(res, file) {// 文件上传成功
                 this.uploadShow = false
-                this.$Notice.success({title: '上传成功'})
+                this.$notify.success({title: '上传成功'})
                 this.payHtml = file.name
-                this.$emit('fileData', file.response.url)
+                this.$emit('fileData', this.newApi ? res.data.url : file.response.url)
             },
             handleError() {// 文件上传失败
-                this.$Notice.error({title: '上传失败'})
+                this.$notify.error({title: '上传失败'})
             },
             handleExceeded() {// 文件超出指定大小限制
-                this.$Notice.warning({title: '上传文件内存应小于10M'})
+                this.$notify.warning({title: '上传文件内存应小于10M'})
             },
             formatError() {// 文件格式验证失败
-                this.$Notice.warning({
+                this.$notify.warning({
                     title: '上传文件格式错误',
-                    desc: '格式支持',
-                    render: h => {
-                        return h('span', [
-                            '格式仅支持:',
-                            h('p', this.accepted)
-                        ])
-                    }
+                    message: `格式仅支持 ${this.accepted}`
                 })
             },
             contractData(name) {
@@ -109,4 +107,4 @@
     top: -28px;
     font-size: 18px;
 }
-</style>
+</style>

+ 8 - 1
src/views/create-order/components/order-detail-submodule/ContractInfo.vue

@@ -215,7 +215,14 @@ export default {
       const url = this.contractRes?.contract_file_url;
       if(url) {
         const urls = this.$router.resolve(url)
-        window.open(urls.href, '_blank')
+        const fileUrl = urls.href.replace('/qmx_page_admin', '')
+        console.log(fileUrl, 'url')
+        this.$confirm("确定下载该归档协议吗?", "提示").then(() => {
+          const a1 = document.createElement('a')
+          a1.download = this.contractRes.contract_file_name
+          a1.href = fileUrl
+          a1.click()
+        })
       }
     },
     // 设置红冲标识显示字段

+ 1 - 1
src/views/order/components/new-detailModel.vue

@@ -89,7 +89,7 @@
                  placeholder="请输入归档份数"></Input>
         </FormItem>
         <FormItem  required label="归档协议">
-          <b-upload ref="uploadRef2" @fileData="contractFile" @onRemove="contractFile('')" :placeholdered="'请上传归档协议'"
+          <b-upload :newApi="true" action="/jyOrderManager/order/upload" ref="uploadRef2" @fileData="contractFile" @onRemove="contractFile('')" :placeholdered="'请上传归档协议'"
                     :accepted="'.doc,.pdf,.docx,.rar,.zip,.jpg,.png,.jpeg'"
                     :formated="['doc', 'pdf', 'docx', 'rar', 'zip', 'jpg', 'png', 'jpeg']" :multipled="false"></b-upload>
         </FormItem>