Browse Source

切换运算符时清空最大最小值

祁鹏飞 2 tháng trước cách đây
mục cha
commit
71902c3758

+ 13 - 3
src/components/ruleConditionContainer/index.vue

@@ -3,12 +3,12 @@
   <div>
     <div class="flex f-c a-start m-top-20" style="width: 100%;">
       <el-row v-for="(item, index) in props.rulesAttrList" :key="index" class="roleClass flex a-c" style="width: 100%;"
-      :gutter="10">
+        :gutter="10">
         <el-col :span="5">
           <el-input v-model="item.attrName" disabled />
         </el-col>
         <el-col :span="4">
-          <el-select v-model="item.operator" placeholder="运算符">
+          <el-select v-model="item.operator" placeholder="运算符" @change="changeOperator(item, index)">
             <template v-if="item.attrType == 'inputTag' || item.attrType == 'checkbox' || item.attrType == 'select'">
               <el-option label="包含" value="1"></el-option>
               <el-option label="不包含" value="2"></el-option>
@@ -138,7 +138,8 @@
           </el-icon>
         </el-col>
         <el-col :span="2">
-          <el-checkbox v-if="item.attrName === '车牌号'" :disabled="disabled" @change="licenseNoSelect($event, item)">全选</el-checkbox>
+          <el-checkbox v-if="item.attrName === '车牌号'" :disabled="disabled"
+            @change="licenseNoSelect($event, item)">全选</el-checkbox>
         </el-col>
       </el-row>
     </div>
@@ -158,6 +159,15 @@ const attrDel = (index: number) => {
   emits('Del', index)
 }
 
+const changeOperator = (item: object, index: number) => {
+  if (['2', '3'].includes(item.operator)) {
+    props.rulesAttrList[index].max = null
+  }
+  if (['4', '5'].includes(item.operator)) {
+    props.rulesAttrList[index].min = null
+  }
+}
+
 const change = (e: string[] | undefined, index: number, item: any) => {
   if (item?.attrType == 'select') {
     if (item.minArray.length === 0) {

+ 16 - 21
src/views/insurancePolicy/index.vue

@@ -860,8 +860,7 @@
                 <div id="JQStartDate" style="width: 100%">
                   <el-date-picker v-model="insurancePolicyForm.JQStartDate" type="datetime" placeholder="请选择"
                     value-format="YYYY-MM-DD HH:mm:ss" style="width: 250px" @change="jqChange"
-                    :disabled-date="disabledDate"
-                    @focus="inParkingDataFocus('JQStartDate', 'JQStartDate')" />
+                    :disabled-date="disabledDate" @focus="inParkingDataFocus('JQStartDate', 'JQStartDate')" />
                 </div>
               </el-form-item>
               <span class="ml-5 mr-5">至</span>
@@ -869,8 +868,7 @@
                 <div id="JQEndDate" style="width: 100%">
                   <el-date-picker v-model="insurancePolicyForm.JQEndDate" type="datetime" placeholder="请选择"
                     value-format="YYYY-MM-DD HH:mm:ss" style="width: 250px" @change="jqChange"
-                    :disabled-date="disabledDate"
-                    @focus="inParkingDataFocus('JQEndDate', 'JQEndDate')" />
+                    :disabled-date="disabledDate" @focus="inParkingDataFocus('JQEndDate', 'JQEndDate')" />
                 </div>
               </el-form-item>
             </div>
@@ -885,8 +883,7 @@
                 <div id="SYStartDate" style="width: 100%">
                   <el-date-picker v-model="insurancePolicyForm.SYStartDate" type="datetime" placeholder="请选择"
                     value-format="YYYY-MM-DD HH:mm:ss" style="width: 250px" @change="syChange"
-                    :disabled-date="disabledDate"
-                    @focus="inParkingDataFocus('SYStartDate', 'SYStartDate')" />
+                    :disabled-date="disabledDate" @focus="inParkingDataFocus('SYStartDate', 'SYStartDate')" />
                 </div>
               </el-form-item>
               <span class="ml-5 mr-5">至</span>
@@ -894,8 +891,7 @@
                 <div id="SYEndDate" style="width: 100%">
                   <el-date-picker v-model="insurancePolicyForm.SYEndDate" type="datetime" placeholder="请选择"
                     value-format="YYYY-MM-DD HH:mm:ss" style="width: 250px" @change="syChange"
-                    :disabled-date="disabledDate"
-                    @focus="inParkingDataFocus('SYEndDate', 'SYEndDate')" />
+                    :disabled-date="disabledDate" @focus="inParkingDataFocus('SYEndDate', 'SYEndDate')" />
                 </div>
               </el-form-item>
             </div>
@@ -976,7 +972,7 @@
                                     :value="item.value"></el-option>
                                 </el-select>
                                 <span v-if="props.row.kindName == '乘客责任险'">*{{ insurancePolicyForm.seatCount - 1
-                                }}/座</span>
+                                  }}/座</span>
                               </div>
                             </template>
                           </el-table-column>
@@ -1046,7 +1042,7 @@
                           <el-table-column label="产品名称" prop="productName" align="center">
                             <template #default="props">
                               <el-button link type="primary" @click="getJYXDetail(props.row)">{{ props.row.productName
-                              }}</el-button>
+                                }}</el-button>
                             </template>
                           </el-table-column>
                           <el-table-column label="数量" align="center">
