浏览代码

提交报关进出口新增上传PDF

caojunjie 2 年之前
父节点
当前提交
778b57d8f9

+ 1 - 1
src/components/trade-card/main.vue

@@ -99,7 +99,7 @@ export default {
 
     .container-title {
       font-size: 12px;
-      line-height: 18px;
+      line-height: 20px;
       font-family: PingFangSC-Semibold, PingFang SC;
       font-weight: 600;
       color: #323233;

+ 45 - 0
src/views/purchase/exportDeclaration/detailsPage.vue

@@ -20,6 +20,10 @@
             @click="confirmEdit"
             v-if="optionForm.disabled === true">编辑
         </el-button>
+        <el-button style="margin-right: 10px" type="primary" size="small"
+                   :disabled="form.status>0 || !form.id"
+                   @click="excelBox = true">上传
+        </el-button>
         <el-dropdown style="margin-right: 10px">
           <el-button type="primary" size="small">
             初审审核<i class="el-icon-arrow-down el-icon--right"></i>
@@ -278,6 +282,36 @@
           @choceScheduleFun="choceScheduleFun"
       ></check-schedule>
     </el-dialog>
+    <el-dialog
+        title="上传附件"
+        append-to-body
+        :visible.sync="excelBox"
+        width="555px"
+        v-if="excelBox"
+        :close-on-click-modal="false"
+        v-dialog-drag
+    >
+      <el-upload
+          class="upload-demo"
+          drag
+          style="text-align: center"
+          ref="upload"
+          :action="action"
+          :headers="headers"
+          :data={id:form.id}
+          accept=".pdf,.PDF"
+          :show-file-list="false"
+          :on-success="onSuccess"
+          :on-error="onError"
+          multiple
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip" slot="tip">
+          如上传文件过大,请耐心等待上传成功
+        </div>
+      </el-upload>
+    </el-dialog>
   </div>
 </template>
 
@@ -297,6 +331,7 @@ import {
 
 import checkSchedule from "@/components/check/checkSchedule";
 import {selectByName} from "@/api/boxManagement";
+import {getToken} from "@/util/auth";
 
 export default {
   name: "detailsPage",
@@ -307,6 +342,9 @@ export default {
   components: {checkSchedule},
   data() {
     return {
+      excelBox:false,
+      action: "/api/blade-box-tube/declareCustoms/importPDF",
+      headers: { "Blade-Auth": "Bearer " + getToken() },
       roleName:'',
       key: 0,
       formTwoTwo:{},
@@ -971,6 +1009,13 @@ export default {
     }
   },
   methods: {
+    onSuccess(response, file, fileList) {
+      this.excelBox = false;
+      this.refresh(this.form.id)
+    },
+    onError(err, file, fileList){
+      this.$message.error(JSON.parse(err.message).msg)
+    },
     confirmEdit() {
       if (this.form.status > 0) {
         //基础资料

+ 46 - 1
src/views/purchase/importDeclaration/detailsPage.vue

@@ -11,10 +11,14 @@
         </el-button>
       </div>
       <div class="add-customer-btn">
-        <el-button class="el-button--small-yh" style="margin-right: 10px" type="primary" size="small"
+        <el-button class="el-button--small-yh" type="primary" size="small"
                    :disabled="form.status>0"
                    @click="confirmEdit" v-if="optionForm.disabled === true">编辑
         </el-button>
+        <el-button style="margin-right: 10px" type="primary" size="small"
+                   :disabled="form.status>0 || !form.id"
+                   @click="excelBox = true">上传
+        </el-button>
         <el-dropdown style="margin-right: 10px">
           <el-button type="primary" size="small">
             初审审核<i class="el-icon-arrow-down el-icon--right"></i>
@@ -267,6 +271,36 @@
           @choceScheduleFun="choceScheduleFun"
       ></check-schedule>
     </el-dialog>
+    <el-dialog
+        title="上传附件"
+        append-to-body
+        :visible.sync="excelBox"
+        width="555px"
+        v-if="excelBox"
+        :close-on-click-modal="false"
+        v-dialog-drag
+    >
+      <el-upload
+          class="upload-demo"
+          drag
+          style="text-align: center"
+          ref="upload"
+          :action="action"
+          :headers="headers"
+          :data={id:form.id}
+          accept=".pdf,.PDF"
+          :show-file-list="false"
+          :on-success="onSuccess"
+          :on-error="onError"
+          multiple
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip" slot="tip">
+          如上传文件过大,请耐心等待上传成功
+        </div>
+      </el-upload>
+    </el-dialog>
   </div>
 </template>
 
@@ -286,6 +320,7 @@ import {
 
 import checkSchedule from "@/components/check/checkSchedule";
 import {selectByName} from "@/api/boxManagement";
+import {getToken} from "@/util/auth";
 
 export default {
   name: "detailsPage",
@@ -296,6 +331,9 @@ export default {
   components: {checkSchedule},
   data() {
     return {
+      excelBox:false,
+      action: "/api/blade-box-tube/declareCustoms/importPDF",
+      headers: { "Blade-Auth": "Bearer " + getToken() },
       roleName:'',
       key: 0,
       formTwoTwo:{},
@@ -960,6 +998,13 @@ export default {
     }
   },
   methods: {
+    onSuccess(response, file, fileList) {
+      this.excelBox = false;
+      this.refresh(this.form.id)
+    },
+    onError(err, file, fileList){
+      this.$message.error(JSON.parse(err.message).msg)
+    },
     confirmEdit() {
       if (this.form.status > 0) {
         //基础资料