Explorar el Código

确权,签收增加查询有无开启审批流,增加跳转盖章按钮

xuefy hace 4 años
padre
commit
66b6512dc4

+ 72 - 6
front-vue/src/views/service/credit/confirmationAudit.vue

@@ -191,9 +191,10 @@
                 </el-table-column>
         </el-table>
         <div class="footer" style="float: right;
-            margin-bottom:2px;">
+            margin-bottom:1px;">
             <el-button type="info" @click="submitForm('01')">拒绝</el-button>
-            <el-button type="primary" @click="submitForm('00')">通过</el-button>
+            <el-button type="primary" @click="submitForm('00')" v-if="isHas">通过</el-button>
+            <el-button type="primary" @click="confirmApproval()" v-if="!isHas">确权</el-button>
             <el-button @click="cancel">取 消</el-button>
         </div>
         <!-- 应付账款信息 -->
@@ -271,7 +272,10 @@
 import {listCreditLine,getCreditDetail,getAccountsCollection,getAvailableBalance,getFile} from "@/api/service/credit/credit";
 import {approveCredit} from "@/api/service/credit/creditHandle";
 import {accAdd} from "@/utils/calculation";
+import {isOpenApproval} from "@/api/service/credit/approvalRelatedCredit";
+import {listCompanyHandler} from "@/api/common/companyHandler";
 import {getToken} from "@/utils/auth";
