From 0a55d0bfe2e4e7dc514d119acbe8fb3239e94e5a Mon Sep 17 00:00:00 2001
From: wangguangchao <875536587@qq.com>
Date: Thu, 6 Jan 2022 15:02:50 +0800
Subject: [PATCH] 复核、到单、付款交易优化

---
 src/components/BusinessButton.vue      | 205 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------------------------------
 src/model/Trnrel/Event.js              |   3 ++-
 src/views/Business/Bdtset/index.vue    |  32 +++++++++++++++++++-------------
 src/views/Business/Ditdck/index.vue    |  47 ++++++++++++++++++++++++-----------------------
 src/views/Business/Trnrel/Inftrnps.vue |   2 +-
 src/views/Review/index.vue             |   5 -----
 6 files changed, 168 insertions(+), 126 deletions(-)

diff --git a/src/components/BusinessButton.vue b/src/components/BusinessButton.vue
index 0dba403..7ba330c 100644
--- a/src/components/BusinessButton.vue
+++ b/src/components/BusinessButton.vue
@@ -1,99 +1,138 @@
 <template>
-    <div class="bus-button">        
-        <c-button type="primary" v-on:click="save">{{ $t('buttons.submit') }}</c-button>
-        <c-button type="primary" v-on:click="pedding">{{ $t('buttons.stash') }}</c-button>
-        <c-button type="primary" v-on:click="check">{{ $t('buttons.check') }}</c-button>
-        <c-button v-on:click="exit">{{ $t('buttons.quit') }}</c-button>
-    </div>
+  <div class="bus-button">
+    <c-button type="primary" v-on:click="save">{{
+      $t("buttons.submit")
+    }}</c-button>
+    <c-button type="primary" v-on:click="pedding">{{
+      $t("buttons.stash")
+    }}</c-button>
+    <c-button type="primary" v-on:click="check">{{
+      $t("buttons.check")
+    }}</c-button>
+    <c-button v-on:click="exit">{{ $t("buttons.quit") }}</c-button>
+  </div>
 </template>
 <script>
