فهرست منبع

其他账务保存时存在相同提单号进行提示

liyuan 1 ماه پیش
والد
کامیت
65bca2b473
2فایلهای تغییر یافته به همراه66 افزوده شده و 15 حذف شده
  1. 7 0
      src/api/otherFinancial/index.js
  2. 59 15
      src/views/finance/otherFinancial/index.vue

+ 7 - 0
src/api/otherFinancial/index.js

@@ -70,3 +70,10 @@ export function exportData(query) {
         params: query
     })
 }
+
+export function validateMblno(data) {
+  return request({
+    url: '/warehouseBusiness/otherFees/validateMblno?mblno=' + data,
+    method: 'post'
+  })
+}

+ 59 - 15
src/views/finance/otherFinancial/index.vue

@@ -317,7 +317,7 @@
             type="primary"
             round
             size="small"
-            @click="submitForm"
+            @click="submit(0)"
             icon="el-icon-edit"
         >保 存
         </el-button
@@ -326,7 +326,7 @@
             type="success"
             round
             size="small"
-            @click="submit"
+            @click="submit(1)"
             icon="el-icon-check"
             :disabled="disabled"
         >提 交
@@ -1013,7 +1013,8 @@ import {
   singleDeletion,
   listCorps_s,
   revokeContainerPort,
-  exportData
+  exportData,
+  validateMblno
 } from "@/api/otherFinancial";
 import {listFees} from "@/api/basicdata/fees";
 import {selectTVesself, selectTVoyagef} from "@/api/finance/kaihe/payment";
@@ -1410,21 +1411,64 @@ export default {
         }
       });
     },
-    submit() {
+    submit(type) {
       this.$refs["rules"].validate((valid) => {
         if (valid) {
-          let formDatae = new window.FormData();
-          formDatae.append("warehouseBills", JSON.stringify(this.queryParams));
-          formDatae.append("feesDr", JSON.stringify(this.warehouseDrList));
-          formDatae.append("feesCr", JSON.stringify(this.warehouseCrList));
-          submit(formDatae).then((res) => {
-            console.log(res);
-            if (res.code === 200) {
-              this.$message.success("提交成功");
-              this.getList();
-              this.jiGang = false;
+          validateMblno(this.queryParams.fMblno).then(res => {
+            if (res.data > 0) {
+              this.$confirm('当前提单号已存在,是否继续' + (type === 0  ? '保存' : '提交') + '?', '提示', {
+                confirmButtonText: '继续',
+                cancelButtonText: '取消',
+                type: 'warning'
+              }).then(() => {
+                if (type === 1) {
+                  this.realSubmit()
+                } else {
+                  this.realSave()
+                }
+                return true
+              }).catch(() => {
+                console.info('用户点击了取消')
+              });
+            } else {
+              if (type === 1) {
+                this.realSubmit()
+              } else {
+                this.realSave()
+              }
             }
-          });
+          })
+
+        }
+      });
+    },
+
+    realSave(){
+      let formDatae = new window.FormData();
+      formDatae.append("warehouseBills", JSON.stringify(this.queryParams));
+      formDatae.append("feesDr", JSON.stringify(this.warehouseDrList));
+      formDatae.append("feesCr", JSON.stringify(this.warehouseCrList));
+      preservation(formDatae).then((res) => {
+        console.log(res);
+        if (res.code === 200) {
+          this.$message.success("保存成功");
+          this.getList();
+          this.jiGang = false;
+        }
+      });
+    },
+
+    realSubmit(){
+      let formDatae = new window.FormData();
+      formDatae.append("warehouseBills", JSON.stringify(this.queryParams));
+      formDatae.append("feesDr", JSON.stringify(this.warehouseDrList));
+      formDatae.append("feesCr", JSON.stringify(this.warehouseCrList));
+      submit(formDatae).then((res) => {
+        console.log(res);
+        if (res.code === 200) {
+          this.$message.success("提交成功");
+          this.getList();
+          this.jiGang = false;
         }
       });
     },