+import Cookies from 'js-cookie'
 export default {
     name: "addCredit",
     components: {},
@@ -381,7 +385,13 @@ export default {
             openFile:false,
             wordUrl: "",
             show:false,
-            heid:false
+            heid:false,
+            //控制通过,确权按钮展示或隐藏
+            isHas:true,
+            //融信编号
+            zfiId:"",
+            //核心审批状态
+            zfiCoreStatus:""
         };
     },
     watch:{
@@ -389,11 +399,14 @@ export default {
     },
     activated() {
         const zfiId = this.$route.params && this.$route.params.zfiId;
+        this.zfiId = zfiId;
         getCreditDetail(zfiId).then((response) => {
              if(response.data){
                 this.form = response.data.financeInf;
                 //融信类型
                 this.zfiCreateType = response.data.financeInf.zfiCreateType;
+                //核心审批状态
+                this.zfiCoreStatus = response.data.financeInf.zfiCoreStatus;
 
                 //供应商开立
                 if(this.zfiCreateType == '2'){
@@ -418,6 +431,8 @@ export default {
                 //附件
                  this.getFile(this.ticketList);
              }
+             //查询有无确权的内部审批
+             this.isOpenApproval();
              
         })
         //授信额度
@@ -829,9 +844,16 @@ export default {
                     this.form.availableAmt = this.availableAmt;
                     approveCredit(this.form).then(response => {
                         loading.close();
-                        this.msgSuccess("确权成功");
-                        this.$store.dispatch("tagsView/delView", this.$route);
-                        this.$router.go(-1);
+                        //通过
+                        if("00" == param){
+                            this.msgSuccess("融信资料已提交企业内部审核");
+                            this.$store.dispatch("tagsView/delView", this.$route);
+                            this.$router.go(-1);
+                        }else if("01" == param){//拒绝
+                            this.msgSuccess("拒绝后,该笔融信业务将作废");
+                            this.$store.dispatch("tagsView/delView", this.$route);
+                            this.$router.go(-1);
+                        }
                     }).catch((response)=>{
                         loading.close();
                     });
@@ -905,6 +927,50 @@ export default {
       this.input=e.target.value
       this.form.zfiAmount=this.input
     },
+    //查询有无确权内部审批
+    isOpenApproval(){
+         var confirmParam = {};
+         confirmParam.menuId = "1000000007";
+         isOpenApproval(confirmParam).then((response) => {
+             var result = response.data.isOpen;
+            //有确权内部审批
+            if(true == result){
+                //获取核心审批状态(拒绝或者状态为空时显示通过按钮)
+                if(this.zfiCoreStatus == "02" || this.zfiCoreStatus == "" || this.zfiCoreStatus == "null" || this.zfiCoreStatus == null ){
+                    this.isHas = true;
+                }else{
+                     this.isHas = false;
+                }
+            }else{//无确权内部审批,显示确权按钮
+                this.isHas = false;
+            }
+        });
+    },
+    //确权
+    confirmApproval(){
+        if(this.zfiCoreStatus != "01"){
+                this.$message({
+                  message: "请内部审核通过后,再合同签署",
+                  type: 'warning'
+                });
+                return false;
+            }
+        //查询当前用户是否为经办人
+        listCompanyHandler().then((response) => {
+            //先判断核心企业确权审批是否通过
+            if(false == response.data){
+              this.$message({
+                  message: "此操作需经办人权限,请确认您是否是经办人",
+                  type: 'warning'
+              });
+              return false;
+            }else{
+              Cookies.set("/credit/creditSeal/"+this.zfiId + "/", this.$route.fullPath)
+              this.$router.push({ path: "/credit/creditSeal/"+this.zfiId + "/" });
+           }
+
+        }); 
+    }
        
     }
 };

+ 86 - 12
front-vue/src/views/service/credit/signFor.vue

@@ -149,8 +149,9 @@
         </el-table>
         <div class="footer" style="float: right;
             margin-bottom:2px;">
-           <!--  <el-button type="info" @click="submitForm('01')">拒签</el-button> -->
-            <el-button type="primary" @click="submitForm('00')">签收</el-button>
+            <el-button type="info" @click="submitForm('01')">拒签</el-button>
+            <el-button type="primary" @click="sign()" v-if="!isHas">签收</el-button>
+            <el-button type="primary" @click="submitForm('00')" v-if="isHas">内部审批</el-button>
             <el-button @click="cancel">取 消</el-button>
         </div>
            <!-- 应收账款信息 -->
@@ -227,6 +228,9 @@ import {signFor} from "@/api/service/credit/creditHandle";
 import {accAdd} from "@/utils/calculation";
 import {getToken} from "@/utils/auth";
 import AddBill from "@/views/service/bill/addBill";
+import {isOpenApproval} from "@/api/service/credit/approvalRelatedCredit";
+import {listCompanyHandler} from "@/api/common/companyHandler";
+import Cookies from 'js-cookie'
 export default {
     name: "addCredit",
     components: {AddBill},
@@ -322,7 +326,13 @@ export default {
           //接收方账户
           receiverAccount:"",
           //起止日期
-          stopDate:""
+          stopDate:"",
+          //控制签收,内部审批按钮展示
+          isHas:true,
+          //融资企业审批状态
+          zfiSupplierStatus:"",
+          //融信编号
+          zfiId:"",
           
         };
     },
@@ -331,6 +341,7 @@ export default {
     },
     created() {
          const zfiId = this.$route.params && this.$route.params.zfiId;
+         this.zfiId = zfiId;
          getCreditDetail(zfiId).then((response) => {
              if(response.data){
                  //签发金额
@@ -343,6 +354,8 @@ export default {
                 this.zfiSupplierId = response.data.financeInf.zfiSupplierId;
                 //类型
                 this.zfiCreateType = response.data.financeInf.zfiCreateType;
+                //融资方审批状态
+                this.zfiSupplierStatus = response.data.financeInf.zfiSupplierStatus;
                 //核心
                 if( this.zfiCreateType == "1"){
                     this.isClick = false;
@@ -367,8 +380,10 @@ export default {
                  //附件
                  this.getFile(this.ticketList);
              }
-             
+             //查询有无签收内部审批
+             this.isOpenApproval();
         })
+      
     },
     methods: {
         // 取消按钮
@@ -720,10 +735,17 @@ export default {
                             _this.form.ticketList = _this.ticketList;
                              _this.form.flag = param;
                             signFor(_this.form).then(response => {
-                                loading.close();
-                                _this.msgSuccess("签收成功");
-                                _this.$store.dispatch("tagsView/delView", _this.$route);
-                                _this.$router.go(-1);
+                                 loading.close();
+                                //通过
+                                if("00" == param){
+                                    _this.msgSuccess("融信资料已提交企业内部审核");
+                                    _this.$store.dispatch("tagsView/delView", _this.$route);
+                                    _this.$router.go(-1);
+                                }else if ("01" == param){//拒绝
+                                    _this.msgSuccess("拒绝后,该笔融信业务将作废");
+                                    _this.$store.dispatch("tagsView/delView", _this.$route);
+                                    _this.$router.go(-1);
+                                }
                             }).catch((response)=>{
                                 loading.close();
                             });
@@ -736,10 +758,17 @@ export default {
                     this.form.ticketList = this.ticketList;
                     this.form.flag = param;
                     signFor(this.form).then(response => {
-                        loading.close();
-                        this.msgSuccess("签收成功");
-                        this.$store.dispatch("tagsView/delView", this.$route);
-                        this.$router.go(-1);
+                         loading.close();
+                        //通过
+                        if("00" == param){
+                            this.msgSuccess("融信资料已提交企业内部审核");
+                            this.$store.dispatch("tagsView/delView", this.$route);
+                            this.$router.go(-1);
+                        }else if ("01" == param){//拒绝
+                            this.msgSuccess("拒绝后,该笔融信业务将作废");
+                            this.$store.dispatch("tagsView/delView", this.$route);
+                            this.$router.go(-1);
+                        }
                     }).catch((response)=>{
                         loading.close();
                     });
@@ -836,6 +865,51 @@ export default {
             }
         })
         self.openAddBill = false
+    },
+    //查询有无签收内部审批
+    isOpenApproval(){
+         var confirmParam = {};
+         confirmParam.menuId = "1000000005";
+         isOpenApproval(confirmParam).then((response) => {
+             var result = response.data.isOpen;
+            //有签收内部审批
+            if(true == result){
+                 //获取融资方审批状态(拒绝或者状态为空时显示通过按钮)
+                if(this.zfiSupplierStatus == "02" || this.zfiSupplierStatus == "" || this.zfiSupplierStatus == "null" || this.zfiSupplierStatus == null ){
+                    this.isHas = true;
+                }else{
+                     this.isHas = false;
+                }
+            }else{//无签收内部审批,显示签收按钮
+                this.isHas = false;
+            }
+        });
+    },
+    //签收
+    sign(){
+          if(this.zfiSupplierStatus != "01"){
+                this.$message({
+                  message: "请内部审核通过后,再融信签收",
+                  type: 'warning'
+                });
+                return false;
+            }
+            //查询当前用户是否为经办人
+            listCompanyHandler().then((response) => {
+                //先判断核心企业确权审批是否通过
+                if(false == response.data){
+                    this.$message({
+                        message: "此操作需经办人权限,请确认您是否是经办人",
+                        type: 'warning'
+                    });
+                    return false;
+                }else{
+                    Cookies.set("/credit/creditSeal/"+this.zfiId + "/", this.$route.fullPath)
+                    this.$router.push({ path: "/credit/creditSeal/"+this.zfiId + "/" });
+                    }
+
+            }); 
+
     }
   }
 };