@@ -1099,12 +1095,12 @@
                             <div class="Factor-item flex a-c f-c ">
                               <span class="item-header flex a-c ">交强续保</span>
                               <span>{{ ['', '新保', '续保', '转保'][Number(scope.row.quoteResult?.scoreVo?.jqRenewal)] || '--'
-                                }}</span>
+                              }}</span>
                             </div>
                             <div class="Factor-item flex a-c f-c ">
                               <span class="item-header flex a-c ">商业续保</span>
                               <span>{{ ['', '新保', '续保', '转保'][Number(scope.row.quoteResult?.scoreVo?.syRenewal)] || '--'
-                                }}</span>
+                              }}</span>
                             </div>
                             <div class="Factor-item flex a-c f-c ">
                               <span class="item-header flex a-c ">总折扣率</span>
@@ -1122,7 +1118,7 @@
                               <span class="item-header flex a-c ">整单折扣</span>
                               <span>
                                 <el-input-number v-model="scope.row.totalAdjustRate" controls-position="right"
-                                 :precision="3" :step="0.01" :max="1" :min="0" />
+                                  :precision="3" :step="0.01" :max="1" :min="0" />
                               </span>
                             </div>
                             <!-- 各保司定制评分 -->
@@ -2859,7 +2855,7 @@ const handleDriving = (scope: any) => {
   drivingRow.value = scope.$index
   drivingShow.value = true
   nextTick(() => {
-    DrivingTypeRef.value.initEditData(scope.row.projectList[scope.row.productIndex].drivings, 0, insurancePolicyForm.value.order.insuranceCompanyCode,scope.row.projectList[scope.row.productIndex].drivingsArr)
+    DrivingTypeRef.value.initEditData(scope.row.projectList[scope.row.productIndex].drivings, 0, insurancePolicyForm.value.order.insuranceCompanyCode, scope.row.projectList[scope.row.productIndex].drivingsArr)
   })
 }
 // 删除驾意险
@@ -3695,8 +3691,8 @@ const quoteInsurance = async (companyId: any, companyIndex: any, val: any) => {
       identifyNumber: insurancePolicyForm.value.identifyNumber,
     },
 
-    otherInfo:{
-      totalAdjustRate:company?.totalAdjustRate,  // 整单折扣
+    otherInfo: {
+      totalAdjustRate: company?.totalAdjustRate,  // 整单折扣
     },
 
     kindInfoVo: company?.insurancePlanInfo?.kinds || [],
@@ -3731,14 +3727,13 @@ const quoteInsurance = async (companyId: any, companyIndex: any, val: any) => {
       if (res.data.kindInfoVo) {
         const obj = quoteData.value.find(v => v.id === companyId)
         if (obj && obj.projectList && obj.productIndex !== undefined) {
-          obj.projectList[obj.productIndex].kinds = obj.projectList[obj.productIndex].kinds.map(v=>{
-            const obj=res.data.kindInfoVo.find(k=>k.id===v.id)
+          obj.projectList[obj.productIndex].kinds = obj.projectList[obj.productIndex].kinds.map(v => {
+            const obj = res.data.kindInfoVo.find((k:any) => k.id === v.id)
             return {
               ...v,
-              premium:obj?.premium
+              premium: obj?.premium
             }
           })
-
         }
       }
       // 设置折扣信息
@@ -3919,7 +3914,7 @@ const ruleFilterCompany = (item: any, obj: any) => {
           obj.insCompanyVo?.map((a: any) => {
             if (item.id == a.id) {
               item.quoteResult = { ...a, ...obj };
-              item.totalAdjustRate=obj?.scoreVo?.totalAdjustRate
+              item.totalAdjustRate = obj?.scoreVo?.totalAdjustRate
               item.insurancePlanInfo = {}
               item.insurancePlanInfo.drivings = obj.accidentalDrivings;
               item.insurancePlanInfo.kinds = obj.kindInfoVo.filter(v => v.id);