-import commonApi from "~/mixin/commonApi"
-import Utils from "~/utils"
+import commonApi from "~/mixin/commonApi";
+import Utils from "~/utils";
 
 export default {
-    props:["$pntvm"],
-    data(){
-        return{            
+  props: ["$pntvm"],
+  data() {
+    return {};
+  },
+  methods: {
+    async save() {
+      console.log(123);
+      let vm = this.getVM();
+      let result = await vm.save();
+      console.log(result);
+      // if (result.respCode == SUCCESS) {
+      //     this.$notify({
+      //         title: '成功',
+      //         message: '保存成功',
+      //         type: 'success'
+      //     });
+      //     this.$router.history.push("/business/trnrel")
+      // } else {
+
+      // }
+
+      if (
+        result.respCode == SUCCESS &&
+        Object.keys(result.fieldErrors).length == 0
+      ) {
+        this.$notify({
+          title: "成功",
+          message: "保存成功",
+          type: "success",
+        });
+        this.$store.dispatch("TagsView/delView", this.$route);
+        this.$router.history.push("/taskList", () => {
+          this.$store.commit("setTaskListTabVal", "trnrel");
+        });
+      } else if (
+        result.fieldErrors &&
+        Object.keys(result.fieldErrors).length > 0
+      ) {
+        let errorMsg = "";
+
+        let errorMsgkey = "";
+        let errorMsgVal = "";
+        for (const key in result.fieldErrors) {
+          errorMsgkey = key;
+          errorMsgVal = result.fieldErrors[key];
+          errorMsg = errorMsg + errorMsgkey + ":" + errorMsgVal + ";";
         }
+        this.$notify.error({
+          title: "失败",
+          message: "保存失败!错误信息[" + errorMsg + "]",
+        });
+      } else {
+        this.$notify({
+          title: "失败",
+          message: "保存失败",
+          type: "error",
+        });
+      }
+    },
+    async pedding() {
+      let result = await this.getVM().pedding();
+      console.log(result);
+      if (result.respCode == SUCCESS) {
+        this.$notify({
+          title: "成功",
+          message: "暂存成功",
+          type: "success",
+        });
+        this.$router.history.push("/business/sptsel");
+      } else {
+        this.$notify({
+          title: "失败",
+          message: "暂存失败",
+          type: "error",
+        });
+      }
     },
-    methods:{
-        async save(){
-            console.log(123)
-            let vm = this.getVM();
-            let result = await vm.save()
-            console.log(result)
-            if (result.respCode == SUCCESS) {
-                this.$notify({
-                    title: '成功',
-                    message: '保存成功',
-                    type: 'success'
-                });
-                this.$router.history.push("/business/trnrel")
-            } else {
-                this.$notify({
-                    title: '失败',
-                    message: '保存失败',
-                    type: 'error'
-                });
-            }
-        },
-        async pedding(){
-            let result = await this.getVM().pedding()
-            console.log(result)
-            if (result.respCode == SUCCESS) {
-                this.$notify({
-                    title: '成功',
-                    message: '暂存成功',
-                    type: 'success'
-                });
-                this.$router.history.push("/business/sptsel")
-            } else {
-                this.$notify({
-                    title: '失败',
-                    message: '暂存失败',
-                    type: 'error'
-                });
-            }
-        },
-        async check(){
-            let result = await this.getVM().checkAll()
-            if(result.respCode != SUCCESS) {
-                this.$notify.error({title: '错误',message: result.respMsg});
-            } else {
-                // 清除之前的校验状态
-                this.getVM().$refs.modelForm.clearValidate()
-                const fields = this.getVM().$refs.modelForm.fields
-                const fieldErrors = result.fieldErrors;
-                this.getVM().updateModel(result.data)
-                Utils.positioningErrorMsg(fieldErrors, fields)
-                const tab = Utils.positioningErrorMsg(fieldErrors, fields);
-                if(tab) {
-                    // tab切换之后,需出发tab-click的事件
-                    this.getVM().tabClick(tab);
-                }
-            }
-        },
-        exit(){
-            this.$confirm('您有未保存的数据,确定退出吗, 是否继续?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(()=>{
-                this.$router.history.push("/home")
-            })
-        },
-        getVM(){
-            return this.$pntvm
+    async check() {
+      let result = await this.getVM().checkAll();
+      if (result.respCode != SUCCESS) {
+        this.$notify.error({ title: "错误", message: result.respMsg });
+      } else {
+        // 清除之前的校验状态
+        this.getVM().$refs.modelForm.clearValidate();
+        const fields = this.getVM().$refs.modelForm.fields;
+        const fieldErrors = result.fieldErrors;
+        this.getVM().updateModel(result.data);
+        Utils.positioningErrorMsg(fieldErrors, fields);
+        const tab = Utils.positioningErrorMsg(fieldErrors, fields);
+        if (tab) {
+          // tab切换之后,需出发tab-click的事件
+          this.getVM().tabClick(tab);
         }
-    }
-}
+      }
+    },
+    exit() {
+      this.$confirm("您有未保存的数据,确定退出吗, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        this.$router.history.push("/home");
+      });
+    },
+    getVM() {
+      return this.$pntvm;
+    },
+  },
+};
 </script>
 <style>
 .bus-button {
-    margin-bottom: 10px;
+  margin-bottom: 10px;
 }
 
 .bus-button :first-child {
-    margin-left: 0;
+  margin-left: 0;
 }
 </style>
\ No newline at end of file
diff --git a/src/model/Trnrel/Event.js b/src/model/Trnrel/Event.js
index b975f48..3798580 100644
--- a/src/model/Trnrel/Event.js
+++ b/src/model/Trnrel/Event.js
@@ -152,8 +152,9 @@ export default {
                     for (const key in rtnmsg.fieldErrors) {
                         errorMsgkey = key;
                         errorMsgVal = rtnmsg.fieldErrors[key];
+                        errorMsg = errorMsg + errorMsgkey + ':' + errorMsgVal + ";";
                     }
-                    errorMsg = errorMsgkey + ':' + errorMsgVal;
+                   
                 } else if (rtnmsg.respMsg) {
                     errorMsg = rtnmsg.respMsg;
                 }
diff --git a/src/views/Business/Bdtset/index.vue b/src/views/Business/Bdtset/index.vue
index dd6362a..4927792 100644
--- a/src/views/Business/Bdtset/index.vue
+++ b/src/views/Business/Bdtset/index.vue
@@ -91,6 +91,7 @@
 </template>
 <script>
 import Api from "~/service/Api"
+import Utils from "~/utils/index";
 import CodeTable from "~/config/CodeTable"
 import Bdtset from "~/model/Bdtset"
 import CommonProcess from "~/mixin/CommonProcess"
