Browse Source

被保人同投车主

yaoyao 2 years ago
parent
commit
5736f7844d
1 changed files with 28 additions and 30 deletions
  1. 28 30
      src/views/Task/daikeComponents/KtLetter1.vue

+ 28 - 30
src/views/Task/daikeComponents/KtLetter1.vue

@@ -5791,13 +5791,30 @@ export default {
       }
       let starttime = new Date(this.carInfo.registerDate);
       let endtime = new Date(this.carInfo.issueDate);
+      // this.policyHolderInfovalidate();
       if (endtime < starttime) {
         this.$message({ message: "发证日期早于初登日期", type: "error" });
         return;
       }
+      if (_this.bbtbcarShow == true) {
+        _this.insuredPersonInfo = JSON.parse(
+          JSON.stringify(_this.policyHolderInfo)
+        );
+      } else if (_this.bbczcarShow == true) {
+        _this.insuredPersonInfo = JSON.parse(
+          JSON.stringify(_this.ownerInfo)
+        );
+      } else {
+        // _this.insuredPersonInfo = {}
+      }
+      if (this.tbczcarShow == true) {
+        this.policyHolderInfo = JSON.parse(
+          JSON.stringify(_this.ownerInfo)
+        );
+      } else {
+        // this.policyHolderInfo = {}
+      }
       console.log(this.policyHolderInfo, 'policyHolderInfo')
-      // this.policyHolderInfovalidate();
-
       this.$refs["insuredPersonInfo"].validate((valid11) => {
           if (valid11) {
             this.$refs["carInfo"].validate((valid) => {
@@ -5809,37 +5826,9 @@ export default {
                       _this.$message.warning('请选择险别')
                       return
                     }
-                    // tbczcarShow: true, //投保人同车主
-                    // bbczcarShow: false, //被保人同车主
-                    // bbtbcarShow: true, //被保人同投保人
-                    // ownerInfo    车主
-                    // policyHolderInfo   投保人
-                    // insuredPersonInfo  被保人
-
-                    if (_this.bbtbcarShow == true) {
-                      _this.insuredPersonInfo = JSON.parse(
-                        JSON.stringify(_this.policyHolderInfo)
-                      );
-                    } else if (_this.bbczcarShow == true) {
-                      _this.insuredPersonInfo = JSON.parse(
-                        JSON.stringify(_this.ownerInfo)
-                      );
-                    } else {
-                      // _this.insuredPersonInfo = {}
-                    }
-
-                    if (this.tbczcarShow == true) {
-                      this.policyHolderInfo = JSON.parse(
-                        JSON.stringify(_this.ownerInfo)
-                      );
-                    } else {
-                      // this.policyHolderInfo = {}
-                    }
-
                     let res = {};
                     // res = await this.$api.letter.getAllAgreement();
                     // this.$api.letter.getAllAgreement().then((res) => {
-                    // oldData
                     let param = {
                       productId: this.productId,
                       carInfo: this.carInfo,
@@ -11352,6 +11341,7 @@ export default {
       switch (this.tbczcarShow) {
         case true:
           this.policyHolderInfo = JSON.parse(JSON.stringify(this.ownerInfo));
+          this.getCompanyList()
           break;
         default:
           for (let key in this.policyHolderInfo) {
@@ -11369,6 +11359,9 @@ export default {
         case true:
           this.bbtbcarShow = false;
           this.insuredPersonInfo = JSON.parse(JSON.stringify(this.ownerInfo));
+          setTimeout(() => {
+            this.getCompanyList()
+          }, 1000);
           break;
         default:
           for (let key in this.insuredPersonInfo) {
@@ -11376,6 +11369,7 @@ export default {
             this.insuredPersonInfo.provinceData = [];
             // this.selectedOptions3 = [];
           }
+          this.insuredPersonInfo = {}
       }
       this.$forceUpdate()
     },
@@ -11387,12 +11381,16 @@ export default {
           this.insuredPersonInfo = JSON.parse(
             JSON.stringify(this.policyHolderInfo)
           );
+          setTimeout(() => {
+            this.getCompanyList()
+          }, 1000);
           break;
         default:
           for (let key in this.insuredPersonInfo) {
             this.insuredPersonInfo[key] = "";
             this.insuredPersonInfo.provinceData = [];
           }
+          this.insuredPersonInfo = {}
       }
       this.$forceUpdate()
     },