ソースを参照

协议产品费用新增方案、删除方案批量操作已填方案的问题

li.pengfei 3 年 前
コミット
16f6d10bb1
1 ファイル変更23 行追加16 行削除
  1. 23 16
      src/views/AgreementManage/CarInsurance/AgreementEntry.vue

+ 23 - 16
src/views/AgreementManage/CarInsurance/AgreementEntry.vue

@@ -229,7 +229,7 @@
               </div>
               <div>
                 <el-button type="warning " style="background-color: #52C578;border:#52C578 " :size="overSize"
-                  @click="addproductCosts">增加方案</el-button>
+                  @click="addproductCosts(schemeindex)">增加方案</el-button>
               </div>
               <div class="productCosts" v-for="(productCostsitem, productCostsindex) in schemeitem.productCosts"
                 :key="productCostsindex">
@@ -240,7 +240,7 @@
                       @click="VehicleFactor(schemeindex, productCostsindex)">费用因子</el-button>
 
                     <el-button v-if="productCostsindex != 0" type="danger" :size="overSize"
-                      @click="deleteproductCosts(productCostsindex)">删除方案</el-button>
+                      @click="deleteproductCosts(schemeindex,productCostsindex)">删除方案</el-button>
                   </div>
                 </div>
                 <el-form ref="costform" :model="productCostsitem" label-width="130px" :size="overSize"
@@ -2142,9 +2142,11 @@ export default {
       this.productCostsindex=productCostsindex;
     },
     disabledDate1(time) {
-      let datetime=this.costform.scheme[this.schemeindex].productCosts[this.productCostsindex].costsStartDate;
-      const disabledTime = new Date(datetime).getTime()+8.64e7;
-      return time.getTime() < disabledTime;
+      if(this.costform.scheme[this.schemeindex]&&this.costform.scheme[this.schemeindex].productCosts[this.productCostsindex]){
+        let datetime=this.costform.scheme[this.schemeindex].productCosts[this.productCostsindex].costsStartDate;
+        const disabledTime = new Date(datetime).getTime()+8.64e7;
+        return time.getTime() < disabledTime;
+      }
     },
 
     //请求类型change
@@ -2235,16 +2237,17 @@ export default {
       this.insure = arr;
     },
     //删除产品方案
-    deleteproductCosts(index) {
-      let params = this.costform.scheme;
-      params.map(ele => {
-        ele.productCosts.splice(index, 1)
-      })
+    deleteproductCosts(schemeindex,productCostsindex) {
+      //获取删除方案对应的大类
+      let ele = this.costform.scheme[schemeindex];
+      //删除方案大类下面对应的细方案
+      ele.productCosts.splice(productCostsindex, 1)
     },
     //增加产品方案
-    addproductCosts() {
-      let params = this.costform.scheme;
-      params.map(ele => {
+    addproductCosts(val) {
+      //获取新增方案对应的大类
+      let ele = this.costform.scheme[val];
+      //方案大类下新增一条初始化的方案信息
         ele.productCosts.push({
           costsDescription: "",//费用描述
           costsStartDate:"",//费用起期
@@ -2266,7 +2269,7 @@ export default {
           sySpilloverPremiums: "",//溢出保费(商业)
           sySpilloverProportion: "",//溢出比例(商业)
         })
-      })
+
     },
     //添加产品
     pruductChange(event, item) {
@@ -2337,8 +2340,8 @@ export default {
         this.natureOfUseList = [];
       } else {
         let item = this.costform.scheme[lineindex].productCosts[outindex];
-        this.vehicleCategoryList = item.vehicleCategory.split(",")
-        this.natureOfUseList = item.natureOfUse.split(",")
+        this.vehicleCategoryList = item.vehicleCategory?item.vehicleCategory.split(","):[];
+        this.natureOfUseList = item.natureOfUse?item.natureOfUse.split(","):[];
         this.value1 = item.licenseNumber != '' ? item.licenseNumber.split(",") : [];
         const {
           transfer, newEnergy, oldAndNew, renewal, minSeats, maxSeats, minTruckTonnage, maxTruckTonnage, minPurchasePrice, maxPurchasePrice, minApprovedLoadCapacity, maxApprovedLoadCapacity, minCompulsoryInsurancePremium, maxCompulsoryInsurancePremium, minTaxAmount, maxTaxAmount, minTheThreePremium, maxTheThreePremium, minOnboardProductsPremium, maxOnboardProductsPremium, minCommercialInsuranceDiscount, maxCommercialInsuranceDiscount, minCompulsoryInsuranceDiscount, maxCompulsoryInsuranceDiscount, minScore, maxScore, minLossRation, maxLossRation,containNoLicense
@@ -2364,6 +2367,10 @@ export default {
         return
       })
       this.CostfactorForm.licenseNumber = linumber.slice(0, -1)
+      //车牌号变更清空时,包含暂未上牌标志也清空
+      if(!this.CostfactorForm.licenseNumber){
+        this.CostfactorForm.containNoLicense="0";
+      }
     },
     vehicleCategoryChange(e) {
       let data = "";