@@ -179,21 +180,26 @@ export default {
      
     },
     created:async function(){
-        console.log("进入bdtset交易");
-        console.log(new Bdtset().data)
-        let rtnmsg = await this.init({})
-        let that = this;
-        if(rtnmsg.respCode == SUCCESS)
-        {
-           this.updateModel(rtnmsg.data)
-           that.$refs.utlp.stmData.data=rtnmsg.data.liaall_tenstm.rows
-           //TODO 处理数据逻辑
+      
 
+         console.log("进入bdtset交易");
+    let rtnmsg = await this.init(this.$route.query)
+    let that = this;
+    if(rtnmsg.respCode == SUCCESS)
+    {
+       //TODO 处理数据逻辑
+        console.log(rtnmsg)
+        Utils.copyValueFromVO(this.model,rtnmsg.data)
+        that.$refs.utlp.stmData.data=rtnmsg.data.liaall_tenstm.rows
+        console.log(this.model);
+        if(this.isInDisplay){
+            this.restoreDisplay()
         }
-        else
-        {
-            this.$notify.error({title: '错误',message: '服务请求失败!'});
-        }
+    }
+    else
+    {
+        this.$notify.error({title: '错误',message: '服务请求失败!'});
+    }
     }
 }
 </script>
diff --git a/src/views/Business/Ditdck/index.vue b/src/views/Business/Ditdck/index.vue
index 24c0491..4d966d6 100644
--- a/src/views/Business/Ditdck/index.vue
+++ b/src/views/Business/Ditdck/index.vue
@@ -76,6 +76,7 @@ import Utils from "~/utils/index";
 import CodeTable from "~/config/CodeTable";
 import Ditdck from "~/model/Ditdck";
 import CommonProcess from "~/mixin/CommonProcess";
+import CommonFuncs from "~/mixin/CommonFuncs";
 import Pattern from "~/model/Ditdck/Pattern";
 import Default from "~/model/Ditdck/Default";
 import Check from "~/model/Ditdck/Check";
@@ -113,7 +114,7 @@ export default {
       root: this,
     };
   },
-  mixins: [CommonProcess], // 里面包含了Default、Check等的公共处理
+  mixins: [CommonProcess,CommonFuncs], // 里面包含了Default、Check等的公共处理
   data() {
     return {
       isShowDocpre:false,
@@ -134,30 +135,30 @@ export default {
     
   },
   created: async function () {
-    // console.log("进入ditdck交易");
-    // let rtnmsg = await this.init(this.$route.query)
-    // if(rtnmsg.respCode == SUCCESS)
-    // {
-    //    //TODO 处理数据逻辑
-    //     console.log(rtnmsg)
-    //     Utils.copyValueFromVO(this.model,rtnmsg.data)
-    //     console.log(this.model);
-    //     if(this.isInDisplay){
-    //         this.restoreDisplay()
-    //     }
-    // }
-    // else
-    // {
-    //     this.$notify.error({title: '错误',message: '服务请求失败!'});
-    // }
-
     console.log("进入ditdck交易");
-    let rtnmsg = await this.init({});
-    if (rtnmsg.respCode == SUCCESS) {
-      Utils.copyValueFromVO(this.model, rtnmsg.data);
-    } else {
-      this.$notify.error({ title: "错误", message: "服务请求失败!" });
+    let rtnmsg = await this.init(this.$route.query)
+    if(rtnmsg.respCode == SUCCESS)
+    {
+       //TODO 处理数据逻辑
+        console.log(rtnmsg)
+        Utils.copyValueFromVO(this.model,rtnmsg.data)
+        console.log(this.model);
+        if(this.isInDisplay){
+            this.restoreDisplay()
+        }
     }
+    else
+    {
+        this.$notify.error({title: '错误',message: '服务请求失败!'});
+    }
+
+    // console.log("进入ditdck交易");
+    // let rtnmsg = await this.init({});
+    // if (rtnmsg.respCode == SUCCESS) {
+    //   Utils.copyValueFromVO(this.model, rtnmsg.data);
+    // } else {
+    //   this.$notify.error({ title: "错误", message: "服务请求失败!" });
+    // }
   },
   methods: {
       changeShowDocpre(val) {
diff --git a/src/views/Business/Trnrel/Inftrnps.vue b/src/views/Business/Trnrel/Inftrnps.vue
index 08f3f76..20413e7 100644
--- a/src/views/Business/Trnrel/Inftrnps.vue
+++ b/src/views/Business/Trnrel/Inftrnps.vue
@@ -401,7 +401,7 @@
             fixed="right"
             prop="display"
             label="操作"
-            width="230px"
+            width="150px"
           >
           <template slot="header">
               <c-col :span="11" style="text-align:left"><span>操作</span></c-col>
diff --git a/src/views/Review/index.vue b/src/views/Review/index.vue
index c904532..9f96dbf 100644
--- a/src/views/Review/index.vue
+++ b/src/views/Review/index.vue
@@ -140,11 +140,6 @@ export default {
   mounted: function() {
     this.init()
   },
-  watch: {
-    $route: function (to, from) {
-      this.init()
-    }
-  },
   methods: {
     async init () {
       this.reset()
--
libgit2 0.26.0