Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev' into dev

dongxin před 1 rokem
rodič
revize
8660b73b4b
32 změnil soubory, kde provedl 3577 přidání a 2534 odebrání
  1. 2 2
      config/dev.env.js
  2. 24 1
      src/assets/css/common.css
  3. 21 0
      src/components/Form/ProductCostForm.vue
  4. 9 0
      src/http/moudules/letter.js
  5. 285 241
      src/views/AgreementManage/InsuranceCompany/CargoTruck/BusinessOperation/Fuel/AddOrdinaryPlan.vue
  6. 89 46
      src/views/AgreementManage/InsuranceCompany/CargoTruck/BusinessOperation/Fuel/OrdinaryPlan.vue
  7. 285 241
      src/views/AgreementManage/InsuranceCompany/CargoTruck/BusinessOperation/NewEnergy/AddOrdinaryPlan.vue
  8. 90 47
      src/views/AgreementManage/InsuranceCompany/CargoTruck/BusinessOperation/NewEnergy/OrdinaryPlan.vue
  9. 285 241
      src/views/AgreementManage/InsuranceCompany/CargoTruck/NonBusiness/Fuel/AddOrdinaryPlan.vue
  10. 90 47
      src/views/AgreementManage/InsuranceCompany/CargoTruck/NonBusiness/Fuel/OrdinaryPlan.vue
  11. 285 241
      src/views/AgreementManage/InsuranceCompany/CargoTruck/NonBusiness/NewEnergy/AddOrdinaryPlan.vue
  12. 90 47
      src/views/AgreementManage/InsuranceCompany/CargoTruck/NonBusiness/NewEnergy/OrdinaryPlan.vue
  13. 289 243
      src/views/AgreementManage/InsuranceCompany/PassengerBus/BusinessOperation/Fuel/AddOrdinaryPlan.vue
  14. 90 47
      src/views/AgreementManage/InsuranceCompany/PassengerBus/BusinessOperation/Fuel/OrdinaryPlan.vue
  15. 262 217
      src/views/AgreementManage/InsuranceCompany/PassengerBus/BusinessOperation/NewEnergy/AddOrdinaryPlan.vue
  16. 90 47
      src/views/AgreementManage/InsuranceCompany/PassengerBus/BusinessOperation/NewEnergy/OrdinaryPlan.vue
  17. 286 241
      src/views/AgreementManage/InsuranceCompany/PassengerBus/NonBusiness/Fuel/AddOrdinaryPlan.vue
  18. 90 47
      src/views/AgreementManage/InsuranceCompany/PassengerBus/NonBusiness/Fuel/OrdinaryPlan.vue
  19. 286 241
      src/views/AgreementManage/InsuranceCompany/PassengerBus/NonBusiness/NewEnergy/AddOrdinaryPlan.vue
  20. 90 47
      src/views/AgreementManage/InsuranceCompany/PassengerBus/NonBusiness/NewEnergy/OrdinaryPlan.vue
  21. 26 1
      src/views/Core/KtCommonTable.vue
  22. 102 0
      src/views/DistributionManage/PartnerManagement/IevelRule.vue
  23. 201 86
      src/views/PeopleManage/Customer/CustomerServiceAccount.vue
  24. 1 1
      src/views/Sys/TaiShanAuth.vue
  25. 18 1
      src/views/Task/AgentPoolChannel/AgentPoolChannel1.vue
  26. 18 2
      src/views/Task/CompanyPoolChannel/CompanyPoolChannel1.vue
  27. 62 38
      src/views/Task/ElectricSales/AgentPoolChannel1.vue
  28. 23 101
      src/views/Task/External/ExternalOrders.vue
  29. 18 1
      src/views/Task/TaskPoolChannel/TaskPoolChannel1.vue
  30. 18 11
      src/views/Task/daikeComponents/KtLetter.vue
  31. 33 6
      src/views/Task/daikeComponents/KtLetter1.vue
  32. 19 2
      src/views/Task/daikeComponents/KtOrder.vue

+ 2 - 2
config/dev.env.js

@@ -6,7 +6,7 @@ module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
   ENV_CONFIG: '"dev"',
   // BASE_URL: '"https://test.baoxianzhanggui.com/web-api"',//测试服务器
-  // BASE_URL:'"https://sxzgkj.baoxianzhanggui.com/web-api"',//正式服务器
+  BASE_URL:'"https://sxzgkj.baoxianzhanggui.com/web-api"',//正式服务器
   // BASE_URL:'"https://sxzgkj.baoxianzhanggui.com/web-api"'//正式服务器
   // BASE_URL: '"http://192.168.0.115:8080/"', //凯森
   // BASE_URL: '"http://192.168.0.106:8080/"',//屈晨
@@ -18,7 +18,7 @@ module.exports = merge(prodEnv, {
   // BASE_URL: '"http://192.168.0.250:8080/"',//
   //  BASE_URL: '"http:///192.168.0.103:8080/"',//霍续亮
   // BASE_URL: '"http://192.168.0.52:8080/"',//贺礼霄
-  BASE_URL: '"http://192.168.0.55:8080/"',// 董鑫
+  // BASE_URL: '"http://192.168.0.55:8080/"',// 董鑫
   CONSOLE_BASE_URL: '"http://localhost:8080/"', //控制台测试服务器
   CONSOLE_KHGX_URL: '"http://192.168.0.103:8081/login"', //跳转客户服务平台地址
   // CONSOLE_BASE_URL: '"https://test.baoxianzhanggui.com/console-api"' //控制台正式服务器

+ 24 - 1
src/assets/css/common.css

@@ -110,6 +110,9 @@
 .m-top-10 {
   margin-top: 10px;
 }
+.m-top-20 {
+  margin-top: 20px;
+}
 
 .m-btn-10 {
   margin-bottom: 10px;
@@ -118,7 +121,27 @@
 .m-btn-15 {
   margin-bottom: 15px;
 }
-
+.mr-1{
+  margin-right: 10px;
+}
+.mr-2{
+  margin-right: 20px;
+}
+.mr-3{
+  margin-right: 30px;
+}
+.ml-1{
+  margin-left: 10px;
+}
+.ml-2{
+  margin-left: 20px;
+}
+.ml-3{
+  margin-left: 30px;
+}
+.mb-2{
+  margin-bottom: 20px;
+}
 .el-button:hover,
 .el-button:focus {
   color: var(--themeColor) ;

+ 21 - 0
src/components/Form/ProductCostForm.vue

@@ -326,6 +326,13 @@
                     <el-option label="不包含" value="2"></el-option>
                   </el-select>
                   </div>
+                  <div v-else-if="formItems.attrCode == 'CarOwnersIDNumber'" style="display: flex;">
+                    <el-input  v-model="formItems.min" placeholder="身份证前2位或前6位"></el-input>
+                    <el-select v-model="formItems.operator" placeholder="请选择" style="width: 120px;margin-left: 20px;">
+                    <el-option label="包含" value="1"></el-option>
+                    <el-option label="不包含" value="2"></el-option>
+                  </el-select>
+                  </div>
                   <el-input v-else v-model="formItems.min" placeholder="身份证前2位或前6位
                   "></el-input>
                 </div>
@@ -481,6 +488,13 @@
                     <el-option label="不包含" value="2"></el-option>
                   </el-select>
                   </div>
+                  <div v-else-if="formItems.attrCode == 'ApplicantIDNumber'" style="display: flex;">
+                    <el-input  v-model="formItems.min" placeholder="身份证前2位或前6位"></el-input>
+                    <el-select v-model="formItems.operator" placeholder="请选择" style="width: 120px;margin-left: 20px;">
+                    <el-option label="包含" value="1"></el-option>
+                    <el-option label="不包含" value="2"></el-option>
+                  </el-select>
+                  </div>
                   <el-input v-else v-model="formItems.min" placeholder="身份证前2位或前6位
                   "></el-input>
                 </div>
@@ -635,6 +649,13 @@
                     <el-option label="不包含" value="2"></el-option>
                   </el-select>
                   </div>
+                  <div v-else-if="formItems.attrCode == 'InsuredIDNumber'" style="display: flex;">
+                    <el-input  v-model="formItems.min" placeholder="身份证前2位或前6位"></el-input>
+                    <el-select v-model="formItems.operator" placeholder="请选择" style="width: 120px;margin-left: 20px;">
+                    <el-option label="包含" value="1"></el-option>
+                    <el-option label="不包含" value="2"></el-option>
+                  </el-select>
+                  </div>
                   <el-input v-else v-model="formItems.min" placeholder="身份证前2位或前6位
                   "></el-input>
                 </div>

+ 9 - 0
src/http/moudules/letter.js

@@ -1536,3 +1536,12 @@ export const updateMessage = (data) => {
     method: 'post'
   })
 }
+
+//批量更新状态
+export const batchOrderStatus = (data) => {
+  return axios({
+    url: `/quote/batchOrderStatus`,
+    method: 'post',
+    data
+  })
+}

+ 285 - 241
src/views/AgreementManage/InsuranceCompany/CargoTruck/BusinessOperation/Fuel/AddOrdinaryPlan.vue

@@ -1,234 +1,240 @@
 <!-- 模板区域 -->
 <template>
   <div>
-      <div class="tab-panestyle">
-        <div class="tab-panecent">
-          <span>险种配置</span>
-          <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
-            @input="productInput" size="small" style="margin-left: 30px;">
-            <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
-              :label="productsitem.dictValue">{{
-                productsitem.dictTag }}</el-radio-button>
-          </el-radio-group>
+    <div class="tab-panestyle">
+      <div class="tab-panecent">
+        <span>险种配置</span>
+        <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
+          @input="productInput" size="small" style="margin-left: 30px;">
+          <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
+            :label="productsitem.dictValue">{{
+              productsitem.dictTag }}</el-radio-button>
+        </el-radio-group>
+      </div>
+      <div class="tab-panecent">
+        <div class=" flex j-s a-c">
+          <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
+            @click="planOptionadd">方案新增</el-button>
         </div>
-        <div class="tab-panecent">
-          <div class=" flex j-s a-c">
-            <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
-              @click="planOptionadd">方案新增</el-button>
+        <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
+          <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
+            <span>方案{{ solutionindex + 1 }}</span>
+            <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
+              @click="planOptiondel(solutionindex)">方案删除</el-button>
           </div>
-          <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
-            <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
-              <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+          <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+            label-width="120px" :size="overSize">
+            <el-row>
+              <el-col :span="8">
+                <el-form-item label="方案名称" prop="schemeName">
+                  <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="4">
+                <el-form-item label="序号" prop="priorityLevel">
+                  <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="20">
+                <el-form-item label="方案描述">
+                  <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
+                    show-word-limit></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+          <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
+            <div class="flex j-s a-c">
+              <h4>商业险方案配置</h4>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="方案名称">
-                    <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="20">
-                  <el-form-item label="方案描述">
-                    <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
-                      show-word-limit></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-            <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
-              <div class="flex j-s a-c">
-                <h4>商业险方案配置</h4>
-              </div>
-              <div class="flex j-start ">
-                <div class="Risk f-c" style="margin-right: 30px;">
-                  <section class="flex j-s a-c ">
-                    <div>
-                      全部险别
-                    </div>
-                    <div>
-                      投保保额
-                    </div>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
-                    <div>
-                      <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
-                      <span>{{ insureitem.kindName }}</span>
-                    </div>
-                    <div>
-                      <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
-                        placeholder="请选择"
-                        @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
-                        style="width: 200px;" clearable :size="overSize">
-                        <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
-                          :value="item.value"></el-option>
-                      </el-select>
-                      <span v-else>
-                        <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
-                          size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
-                          :min="0"></el-input-number>次
-                      </span>
-                    </div>
-                  </main>
-                </div>
-                <div class="Risk">
-                  <section class="flex j-s a-c ">
-                    <span class="flex j-start">已选险别</span>
-                    <span class="flex j-c">投保保额</span>
-                    <span class="flex j-end">操作</span>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
-                    :key="filteredInsureindex" v-if="filteredInsureitem.switch">
-                    <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
-                    <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
-                      filteredInsureitem.amountDesc }}</span>
-                    <span class="flex j-c"
-                      v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}%</span>
-                    <span class="flex j-c"
-                      v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}次</span>
-                    <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
-                    <span class="flex j-end">
-                      <i class="el-icon-delete" style="font-size: 20px;"
-                        @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
+            <div class="flex j-start ">
+              <div class="Risk f-c" style="margin-right: 30px;">
+                <section class="flex j-s a-c ">
+                  <div>
+                    全部险别
+                  </div>
+                  <div>
+                    投保保额
+                  </div>
+                </section>
+                <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
+                  <div>
+                    <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
+                    <span>{{ insureitem.kindName }}</span>
+                  </div>
+                  <div>
+                    <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
+                      placeholder="请选择"
+                      @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
+                      style="width: 200px;" clearable :size="overSize">
+                      <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
+                        :value="item.value"></el-option>
+                    </el-select>
+                    <span v-else>
+                      <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
+                        size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
+                        :min="0"></el-input-number>次
                     </span>
-                  </main>
-                </div>
-              </div>
-            </div>
-            <div>
-              <div class="flex a-c">
-                <h4>驾意险方案配置</h4>
-                <el-button size="mini"
-                  style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
-                  @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
-              </div>
-              <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
-                style="margin-bottom: 20px;">
-                <div class="flex j-s a-c">
-                  <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
-                    :key="DriverTypeitem.id">
-                    <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
-                      DriverTypeitem.typeName
-                    }}</span>
-                    <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
-                      :key="childrenitem.id"
-                      @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
-                        childrenitem.typeName }}</el-checkbox>
                   </div>
+                </main>
+              </div>
+              <div class="Risk">
+                <section class="flex j-s a-c ">
+                  <span class="flex j-start">已选险别</span>
+                  <span class="flex j-c">投保保额</span>
+                  <span class="flex j-end">操作</span>
+                </section>
+                <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
+                  :key="filteredInsureindex" v-if="filteredInsureitem.switch">
+                  <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
+                  <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
+                    filteredInsureitem.amountDesc }}</span>
+                  <span class="flex j-c"
+                    v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}%</span>
+                  <span class="flex j-c"
+                    v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}次</span>
+                  <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
                   <span class="flex j-end">
                     <i class="el-icon-delete" style="font-size: 20px;"
-                      @click="drvingDel(solutionindex, configureindex)"></i>
+                      @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
                   </span>
+                </main>
+              </div>
+            </div>
+          </div>
+          <div>
+            <div class="flex a-c">
+              <h4>驾意险方案配置</h4>
+              <el-button size="mini"
+                style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
+                @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
+            </div>
+            <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
+              style="margin-bottom: 20px;">
+              <div class="flex j-s a-c">
+                <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
+                  :key="DriverTypeitem.id">
+                  <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
+                    DriverTypeitem.typeName
+                  }}</span>
+                  <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
+                    :key="childrenitem.id"
+                    @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
+                      childrenitem.typeName }}</el-checkbox>
                 </div>
-                <el-form ref="form" :model="formitem" label-width="120px" size="small"
-                  v-for="(formitem, formindex) in configureitem.list" :key="formindex">
-                  <el-row>
-                    <el-col :span="24">
-                      <el-col :span="10">
-                        <el-form-item label="驾意选择:">
-                          <el-select
-                            v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
-                            :size="overSize" style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                <span class="flex j-end">
+                  <i class="el-icon-delete" style="font-size: 20px;"
+                    @click="drvingDel(solutionindex, configureindex)"></i>
+                </span>
+              </div>
+              <el-form ref="form" :model="formitem" label-width="120px" size="small"
+                v-for="(formitem, formindex) in configureitem.list" :key="formindex">
+                <el-row>
+                  <el-col :span="24">
+                    <el-col :span="10">
+                      <el-form-item label="驾意选择:">
+                        <el-select
+                          v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
+                          :size="overSize" style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <template v-if="formitem.drvingChildren">
+                          <el-select v-if="formitem.isMultiple == 1" multiple filterable
+                            v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
                             style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <template v-if="formitem.drvingChildren">
-                            <el-select v-if="formitem.isMultiple == 1" multiple filterable
-                              v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
-                              style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                          </template>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="4">
-                        <el-form-item label="别名:">
-                          <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="座位数:">
-                          <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>座</span>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="份数:">
-                          <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>份</span>
-                        </el-form-item>
-                      </el-col>
+                        </template>
+                      </el-form-item>
                     </el-col>
-                    <el-col :span="20">
-                      <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
-                        :key="LiabilityTermsindex">
-                        <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
-                        <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
-                          background: '#F7F7F9',
-                          fontWeight: '700',
-                          color: '#606266',
-                        }">
-                          <el-table-column prop="name" label="保险责任" align="center">
-                          </el-table-column>
-                          <el-table-column prop="amount" label="保险金额" width="180" align="center">
-                          </el-table-column>
-                          <el-table-column prop="premium" label="保费(元)" width="180" align="center">
-                          </el-table-column>
-                        </el-table>
-                      </div>
+                    <el-col :span="4">
+                      <el-form-item label="别名:">
+                        <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
+                      </el-form-item>
                     </el-col>
-                  </el-row>
-                </el-form>
-              </div>
+                    <el-col :span="5">
+                      <el-form-item label="座位数:">
+                        <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>座</span>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="5">
+                      <el-form-item label="份数:">
+                        <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>份</span>
+                      </el-form-item>
+                    </el-col>
+                  </el-col>
+                  <el-col :span="20">
+                    <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
+                      :key="LiabilityTermsindex">
+                      <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
+                      <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
+                        background: '#F7F7F9',
+                        fontWeight: '700',
+                        color: '#606266',
+                      }">
+                        <el-table-column prop="name" label="保险责任" align="center">
+                        </el-table-column>
+                        <el-table-column prop="amount" label="保险金额" width="180" align="center">
+                        </el-table-column>
+                        <el-table-column prop="premium" label="保费(元)" width="180" align="center">
+                        </el-table-column>
+                      </el-table>
+                    </div>
+                  </el-col>
+                </el-row>
+              </el-form>
             </div>
           </div>
         </div>
       </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
-          消</el-button>
-        <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
-          @click="solutionSubmit('solutionForm')">确 定</el-button>
-      </span>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
+        消</el-button>
+      <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
+        @click="solutionSubmit('solutionForm')">确 定</el-button>
+    </span>
   </div>
 </template>
 <!-- 行为区域 -->
@@ -250,6 +256,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -264,6 +279,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",//方案序号
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -301,6 +317,15 @@ export default {
   },
   // 方法函数
   methods: {
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -493,6 +518,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",//方案序号
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -532,43 +558,61 @@ export default {
         seatNum: ""//座位数
       });
     },
-    ordinaryPlanCancel () {
+    ordinaryPlanCancel() {
       this.$emit('ordinaryPlanCancel')
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"01",vehicleType:"A1",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"01",vehicleType:"A1",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "01", vehicleType: "A1", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "01", vehicleType: "A1", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -582,7 +626,7 @@ export default {
       this.solutionDialogTitle = '添加方案'
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"01",vehicleType:"A1",energyType:"0" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "01", vehicleType: "A1", energyType: "0" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -603,7 +647,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"01",'A1','0').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "01", 'A1', '0').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -616,7 +660,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -675,6 +719,7 @@ export default {
   align-items: flex-end;
   justify-content: flex-end;
 }
+
 /deep/ {
   .el-radio__input.is-checked .el-radio__inner,
   .el-checkbox__input.is-checked .el-checkbox__inner,
@@ -805,4 +850,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 89 - 46
src/views/AgreementManage/InsuranceCompany/CargoTruck/BusinessOperation/Fuel/OrdinaryPlan.vue

@@ -7,8 +7,8 @@
     <!-- @findPage="solutionFindPage" -->
     <kt-common-table :tableHeights="700" :SerialShow="false" :operationWidth="200" :showOperation="true"
       :showBatchDelete="false" :showBatchSettled="false" :showBatchPrint="false" :data="solutionResult" button2Name="编辑"
-      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除" button3Type="text" @handleButton3="solutionDel"
-      :columns="solutionColumns">
+      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除"
+      button3Type="text" @handleButton3="solutionDel" :columns="solutionColumns">
     </kt-common-table>
     <el-dialog v-dialogDrag :title="solutionDialogTitle" :visible.sync="solutionVisible" width="90%" top="2vh"
       @close="solutioncloseDialog">
@@ -30,16 +30,22 @@
           <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
             <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
               <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete"
+                class="planOption-del" @click="planOptiondel(solutionindex)">方案删除</el-button>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
+            <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+              label-width="120px" :size="overSize">
               <el-row>
                 <el-col :span="8">
-                  <el-form-item label="方案名称">
+                  <el-form-item label="方案名称" prop="schemeName">
                     <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
                   </el-form-item>
                 </el-col>
+                <el-col :span="4">
+                  <el-form-item label="序号" prop="priorityLevel">
+                    <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                  </el-form-item>
+                </el-col>
                 <el-col :span="20">
                   <el-form-item label="方案描述">
                     <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
@@ -158,8 +164,8 @@
                           </el-select>
                           <el-select
                             v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
+                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
                             @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
                               v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
@@ -180,8 +186,8 @@
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                             </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
+                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择"
+                              clearable :size="overSize" style="width: 250px;"
                               @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
@@ -275,6 +281,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -289,6 +304,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",//方案序号
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -308,12 +324,12 @@ export default {
     }
   },
   watch: {
-    activeIndex (newVal) {
+    activeIndex(newVal) {
       if (newVal === 0) {
         this.initData()
       }
     },
-    ordinaryIndex (newVal) {
+    ordinaryIndex(newVal) {
       if (newVal) {
         this.initData()
       }
@@ -321,13 +337,13 @@ export default {
   },
   // 生命周期函数
   created() {
-    if (this.$route.query.type*1 === 0) {
+    if (this.$route.query.type * 1 === 0) {
       this.initData()
     }
   },
   // 方法函数
   methods: {
-    initData () {
+    initData() {
       this.companyId = this.$route.query.companyId;
       this.solutionData.companyId = this.$route.query.companyId;
       this.getDicType("productsType"); //车险产品
@@ -344,6 +360,15 @@ export default {
       });
       localStorage.setItem("insureList", JSON.stringify(this.insureList));
     },
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -536,6 +561,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",//方案序号
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -575,40 +601,58 @@ export default {
         seatNum: ""//座位数
       });
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"01",vehicleType:"A1",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionVisible = false;
-            this.solutionFindPage();
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"01",vehicleType:"A1",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "01", vehicleType: "A1", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionVisible = false;
-            this.solutionFindPage();
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "01", vehicleType: "A1", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -623,7 +667,7 @@ export default {
       this.solutionVisible = true;
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"01",vehicleType:"A1",energyType:"0" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "01", vehicleType: "A1", energyType: "0" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -644,7 +688,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"01",'A1','0').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "01", 'A1', '0').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -657,7 +701,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -839,4 +883,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 285 - 241
src/views/AgreementManage/InsuranceCompany/CargoTruck/BusinessOperation/NewEnergy/AddOrdinaryPlan.vue

@@ -1,234 +1,240 @@
 <!-- 模板区域 -->
 <template>
   <div>
-      <div class="tab-panestyle">
-        <div class="tab-panecent">
-          <span>险种配置</span>
-          <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
-            @input="productInput" size="small" style="margin-left: 30px;">
-            <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
-              :label="productsitem.dictValue">{{
-                productsitem.dictTag }}</el-radio-button>
-          </el-radio-group>
+    <div class="tab-panestyle">
+      <div class="tab-panecent">
+        <span>险种配置</span>
+        <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
+          @input="productInput" size="small" style="margin-left: 30px;">
+          <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
+            :label="productsitem.dictValue">{{
+              productsitem.dictTag }}</el-radio-button>
+        </el-radio-group>
+      </div>
+      <div class="tab-panecent">
+        <div class=" flex j-s a-c">
+          <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
+            @click="planOptionadd">方案新增</el-button>
         </div>
-        <div class="tab-panecent">
-          <div class=" flex j-s a-c">
-            <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
-              @click="planOptionadd">方案新增</el-button>
+        <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
+          <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
+            <span>方案{{ solutionindex + 1 }}</span>
+            <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
+              @click="planOptiondel(solutionindex)">方案删除</el-button>
           </div>
-          <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
-            <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
-              <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+          <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+            label-width="120px" :size="overSize">
+            <el-row>
+              <el-col :span="8">
+                <el-form-item label="方案名称" prop="schemeName">
+                  <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="4">
+                <el-form-item label="序号" prop="priorityLevel">
+                  <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="20">
+                <el-form-item label="方案描述">
+                  <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
+                    show-word-limit></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+          <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
+            <div class="flex j-s a-c">
+              <h4>商业险方案配置</h4>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="方案名称">
-                    <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="20">
-                  <el-form-item label="方案描述">
-                    <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
-                      show-word-limit></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-            <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
-              <div class="flex j-s a-c">
-                <h4>商业险方案配置</h4>
-              </div>
-              <div class="flex j-start ">
-                <div class="Risk f-c" style="margin-right: 30px;">
-                  <section class="flex j-s a-c ">
-                    <div>
-                      全部险别
-                    </div>
-                    <div>
-                      投保保额
-                    </div>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
-                    <div>
-                      <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
-                      <span>{{ insureitem.kindName }}</span>
-                    </div>
-                    <div>
-                      <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
-                        placeholder="请选择"
-                        @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
-                        style="width: 200px;" clearable :size="overSize">
-                        <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
-                          :value="item.value"></el-option>
-                      </el-select>
-                      <span v-else>
-                        <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
-                          size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
-                          :min="0"></el-input-number>次
-                      </span>
-                    </div>
-                  </main>
-                </div>
-                <div class="Risk">
-                  <section class="flex j-s a-c ">
-                    <span class="flex j-start">已选险别</span>
-                    <span class="flex j-c">投保保额</span>
-                    <span class="flex j-end">操作</span>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
-                    :key="filteredInsureindex" v-if="filteredInsureitem.switch">
-                    <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
-                    <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
-                      filteredInsureitem.amountDesc }}</span>
-                    <span class="flex j-c"
-                      v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}%</span>
-                    <span class="flex j-c"
-                      v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}次</span>
-                    <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
-                    <span class="flex j-end">
-                      <i class="el-icon-delete" style="font-size: 20px;"
-                        @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
+            <div class="flex j-start ">
+              <div class="Risk f-c" style="margin-right: 30px;">
+                <section class="flex j-s a-c ">
+                  <div>
+                    全部险别
+                  </div>
+                  <div>
+                    投保保额
+                  </div>
+                </section>
+                <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
+                  <div>
+                    <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
+                    <span>{{ insureitem.kindName }}</span>
+                  </div>
+                  <div>
+                    <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
+                      placeholder="请选择"
+                      @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
+                      style="width: 200px;" clearable :size="overSize">
+                      <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
+                        :value="item.value"></el-option>
+                    </el-select>
+                    <span v-else>
+                      <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
+                        size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
+                        :min="0"></el-input-number>次
                     </span>
-                  </main>
-                </div>
-              </div>
-            </div>
-            <div>
-              <div class="flex a-c">
-                <h4>驾意险方案配置</h4>
-                <el-button size="mini"
-                  style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
-                  @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
-              </div>
-              <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
-                style="margin-bottom: 20px;">
-                <div class="flex j-s a-c">
-                  <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
-                    :key="DriverTypeitem.id">
-                    <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
-                      DriverTypeitem.typeName
-                    }}</span>
-                    <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
-                      :key="childrenitem.id"
-                      @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
-                        childrenitem.typeName }}</el-checkbox>
                   </div>
+                </main>
+              </div>
+              <div class="Risk">
+                <section class="flex j-s a-c ">
+                  <span class="flex j-start">已选险别</span>
+                  <span class="flex j-c">投保保额</span>
+                  <span class="flex j-end">操作</span>
+                </section>
+                <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
+                  :key="filteredInsureindex" v-if="filteredInsureitem.switch">
+                  <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
+                  <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
+                    filteredInsureitem.amountDesc }}</span>
+                  <span class="flex j-c"
+                    v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}%</span>
+                  <span class="flex j-c"
+                    v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}次</span>
+                  <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
                   <span class="flex j-end">
                     <i class="el-icon-delete" style="font-size: 20px;"
-                      @click="drvingDel(solutionindex, configureindex)"></i>
+                      @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
                   </span>
+                </main>
+              </div>
+            </div>
+          </div>
+          <div>
+            <div class="flex a-c">
+              <h4>驾意险方案配置</h4>
+              <el-button size="mini"
+                style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
+                @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
+            </div>
+            <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
+              style="margin-bottom: 20px;">
+              <div class="flex j-s a-c">
+                <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
+                  :key="DriverTypeitem.id">
+                  <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
+                    DriverTypeitem.typeName
+                    }}</span>
+                  <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
+                    :key="childrenitem.id"
+                    @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
+                      childrenitem.typeName }}</el-checkbox>
                 </div>
-                <el-form ref="form" :model="formitem" label-width="120px" size="small"
-                  v-for="(formitem, formindex) in configureitem.list" :key="formindex">
-                  <el-row>
-                    <el-col :span="24">
-                      <el-col :span="10">
-                        <el-form-item label="驾意选择:">
-                          <el-select
-                            v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
-                            :size="overSize" style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                <span class="flex j-end">
+                  <i class="el-icon-delete" style="font-size: 20px;"
+                    @click="drvingDel(solutionindex, configureindex)"></i>
+                </span>
+              </div>
+              <el-form ref="form" :model="formitem" label-width="120px" size="small"
+                v-for="(formitem, formindex) in configureitem.list" :key="formindex">
+                <el-row>
+                  <el-col :span="24">
+                    <el-col :span="10">
+                      <el-form-item label="驾意选择:">
+                        <el-select
+                          v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
+                          :size="overSize" style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <template v-if="formitem.drvingChildren">
+                          <el-select v-if="formitem.isMultiple == 1" multiple filterable
+                            v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
                             style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <template v-if="formitem.drvingChildren">
-                            <el-select v-if="formitem.isMultiple == 1" multiple filterable
-                              v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
-                              style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                          </template>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="4">
-                        <el-form-item label="别名:">
-                          <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="座位数:">
-                          <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>座</span>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="份数:">
-                          <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>份</span>
-                        </el-form-item>
-                      </el-col>
+                        </template>
+                      </el-form-item>
                     </el-col>
-                    <el-col :span="20">
-                      <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
-                        :key="LiabilityTermsindex">
-                        <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
-                        <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
-                          background: '#F7F7F9',
-                          fontWeight: '700',
-                          color: '#606266',
-                        }">
-                          <el-table-column prop="name" label="保险责任" align="center">
-                          </el-table-column>
-                          <el-table-column prop="amount" label="保险金额" width="180" align="center">
-                          </el-table-column>
-                          <el-table-column prop="premium" label="保费(元)" width="180" align="center">
-                          </el-table-column>
-                        </el-table>
-                      </div>
+                    <el-col :span="4">
+                      <el-form-item label="别名:">
+                        <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
+                      </el-form-item>
                     </el-col>
-                  </el-row>
-                </el-form>
-              </div>
+                    <el-col :span="5">
+                      <el-form-item label="座位数:">
+                        <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>座</span>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="5">
+                      <el-form-item label="份数:">
+                        <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>份</span>
+                      </el-form-item>
+                    </el-col>
+                  </el-col>
+                  <el-col :span="20">
+                    <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
+                      :key="LiabilityTermsindex">
+                      <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
+                      <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
+                        background: '#F7F7F9',
+                        fontWeight: '700',
+                        color: '#606266',
+                      }">
+                        <el-table-column prop="name" label="保险责任" align="center">
+                        </el-table-column>
+                        <el-table-column prop="amount" label="保险金额" width="180" align="center">
+                        </el-table-column>
+                        <el-table-column prop="premium" label="保费(元)" width="180" align="center">
+                        </el-table-column>
+                      </el-table>
+                    </div>
+                  </el-col>
+                </el-row>
+              </el-form>
             </div>
           </div>
         </div>
       </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
-          消</el-button>
-        <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
-          @click="solutionSubmit('solutionForm')">确 定</el-button>
-      </span>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
+        消</el-button>
+      <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
+        @click="solutionSubmit('solutionForm')">确 定</el-button>
+    </span>
   </div>
 </template>
 <!-- 行为区域 -->
@@ -250,6 +256,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -264,6 +279,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",//方案序号
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -301,6 +317,15 @@ export default {
   },
   // 方法函数
   methods: {
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -493,6 +518,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",//方案序号
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -532,43 +558,61 @@ export default {
         seatNum: ""//座位数
       });
     },
-    ordinaryPlanCancel () {
+    ordinaryPlanCancel() {
       this.$emit('ordinaryPlanCancel')
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"01",vehicleType:"A1",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"01",vehicleType:"A1",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "01", vehicleType: "A1", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "01", vehicleType: "A1", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -582,7 +626,7 @@ export default {
       this.solutionDialogTitle = '添加方案'
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"01",vehicleType:"A1",energyType:"1" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "01", vehicleType: "A1", energyType: "1" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -603,7 +647,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"01",'A1','1').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "01", 'A1', '1').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -616,7 +660,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -675,6 +719,7 @@ export default {
   align-items: flex-end;
   justify-content: flex-end;
 }
+
 /deep/ {
   .el-radio__input.is-checked .el-radio__inner,
   .el-checkbox__input.is-checked .el-checkbox__inner,
@@ -805,4 +850,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 90 - 47
src/views/AgreementManage/InsuranceCompany/CargoTruck/BusinessOperation/NewEnergy/OrdinaryPlan.vue

@@ -7,8 +7,8 @@
     <!-- @findPage="solutionFindPage" -->
     <kt-common-table :tableHeights="700" :SerialShow="false" :operationWidth="200" :showOperation="true"
       :showBatchDelete="false" :showBatchSettled="false" :showBatchPrint="false" :data="solutionResult" button2Name="编辑"
-      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除" button3Type="text" @handleButton3="solutionDel"
-      :columns="solutionColumns">
+      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除"
+      button3Type="text" @handleButton3="solutionDel" :columns="solutionColumns">
     </kt-common-table>
     <el-dialog v-dialogDrag :title="solutionDialogTitle" :visible.sync="solutionVisible" width="90%" top="2vh"
       @close="solutioncloseDialog">
@@ -30,16 +30,22 @@
           <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
             <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
               <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete"
+                class="planOption-del" @click="planOptiondel(solutionindex)">方案删除</el-button>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
+            <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+              label-width="120px" :size="overSize">
               <el-row>
                 <el-col :span="8">
-                  <el-form-item label="方案名称">
+                  <el-form-item label="方案名称" prop="schemeName">
                     <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
                   </el-form-item>
                 </el-col>
+                <el-col :span="4">
+                  <el-form-item label="序号" prop="priorityLevel">
+                    <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                  </el-form-item>
+                </el-col>
                 <el-col :span="20">
                   <el-form-item label="方案描述">
                     <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
@@ -123,7 +129,7 @@
                     :key="DriverTypeitem.id">
                     <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
                       DriverTypeitem.typeName
-                    }}</span>
+                      }}</span>
                     <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
                       :key="childrenitem.id"
                       @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
@@ -158,8 +164,8 @@
                           </el-select>
                           <el-select
                             v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
+                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
                             @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
                               v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
@@ -180,8 +186,8 @@
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                             </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
+                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择"
+                              clearable :size="overSize" style="width: 250px;"
                               @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
@@ -275,6 +281,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -289,6 +304,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",//方案序号
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -308,12 +324,12 @@ export default {
     }
   },
   watch: {
-    activeIndex (newVal) {
+    activeIndex(newVal) {
       if (newVal === 0) {
         this.initData()
       }
     },
-    ordinaryIndex (newVal) {
+    ordinaryIndex(newVal) {
       if (newVal) {
         this.initData()
       }
@@ -321,13 +337,13 @@ export default {
   },
   // 生命周期函数
   created() {
-    if (this.$route.query.type*1 === 0) {
+    if (this.$route.query.type * 1 === 0) {
       this.initData()
     }
   },
   // 方法函数
   methods: {
-    initData () {
+    initData() {
       this.companyId = this.$route.query.companyId;
       this.solutionData.companyId = this.$route.query.companyId;
       this.getDicType("productsType"); //车险产品
@@ -344,6 +360,15 @@ export default {
       });
       localStorage.setItem("insureList", JSON.stringify(this.insureList));
     },
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -536,6 +561,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",//方案序号
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -575,40 +601,58 @@ export default {
         seatNum: ""//座位数
       });
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"01",vehicleType:"A1",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionVisible = false;
-            this.solutionFindPage();
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"01",vehicleType:"A1",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "01", vehicleType: "A1", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionVisible = false;
-            this.solutionFindPage();
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "01", vehicleType: "A1", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -623,7 +667,7 @@ export default {
       this.solutionVisible = true;
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"01",vehicleType:"A1",energyType:"1" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "01", vehicleType: "A1", energyType: "1" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -644,7 +688,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"01",'A1','1').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "01", 'A1', '1').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -657,7 +701,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -839,4 +883,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 285 - 241
src/views/AgreementManage/InsuranceCompany/CargoTruck/NonBusiness/Fuel/AddOrdinaryPlan.vue

@@ -1,234 +1,240 @@
 <!-- 模板区域 -->
 <template>
   <div>
-      <div class="tab-panestyle">
-        <div class="tab-panecent">
-          <span>险种配置</span>
-          <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
-            @input="productInput" size="small" style="margin-left: 30px;">
-            <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
-              :label="productsitem.dictValue">{{
-                productsitem.dictTag }}</el-radio-button>
-          </el-radio-group>
+    <div class="tab-panestyle">
+      <div class="tab-panecent">
+        <span>险种配置</span>
+        <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
+          @input="productInput" size="small" style="margin-left: 30px;">
+          <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
+            :label="productsitem.dictValue">{{
+              productsitem.dictTag }}</el-radio-button>
+        </el-radio-group>
+      </div>
+      <div class="tab-panecent">
+        <div class=" flex j-s a-c">
+          <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
+            @click="planOptionadd">方案新增</el-button>
         </div>
-        <div class="tab-panecent">
-          <div class=" flex j-s a-c">
-            <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
-              @click="planOptionadd">方案新增</el-button>
+        <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
+          <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
+            <span>方案{{ solutionindex + 1 }}</span>
+            <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
+              @click="planOptiondel(solutionindex)">方案删除</el-button>
           </div>
-          <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
-            <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
-              <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+          <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+            label-width="120px" :size="overSize">
+            <el-row>
+              <el-col :span="8">
+                <el-form-item label="方案名称" prop="schemeName">
+                  <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="4">
+                <el-form-item label="序号" prop="priorityLevel">
+                  <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="20">
+                <el-form-item label="方案描述">
+                  <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
+                    show-word-limit></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+          <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
+            <div class="flex j-s a-c">
+              <h4>商业险方案配置</h4>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="方案名称">
-                    <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="20">
-                  <el-form-item label="方案描述">
-                    <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
-                      show-word-limit></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-            <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
-              <div class="flex j-s a-c">
-                <h4>商业险方案配置</h4>
-              </div>
-              <div class="flex j-start ">
-                <div class="Risk f-c" style="margin-right: 30px;">
-                  <section class="flex j-s a-c ">
-                    <div>
-                      全部险别
-                    </div>
-                    <div>
-                      投保保额
-                    </div>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
-                    <div>
-                      <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
-                      <span>{{ insureitem.kindName }}</span>
-                    </div>
-                    <div>
-                      <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
-                        placeholder="请选择"
-                        @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
-                        style="width: 200px;" clearable :size="overSize">
-                        <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
-                          :value="item.value"></el-option>
-                      </el-select>
-                      <span v-else>
-                        <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
-                          size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
-                          :min="0"></el-input-number>次
-                      </span>
-                    </div>
-                  </main>
-                </div>
-                <div class="Risk">
-                  <section class="flex j-s a-c ">
-                    <span class="flex j-start">已选险别</span>
-                    <span class="flex j-c">投保保额</span>
-                    <span class="flex j-end">操作</span>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
-                    :key="filteredInsureindex" v-if="filteredInsureitem.switch">
-                    <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
-                    <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
-                      filteredInsureitem.amountDesc }}</span>
-                    <span class="flex j-c"
-                      v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}%</span>
-                    <span class="flex j-c"
-                      v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}次</span>
-                    <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
-                    <span class="flex j-end">
-                      <i class="el-icon-delete" style="font-size: 20px;"
-                        @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
+            <div class="flex j-start ">
+              <div class="Risk f-c" style="margin-right: 30px;">
+                <section class="flex j-s a-c ">
+                  <div>
+                    全部险别
+                  </div>
+                  <div>
+                    投保保额
+                  </div>
+                </section>
+                <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
+                  <div>
+                    <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
+                    <span>{{ insureitem.kindName }}</span>
+                  </div>
+                  <div>
+                    <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
+                      placeholder="请选择"
+                      @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
+                      style="width: 200px;" clearable :size="overSize">
+                      <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
+                        :value="item.value"></el-option>
+                    </el-select>
+                    <span v-else>
+                      <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
+                        size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
+                        :min="0"></el-input-number>次
                     </span>
-                  </main>
-                </div>
-              </div>
-            </div>
-            <div>
-              <div class="flex a-c">
-                <h4>驾意险方案配置</h4>
-                <el-button size="mini"
-                  style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
-                  @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
-              </div>
-              <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
-                style="margin-bottom: 20px;">
-                <div class="flex j-s a-c">
-                  <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
-                    :key="DriverTypeitem.id">
-                    <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
-                      DriverTypeitem.typeName
-                    }}</span>
-                    <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
-                      :key="childrenitem.id"
-                      @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
-                        childrenitem.typeName }}</el-checkbox>
                   </div>
+                </main>
+              </div>
+              <div class="Risk">
+                <section class="flex j-s a-c ">
+                  <span class="flex j-start">已选险别</span>
+                  <span class="flex j-c">投保保额</span>
+                  <span class="flex j-end">操作</span>
+                </section>
+                <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
+                  :key="filteredInsureindex" v-if="filteredInsureitem.switch">
+                  <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
+                  <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
+                    filteredInsureitem.amountDesc }}</span>
+                  <span class="flex j-c"
+                    v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}%</span>
+                  <span class="flex j-c"
+                    v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}次</span>
+                  <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
                   <span class="flex j-end">
                     <i class="el-icon-delete" style="font-size: 20px;"
-                      @click="drvingDel(solutionindex, configureindex)"></i>
+                      @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
                   </span>
+                </main>
+              </div>
+            </div>
+          </div>
+          <div>
+            <div class="flex a-c">
+              <h4>驾意险方案配置</h4>
+              <el-button size="mini"
+                style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
+                @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
+            </div>
+            <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
+              style="margin-bottom: 20px;">
+              <div class="flex j-s a-c">
+                <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
+                  :key="DriverTypeitem.id">
+                  <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
+                    DriverTypeitem.typeName
+                    }}</span>
+                  <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
+                    :key="childrenitem.id"
+                    @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
+                      childrenitem.typeName }}</el-checkbox>
                 </div>
-                <el-form ref="form" :model="formitem" label-width="120px" size="small"
-                  v-for="(formitem, formindex) in configureitem.list" :key="formindex">
-                  <el-row>
-                    <el-col :span="24">
-                      <el-col :span="10">
-                        <el-form-item label="驾意选择:">
-                          <el-select
-                            v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
-                            :size="overSize" style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                <span class="flex j-end">
+                  <i class="el-icon-delete" style="font-size: 20px;"
+                    @click="drvingDel(solutionindex, configureindex)"></i>
+                </span>
+              </div>
+              <el-form ref="form" :model="formitem" label-width="120px" size="small"
+                v-for="(formitem, formindex) in configureitem.list" :key="formindex">
+                <el-row>
+                  <el-col :span="24">
+                    <el-col :span="10">
+                      <el-form-item label="驾意选择:">
+                        <el-select
+                          v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
+                          :size="overSize" style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <template v-if="formitem.drvingChildren">
+                          <el-select v-if="formitem.isMultiple == 1" multiple filterable
+                            v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
                             style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <template v-if="formitem.drvingChildren">
-                            <el-select v-if="formitem.isMultiple == 1" multiple filterable
-                              v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
-                              style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                          </template>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="4">
-                        <el-form-item label="别名:">
-                          <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="座位数:">
-                          <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>座</span>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="份数:">
-                          <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>份</span>
-                        </el-form-item>
-                      </el-col>
+                        </template>
+                      </el-form-item>
                     </el-col>
-                    <el-col :span="20">
-                      <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
-                        :key="LiabilityTermsindex">
-                        <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
-                        <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
-                          background: '#F7F7F9',
-                          fontWeight: '700',
-                          color: '#606266',
-                        }">
-                          <el-table-column prop="name" label="保险责任" align="center">
-                          </el-table-column>
-                          <el-table-column prop="amount" label="保险金额" width="180" align="center">
-                          </el-table-column>
-                          <el-table-column prop="premium" label="保费(元)" width="180" align="center">
-                          </el-table-column>
-                        </el-table>
-                      </div>
+                    <el-col :span="4">
+                      <el-form-item label="别名:">
+                        <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
+                      </el-form-item>
                     </el-col>
-                  </el-row>
-                </el-form>
-              </div>
+                    <el-col :span="5">
+                      <el-form-item label="座位数:">
+                        <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>座</span>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="5">
+                      <el-form-item label="份数:">
+                        <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>份</span>
+                      </el-form-item>
+                    </el-col>
+                  </el-col>
+                  <el-col :span="20">
+                    <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
+                      :key="LiabilityTermsindex">
+                      <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
+                      <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
+                        background: '#F7F7F9',
+                        fontWeight: '700',
+                        color: '#606266',
+                      }">
+                        <el-table-column prop="name" label="保险责任" align="center">
+                        </el-table-column>
+                        <el-table-column prop="amount" label="保险金额" width="180" align="center">
+                        </el-table-column>
+                        <el-table-column prop="premium" label="保费(元)" width="180" align="center">
+                        </el-table-column>
+                      </el-table>
+                    </div>
+                  </el-col>
+                </el-row>
+              </el-form>
             </div>
           </div>
         </div>
       </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
-          消</el-button>
-        <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
-          @click="solutionSubmit('solutionForm')">确 定</el-button>
-      </span>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
+        消</el-button>
+      <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
+        @click="solutionSubmit('solutionForm')">确 定</el-button>
+    </span>
   </div>
 </template>
 <!-- 行为区域 -->
@@ -250,6 +256,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -264,6 +279,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",//方案序号
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -301,6 +317,15 @@ export default {
   },
   // 方法函数
   methods: {
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -493,6 +518,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",//方案序号
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -532,43 +558,61 @@ export default {
         seatNum: ""//座位数
       });
     },
-    ordinaryPlanCancel () {
+    ordinaryPlanCancel() {
       this.$emit('ordinaryPlanCancel')
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"02",vehicleType:"A1",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"02",vehicleType:"A1",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "02", vehicleType: "A1", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "02", vehicleType: "A1", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -582,7 +626,7 @@ export default {
       this.solutionDialogTitle = '添加方案'
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"02",vehicleType:"A1",energyType:"0" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "02", vehicleType: "A1", energyType: "0" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -603,7 +647,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"02",'A1','0').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "02", 'A1', '0').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -616,7 +660,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -675,6 +719,7 @@ export default {
   align-items: flex-end;
   justify-content: flex-end;
 }
+
 /deep/ {
   .el-radio__input.is-checked .el-radio__inner,
   .el-checkbox__input.is-checked .el-checkbox__inner,
@@ -805,4 +850,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 90 - 47
src/views/AgreementManage/InsuranceCompany/CargoTruck/NonBusiness/Fuel/OrdinaryPlan.vue

@@ -7,8 +7,8 @@
     <!-- @findPage="solutionFindPage" -->
     <kt-common-table :tableHeights="700" :SerialShow="false" :operationWidth="200" :showOperation="true"
       :showBatchDelete="false" :showBatchSettled="false" :showBatchPrint="false" :data="solutionResult" button2Name="编辑"
-      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除" button3Type="text" @handleButton3="solutionDel"
-      :columns="solutionColumns">
+      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除"
+      button3Type="text" @handleButton3="solutionDel" :columns="solutionColumns">
     </kt-common-table>
     <el-dialog v-dialogDrag :title="solutionDialogTitle" :visible.sync="solutionVisible" width="90%" top="2vh"
       @close="solutioncloseDialog">
@@ -30,16 +30,22 @@
           <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
             <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
               <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete"
+                class="planOption-del" @click="planOptiondel(solutionindex)">方案删除</el-button>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
+            <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+              label-width="120px" :size="overSize">
               <el-row>
                 <el-col :span="8">
-                  <el-form-item label="方案名称">
+                  <el-form-item label="方案名称" prop="schemeName">
                     <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
                   </el-form-item>
                 </el-col>
+                <el-col :span="4">
+                  <el-form-item label="序号" prop="priorityLevel">
+                    <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                  </el-form-item>
+                </el-col>
                 <el-col :span="20">
                   <el-form-item label="方案描述">
                     <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
@@ -123,7 +129,7 @@
                     :key="DriverTypeitem.id">
                     <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
                       DriverTypeitem.typeName
-                    }}</span>
+                      }}</span>
                     <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
                       :key="childrenitem.id"
                       @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
@@ -158,8 +164,8 @@
                           </el-select>
                           <el-select
                             v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
+                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
                             @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
                               v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
@@ -180,8 +186,8 @@
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                             </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
+                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择"
+                              clearable :size="overSize" style="width: 250px;"
                               @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
@@ -275,6 +281,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -289,6 +304,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -308,12 +324,12 @@ export default {
     }
   },
   watch: {
-    activeIndex (newVal) {
+    activeIndex(newVal) {
       if (newVal === 0) {
         this.initData()
       }
     },
-    ordinaryIndex (newVal) {
+    ordinaryIndex(newVal) {
       if (newVal) {
         this.initData()
       }
@@ -321,13 +337,13 @@ export default {
   },
   // 生命周期函数
   created() {
-    if (this.$route.query.type*1 === 0) {
+    if (this.$route.query.type * 1 === 0) {
       this.initData()
     }
   },
   // 方法函数
   methods: {
-    initData () {
+    initData() {
       this.companyId = this.$route.query.companyId;
       this.solutionData.companyId = this.$route.query.companyId;
       this.getDicType("productsType"); //车险产品
@@ -344,6 +360,15 @@ export default {
       });
       localStorage.setItem("insureList", JSON.stringify(this.insureList));
     },
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -536,6 +561,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -575,40 +601,58 @@ export default {
         seatNum: ""//座位数
       });
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"02",vehicleType:"A1",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionVisible = false;
-            this.solutionFindPage();
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"02",vehicleType:"A1",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "02", vehicleType: "A1", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionVisible = false;
-            this.solutionFindPage();
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "02", vehicleType: "A1", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -623,7 +667,7 @@ export default {
       this.solutionVisible = true;
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"02",vehicleType:"A1",energyType:"0" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "02", vehicleType: "A1", energyType: "0" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -644,7 +688,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"02",'A1','0').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "02", 'A1', '0').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -657,7 +701,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -839,4 +883,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 285 - 241
src/views/AgreementManage/InsuranceCompany/CargoTruck/NonBusiness/NewEnergy/AddOrdinaryPlan.vue

@@ -1,234 +1,240 @@
 <!-- 模板区域 -->
 <template>
   <div>
-      <div class="tab-panestyle">
-        <div class="tab-panecent">
-          <span>险种配置</span>
-          <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
-            @input="productInput" size="small" style="margin-left: 30px;">
-            <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
-              :label="productsitem.dictValue">{{
-                productsitem.dictTag }}</el-radio-button>
-          </el-radio-group>
+    <div class="tab-panestyle">
+      <div class="tab-panecent">
+        <span>险种配置</span>
+        <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
+          @input="productInput" size="small" style="margin-left: 30px;">
+          <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
+            :label="productsitem.dictValue">{{
+              productsitem.dictTag }}</el-radio-button>
+        </el-radio-group>
+      </div>
+      <div class="tab-panecent">
+        <div class=" flex j-s a-c">
+          <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
+            @click="planOptionadd">方案新增</el-button>
         </div>
-        <div class="tab-panecent">
-          <div class=" flex j-s a-c">
-            <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
-              @click="planOptionadd">方案新增</el-button>
+        <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
+          <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
+            <span>方案{{ solutionindex + 1 }}</span>
+            <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
+              @click="planOptiondel(solutionindex)">方案删除</el-button>
           </div>
-          <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
-            <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
-              <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+          <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+            label-width="120px" :size="overSize">
+            <el-row>
+              <el-col :span="8">
+                <el-form-item label="方案名称" prop="schemeName">
+                  <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="4">
+                <el-form-item label="序号" prop="priorityLevel">
+                  <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="20">
+                <el-form-item label="方案描述">
+                  <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
+                    show-word-limit></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+          <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
+            <div class="flex j-s a-c">
+              <h4>商业险方案配置</h4>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="方案名称">
-                    <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="20">
-                  <el-form-item label="方案描述">
-                    <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
-                      show-word-limit></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-            <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
-              <div class="flex j-s a-c">
-                <h4>商业险方案配置</h4>
-              </div>
-              <div class="flex j-start ">
-                <div class="Risk f-c" style="margin-right: 30px;">
-                  <section class="flex j-s a-c ">
-                    <div>
-                      全部险别
-                    </div>
-                    <div>
-                      投保保额
-                    </div>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
-                    <div>
-                      <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
-                      <span>{{ insureitem.kindName }}</span>
-                    </div>
-                    <div>
-                      <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
-                        placeholder="请选择"
-                        @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
-                        style="width: 200px;" clearable :size="overSize">
-                        <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
-                          :value="item.value"></el-option>
-                      </el-select>
-                      <span v-else>
-                        <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
-                          size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
-                          :min="0"></el-input-number>次
-                      </span>
-                    </div>
-                  </main>
-                </div>
-                <div class="Risk">
-                  <section class="flex j-s a-c ">
-                    <span class="flex j-start">已选险别</span>
-                    <span class="flex j-c">投保保额</span>
-                    <span class="flex j-end">操作</span>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
-                    :key="filteredInsureindex" v-if="filteredInsureitem.switch">
-                    <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
-                    <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
-                      filteredInsureitem.amountDesc }}</span>
-                    <span class="flex j-c"
-                      v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}%</span>
-                    <span class="flex j-c"
-                      v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}次</span>
-                    <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
-                    <span class="flex j-end">
-                      <i class="el-icon-delete" style="font-size: 20px;"
-                        @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
+            <div class="flex j-start ">
+              <div class="Risk f-c" style="margin-right: 30px;">
+                <section class="flex j-s a-c ">
+                  <div>
+                    全部险别
+                  </div>
+                  <div>
+                    投保保额
+                  </div>
+                </section>
+                <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
+                  <div>
+                    <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
+                    <span>{{ insureitem.kindName }}</span>
+                  </div>
+                  <div>
+                    <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
+                      placeholder="请选择"
+                      @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
+                      style="width: 200px;" clearable :size="overSize">
+                      <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
+                        :value="item.value"></el-option>
+                    </el-select>
+                    <span v-else>
+                      <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
+                        size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
+                        :min="0"></el-input-number>次
                     </span>
-                  </main>
-                </div>
-              </div>
-            </div>
-            <div>
-              <div class="flex a-c">
-                <h4>驾意险方案配置</h4>
-                <el-button size="mini"
-                  style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
-                  @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
-              </div>
-              <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
-                style="margin-bottom: 20px;">
-                <div class="flex j-s a-c">
-                  <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
-                    :key="DriverTypeitem.id">
-                    <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
-                      DriverTypeitem.typeName
-                    }}</span>
-                    <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
-                      :key="childrenitem.id"
-                      @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
-                        childrenitem.typeName }}</el-checkbox>
                   </div>
+                </main>
+              </div>
+              <div class="Risk">
+                <section class="flex j-s a-c ">
+                  <span class="flex j-start">已选险别</span>
+                  <span class="flex j-c">投保保额</span>
+                  <span class="flex j-end">操作</span>
+                </section>
+                <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
+                  :key="filteredInsureindex" v-if="filteredInsureitem.switch">
+                  <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
+                  <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
+                    filteredInsureitem.amountDesc }}</span>
+                  <span class="flex j-c"
+                    v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}%</span>
+                  <span class="flex j-c"
+                    v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}次</span>
+                  <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
                   <span class="flex j-end">
                     <i class="el-icon-delete" style="font-size: 20px;"
-                      @click="drvingDel(solutionindex, configureindex)"></i>
+                      @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
                   </span>
+                </main>
+              </div>
+            </div>
+          </div>
+          <div>
+            <div class="flex a-c">
+              <h4>驾意险方案配置</h4>
+              <el-button size="mini"
+                style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
+                @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
+            </div>
+            <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
+              style="margin-bottom: 20px;">
+              <div class="flex j-s a-c">
+                <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
+                  :key="DriverTypeitem.id">
+                  <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
+                    DriverTypeitem.typeName
+                    }}</span>
+                  <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
+                    :key="childrenitem.id"
+                    @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
+                      childrenitem.typeName }}</el-checkbox>
                 </div>
-                <el-form ref="form" :model="formitem" label-width="120px" size="small"
-                  v-for="(formitem, formindex) in configureitem.list" :key="formindex">
-                  <el-row>
-                    <el-col :span="24">
-                      <el-col :span="10">
-                        <el-form-item label="驾意选择:">
-                          <el-select
-                            v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
-                            :size="overSize" style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                <span class="flex j-end">
+                  <i class="el-icon-delete" style="font-size: 20px;"
+                    @click="drvingDel(solutionindex, configureindex)"></i>
+                </span>
+              </div>
+              <el-form ref="form" :model="formitem" label-width="120px" size="small"
+                v-for="(formitem, formindex) in configureitem.list" :key="formindex">
+                <el-row>
+                  <el-col :span="24">
+                    <el-col :span="10">
+                      <el-form-item label="驾意选择:">
+                        <el-select
+                          v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
+                          :size="overSize" style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <template v-if="formitem.drvingChildren">
+                          <el-select v-if="formitem.isMultiple == 1" multiple filterable
+                            v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
                             style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <template v-if="formitem.drvingChildren">
-                            <el-select v-if="formitem.isMultiple == 1" multiple filterable
-                              v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
-                              style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                          </template>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="4">
-                        <el-form-item label="别名:">
-                          <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="座位数:">
-                          <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>座</span>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="份数:">
-                          <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>份</span>
-                        </el-form-item>
-                      </el-col>
+                        </template>
+                      </el-form-item>
                     </el-col>
-                    <el-col :span="20">
-                      <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
-                        :key="LiabilityTermsindex">
-                        <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
-                        <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
-                          background: '#F7F7F9',
-                          fontWeight: '700',
-                          color: '#606266',
-                        }">
-                          <el-table-column prop="name" label="保险责任" align="center">
-                          </el-table-column>
-                          <el-table-column prop="amount" label="保险金额" width="180" align="center">
-                          </el-table-column>
-                          <el-table-column prop="premium" label="保费(元)" width="180" align="center">
-                          </el-table-column>
-                        </el-table>
-                      </div>
+                    <el-col :span="4">
+                      <el-form-item label="别名:">
+                        <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
+                      </el-form-item>
                     </el-col>
-                  </el-row>
-                </el-form>
-              </div>
+                    <el-col :span="5">
+                      <el-form-item label="座位数:">
+                        <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>座</span>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="5">
+                      <el-form-item label="份数:">
+                        <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>份</span>
+                      </el-form-item>
+                    </el-col>
+                  </el-col>
+                  <el-col :span="20">
+                    <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
+                      :key="LiabilityTermsindex">
+                      <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
+                      <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
+                        background: '#F7F7F9',
+                        fontWeight: '700',
+                        color: '#606266',
+                      }">
+                        <el-table-column prop="name" label="保险责任" align="center">
+                        </el-table-column>
+                        <el-table-column prop="amount" label="保险金额" width="180" align="center">
+                        </el-table-column>
+                        <el-table-column prop="premium" label="保费(元)" width="180" align="center">
+                        </el-table-column>
+                      </el-table>
+                    </div>
+                  </el-col>
+                </el-row>
+              </el-form>
             </div>
           </div>
         </div>
       </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
-          消</el-button>
-        <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
-          @click="solutionSubmit('solutionForm')">确 定</el-button>
-      </span>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
+        消</el-button>
+      <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
+        @click="solutionSubmit('solutionForm')">确 定</el-button>
+    </span>
   </div>
 </template>
 <!-- 行为区域 -->
@@ -250,6 +256,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -264,6 +279,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",//方案序号
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -301,6 +317,15 @@ export default {
   },
   // 方法函数
   methods: {
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -493,6 +518,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",//方案序号
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -532,43 +558,61 @@ export default {
         seatNum: ""//座位数
       });
     },
-    ordinaryPlanCancel () {
+    ordinaryPlanCancel() {
       this.$emit('ordinaryPlanCancel')
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"02",vehicleType:"A1",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"02",vehicleType:"A1",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "02", vehicleType: "A1", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "02", vehicleType: "A1", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -582,7 +626,7 @@ export default {
       this.solutionDialogTitle = '添加方案'
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"02",vehicleType:"A1",energyType:"1" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "02", vehicleType: "A1", energyType: "1" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -603,7 +647,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"02",'A1','1').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "02", 'A1', '1').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -616,7 +660,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -675,6 +719,7 @@ export default {
   align-items: flex-end;
   justify-content: flex-end;
 }
+
 /deep/ {
   .el-radio__input.is-checked .el-radio__inner,
   .el-checkbox__input.is-checked .el-checkbox__inner,
@@ -805,4 +850,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 90 - 47
src/views/AgreementManage/InsuranceCompany/CargoTruck/NonBusiness/NewEnergy/OrdinaryPlan.vue

@@ -7,8 +7,8 @@
     <!-- @findPage="solutionFindPage" -->
     <kt-common-table :tableHeights="700" :SerialShow="false" :operationWidth="200" :showOperation="true"
       :showBatchDelete="false" :showBatchSettled="false" :showBatchPrint="false" :data="solutionResult" button2Name="编辑"
-      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除" button3Type="text" @handleButton3="solutionDel"
-      :columns="solutionColumns">
+      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除"
+      button3Type="text" @handleButton3="solutionDel" :columns="solutionColumns">
     </kt-common-table>
     <el-dialog v-dialogDrag :title="solutionDialogTitle" :visible.sync="solutionVisible" width="90%" top="2vh"
       @close="solutioncloseDialog">
@@ -30,16 +30,22 @@
           <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
             <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
               <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete"
+                class="planOption-del" @click="planOptiondel(solutionindex)">方案删除</el-button>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
+            <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+              label-width="120px" :size="overSize">
               <el-row>
                 <el-col :span="8">
-                  <el-form-item label="方案名称">
+                  <el-form-item label="方案名称" prop="schemeName">
                     <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
                   </el-form-item>
                 </el-col>
+                <el-col :span="4">
+                  <el-form-item label="序号" prop="priorityLevel">
+                    <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                  </el-form-item>
+                </el-col>
                 <el-col :span="20">
                   <el-form-item label="方案描述">
                     <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
@@ -123,7 +129,7 @@
                     :key="DriverTypeitem.id">
                     <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
                       DriverTypeitem.typeName
-                    }}</span>
+                      }}</span>
                     <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
                       :key="childrenitem.id"
                       @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
@@ -158,8 +164,8 @@
                           </el-select>
                           <el-select
                             v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
+                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
                             @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
                               v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
@@ -180,8 +186,8 @@
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                             </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
+                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择"
+                              clearable :size="overSize" style="width: 250px;"
                               @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
@@ -275,6 +281,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -289,6 +304,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -308,12 +324,12 @@ export default {
     }
   },
   watch: {
-    activeIndex (newVal) {
+    activeIndex(newVal) {
       if (newVal === 0) {
         this.initData()
       }
     },
-    ordinaryIndex (newVal) {
+    ordinaryIndex(newVal) {
       if (newVal) {
         this.initData()
       }
@@ -321,13 +337,13 @@ export default {
   },
   // 生命周期函数
   created() {
-    if (this.$route.query.type*1 === 0) {
+    if (this.$route.query.type * 1 === 0) {
       this.initData()
     }
   },
   // 方法函数
   methods: {
-    initData () {
+    initData() {
       this.companyId = this.$route.query.companyId;
       this.solutionData.companyId = this.$route.query.companyId;
       this.getDicType("productsType"); //车险产品
@@ -344,6 +360,15 @@ export default {
       });
       localStorage.setItem("insureList", JSON.stringify(this.insureList));
     },
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -536,6 +561,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -575,40 +601,58 @@ export default {
         seatNum: ""//座位数
       });
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"02",vehicleType:"A1",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionVisible = false;
-            this.solutionFindPage();
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"02",vehicleType:"A1",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "02", vehicleType: "A1", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionVisible = false;
-            this.solutionFindPage();
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "02", vehicleType: "A1", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -623,7 +667,7 @@ export default {
       this.solutionVisible = true;
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"02",vehicleType:"A1",energyType:"1" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "02", vehicleType: "A1", energyType: "1" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -644,7 +688,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"02",'A1','1').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "02", 'A1', '1').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -657,7 +701,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -839,4 +883,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 289 - 243
src/views/AgreementManage/InsuranceCompany/PassengerBus/BusinessOperation/Fuel/AddOrdinaryPlan.vue

@@ -1,234 +1,240 @@
 <!-- 模板区域 -->
 <template>
   <div>
-      <div class="tab-panestyle">
-        <div class="tab-panecent">
-          <span>险种配置</span>
-          <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
-            @input="productInput" size="small" style="margin-left: 30px;">
-            <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
-              :label="productsitem.dictValue">{{
-                productsitem.dictTag }}</el-radio-button>
-          </el-radio-group>
+    <div class="tab-panestyle">
+      <div class="tab-panecent">
+        <span>险种配置</span>
+        <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
+          @input="productInput" size="small" style="margin-left: 30px;">
+          <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
+            :label="productsitem.dictValue">{{
+              productsitem.dictTag }}</el-radio-button>
+        </el-radio-group>
+      </div>
+      <div class="tab-panecent">
+        <div class=" flex j-s a-c">
+          <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
+            @click="planOptionadd">方案新增</el-button>
         </div>
-        <div class="tab-panecent">
-          <div class=" flex j-s a-c">
-            <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
-              @click="planOptionadd">方案新增</el-button>
+        <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
+          <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
+            <span>方案{{ solutionindex + 1 }}</span>
+            <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
+              @click="planOptiondel(solutionindex)">方案删除</el-button>
           </div>
-          <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
-            <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
-              <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+          <el-form :ref="`solutionForm${solutionindex}`" :model="solutionitem" label-width="120px"
+            :rules="solutionrules" :size="overSize">
+            <el-row>
+              <el-col :span="8">
+                <el-form-item label="方案名称" prop="schemeName">
+                  <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="4">
+                <el-form-item label="序号" prop="priorityLevel">
+                  <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="20">
+                <el-form-item label="方案描述">
+                  <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
+                    show-word-limit></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+          <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
+            <div class="flex j-s a-c">
+              <h4>商业险方案配置</h4>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="方案名称">
-                    <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="20">
-                  <el-form-item label="方案描述">
-                    <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
-                      show-word-limit></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-            <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
-              <div class="flex j-s a-c">
-                <h4>商业险方案配置</h4>
-              </div>
-              <div class="flex j-start ">
-                <div class="Risk f-c" style="margin-right: 30px;">
-                  <section class="flex j-s a-c ">
-                    <div>
-                      全部险别
-                    </div>
-                    <div>
-                      投保保额
-                    </div>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
-                    <div>
-                      <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
-                      <span>{{ insureitem.kindName }}</span>
-                    </div>
-                    <div>
-                      <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
-                        placeholder="请选择"
-                        @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
-                        style="width: 200px;" clearable :size="overSize">
-                        <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
-                          :value="item.value"></el-option>
-                      </el-select>
-                      <span v-else>
-                        <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
-                          size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
-                          :min="0"></el-input-number>次
-                      </span>
-                    </div>
-                  </main>
-                </div>
-                <div class="Risk">
-                  <section class="flex j-s a-c ">
-                    <span class="flex j-start">已选险别</span>
-                    <span class="flex j-c">投保保额</span>
-                    <span class="flex j-end">操作</span>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
-                    :key="filteredInsureindex" v-if="filteredInsureitem.switch">
-                    <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
-                    <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
-                      filteredInsureitem.amountDesc }}</span>
-                    <span class="flex j-c"
-                      v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}%</span>
-                    <span class="flex j-c"
-                      v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}次</span>
-                    <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
-                    <span class="flex j-end">
-                      <i class="el-icon-delete" style="font-size: 20px;"
-                        @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
+            <div class="flex j-start ">
+              <div class="Risk f-c" style="margin-right: 30px;">
+                <section class="flex j-s a-c ">
+                  <div>
+                    全部险别
+                  </div>
+                  <div>
+                    投保保额
+                  </div>
+                </section>
+                <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
+                  <div>
+                    <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
+                    <span>{{ insureitem.kindName }}</span>
+                  </div>
+                  <div>
+                    <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
+                      placeholder="请选择"
+                      @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
+                      style="width: 200px;" clearable :size="overSize">
+                      <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
+                        :value="item.value"></el-option>
+                    </el-select>
+                    <span v-else>
+                      <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
+                        size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
+                        :min="0"></el-input-number>次
                     </span>
-                  </main>
-                </div>
-              </div>
-            </div>
-            <div>
-              <div class="flex a-c">
-                <h4>驾意险方案配置</h4>
-                <el-button size="mini"
-                  style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
-                  @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
-              </div>
-              <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
-                style="margin-bottom: 20px;">
-                <div class="flex j-s a-c">
-                  <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
-                    :key="DriverTypeitem.id">
-                    <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
-                      DriverTypeitem.typeName
-                    }}</span>
-                    <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
-                      :key="childrenitem.id"
-                      @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
-                        childrenitem.typeName }}</el-checkbox>
                   </div>
+                </main>
+              </div>
+              <div class="Risk">
+                <section class="flex j-s a-c ">
+                  <span class="flex j-start">已选险别</span>
+                  <span class="flex j-c">投保保额</span>
+                  <span class="flex j-end">操作</span>
+                </section>
+                <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
+                  :key="filteredInsureindex" v-if="filteredInsureitem.switch">
+                  <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
+                  <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
+                    filteredInsureitem.amountDesc }}</span>
+                  <span class="flex j-c"
+                    v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}%</span>
+                  <span class="flex j-c"
+                    v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}次</span>
+                  <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
                   <span class="flex j-end">
                     <i class="el-icon-delete" style="font-size: 20px;"
-                      @click="drvingDel(solutionindex, configureindex)"></i>
+                      @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
                   </span>
+                </main>
+              </div>
+            </div>
+          </div>
+          <div>
+            <div class="flex a-c">
+              <h4>驾意险方案配置</h4>
+              <el-button size="mini"
+                style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
+                @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
+            </div>
+            <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
+              style="margin-bottom: 20px;">
+              <div class="flex j-s a-c">
+                <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
+                  :key="DriverTypeitem.id">
+                  <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
+                    DriverTypeitem.typeName
+                  }}</span>
+                  <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
+                    :key="childrenitem.id"
+                    @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
+                      childrenitem.typeName }}</el-checkbox>
                 </div>
-                <el-form ref="form" :model="formitem" label-width="120px" size="small"
-                  v-for="(formitem, formindex) in configureitem.list" :key="formindex">
-                  <el-row>
-                    <el-col :span="24">
-                      <el-col :span="10">
-                        <el-form-item label="驾意选择:">
-                          <el-select
-                            v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
-                            :size="overSize" style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                <span class="flex j-end">
+                  <i class="el-icon-delete" style="font-size: 20px;"
+                    @click="drvingDel(solutionindex, configureindex)"></i>
+                </span>
+              </div>
+              <el-form ref="form" :model="formitem" label-width="120px" size="small"
+                v-for="(formitem, formindex) in configureitem.list" :key="formindex">
+                <el-row>
+                  <el-col :span="24">
+                    <el-col :span="10">
+                      <el-form-item label="驾意选择:">
+                        <el-select
+                          v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
+                          :size="overSize" style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <template v-if="formitem.drvingChildren">
+                          <el-select v-if="formitem.isMultiple == 1" multiple filterable
+                            v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
                             style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <template v-if="formitem.drvingChildren">
-                            <el-select v-if="formitem.isMultiple == 1" multiple filterable
-                              v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
-                              style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                          </template>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="4">
-                        <el-form-item label="别名:">
-                          <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="座位数:">
-                          <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>座</span>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="份数:">
-                          <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>份</span>
-                        </el-form-item>
-                      </el-col>
+                        </template>
+                      </el-form-item>
                     </el-col>
-                    <el-col :span="20">
-                      <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
-                        :key="LiabilityTermsindex">
-                        <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
-                        <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
-                          background: '#F7F7F9',
-                          fontWeight: '700',
-                          color: '#606266',
-                        }">
-                          <el-table-column prop="name" label="保险责任" align="center">
-                          </el-table-column>
-                          <el-table-column prop="amount" label="保险金额" width="180" align="center">
-                          </el-table-column>
-                          <el-table-column prop="premium" label="保费(元)" width="180" align="center">
-                          </el-table-column>
-                        </el-table>
-                      </div>
+                    <el-col :span="4">
+                      <el-form-item label="别名:">
+                        <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
+                      </el-form-item>
                     </el-col>
-                  </el-row>
-                </el-form>
-              </div>
+                    <el-col :span="5">
+                      <el-form-item label="座位数:">
+                        <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>座</span>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="5">
+                      <el-form-item label="份数:">
+                        <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>份</span>
+                      </el-form-item>
+                    </el-col>
+                  </el-col>
+                  <el-col :span="20">
+                    <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
+                      :key="LiabilityTermsindex">
+                      <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
+                      <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
+                        background: '#F7F7F9',
+                        fontWeight: '700',
+                        color: '#606266',
+                      }">
+                        <el-table-column prop="name" label="保险责任" align="center">
+                        </el-table-column>
+                        <el-table-column prop="amount" label="保险金额" width="180" align="center">
+                        </el-table-column>
+                        <el-table-column prop="premium" label="保费(元)" width="180" align="center">
+                        </el-table-column>
+                      </el-table>
+                    </div>
+                  </el-col>
+                </el-row>
+              </el-form>
             </div>
           </div>
         </div>
       </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
-          消</el-button>
-        <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
-          @click="solutionSubmit('solutionForm')">确 定</el-button>
-      </span>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
+        消</el-button>
+      <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
+        @click="solutionSubmit('solutionForm')">确 定</el-button>
+    </span>
   </div>
 </template>
 <!-- 行为区域 -->
@@ -241,6 +247,7 @@ export default {
   },
   data() {
     return {
+
       DriveSelectAll: false,
       checkedall: false,
       insureList: [],
@@ -250,6 +257,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -263,8 +279,9 @@ export default {
         productName: "",
         productList: [
           {
-            schemeName: "",
-            description: "",
+            schemeName: "",//方案名称
+            priorityLevel: "",//方案序号
+            description: "",//方案描述
             kinds: [],
             drvingIntentions: [
               {
@@ -301,6 +318,15 @@ export default {
   },
   // 方法函数
   methods: {
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -493,6 +519,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",//方案序号
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -532,43 +559,62 @@ export default {
         seatNum: ""//座位数
       });
     },
-    ordinaryPlanCancel () {
+    ordinaryPlanCancel() {
       this.$emit('ordinaryPlanCancel')
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"01",vehicleType:"A0",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"01",vehicleType:"A0",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "01", vehicleType: "A0", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "01", vehicleType: "A0", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
+
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -582,7 +628,7 @@ export default {
       this.solutionDialogTitle = '添加方案'
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"01",vehicleType:"A0",energyType:"0" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "01", vehicleType: "A0", energyType: "0" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -603,7 +649,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"01",'A0','0').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "01", 'A0', '0').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -616,7 +662,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -675,6 +721,7 @@ export default {
   align-items: flex-end;
   justify-content: flex-end;
 }
+
 /deep/ {
   .el-radio__input.is-checked .el-radio__inner,
   .el-checkbox__input.is-checked .el-checkbox__inner,
@@ -805,4 +852,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 90 - 47
src/views/AgreementManage/InsuranceCompany/PassengerBus/BusinessOperation/Fuel/OrdinaryPlan.vue

@@ -7,8 +7,8 @@
     <!-- @findPage="solutionFindPage" -->
     <kt-common-table :tableHeights="700" :SerialShow="false" :operationWidth="200" :showOperation="true"
       :showBatchDelete="false" :showBatchSettled="false" :showBatchPrint="false" :data="solutionResult" button2Name="编辑"
-      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除" button3Type="text" @handleButton3="solutionDel"
-      :columns="solutionColumns">
+      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除"
+      button3Type="text" @handleButton3="solutionDel" :columns="solutionColumns">
     </kt-common-table>
     <el-dialog v-dialogDrag :title="solutionDialogTitle" :visible.sync="solutionVisible" width="90%" top="2vh"
       @close="solutioncloseDialog">
@@ -30,16 +30,22 @@
           <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
             <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
               <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete"
+                class="planOption-del" @click="planOptiondel(solutionindex)">方案删除</el-button>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
+            <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+              label-width="120px" :size="overSize">
               <el-row>
                 <el-col :span="8">
-                  <el-form-item label="方案名称">
+                  <el-form-item label="方案名称" prop="schemeName">
                     <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
                   </el-form-item>
                 </el-col>
+                <el-col :span="4">
+                  <el-form-item label="序号" prop="priorityLevel">
+                    <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                  </el-form-item>
+                </el-col>
                 <el-col :span="20">
                   <el-form-item label="方案描述">
                     <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
@@ -123,7 +129,7 @@
                     :key="DriverTypeitem.id">
                     <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
                       DriverTypeitem.typeName
-                    }}</span>
+                      }}</span>
                     <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
                       :key="childrenitem.id"
                       @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
@@ -158,8 +164,8 @@
                           </el-select>
                           <el-select
                             v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
+                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
                             @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
                               v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
@@ -180,8 +186,8 @@
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                             </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
+                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择"
+                              clearable :size="overSize" style="width: 250px;"
                               @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
@@ -275,6 +281,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -289,6 +304,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -308,12 +324,12 @@ export default {
     }
   },
   watch: {
-    activeIndex (newVal) {
+    activeIndex(newVal) {
       if (newVal === 0) {
         this.initData()
       }
     },
-    ordinaryIndex (newVal) {
+    ordinaryIndex(newVal) {
       if (newVal) {
         this.initData()
       }
@@ -321,13 +337,13 @@ export default {
   },
   // 生命周期函数
   created() {
-    if (this.$route.query.type*1 === 0) {
+    if (this.$route.query.type * 1 === 0) {
       this.initData()
     }
   },
   // 方法函数
   methods: {
-    initData () {
+    initData() {
       this.companyId = this.$route.query.companyId;
       this.solutionData.companyId = this.$route.query.companyId;
       this.getDicType("productsType"); //车险产品
@@ -344,6 +360,15 @@ export default {
       });
       localStorage.setItem("insureList", JSON.stringify(this.insureList));
     },
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -536,6 +561,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -575,40 +601,58 @@ export default {
         seatNum: ""//座位数
       });
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"01",vehicleType:"A0",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionVisible = false;
-            this.solutionFindPage();
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"01",vehicleType:"A0",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "01", vehicleType: "A0", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionVisible = false;
-            this.solutionFindPage();
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "01", vehicleType: "A0", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -623,7 +667,7 @@ export default {
       this.solutionVisible = true;
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"01",vehicleType:"A0",energyType:"0" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "01", vehicleType: "A0", energyType: "0" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -644,7 +688,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"01",'A0','0').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "01", 'A0', '0').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -657,7 +701,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -839,4 +883,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 262 - 217
src/views/AgreementManage/InsuranceCompany/PassengerBus/BusinessOperation/NewEnergy/AddOrdinaryPlan.vue

@@ -1,234 +1,240 @@
 <!-- 模板区域 -->
 <template>
   <div>
-      <div class="tab-panestyle">
-        <div class="tab-panecent">
-          <span>险种配置</span>
-          <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
-            @input="productInput" size="small" style="margin-left: 30px;">
-            <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
-              :label="productsitem.dictValue">{{
-                productsitem.dictTag }}</el-radio-button>
-          </el-radio-group>
+    <div class="tab-panestyle">
+      <div class="tab-panecent">
+        <span>险种配置</span>
+        <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
+          @input="productInput" size="small" style="margin-left: 30px;">
+          <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
+            :label="productsitem.dictValue">{{
+              productsitem.dictTag }}</el-radio-button>
+        </el-radio-group>
+      </div>
+      <div class="tab-panecent">
+        <div class=" flex j-s a-c">
+          <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
+            @click="planOptionadd">方案新增</el-button>
         </div>
-        <div class="tab-panecent">
-          <div class=" flex j-s a-c">
-            <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
-              @click="planOptionadd">方案新增</el-button>
+        <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
+          <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
+            <span>方案{{ solutionindex + 1 }}</span>
+            <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
+              @click="planOptiondel(solutionindex)">方案删除</el-button>
           </div>
-          <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
-            <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
-              <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+          <el-form :ref="`solutionForm${solutionindex}`" :model="solutionitem" label-width="120px"
+            :rules="solutionrules" :size="overSize">
+            <el-row>
+              <el-col :span="8">
+                <el-form-item label="方案名称" prop="schemeName">
+                  <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="4">
+                <el-form-item label="序号" prop="priorityLevel">
+                  <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="20">
+                <el-form-item label="方案描述">
+                  <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
+                    show-word-limit></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+          <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
+            <div class="flex j-s a-c">
+              <h4>商业险方案配置</h4>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="方案名称">
-                    <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="20">
-                  <el-form-item label="方案描述">
-                    <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
-                      show-word-limit></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-            <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
-              <div class="flex j-s a-c">
-                <h4>商业险方案配置</h4>
-              </div>
-              <div class="flex j-start ">
-                <div class="Risk f-c" style="margin-right: 30px;">
-                  <section class="flex j-s a-c ">
-                    <div>
-                      全部险别
-                    </div>
-                    <div>
-                      投保保额
-                    </div>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
-                    <div>
-                      <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
-                      <span>{{ insureitem.kindName }}</span>
-                    </div>
-                    <div>
-                      <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
-                        placeholder="请选择"
-                        @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
-                        style="width: 200px;" clearable :size="overSize">
-                        <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
-                          :value="item.value"></el-option>
-                      </el-select>
-                      <span v-else>
-                        <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
-                          size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
-                          :min="0"></el-input-number>次
-                      </span>
-                    </div>
-                  </main>
-                </div>
-                <div class="Risk">
-                  <section class="flex j-s a-c ">
-                    <span class="flex j-start">已选险别</span>
-                    <span class="flex j-c">投保保额</span>
-                    <span class="flex j-end">操作</span>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
-                    :key="filteredInsureindex" v-if="filteredInsureitem.switch">
-                    <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
-                    <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
-                      filteredInsureitem.amountDesc }}</span>
-                    <span class="flex j-c"
-                      v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}%</span>
-                    <span class="flex j-c"
-                      v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}次</span>
-                    <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
-                    <span class="flex j-end">
-                      <i class="el-icon-delete" style="font-size: 20px;"
-                        @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
+            <div class="flex j-start ">
+              <div class="Risk f-c" style="margin-right: 30px;">
+                <section class="flex j-s a-c ">
+                  <div>
+                    全部险别
+                  </div>
+                  <div>
+                    投保保额
+                  </div>
+                </section>
+                <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
+                  <div>
+                    <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
+                    <span>{{ insureitem.kindName }}</span>
+                  </div>
+                  <div>
+                    <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
+                      placeholder="请选择"
+                      @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
+                      style="width: 200px;" clearable :size="overSize">
+                      <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
+                        :value="item.value"></el-option>
+                    </el-select>
+                    <span v-else>
+                      <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
+                        size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
+                        :min="0"></el-input-number>次
                     </span>
-                  </main>
-                </div>
-              </div>
-            </div>
-            <div>
-              <div class="flex a-c">
-                <h4>驾意险方案配置</h4>
-                <el-button size="mini"
-                  style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
-                  @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
-              </div>
-              <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
-                style="margin-bottom: 20px;">
-                <div class="flex j-s a-c">
-                  <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
-                    :key="DriverTypeitem.id">
-                    <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
-                      DriverTypeitem.typeName
-                    }}</span>
-                    <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
-                      :key="childrenitem.id"
-                      @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
-                        childrenitem.typeName }}</el-checkbox>
                   </div>
+                </main>
+              </div>
+              <div class="Risk">
+                <section class="flex j-s a-c ">
+                  <span class="flex j-start">已选险别</span>
+                  <span class="flex j-c">投保保额</span>
+                  <span class="flex j-end">操作</span>
+                </section>
+                <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
+                  :key="filteredInsureindex" v-if="filteredInsureitem.switch">
+                  <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
+                  <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
+                    filteredInsureitem.amountDesc }}</span>
+                  <span class="flex j-c"
+                    v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}%</span>
+                  <span class="flex j-c"
+                    v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}次</span>
+                  <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
                   <span class="flex j-end">
                     <i class="el-icon-delete" style="font-size: 20px;"
-                      @click="drvingDel(solutionindex, configureindex)"></i>
+                      @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
                   </span>
+                </main>
+              </div>
+            </div>
+          </div>
+          <div>
+            <div class="flex a-c">
+              <h4>驾意险方案配置</h4>
+              <el-button size="mini"
+                style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
+                @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
+            </div>
+            <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
+              style="margin-bottom: 20px;">
+              <div class="flex j-s a-c">
+                <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
+                  :key="DriverTypeitem.id">
+                  <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
+                    DriverTypeitem.typeName
+                  }}</span>
+                  <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
+                    :key="childrenitem.id"
+                    @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
+                      childrenitem.typeName }}</el-checkbox>
                 </div>
-                <el-form ref="form" :model="formitem" label-width="120px" size="small"
-                  v-for="(formitem, formindex) in configureitem.list" :key="formindex">
-                  <el-row>
-                    <el-col :span="24">
-                      <el-col :span="10">
-                        <el-form-item label="驾意选择:">
-                          <el-select
-                            v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
-                            :size="overSize" style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                <span class="flex j-end">
+                  <i class="el-icon-delete" style="font-size: 20px;"
+                    @click="drvingDel(solutionindex, configureindex)"></i>
+                </span>
+              </div>
+              <el-form ref="form" :model="formitem" label-width="120px" size="small"
+                v-for="(formitem, formindex) in configureitem.list" :key="formindex">
+                <el-row>
+                  <el-col :span="24">
+                    <el-col :span="10">
+                      <el-form-item label="驾意选择:">
+                        <el-select
+                          v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
+                          :size="overSize" style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <template v-if="formitem.drvingChildren">
+                          <el-select v-if="formitem.isMultiple == 1" multiple filterable
+                            v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
                             style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <template v-if="formitem.drvingChildren">
-                            <el-select v-if="formitem.isMultiple == 1" multiple filterable
-                              v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
-                              style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                          </template>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="4">
-                        <el-form-item label="别名:">
-                          <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="座位数:">
-                          <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>座</span>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="份数:">
-                          <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>份</span>
-                        </el-form-item>
-                      </el-col>
+                        </template>
+                      </el-form-item>
                     </el-col>
-                    <el-col :span="20">
-                      <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
-                        :key="LiabilityTermsindex">
-                        <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
-                        <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
-                          background: '#F7F7F9',
-                          fontWeight: '700',
-                          color: '#606266',
-                        }">
-                          <el-table-column prop="name" label="保险责任" align="center">
-                          </el-table-column>
-                          <el-table-column prop="amount" label="保险金额" width="180" align="center">
-                          </el-table-column>
-                          <el-table-column prop="premium" label="保费(元)" width="180" align="center">
-                          </el-table-column>
-                        </el-table>
-                      </div>
+                    <el-col :span="4">
+                      <el-form-item label="别名:">
+                        <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
+                      </el-form-item>
                     </el-col>
-                  </el-row>
-                </el-form>
-              </div>
+                    <el-col :span="5">
+                      <el-form-item label="座位数:">
+                        <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>座</span>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="5">
+                      <el-form-item label="份数:">
+                        <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>份</span>
+                      </el-form-item>
+                    </el-col>
+                  </el-col>
+                  <el-col :span="20">
+                    <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
+                      :key="LiabilityTermsindex">
+                      <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
+                      <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
+                        background: '#F7F7F9',
+                        fontWeight: '700',
+                        color: '#606266',
+                      }">
+                        <el-table-column prop="name" label="保险责任" align="center">
+                        </el-table-column>
+                        <el-table-column prop="amount" label="保险金额" width="180" align="center">
+                        </el-table-column>
+                        <el-table-column prop="premium" label="保费(元)" width="180" align="center">
+                        </el-table-column>
+                      </el-table>
+                    </div>
+                  </el-col>
+                </el-row>
+              </el-form>
             </div>
           </div>
         </div>
       </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
-          消</el-button>
-        <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
-          @click="solutionSubmit('solutionForm')">确 定</el-button>
-      </span>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
+        消</el-button>
+      <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
+        @click="solutionSubmit('solutionForm')">确 定</el-button>
+    </span>
   </div>
 </template>
 <!-- 行为区域 -->
@@ -250,6 +256,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -264,6 +279,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",//方案序号
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -301,6 +317,15 @@ export default {
   },
   // 方法函数
   methods: {
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -493,6 +518,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",//方案序号
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -532,12 +558,26 @@ export default {
         seatNum: ""//座位数
       });
     },
-    ordinaryPlanCancel () {
+    ordinaryPlanCancel() {
       this.$emit('ordinaryPlanCancel')
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"01",vehicleType:"A0",energyType:"1"}).then((res) => {
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+      const formName = `solutionForm${index}`;
+      return new Promise((resolve, reject) => {
+        this.$refs[formName][0].validate((valid) => {
+          if (valid) {
+            resolve();
+          } else {
+            reject(`方案 ${index + 1} 校验失败!`);
+          }
+        });
+      });
+    });
+    Promise.all(promises)
+      .then(() => {
+        if (this.solutionDialogType == 'add') {
+        this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "01", vehicleType: "A0", energyType: "1" }).then((res) => {
           if (res.code == '200') {
             this.$message({
               type: 'success',
@@ -553,7 +593,7 @@ export default {
           }
         });
       } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"01",vehicleType:"A0",energyType:"1"}).then((res) => {
+        this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "01", vehicleType: "A0", energyType: "1" }).then((res) => {
           if (res.code == '200') {
             this.$message({
               type: 'success',
@@ -569,6 +609,11 @@ export default {
           }
         });
       }
+      })
+      .catch((error) => {
+        console.log(error);
+      });
+
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -582,7 +627,7 @@ export default {
       this.solutionDialogTitle = '添加方案'
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"01",vehicleType:"A0",energyType:"1" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "01", vehicleType: "A0", energyType: "1" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -603,7 +648,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"01",'A0','1').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "01", 'A0', '1').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -616,7 +661,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -675,6 +720,7 @@ export default {
   align-items: flex-end;
   justify-content: flex-end;
 }
+
 /deep/ {
   .el-radio__input.is-checked .el-radio__inner,
   .el-checkbox__input.is-checked .el-checkbox__inner,
@@ -805,4 +851,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 90 - 47
src/views/AgreementManage/InsuranceCompany/PassengerBus/BusinessOperation/NewEnergy/OrdinaryPlan.vue

@@ -7,8 +7,8 @@
     <!-- @findPage="solutionFindPage" -->
     <kt-common-table :tableHeights="700" :SerialShow="false" :operationWidth="200" :showOperation="true"
       :showBatchDelete="false" :showBatchSettled="false" :showBatchPrint="false" :data="solutionResult" button2Name="编辑"
-      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除" button3Type="text" @handleButton3="solutionDel"
-      :columns="solutionColumns">
+      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除"
+      button3Type="text" @handleButton3="solutionDel" :columns="solutionColumns">
     </kt-common-table>
     <el-dialog v-dialogDrag :title="solutionDialogTitle" :visible.sync="solutionVisible" width="90%" top="2vh"
       @close="solutioncloseDialog">
@@ -30,16 +30,22 @@
           <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
             <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
               <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete"
+                class="planOption-del" @click="planOptiondel(solutionindex)">方案删除</el-button>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
+            <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+              label-width="120px" :size="overSize">
               <el-row>
                 <el-col :span="8">
-                  <el-form-item label="方案名称">
+                  <el-form-item label="方案名称" prop="schemeName">
                     <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
                   </el-form-item>
                 </el-col>
+                <el-col :span="4">
+                  <el-form-item label="序号" prop="priorityLevel">
+                    <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                  </el-form-item>
+                </el-col>
                 <el-col :span="20">
                   <el-form-item label="方案描述">
                     <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
@@ -123,7 +129,7 @@
                     :key="DriverTypeitem.id">
                     <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
                       DriverTypeitem.typeName
-                    }}</span>
+                      }}</span>
                     <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
                       :key="childrenitem.id"
                       @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
@@ -158,8 +164,8 @@
                           </el-select>
                           <el-select
                             v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
+                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
                             @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
                               v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
@@ -180,8 +186,8 @@
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                             </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
+                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择"
+                              clearable :size="overSize" style="width: 250px;"
                               @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
@@ -275,6 +281,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -289,6 +304,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -308,12 +324,12 @@ export default {
     }
   },
   watch: {
-    activeIndex (newVal) {
+    activeIndex(newVal) {
       if (newVal === 0) {
         this.initData()
       }
     },
-    ordinaryIndex (newVal) {
+    ordinaryIndex(newVal) {
       if (newVal) {
         this.initData()
       }
@@ -321,13 +337,13 @@ export default {
   },
   // 生命周期函数
   created() {
-    if (this.$route.query.type*1 === 0) {
+    if (this.$route.query.type * 1 === 0) {
       this.initData()
     }
   },
   // 方法函数
   methods: {
-    initData () {
+    initData() {
       this.companyId = this.$route.query.companyId;
       this.solutionData.companyId = this.$route.query.companyId;
       this.getDicType("productsType"); //车险产品
@@ -344,6 +360,15 @@ export default {
       });
       localStorage.setItem("insureList", JSON.stringify(this.insureList));
     },
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -536,6 +561,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -575,40 +601,58 @@ export default {
         seatNum: ""//座位数
       });
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"01",vehicleType:"A0",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionVisible = false;
-            this.solutionFindPage();
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"01",vehicleType:"A0",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "01", vehicleType: "A0", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionVisible = false;
-            this.solutionFindPage();
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "01", vehicleType: "A0", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -623,7 +667,7 @@ export default {
       this.solutionVisible = true;
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"01",vehicleType:"A0",energyType:"1" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "01", vehicleType: "A0", energyType: "1" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -644,7 +688,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"01",'A0','1').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "01", 'A0', '1').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -657,7 +701,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -839,4 +883,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 286 - 241
src/views/AgreementManage/InsuranceCompany/PassengerBus/NonBusiness/Fuel/AddOrdinaryPlan.vue

@@ -1,234 +1,240 @@
 <!-- 模板区域 -->
 <template>
   <div>
-      <div class="tab-panestyle">
-        <div class="tab-panecent">
-          <span>险种配置</span>
-          <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
-            @input="productInput" size="small" style="margin-left: 30px;">
-            <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
-              :label="productsitem.dictValue">{{
-                productsitem.dictTag }}</el-radio-button>
-          </el-radio-group>
+    <div class="tab-panestyle">
+      <div class="tab-panecent">
+        <span>险种配置</span>
+        <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
+          @input="productInput" size="small" style="margin-left: 30px;">
+          <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
+            :label="productsitem.dictValue">{{
+              productsitem.dictTag }}</el-radio-button>
+        </el-radio-group>
+      </div>
+      <div class="tab-panecent">
+        <div class=" flex j-s a-c">
+          <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
+            @click="planOptionadd">方案新增</el-button>
         </div>
-        <div class="tab-panecent">
-          <div class=" flex j-s a-c">
-            <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
-              @click="planOptionadd">方案新增</el-button>
+        <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
+          <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
+            <span>方案{{ solutionindex + 1 }}</span>
+            <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
+              @click="planOptiondel(solutionindex)">方案删除</el-button>
           </div>
-          <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
-            <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
-              <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+          <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+            label-width="120px" :size="overSize">
+            <el-row>
+              <el-col :span="8">
+                <el-form-item label="方案名称" prop="schemeName">
+                  <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="4">
+                <el-form-item label="序号" prop="priorityLevel">
+                  <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="20">
+                <el-form-item label="方案描述">
+                  <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
+                    show-word-limit></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+          <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
+            <div class="flex j-s a-c">
+              <h4>商业险方案配置</h4>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="方案名称">
-                    <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="20">
-                  <el-form-item label="方案描述">
-                    <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
-                      show-word-limit></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-            <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
-              <div class="flex j-s a-c">
-                <h4>商业险方案配置</h4>
-              </div>
-              <div class="flex j-start ">
-                <div class="Risk f-c" style="margin-right: 30px;">
-                  <section class="flex j-s a-c ">
-                    <div>
-                      全部险别
-                    </div>
-                    <div>
-                      投保保额
-                    </div>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
-                    <div>
-                      <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
-                      <span>{{ insureitem.kindName }}</span>
-                    </div>
-                    <div>
-                      <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
-                        placeholder="请选择"
-                        @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
-                        style="width: 200px;" clearable :size="overSize">
-                        <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
-                          :value="item.value"></el-option>
-                      </el-select>
-                      <span v-else>
-                        <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
-                          size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
-                          :min="0"></el-input-number>次
-                      </span>
-                    </div>
-                  </main>
-                </div>
-                <div class="Risk">
-                  <section class="flex j-s a-c ">
-                    <span class="flex j-start">已选险别</span>
-                    <span class="flex j-c">投保保额</span>
-                    <span class="flex j-end">操作</span>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
-                    :key="filteredInsureindex" v-if="filteredInsureitem.switch">
-                    <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
-                    <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
-                      filteredInsureitem.amountDesc }}</span>
-                    <span class="flex j-c"
-                      v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}%</span>
-                    <span class="flex j-c"
-                      v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}次</span>
-                    <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
-                    <span class="flex j-end">
-                      <i class="el-icon-delete" style="font-size: 20px;"
-                        @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
+            <div class="flex j-start ">
+              <div class="Risk f-c" style="margin-right: 30px;">
+                <section class="flex j-s a-c ">
+                  <div>
+                    全部险别
+                  </div>
+                  <div>
+                    投保保额
+                  </div>
+                </section>
+                <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
+                  <div>
+                    <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
+                    <span>{{ insureitem.kindName }}</span>
+                  </div>
+                  <div>
+                    <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
+                      placeholder="请选择"
+                      @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
+                      style="width: 200px;" clearable :size="overSize">
+                      <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
+                        :value="item.value"></el-option>
+                    </el-select>
+                    <span v-else>
+                      <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
+                        size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
+                        :min="0"></el-input-number>次
                     </span>
-                  </main>
-                </div>
-              </div>
-            </div>
-            <div>
-              <div class="flex a-c">
-                <h4>驾意险方案配置</h4>
-                <el-button size="mini"
-                  style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
-                  @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
-              </div>
-              <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
-                style="margin-bottom: 20px;">
-                <div class="flex j-s a-c">
-                  <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
-                    :key="DriverTypeitem.id">
-                    <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
-                      DriverTypeitem.typeName
-                    }}</span>
-                    <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
-                      :key="childrenitem.id"
-                      @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
-                        childrenitem.typeName }}</el-checkbox>
                   </div>
+                </main>
+              </div>
+              <div class="Risk">
+                <section class="flex j-s a-c ">
+                  <span class="flex j-start">已选险别</span>
+                  <span class="flex j-c">投保保额</span>
+                  <span class="flex j-end">操作</span>
+                </section>
+                <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
+                  :key="filteredInsureindex" v-if="filteredInsureitem.switch">
+                  <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
+                  <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
+                    filteredInsureitem.amountDesc }}</span>
+                  <span class="flex j-c"
+                    v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}%</span>
+                  <span class="flex j-c"
+                    v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}次</span>
+                  <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
                   <span class="flex j-end">
                     <i class="el-icon-delete" style="font-size: 20px;"
-                      @click="drvingDel(solutionindex, configureindex)"></i>
+                      @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
                   </span>
+                </main>
+              </div>
+            </div>
+          </div>
+          <div>
+            <div class="flex a-c">
+              <h4>驾意险方案配置</h4>
+              <el-button size="mini"
+                style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
+                @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
+            </div>
+            <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
+              style="margin-bottom: 20px;">
+              <div class="flex j-s a-c">
+                <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
+                  :key="DriverTypeitem.id">
+                  <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
+                    DriverTypeitem.typeName
+                  }}</span>
+                  <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
+                    :key="childrenitem.id"
+                    @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
+                      childrenitem.typeName }}</el-checkbox>
                 </div>
-                <el-form ref="form" :model="formitem" label-width="120px" size="small"
-                  v-for="(formitem, formindex) in configureitem.list" :key="formindex">
-                  <el-row>
-                    <el-col :span="24">
-                      <el-col :span="10">
-                        <el-form-item label="驾意选择:">
-                          <el-select
-                            v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
-                            :size="overSize" style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                <span class="flex j-end">
+                  <i class="el-icon-delete" style="font-size: 20px;"
+                    @click="drvingDel(solutionindex, configureindex)"></i>
+                </span>
+              </div>
+              <el-form ref="form" :model="formitem" label-width="120px" size="small"
+                v-for="(formitem, formindex) in configureitem.list" :key="formindex">
+                <el-row>
+                  <el-col :span="24">
+                    <el-col :span="10">
+                      <el-form-item label="驾意选择:">
+                        <el-select
+                          v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
+                          :size="overSize" style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <template v-if="formitem.drvingChildren">
+                          <el-select v-if="formitem.isMultiple == 1" multiple filterable
+                            v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
                             style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <template v-if="formitem.drvingChildren">
-                            <el-select v-if="formitem.isMultiple == 1" multiple filterable
-                              v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
-                              style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                          </template>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="4">
-                        <el-form-item label="别名:">
-                          <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="座位数:">
-                          <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>座</span>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="份数:">
-                          <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>份</span>
-                        </el-form-item>
-                      </el-col>
+                        </template>
+                      </el-form-item>
                     </el-col>
-                    <el-col :span="20">
-                      <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
-                        :key="LiabilityTermsindex">
-                        <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
-                        <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
-                          background: '#F7F7F9',
-                          fontWeight: '700',
-                          color: '#606266',
-                        }">
-                          <el-table-column prop="name" label="保险责任" align="center">
-                          </el-table-column>
-                          <el-table-column prop="amount" label="保险金额" width="180" align="center">
-                          </el-table-column>
-                          <el-table-column prop="premium" label="保费(元)" width="180" align="center">
-                          </el-table-column>
-                        </el-table>
-                      </div>
+                    <el-col :span="4">
+                      <el-form-item label="别名:">
+                        <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
+                      </el-form-item>
                     </el-col>
-                  </el-row>
-                </el-form>
-              </div>
+                    <el-col :span="5">
+                      <el-form-item label="座位数:">
+                        <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>座</span>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="5">
+                      <el-form-item label="份数:">
+                        <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>份</span>
+                      </el-form-item>
+                    </el-col>
+                  </el-col>
+                  <el-col :span="20">
+                    <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
+                      :key="LiabilityTermsindex">
+                      <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
+                      <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
+                        background: '#F7F7F9',
+                        fontWeight: '700',
+                        color: '#606266',
+                      }">
+                        <el-table-column prop="name" label="保险责任" align="center">
+                        </el-table-column>
+                        <el-table-column prop="amount" label="保险金额" width="180" align="center">
+                        </el-table-column>
+                        <el-table-column prop="premium" label="保费(元)" width="180" align="center">
+                        </el-table-column>
+                      </el-table>
+                    </div>
+                  </el-col>
+                </el-row>
+              </el-form>
             </div>
           </div>
         </div>
       </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
-          消</el-button>
-        <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
-          @click="solutionSubmit('solutionForm')">确 定</el-button>
-      </span>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
+        消</el-button>
+      <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
+        @click="solutionSubmit('solutionForm')">确 定</el-button>
+    </span>
   </div>
 </template>
 <!-- 行为区域 -->
@@ -250,6 +256,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -264,6 +279,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",//方案序号
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -301,6 +317,15 @@ export default {
   },
   // 方法函数
   methods: {
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -493,6 +518,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",//方案序号
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -532,43 +558,62 @@ export default {
         seatNum: ""//座位数
       });
     },
-    ordinaryPlanCancel () {
+    ordinaryPlanCancel() {
       this.$emit('ordinaryPlanCancel')
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"02",vehicleType:"A0",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"02",vehicleType:"A0",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "02", vehicleType: "A0", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "02", vehicleType: "A0", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
+
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -582,7 +627,7 @@ export default {
       this.solutionDialogTitle = '添加方案'
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"02",vehicleType:"A0",energyType:"0" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "02", vehicleType: "A0", energyType: "0" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -603,7 +648,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"02",'A0','0').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "02", 'A0', '0').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -616,7 +661,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -675,6 +720,7 @@ export default {
   align-items: flex-end;
   justify-content: flex-end;
 }
+
 /deep/ {
   .el-radio__input.is-checked .el-radio__inner,
   .el-checkbox__input.is-checked .el-checkbox__inner,
@@ -805,4 +851,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 90 - 47
src/views/AgreementManage/InsuranceCompany/PassengerBus/NonBusiness/Fuel/OrdinaryPlan.vue

@@ -7,8 +7,8 @@
     <!-- @findPage="solutionFindPage" -->
     <kt-common-table :tableHeights="700" :SerialShow="false" :operationWidth="200" :showOperation="true"
       :showBatchDelete="false" :showBatchSettled="false" :showBatchPrint="false" :data="solutionResult" button2Name="编辑"
-      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除" button3Type="text" @handleButton3="solutionDel"
-      :columns="solutionColumns">
+      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除"
+      button3Type="text" @handleButton3="solutionDel" :columns="solutionColumns">
     </kt-common-table>
     <el-dialog v-dialogDrag :title="solutionDialogTitle" :visible.sync="solutionVisible" width="90%" top="2vh"
       @close="solutioncloseDialog">
@@ -30,16 +30,22 @@
           <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
             <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
               <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete"
+                class="planOption-del" @click="planOptiondel(solutionindex)">方案删除</el-button>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
+            <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+              label-width="120px" :size="overSize">
               <el-row>
                 <el-col :span="8">
-                  <el-form-item label="方案名称">
+                  <el-form-item label="方案名称" prop="schemeName">
                     <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
                   </el-form-item>
                 </el-col>
+                <el-col :span="4">
+                  <el-form-item label="序号" prop="priorityLevel">
+                    <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                  </el-form-item>
+                </el-col>
                 <el-col :span="20">
                   <el-form-item label="方案描述">
                     <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
@@ -123,7 +129,7 @@
                     :key="DriverTypeitem.id">
                     <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
                       DriverTypeitem.typeName
-                    }}</span>
+                      }}</span>
                     <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
                       :key="childrenitem.id"
                       @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
@@ -158,8 +164,8 @@
                           </el-select>
                           <el-select
                             v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
+                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
                             @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
                               v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
@@ -180,8 +186,8 @@
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                             </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
+                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择"
+                              clearable :size="overSize" style="width: 250px;"
                               @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
@@ -275,6 +281,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -289,6 +304,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -308,12 +324,12 @@ export default {
     }
   },
   watch: {
-    activeIndex (newVal) {
+    activeIndex(newVal) {
       if (newVal === 0) {
         this.initData()
       }
     },
-    ordinaryIndex (newVal) {
+    ordinaryIndex(newVal) {
       if (newVal) {
         this.initData()
       }
@@ -321,13 +337,13 @@ export default {
   },
   // 生命周期函数
   created() {
-    if (this.$route.query.type*1 === 0) {
+    if (this.$route.query.type * 1 === 0) {
       this.initData()
     }
   },
   // 方法函数
   methods: {
-    initData () {
+    initData() {
       this.companyId = this.$route.query.companyId;
       this.solutionData.companyId = this.$route.query.companyId;
       this.getDicType("productsType"); //车险产品
@@ -344,6 +360,15 @@ export default {
       });
       localStorage.setItem("insureList", JSON.stringify(this.insureList));
     },
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -538,6 +563,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -577,40 +603,58 @@ export default {
         seatNum: ""//座位数
       });
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"02",vehicleType:"A0",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionVisible = false;
-            this.solutionFindPage();
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"02",vehicleType:"A0",energyType:"0"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "02", vehicleType: "A0", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionVisible = false;
-            this.solutionFindPage();
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "02", vehicleType: "A0", energyType: "0" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -625,7 +669,7 @@ export default {
       this.solutionVisible = true;
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"02",vehicleType:"A0",energyType:"0" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "02", vehicleType: "A0", energyType: "0" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -646,7 +690,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"02",'A0','0').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "02", 'A0', '0').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -659,7 +703,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -841,4 +885,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 286 - 241
src/views/AgreementManage/InsuranceCompany/PassengerBus/NonBusiness/NewEnergy/AddOrdinaryPlan.vue

@@ -1,234 +1,240 @@
 <!-- 模板区域 -->
 <template>
   <div>
-      <div class="tab-panestyle">
-        <div class="tab-panecent">
-          <span>险种配置</span>
-          <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
-            @input="productInput" size="small" style="margin-left: 30px;">
-            <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
-              :label="productsitem.dictValue">{{
-                productsitem.dictTag }}</el-radio-button>
-          </el-radio-group>
+    <div class="tab-panestyle">
+      <div class="tab-panecent">
+        <span>险种配置</span>
+        <el-radio-group :disabled="this.solutionDialogType == 'edit'" v-model="solutionData.productId"
+          @input="productInput" size="small" style="margin-left: 30px;">
+          <el-radio-button v-for="(productsitem, productsindex) in productsTypeoptions" :key="productsindex"
+            :label="productsitem.dictValue">{{
+              productsitem.dictTag }}</el-radio-button>
+        </el-radio-group>
+      </div>
+      <div class="tab-panecent">
+        <div class=" flex j-s a-c">
+          <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
+            @click="planOptionadd">方案新增</el-button>
         </div>
-        <div class="tab-panecent">
-          <div class=" flex j-s a-c">
-            <el-button type="primary" size="small" icon="el-icon-plus" class="planOption-btn"
-              @click="planOptionadd">方案新增</el-button>
+        <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
+          <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
+            <span>方案{{ solutionindex + 1 }}</span>
+            <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
+              @click="planOptiondel(solutionindex)">方案删除</el-button>
           </div>
-          <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
-            <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
-              <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+          <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+            label-width="120px" :size="overSize">
+            <el-row>
+              <el-col :span="8">
+                <el-form-item label="方案名称" prop="schemeName">
+                  <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="4">
+                <el-form-item label="序号" prop="priorityLevel">
+                  <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="20">
+                <el-form-item label="方案描述">
+                  <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
+                    show-word-limit></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+          <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
+            <div class="flex j-s a-c">
+              <h4>商业险方案配置</h4>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="方案名称">
-                    <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="20">
-                  <el-form-item label="方案描述">
-                    <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
-                      show-word-limit></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-            <div v-if="['单商', '单三', '交三', '交商'].includes(solutionData.productName)">
-              <div class="flex j-s a-c">
-                <h4>商业险方案配置</h4>
-              </div>
-              <div class="flex j-start ">
-                <div class="Risk f-c" style="margin-right: 30px;">
-                  <section class="flex j-s a-c ">
-                    <div>
-                      全部险别
-                    </div>
-                    <div>
-                      投保保额
-                    </div>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
-                    <div>
-                      <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
-                      <span>{{ insureitem.kindName }}</span>
-                    </div>
-                    <div>
-                      <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
-                        placeholder="请选择"
-                        @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
-                        style="width: 200px;" clearable :size="overSize">
-                        <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
-                          :value="item.value"></el-option>
-                      </el-select>
-                      <span v-else>
-                        <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
-                          size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
-                          :min="0"></el-input-number>次
-                      </span>
-                    </div>
-                  </main>
-                </div>
-                <div class="Risk">
-                  <section class="flex j-s a-c ">
-                    <span class="flex j-start">已选险别</span>
-                    <span class="flex j-c">投保保额</span>
-                    <span class="flex j-end">操作</span>
-                  </section>
-                  <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
-                    :key="filteredInsureindex" v-if="filteredInsureitem.switch">
-                    <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
-                    <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
-                      filteredInsureitem.amountDesc }}</span>
-                    <span class="flex j-c"
-                      v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}%</span>
-                    <span class="flex j-c"
-                      v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
-                        filteredInsureitem.amount }}次</span>
-                    <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
-                    <span class="flex j-end">
-                      <i class="el-icon-delete" style="font-size: 20px;"
-                        @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
+            <div class="flex j-start ">
+              <div class="Risk f-c" style="margin-right: 30px;">
+                <section class="flex j-s a-c ">
+                  <div>
+                    全部险别
+                  </div>
+                  <div>
+                    投保保额
+                  </div>
+                </section>
+                <main class="flex j-s a-c" v-for="(insureitem, insureindex) in solutionitem.kinds" :key="insureindex">
+                  <div>
+                    <el-checkbox v-model="insureitem.switch" style="margin-right: 10px;" disabled></el-checkbox>
+                    <span>{{ insureitem.kindName }}</span>
+                  </div>
+                  <div>
+                    <el-select v-if="insureitem.amtList.length > 0" filterable v-model="insureitem.amount"
+                      placeholder="请选择"
+                      @change="(value) => amtListChange(value, insureitem.amtList, insureindex, solutionindex)"
+                      style="width: 200px;" clearable :size="overSize">
+                      <el-option v-for="(item, index) in insureitem.amtList" :key="index" :label="item.label"
+                        :value="item.value"></el-option>
+                    </el-select>
+                    <span v-else>
+                      <el-input-number @change="(value) => inputNumberChange(value, insureindex, solutionindex)"
+                        size="small" style="width:200px; margin-right: 10px;" v-model="insureitem.amount"
+                        :min="0"></el-input-number>次
                     </span>
-                  </main>
-                </div>
-              </div>
-            </div>
-            <div>
-              <div class="flex a-c">
-                <h4>驾意险方案配置</h4>
-                <el-button size="mini"
-                  style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
-                  @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
-              </div>
-              <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
-                style="margin-bottom: 20px;">
-                <div class="flex j-s a-c">
-                  <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
-                    :key="DriverTypeitem.id">
-                    <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
-                      DriverTypeitem.typeName
-                    }}</span>
-                    <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
-                      :key="childrenitem.id"
-                      @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
-                        childrenitem.typeName }}</el-checkbox>
                   </div>
+                </main>
+              </div>
+              <div class="Risk">
+                <section class="flex j-s a-c ">
+                  <span class="flex j-start">已选险别</span>
+                  <span class="flex j-c">投保保额</span>
+                  <span class="flex j-end">操作</span>
+                </section>
+                <main class="flex j-s a-c" v-for="(filteredInsureitem, filteredInsureindex) in solutionitem.kinds"
+                  :key="filteredInsureindex" v-if="filteredInsureitem.switch">
+                  <span class="flex j-start">{{ filteredInsureitem.kindName }}</span>
+                  <span class="flex j-c" v-if="['A'].includes(filteredInsureitem.kindCode)">{{
+                    filteredInsureitem.amountDesc }}</span>
+                  <span class="flex j-c"
+                    v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}%</span>
+                  <span class="flex j-c"
+                    v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(filteredInsureitem.kindCode)">{{
+                      filteredInsureitem.amount }}次</span>
+                  <span class="flex j-c" v-else>{{ convertedValue(filteredInsureitem.amount) }}</span>
                   <span class="flex j-end">
                     <i class="el-icon-delete" style="font-size: 20px;"
-                      @click="drvingDel(solutionindex, configureindex)"></i>
+                      @click="InsureDel(solutionindex, filteredInsureitem.kindCode)"></i>
                   </span>
+                </main>
+              </div>
+            </div>
+          </div>
+          <div>
+            <div class="flex a-c">
+              <h4>驾意险方案配置</h4>
+              <el-button size="mini"
+                style="margin-left: 15px;background: #EAEDF1;border: 1px solid #D9D9D9;color: #2D4D89;"
+                @click="AddDriverInsurancePlan(solutionindex)">添加配置</el-button>
+            </div>
+            <div v-for="(configureitem, configureindex) in solutionitem.drvingIntentions" :key="configureindex"
+              style="margin-bottom: 20px;">
+              <div class="flex j-s a-c">
+                <div class="flex a-c " style="margin-bottom: 15px;" v-for="DriverTypeitem in configureitem.driverType"
+                  :key="DriverTypeitem.id">
+                  <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
+                    DriverTypeitem.typeName
+                  }}</span>
+                  <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
+                    :key="childrenitem.id"
+                    @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
+                      childrenitem.typeName }}</el-checkbox>
                 </div>
-                <el-form ref="form" :model="formitem" label-width="120px" size="small"
-                  v-for="(formitem, formindex) in configureitem.list" :key="formindex">
-                  <el-row>
-                    <el-col :span="24">
-                      <el-col :span="10">
-                        <el-form-item label="驾意选择:">
-                          <el-select
-                            v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
-                            :size="overSize" style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
-                            <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
-                          </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                <span class="flex j-end">
+                  <i class="el-icon-delete" style="font-size: 20px;"
+                    @click="drvingDel(solutionindex, configureindex)"></i>
+                </span>
+              </div>
+              <el-form ref="form" :model="formitem" label-width="120px" size="small"
+                v-for="(formitem, formindex) in configureitem.list" :key="formindex">
+                <el-row>
+                  <el-col :span="24">
+                    <el-col :span="10">
+                      <el-form-item label="驾意选择:">
+                        <el-select
+                          v-if="formitem.isMultiple == 1 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable multiple v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable
+                          :size="overSize" style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 1 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <el-select
+                          v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
+                          filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
+                          style="width: 250px;"
+                          @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-option :label="item.projectName" :value="item.id"
+                            v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                        </el-select>
+                        <template v-if="formitem.drvingChildren">
+                          <el-select v-if="formitem.isMultiple == 1" multiple filterable
+                            v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
                             style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <el-select
-                            v-else-if="formitem.isMultiple == 0 && formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.parentId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
-                            @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
+                          <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
+                            @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
-                              v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
+                              v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                           </el-select>
-                          <template v-if="formitem.drvingChildren">
-                            <el-select v-if="formitem.isMultiple == 1" multiple filterable
-                              v-model="formitem.drivingIntentionIds" placeholder="请选择" clearable :size="overSize"
-                              style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
-                              @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
-                              <el-option :label="item.projectName" :value="item.id"
-                                v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
-                            </el-select>
-                          </template>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="4">
-                        <el-form-item label="别名:">
-                          <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="座位数:">
-                          <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>座</span>
-                        </el-form-item>
-                      </el-col>
-                      <el-col :span="5">
-                        <el-form-item label="份数:">
-                          <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
-                            :max="10"></el-input-number>
-                          <span>份</span>
-                        </el-form-item>
-                      </el-col>
+                        </template>
+                      </el-form-item>
                     </el-col>
-                    <el-col :span="20">
-                      <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
-                        :key="LiabilityTermsindex">
-                        <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
-                        <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
-                          background: '#F7F7F9',
-                          fontWeight: '700',
-                          color: '#606266',
-                        }">
-                          <el-table-column prop="name" label="保险责任" align="center">
-                          </el-table-column>
-                          <el-table-column prop="amount" label="保险金额" width="180" align="center">
-                          </el-table-column>
-                          <el-table-column prop="premium" label="保费(元)" width="180" align="center">
-                          </el-table-column>
-                        </el-table>
-                      </div>
+                    <el-col :span="4">
+                      <el-form-item label="别名:">
+                        <el-input v-model="formitem.alias" placeholder="驾意险别名"></el-input>
+                      </el-form-item>
                     </el-col>
-                  </el-row>
-                </el-form>
-              </div>
+                    <el-col :span="5">
+                      <el-form-item label="座位数:">
+                        <el-input-number v-model="formitem.seatNum" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>座</span>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="5">
+                      <el-form-item label="份数:">
+                        <el-input-number v-model="formitem.quantity" controls-position="right" :min="1"
+                          :max="10"></el-input-number>
+                        <span>份</span>
+                      </el-form-item>
+                    </el-col>
+                  </el-col>
+                  <el-col :span="20">
+                    <div v-for="(LiabilityTermsitem, LiabilityTermsindex) in formitem.LiabilityTerms"
+                      :key="LiabilityTermsindex">
+                      <div style="font-weight: bold;margin-bottom: 10px;">{{ LiabilityTermsitem.projectName }}</div>
+                      <el-table :data="LiabilityTermsitem.LiabilityTerms" size="mini" :header-cell-style="{
+                        background: '#F7F7F9',
+                        fontWeight: '700',
+                        color: '#606266',
+                      }">
+                        <el-table-column prop="name" label="保险责任" align="center">
+                        </el-table-column>
+                        <el-table-column prop="amount" label="保险金额" width="180" align="center">
+                        </el-table-column>
+                        <el-table-column prop="premium" label="保费(元)" width="180" align="center">
+                        </el-table-column>
+                      </el-table>
+                    </div>
+                  </el-col>
+                </el-row>
+              </el-form>
             </div>
           </div>
         </div>
       </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
-          消</el-button>
-        <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
-          @click="solutionSubmit('solutionForm')">确 定</el-button>
-      </span>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="ordinaryPlanCancel">取
+        消</el-button>
+      <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
+        @click="solutionSubmit('solutionForm')">确 定</el-button>
+    </span>
   </div>
 </template>
 <!-- 行为区域 -->
@@ -250,6 +256,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -264,6 +279,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",//方案序号
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -301,6 +317,15 @@ export default {
   },
   // 方法函数
   methods: {
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -493,6 +518,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",//方案序号
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -532,43 +558,62 @@ export default {
         seatNum: ""//座位数
       });
     },
-    ordinaryPlanCancel () {
+    ordinaryPlanCancel() {
       this.$emit('ordinaryPlanCancel')
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"02",vehicleType:"A0",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"02",vehicleType:"A0",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "02", vehicleType: "A0", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionFindPage();
-            this.$emit('ordinaryPlanSubmit')
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "02", vehicleType: "A0", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionFindPage();
+                this.$emit('ordinaryPlanSubmit')
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
+
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -582,7 +627,7 @@ export default {
       this.solutionDialogTitle = '添加方案'
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"02",vehicleType:"A0",energyType:"1" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "02", vehicleType: "A0", energyType: "1" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -603,7 +648,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"02",'A0','1').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "02", 'A0', '1').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -616,7 +661,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -675,6 +720,7 @@ export default {
   align-items: flex-end;
   justify-content: flex-end;
 }
+
 /deep/ {
   .el-radio__input.is-checked .el-radio__inner,
   .el-checkbox__input.is-checked .el-checkbox__inner,
@@ -805,4 +851,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 90 - 47
src/views/AgreementManage/InsuranceCompany/PassengerBus/NonBusiness/NewEnergy/OrdinaryPlan.vue

@@ -7,8 +7,8 @@
     <!-- @findPage="solutionFindPage" -->
     <kt-common-table :tableHeights="700" :SerialShow="false" :operationWidth="200" :showOperation="true"
       :showBatchDelete="false" :showBatchSettled="false" :showBatchPrint="false" :data="solutionResult" button2Name="编辑"
-      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除" button3Type="text" @handleButton3="solutionDel"
-      :columns="solutionColumns">
+      button2Type="text" @findPage="solutionFindPage" @handleButton2="solutionUpdate" button3Name="删除"
+      button3Type="text" @handleButton3="solutionDel" :columns="solutionColumns">
     </kt-common-table>
     <el-dialog v-dialogDrag :title="solutionDialogTitle" :visible.sync="solutionVisible" width="90%" top="2vh"
       @close="solutioncloseDialog">
@@ -30,16 +30,22 @@
           <div v-for="(solutionitem, solutionindex) in solutionData.productList" :key="solutionindex">
             <div class="flex j-s a-c " style="margin-top: 20px;font-size: 16px;color: #262626;">
               <span>方案{{ solutionindex + 1 }}</span>
-              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete" class="planOption-del"
-                @click="planOptiondel(solutionindex)">方案删除</el-button>
+              <el-button v-if="solutionindex > 0" type="primary" size="small" icon="el-icon-delete"
+                class="planOption-del" @click="planOptiondel(solutionindex)">方案删除</el-button>
             </div>
-            <el-form ref="solutionForm" :model="solutionitem" label-width="120px" :size="overSize">
+            <el-form :ref="`solutionForm${solutionindex}`" :rules="solutionrules" :model="solutionitem"
+              label-width="120px" :size="overSize">
               <el-row>
                 <el-col :span="8">
-                  <el-form-item label="方案名称">
+                  <el-form-item label="方案名称" prop="schemeName">
                     <el-input type="text" v-model="solutionitem.schemeName" placeholder="输入方案名称"></el-input>
                   </el-form-item>
                 </el-col>
+                <el-col :span="4">
+                  <el-form-item label="序号" prop="priorityLevel">
+                    <el-input type="text" v-model="solutionitem.priorityLevel" clearable :maxlength="2"></el-input>
+                  </el-form-item>
+                </el-col>
                 <el-col :span="20">
                   <el-form-item label="方案描述">
                     <el-input type="textarea" v-model="solutionitem.description" placeholder="输入方案描述" maxlength="100"
@@ -123,7 +129,7 @@
                     :key="DriverTypeitem.id">
                     <span style="margin-right: 10px;color: #262626;font-size: 14px;font-weight: bold;">{{
                       DriverTypeitem.typeName
-                    }}</span>
+                      }}</span>
                     <el-checkbox v-model="childrenitem.checked" v-for="childrenitem in DriverTypeitem.children"
                       :key="childrenitem.id"
                       @change="event => drvingcheckboxChange(event, childrenitem, solutionindex, configureindex)">{{
@@ -158,8 +164,8 @@
                           </el-select>
                           <el-select
                             v-else-if="formitem.isMultiple == 0 && !formitem.drvingList[0].insDrivingIntentionInsurances"
-                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable :size="overSize"
-                            style="width: 250px;"
+                            filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
+                            :size="overSize" style="width: 250px;"
                             @change="event => drivingChange(event, formitem, solutionindex, configureindex, formindex)">
                             <el-option :label="item.projectName" :value="item.id"
                               v-for="(item, index) in formitem.drvingList" :key="index"></el-option>
@@ -180,8 +186,8 @@
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
                             </el-select>
-                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择" clearable
-                              :size="overSize" style="width: 250px;"
+                            <el-select v-else filterable v-model="formitem.drivingIntentionId" placeholder="请选择"
+                              clearable :size="overSize" style="width: 250px;"
                               @change="event => drivingChildrenChange(event, solutionindex, configureindex, formindex)">
                               <el-option :label="item.projectName" :value="item.id"
                                 v-for="(item, index) in formitem.drvingChildren" :key="index"></el-option>
@@ -275,6 +281,15 @@ export default {
         { prop: "companyId", label: "保险公司编码", minWidth: 160, },
         { prop: "productName", label: "方案险种", minWidth: 180, },
       ],
+      solutionrules: {
+        schemeName: [
+          { required: true, message: '方案名称必填', trigger: 'blur' }
+        ],
+        priorityLevel: [
+          { required: true, message: '序号必填', trigger: 'blur' },
+          { validator: this.validatePriority, trigger: 'blur' },
+        ],
+      },
       solutionResult: [],
       //操作符字典
       pageRequest: {
@@ -289,6 +304,7 @@ export default {
         productList: [
           {
             schemeName: "",
+            priorityLevel: "",
             description: "",
             kinds: [],
             drvingIntentions: [
@@ -308,12 +324,12 @@ export default {
     }
   },
   watch: {
-    activeIndex (newVal) {
+    activeIndex(newVal) {
       if (newVal === 0) {
         this.initData()
       }
     },
-    ordinaryIndex (newVal) {
+    ordinaryIndex(newVal) {
       if (newVal) {
         this.initData()
       }
@@ -321,13 +337,13 @@ export default {
   },
   // 生命周期函数
   created() {
-    if (this.$route.query.type*1 === 0) {
+    if (this.$route.query.type * 1 === 0) {
       this.initData()
     }
   },
   // 方法函数
   methods: {
-    initData () {
+    initData() {
       this.companyId = this.$route.query.companyId;
       this.solutionData.companyId = this.$route.query.companyId;
       this.getDicType("productsType"); //车险产品
@@ -344,6 +360,15 @@ export default {
       });
       localStorage.setItem("insureList", JSON.stringify(this.insureList));
     },
+    validatePriority(rule, value, callback) {
+      if (!value) {
+        callback(new Error('请输入序号'));
+      } else if (!/^[1-9][0-9]?$/.test(value)) {
+        callback(new Error('请输入 1-99 的整数'));
+      } else {
+        callback();
+      }
+    },
     // drivingChange(event, solutionindex, configureindex, formindex) {
     //   if (event) {
     //     if (event instanceof Array) {
@@ -536,6 +561,7 @@ export default {
       })
       this.solutionData.productList.push({
         schemeName: "",
+        priorityLevel: "",
         description: "",
         kinds: this.solutionData.productName !== '单交' ? list : [],
         drvingIntentions: [
@@ -575,40 +601,58 @@ export default {
         seatNum: ""//座位数
       });
     },
-    solutionSubmit(formName) {
-      if (this.solutionDialogType == 'add') {
-        this.$api.insCompany.shcemeAdd({...this.solutionData,carnature:"02",vehicleType:"A0",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
-            });
-            this.solutionVisible = false;
-            this.solutionFindPage();
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
-            });
-          }
+    solutionSubmit() {
+      const promises = this.solutionData.productList.map((_, index) => {
+        const formName = `solutionForm${index}`;
+        return new Promise((resolve, reject) => {
+          this.$refs[formName][0].validate((valid) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject(`方案 ${index + 1} 校验失败!`);
+            }
+          });
         });
-      } else {
-        this.$api.insCompany.schemeUpdate({...this.solutionData,carnature:"02",vehicleType:"A0",energyType:"1"}).then((res) => {
-          if (res.code == '200') {
-            this.$message({
-              type: 'success',
-              message: res.msg,
+      });
+      Promise.all(promises)
+        .then(() => {
+          if (this.solutionDialogType == 'add') {
+            this.$api.insCompany.shcemeAdd({ ...this.solutionData, carnature: "02", vehicleType: "A0", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
-            this.solutionVisible = false;
-            this.solutionFindPage();
           } else {
-            this.$message({
-              type: 'error',
-              message: res.msg,
+            this.$api.insCompany.schemeUpdate({ ...this.solutionData, carnature: "02", vehicleType: "A0", energyType: "1" }).then((res) => {
+              if (res.code == '200') {
+                this.$message({
+                  type: 'success',
+                  message: res.msg,
+                });
+                this.solutionVisible = false;
+                this.solutionFindPage();
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: res.msg,
+                });
+              }
             });
           }
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      }
     },
     getDicType(type) {
       this.$api.insCompany.dicType(type).then((res) => {
@@ -623,7 +667,7 @@ export default {
       this.solutionVisible = true;
     },
     solutionFindPage() {
-      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId,carnature:"02",vehicleType:"A0",energyType:"1" }).then((res) => {
+      this.$api.insCompany.schemeList({ ...this.pageRequest, companyId: this.companyId, carnature: "02", vehicleType: "A0", energyType: "1" }).then((res) => {
         if (res.code == '200') {
           let pageList = {
             content: res.data.records,
@@ -644,7 +688,7 @@ export default {
     solutionUpdate({ row, column }) {
       this.solutionDialogType = 'edit';
       this.solutionDialogTitle = '编辑方案'
-      this.$api.insCompany.schemedetails(row.companyId, row.productId,"02",'A0','1').then((res) => {
+      this.$api.insCompany.schemedetails(row.companyId, row.productId, "02", 'A0', '1').then((res) => {
         if (res.code == '200') {
           res.data.productList.map(valA => {
             valA.kinds.map(valB => {
@@ -657,7 +701,7 @@ export default {
               data.list.map(val => {
                 if (val.parentId != '0') {
                   let obj = val.drvingList.find(item => item.id == val.parentId)
-                    val.drvingChildren = obj.insDrivingIntentionInsurances;
+                  val.drvingChildren = obj.insDrivingIntentionInsurances;
                 }
               })
               const listCodes = data.list.map(item => item.code); // 获取当前 data 的所有 code
@@ -839,4 +883,3 @@ export default {
   background: #F2F2F2;
 }
 </style>
-

+ 26 - 1
src/views/Core/KtCommonTable.vue

@@ -164,6 +164,7 @@
         align="center"
         v-if="
           showBatchDelete ||
+          refreshStatus||
           showBatchSettled ||
           showBatchPrint ||
           customToolseletted ||
@@ -455,7 +456,16 @@
         style="float: left"
         v-if="showBatchDelete & showOperation"
       />
-
+      <kt-button
+        class="debutton"
+        :label="refreshStatusName"
+        :size="size"
+        type="danger"
+        @click="refreshStatusBatch()"
+        :disabled="selections.length === 0"
+        style="float: left"
+        v-if="refreshStatus"
+      />
       <kt-button
         :label="customToolName1"
         :perms="permscustomTool"
@@ -526,6 +536,11 @@ export default {
     ProductCostForm
   },
   props: {
+    //批量刷新状态
+    refreshStatus:{
+      type: Boolean,
+      default: false
+    },
     // 承保规则expend内容
     agreementUnderwritingRuleShow: {
       type: Boolean,
@@ -588,6 +603,10 @@ export default {
     deleteName: {
       type: String,
     },
+    refreshStatusName:{
+      //批量更新状态按钮Name
+      type:String,
+    },
     showBatchPrint: {
       //显示批量导出
       type: Boolean,
@@ -1245,6 +1264,12 @@ export default {
       //     this.loading = false;
       //   });
     },
+    //批量刷新状态
+    refreshStatusBatch: function () {
+      let idlist = [];
+      this.selections.map((item) => idlist.push(item.subOrderId));
+      this.$emit("refreshStatusBatch", idlist);
+    },
     // 批量删除
     handleBatchDelete: function () {
       let idlist = [];

+ 102 - 0
src/views/DistributionManage/PartnerManagement/IevelRule.vue

@@ -0,0 +1,102 @@
+<!-- 模板区域 -->
+<template>
+  <div class="body p-2">
+    <!-- 模板内容 -->
+    <el-tabs v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="等级一" name="level1">
+        <h5>等级规则</h5>
+        <el-form ref="form" :model="levelForm" label-width="80px" size="small" style="width: 800px;">
+          <el-form-item label="等级名称">
+            <el-input v-model="levelForm.name"></el-input>
+          </el-form-item>
+          <el-form-item label="升级策略">
+            <el-radio-group v-model="levelForm.name">
+              <el-radio :label="3">支持</el-radio>
+              <el-radio :label="6">不支持</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="保级策略">
+            <el-radio-group v-model="levelForm.name">
+              <el-radio :label="3">支持</el-radio>
+              <el-radio :label="6">不支持</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-form>
+      </el-tab-pane>
+      <el-tab-pane label="等级二" name="level2">
+        <h5>等级规则</h5>
+        <el-form ref="form" :model="levelForm" label-width="80px" size="small" style="width: 800px;">
+          <el-form-item label="等级名称">
+            <el-input v-model="levelForm.name"></el-input>
+          </el-form-item>
+          <el-form-item label="升级策略">
+            <div class="flex f-c m-top-10" >
+              <el-radio-group v-model="levelForm.name">
+                <el-radio :label="3">支持</el-radio>
+                <el-radio :label="6">不支持</el-radio>
+              </el-radio-group>
+              <el-form-item label="考核周期"  class="m-top-20 spacing ">
+                  <el-radio-group v-model="levelForm.name" class="flex f-c ">
+                    <el-radio  :label="3">不限期</el-radio>
+                    <el-radio  :label="6">固定天数
+                      成为该等级后,限期
+                      <el-input v-model="levelForm.name" size="small" style="width: 300px;"  placeholder="请输入1~365的正整数"/>
+                      天
+                    </el-radio>
+                    <el-radio :label="6">固定日期</el-radio>
+                  </el-radio-group>
+              </el-form-item>
+            </div>
+          </el-form-item>
+          <el-form-item label="保级策略">
+            <el-radio-group v-model="levelForm.name">
+              <el-radio :label="3">不保级</el-radio>
+              <el-radio :label="6">任务保级</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-form>
+      </el-tab-pane>
+      <el-tab-pane label="等级三" name="level3">
+        <h5>等级规则</h5>
+      </el-tab-pane>
+      <el-tab-pane label="等级四" name="level4">
+        <h5>等级规则</h5>
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+</template>
+
+<!-- 行为区域 -->
+<script>
+export default {
+  // 数据存放区域
+  data() {
+    return {
+      levelForm: {
+        name: "",
+      },
+      activeName: 'second'
+    }
+  },
+  // 生命周期函数
+  created() {
+  },
+  // 方法函数
+  methods: {
+    handleClick(tab, event) {
+      console.log(tab, event);
+    }
+  },
+  // 计算属性
+  computed: {
+  }
+}
+</script>
+<!-- 样式区域 -->
+<style lang='scss' scoped>
+.spacing{
+  .el-radio{
+    margin: 10px 0;
+  }
+}
+</style>

+ 201 - 86
src/views/PeopleManage/Customer/CustomerServiceAccount.vue

@@ -39,13 +39,15 @@ export default {
       formData: {
         nickname: '',
         customerId: '',
-        dutyCustomerId: null,
-        dutyDateTimeList: [{
-          startTime: new Date().setHours(8, 30, 0),
-          endTime: new Date().setHours(18, 30, 0)
-        }]
+        dutyCustomerDTOS: [
+          {
+            dutyCustomerId: null,
+            dutyDateTimeList: [{
+              startTime: new Date().setHours(8, 30, 0),
+              endTime: new Date().setHours(18, 30, 0)
+            }]
+          }]
       },
-
       // 选项数据
       backendOptions: [],
       departmentTree: [],
@@ -64,8 +66,7 @@ export default {
         {prop: "username", label: "姓名"},
         {prop: "userId", label: "工号"},
         {prop: "receptionist", label: "企微用户"},
-        {prop: "dutyCustomer", label: "值班客服"},
-        {prop: "dutyDatetime", label: "值班时间", minWidth: 200, formatter: this.dutyDatetimeFormatter},
+        {prop: "dutyCustomerDTO", label: "值班客服/值班时间", minWidth: 200, formatter: this.dutyDatetimeFormatter},
       ],
 
       rules: {
@@ -192,9 +193,29 @@ export default {
       return <img src={"" + process.env.BASE_URL + row.avatarUrl + ""} style="width: 74px; height: 74px"></img>;
     },
     dutyDatetimeFormatter(row) {
-      if (row.dutyDatetime != null && row.dutyDatetime.length > 0) {
-        return row.dutyDatetime.map(x => {
-          return <el-tag>{x} </el-tag>
+      if (row.dutyCustomerDTO != null && row.dutyCustomerDTO.length > 0) {
+        return row.dutyCustomerDTO.map(item => {
+          const data = item.dutyDatetime.map(dateTime => {
+            return <el-tag size="small">{dateTime}</el-tag>
+          });
+          return (
+            <div style="padding: 10px;">
+              <el-row>
+                <el-col>
+                  <el-card class="duty-card">
+                    <div slot="header" class="clearfix">
+                      <span><strong>值班人员:</strong>{item.dutyCustomer}</span>
+                    </div>
+                    <div class="duty-content">
+                      <div class="duty-time">
+                        {data}
+                      </div>
+                    </div>
+                  </el-card>
+                </el-col>
+              </el-row>
+            </div>
+          )
         })
       }
     },
@@ -345,11 +366,14 @@ export default {
       this.formData = {
         nickname: '',
         customerId: '',
-        dutyCustomerId: null,
-        dutyDateTimeList: [{
-          startTime: new Date().setHours(8, 30, 0),
-          endTime: new Date().setHours(18, 30, 0)
-        }]
+        dutyCustomerDTOS: [
+          {
+            dutyCustomerId: null,
+            dutyDateTimeList: [{
+              startTime: new Date().setHours(8, 30, 0),
+              endTime: new Date().setHours(18, 30, 0)
+            }]
+          }]
       }
     },
     // 弹窗关闭处理
@@ -368,19 +392,18 @@ export default {
     getDutyConfig(customerId) {
       this.$api.customerManage.getDutyConfig(customerId).then(res => {
         if (res.code === 200) {
-          const isReceptionistId = this.allServiceList.some(service => service.id === Number(res.data.dutyCustomerId));
-          if (isReceptionistId) {
-            this.formData.dutyCustomerId = Number(res.data.dutyCustomerId)
-          }else {
-            this.formData.dutyCustomerId = null
-          }
-
-          res.data.dutyDateTimeList.map(item => {
-            this.startTime = dayjs(item.startTime).valueOf()
-            this.endTime = dayjs(item.endTime).valueOf()
+          res.data.dutyCustomerDTOS.forEach(item => {
+            const isReceptionistId = this.allServiceList.some(service => service.id === Number(item.dutyCustomerId));
+            if (isReceptionistId) {
+              item.dutyCustomerId = Number(item.dutyCustomerId)
+            } else {
+              item.dutyCustomerId = null
+            }
           })
+          this.formData.dutyCustomerDTOS = res.data.dutyCustomerDTOS
+        } else {
+          this.$message.error(res.msg);
         }
-        this.formData.dutyDateTimeList = res.data.dutyDateTimeList
       })
     },
     openDialog({row}) {
@@ -390,18 +413,41 @@ export default {
       this.formData.nickname = row.nickname
       this.dialogVisibleDuty = true;
     },
-    addTime() {
-      this.formData.dutyDateTimeList.push({
+    // 添加值班客服
+    addCustomer() {
+      this.formData.dutyCustomerDTOS.push({
+        dutyCustomerId: null,
+        dutyDateTimeList: [{
+          startTime: new Date().setHours(8, 30, 0),
+          endTime: new Date().setHours(18, 30, 0)
+        }]
+      });
+    },
+    // 移除值班客服
+    removeCustomer(index) {
+      this.formData.dutyCustomerDTOS.splice(index, 1);
+    },
+    availableServices(currentIndex) {
+      return this.allServiceList.filter(service =>
+        !this.formData.dutyCustomerDTOS.some((cust, idx) =>
+          idx !== currentIndex && cust.dutyCustomerId === service.id
+        )
+      );
+    },
+    // 添加时间
+    addTime(cIndex) {
+      this.formData.dutyCustomerDTOS[cIndex].dutyDateTimeList.push({
         startTime: new Date().setHours(8, 30, 0),
         endTime: new Date().setHours(18, 30, 0)
       });
     },
-    removeTime(index) {
-      if (this.formData.dutyDateTimeList.length === 1) {
+    // 删除时间
+    removeTime(cIndex, tIndex) {
+      if (this.formData.dutyCustomerDTOS[cIndex].dutyDateTimeList.length === 1) {
         this.$message.warning('请至少保留一条数据');
         return;
       }
-      this.formData.dutyDateTimeList.splice(index, 1);
+      this.formData.dutyCustomerDTOS[cIndex].dutyDateTimeList.splice(tIndex, 1);
     },
     handleCancel() {
       this.resetFormData();
@@ -409,19 +455,23 @@ export default {
       this.$message({type: 'info', message: '已取消操作'});
     },
     dutyConfigData() {
+      this.formData.dutyCustomerDTOS.map(x => {
+        x.dutyDateTimeList = x.dutyDateTimeList.map(item => ({
+          startTime: item.startTime ? dayjs(item.startTime).format('YYYY-MM-DD HH:mm:ss') : null,
+          endTime: item.endTime ? dayjs(item.endTime).format('YYYY-MM-DD HH:mm:ss') : null,
+        }))
+      })
       return {
         customerId: this.formData.customerId,
-        dutyCustomerId: this.formData.dutyCustomerId,
-        dutyDateTimeList: this.formData.dutyDateTimeList.map(t => ({
-          startTime: dayjs(t.startTime).format('YYYY-MM-DD HH:mm:ss'),
-          endTime: dayjs(t.endTime).format('YYYY-MM-DD HH:mm:ss')
-        }))
+        dutyCustomerDTOS: this.formData.dutyCustomerDTOS
       }
     },
     // 确认操作
     handleConfirm() {
       // 数据校验
-      if (!this.validateTime()) return;
+      if (!this.validateTime()) {
+        return
+      }
       // 提交逻辑(示例)
       this.$api.customerManage.dutyConfig(this.dutyConfigData())
         .then((res) => {
@@ -440,18 +490,25 @@ export default {
 
     // 时间有效性校验
     validateTime() {
-      for (const time of this.formData.dutyDateTimeList) {
-        if(time.startTime === null){
-          this.$message.error('开始时间必填');
+      for (let dutyCustomerDTO of this.formData.dutyCustomerDTOS) {
+        console.log(dutyCustomerDTO);
+        if (dutyCustomerDTO.dutyCustomerId === null || dutyCustomerDTO.dutyCustomerId === '') {
+          this.$message.error('值班客服必填');
           return false;
         }
-        if(time.endTime === null){
-          this.$message.error('结束时间必填');
-          return false;
-        }
-        if (new Date(time.startTime) >= new Date(time.endTime)) {
-          this.$message.error('结束时间必须晚于开始时间');
-          return false;
+        for (let dutyCustomerDTOKey of dutyCustomerDTO.dutyDateTimeList) {
+          if (dutyCustomerDTOKey.startTime === null) {
+            this.$message.error('开始时间必填');
+            return false;
+          }
+          if (dutyCustomerDTOKey.endTime === null) {
+            this.$message.error('结束时间必填');
+            return false;
+          }
+          if (new Date(dutyCustomerDTOKey.startTime) >= new Date(dutyCustomerDTOKey.endTime)) {
+            this.$message.error('结束时间必须晚于开始时间');
+            return false;
+          }
         }
       }
       return true;
@@ -477,7 +534,7 @@ export default {
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-button type="primary" size="small" @click="queryPage">查询</el-button>
+            <el-button type="primary" size="small" style="margin-left: 20px" @click="queryPage">查询</el-button>
             <el-button type="primary" size="small" @click="handleAdd">添加客服</el-button>
           </el-col>
         </el-row>
@@ -600,48 +657,78 @@ export default {
         </el-form-item>
 
         <!-- 值班客服(可编辑) -->
-        <el-form-item label="值班客服">
-          <el-select v-model="formData.dutyCustomerId" placeholder="请选择">
-            <el-option
-              v-for="item in allServiceList"
-              :key="item.id"
-              :label="item.nickname"
-              :value="item.id">
-            </el-option>
-          </el-select>
-        </el-form-item>
+        <div v-for="(customer, cIndex) in formData.dutyCustomerDTOS" :key="cIndex" class="customer-block">
+          <!-- 值班客服选择 -->
+          <el-form-item :label="`值班客服 ${cIndex + 1}`">
+            <el-select
+              v-model="customer.dutyCustomerId"
+              placeholder="请选择值班客服"
+              filterable
+              style="width: 300px">
+              <el-option
+                v-for="item in availableServices(cIndex)"
+                :key="item.id"
+                :label="item.nickname"
+                :value="item.id">
+              </el-option>
+            </el-select>
+            <el-button
+              v-if="cIndex !== 0"
+              @click="removeCustomer(cIndex)"
+              type="danger"
+              icon="el-icon-remove"
+              circle
+              style="margin-left: 10px">
+            </el-button>
+          </el-form-item>
+
+          <!-- 值班时间列表 -->
+          <div v-for="(time, tIndex) in customer.dutyDateTimeList" :key="tIndex" class="time-row">
+            <el-form-item label="值班时间">
+              <el-date-picker
+                v-model="time.startTime"
+                type="datetime"
+                format="yyyy-MM-dd HH:mm:ss"
+                placeholder="开始时间"
+              >
+              </el-date-picker>
+              <span style="margin: 0 10px">至</span>
+              <el-date-picker
+                v-model="time.endTime"
+                type="datetime"
+                format="yyyy-MM-dd HH:mm:ss"
+                placeholder="结束时间"
+              >
+              </el-date-picker>
+              <el-button
+                v-if="tIndex !== 0"
+                @click="removeTime(cIndex, tIndex)"
+                type="danger"
+                icon="el-icon-remove"
+                circle
+                style="margin-left: 10px">
+              </el-button>
+            </el-form-item>
+          </div>
 
-        <!-- 值班时间列表 -->
-        <el-form-item label="值班时间" v-for="(time, index) in formData.dutyDateTimeList" :key="index">
-          <el-date-picker
-            v-model="time.startTime"
-            type="datetime"
-            format="yyyy-MM-dd HH:mm:ss"
-            placeholder="开始时间">
-          </el-date-picker>
-          <span>至</span>
-          <el-date-picker
-            v-model="time.endTime"
-            type="datetime"
-            format="yyyy-MM-dd HH:mm:ss"
-            placeholder="结束时间">
-          </el-date-picker>
-          <!-- 删除按钮(首行隐藏) -->
+          <!-- 添加时间按钮 -->
           <el-button
-            v-if="index !== 0"
-            @click="removeTime(index)"
-            icon="el-icon-close"
-            circle>
+            @click="addTime(cIndex)"
+            type="primary"
+            icon="el-icon-plus"
+            plain
+            style="margin-bottom: 20px">
+            添加时间段
           </el-button>
-        </el-form-item>
+        </div>
 
-        <!-- 添加按钮(动态隐藏) -->
+        <!-- 添加客服按钮 -->
         <el-button
-          v-if="showAddButton"
-          @click="addTime"
-          type="text"
-          icon="el-icon-plus">
-          添加值班时间
+          @click="addCustomer"
+          type="success"
+          icon="el-icon-plus"
+          plain>
+          添加值班客服
         </el-button>
       </el-form>
 
@@ -655,5 +742,33 @@ export default {
 </template>
 
 <style scoped>
+.customer-block {
+  border: 1px solid #ebeef5;
+  border-radius: 4px;
+  padding: 15px;
+  margin-bottom: 20px;
+  background: #fafafa;
+}
+
+.time-row {
+  margin-left: 30px;
+  border-left: 2px solid #409eff;
+  padding-left: 15px;
+}
+
+.duty-card {
+  margin-bottom: 20px;
+  border-radius: 8px;
+  overflow: hidden;
+  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
+}
 
+.duty-card .duty-content {
+  padding: 16px;
+}
+
+.duty-time p {
+  margin: 4px 0;
+  color: #909399;
+}
 </style>

+ 1 - 1
src/views/Sys/TaiShanAuth.vue

@@ -71,7 +71,7 @@ export default {
       });
     },
     agreement() {
-      this.$api.insCompany.findAgreementByCompanyId({ partnerCompaniesId: 'TSBX1000000', apiType: 2 }).then((res) => {
+      this.$api.insCompany.findAgreementByCompanyId({ partnerCompaniesId: 'TSBX1000000', apiType: 2,isValid: 1,validStatus: 1 }).then((res) => {
         if (res.code == '200') {
           this.pageResult = res.data;
         } else {

+ 18 - 1
src/views/Task/AgentPoolChannel/AgentPoolChannel1.vue

@@ -4,7 +4,7 @@
                    @exportSubmit="exportSubmit" :isExport="true"
       @areaSelectChange="areaSelectChange"></retrievalForm>
     <kt-common-table :data="pageResult" :columns="columns" element-loading-text="加载中..." v-loading="loading"
-      :showBatchDelete="false" @findPage="findPage" button3Name="转发" button3Type="text"
+      :showBatchDelete="false" :refreshStatus="true" refreshStatusName="批量更新状态" @refreshStatusBatch="refreshStatusBatch" @findPage="findPage" button3Name="转发" button3Type="text"
       @handleButton3="transmit" :buttonDropdown="dropdownOption" button5Name="详情" button5Type="text" @handleButton5="detailFun" button4Name="转发记录" button4Type="text"
       @handleButton4="forwardingRecords" :operationWidth="300"></kt-common-table>
     <el-dialog title="转发" :visible.sync="dialogVisible" width="30%">
@@ -141,6 +141,23 @@ export default {
   },
 
   methods: {
+      //批量更新订单状态
+      refreshStatusBatch(list) {
+      this.$api.letter.batchOrderStatus({ orderNos: list }).then((res) => {
+        if (res.code == '200') {
+          this.$message({
+            type: 'success',
+            message: res.msg,
+          });
+          this.findPage();
+        } else {
+          this.$message({
+            type: 'error',
+            message: res.msg,
+          });
+        }
+      });
+    },
     //导出
     exportSubmit(data) {
       let obj = Object.assign(this.pageRequest, data)

+ 18 - 2
src/views/Task/CompanyPoolChannel/CompanyPoolChannel1.vue

@@ -4,7 +4,7 @@
                    @exportSubmit="exportSubmit" :isExport="true"
       @areaSelectChange="areaSelectChange"></retrievalForm>
     <kt-common-table :data="pageResult" :columns="columns" element-loading-text="加载中..." v-loading="loading"
-      :showBatchDelete="false" @findPage="findPage" button3Name="转发" button3Type="text"
+      :showBatchDelete="false" :refreshStatus="true" refreshStatusName="批量更新状态" @refreshStatusBatch="refreshStatusBatch" @findPage="findPage" button3Name="转发" button3Type="text"
       @handleButton3="transmit"   :buttonDropdown="dropdownOption"
        button5Name="详情" button5Type="text" @handleButton5="detailFun" button4Name="转发记录" button4Type="text"
       @handleButton4="forwardingRecords" :operationWidth="300"></kt-common-table>
@@ -199,7 +199,23 @@ export default {
   },
 
   methods: {
-
+      //批量更新订单状态
+      refreshStatusBatch(list) {
+      this.$api.letter.batchOrderStatus({ orderNos: list }).then((res) => {
+        if (res.code == '200') {
+          this.$message({
+            type: 'success',
+            message: res.msg,
+          });
+          this.findPage();
+        } else {
+          this.$message({
+            type: 'error',
+            message: res.msg,
+          });
+        }
+      });
+    },
     //导出
     exportSubmit(data) {
       let obj = Object.assign(this.pageRequest, data)

+ 62 - 38
src/views/Task/ElectricSales/AgentPoolChannel1.vue

@@ -1,12 +1,12 @@
 <template>
   <div>
     <retrievalForm :fields="retrievalFields" @submit="handleFormSubmit" @toggleCollapse="toggleCollapse" :dateType="1"
-                   @exportSubmit="exportSubmit" :isExport="true"
-      @areaSelectChange="areaSelectChange"></retrievalForm>
+      @exportSubmit="exportSubmit" :isExport="true" @areaSelectChange="areaSelectChange"></retrievalForm>
     <kt-common-table :data="pageResult" :columns="columns" element-loading-text="加载中..." v-loading="loading"
-      :showBatchDelete="false" @findPage="findPage" button3Name="转发" button3Type="text"
-      @handleButton3="transmit" :buttonDropdown="dropdownOption" button5Name="详情" button5Type="text" @handleButton5="detailFun" button4Name="转发记录" button4Type="text"
-      @handleButton4="forwardingRecords" :operationWidth="300"></kt-common-table>
+      :showBatchDelete="false" :refreshStatus="true" refreshStatusName="批量更新状态" @refreshStatusBatch="refreshStatusBatch"
+      @findPage="findPage" button3Name="转发" button3Type="text" @handleButton3="transmit"
+      :buttonDropdown="dropdownOption" button5Name="详情" button5Type="text" @handleButton5="detailFun" button4Name="转发记录"
+      button4Type="text" @handleButton4="forwardingRecords" :operationWidth="300"></kt-common-table>
     <el-dialog title="转发" :visible.sync="dialogVisible" width="30%">
       转发人:
       <el-select v-model="transmitValue" filterable clearable placeholder="请选择">
@@ -17,7 +17,8 @@
         <el-button type="primary" size="small" @click="transmitSumit">确 定</el-button>
       </span>
     </el-dialog>
-    <detailsDialog ref="detailsDialog" :isTaskPool="true" :orderInfo="queryOrders" :isAuditing="isAuditing" :feeOrderNewVoList="feeOrderNewVoList"></detailsDialog>
+    <detailsDialog ref="detailsDialog" :isTaskPool="true" :orderInfo="queryOrders" :isAuditing="isAuditing"
+      :feeOrderNewVoList="feeOrderNewVoList"></detailsDialog>
     <el-dialog :visible.sync="ddgjdialogVisible" width="500px">
       <div slot="title" class=" dialog-title">
         <span>订单轨迹</span>
@@ -31,7 +32,7 @@
                 <div>车牌号:{{ item.licenseNo }}</div>
                 <div>被保人:{{ item.insuredname }}</div>
                 <div>
-                  <span >操作人:{{ item.operator }}</span>
+                  <span>操作人:{{ item.operator }}</span>
                   <span style="margin-left: 10px">操作人工号:{{ item.audituser }}</span>
                 </div>
                 <span v-if="item.operatorTime">
@@ -43,8 +44,8 @@
         </el-steps>
       </div>
     </el-dialog>
-    <el-dialog :visible.sync="forwardingRecordsdialogVisible"  title="转发记录" width="70%">
-      <el-table :data="gridData"  height="400" border  v-loading="loading" highlight-current-row stripe
+    <el-dialog :visible.sync="forwardingRecordsdialogVisible" title="转发记录" width="70%">
+      <el-table :data="gridData" height="400" border v-loading="loading" highlight-current-row stripe
         :header-cell-style="{
           background: '#F2F7FC',
           fontWeight: '700',
@@ -53,11 +54,11 @@
         <el-table-column property="subOrderId" align="center" label="订单号" width="200"></el-table-column>
         <el-table-column property="oldOperatorId" align="center" label="转发人" width="200"></el-table-column>
         <el-table-column property="newOperatorId" align="center" label="接收人"></el-table-column>
-        <el-table-column property="remark"  align="center" label="转发信息"></el-table-column>
+        <el-table-column property="remark" align="center" label="转发信息"></el-table-column>
         <el-table-column property="createTime" align="center" label="转发时间"></el-table-column>
       </el-table>
     </el-dialog>
-    <el-dialog title="原因查看" :visible.sync="viewReasondialogVisible" width="30%" >
+    <el-dialog title="原因查看" :visible.sync="viewReasondialogVisible" width="30%">
       <span>{{ viewReasonMsg }}</span>
       <span slot="footer" class="dialog-footer">
         <el-button size="small" @click="viewReasondialogVisible = false">关闭</el-button>
@@ -88,23 +89,23 @@ export default {
         userId: "",
       },
 
-      ddgjdialogVisible:false,
-      trajectoryTable:[],
-      optionsStatus:[],
-      dropdownOption:[
+      ddgjdialogVisible: false,
+      trajectoryTable: [],
+      optionsStatus: [],
+      dropdownOption: [
         {
-          label:'报价轨迹',
-          click:(row)=>this.trajectory(row)
+          label: '报价轨迹',
+          click: (row) => this.trajectory(row)
         },
         {
-          label:'撤单',
-          hide:(row) => {
-            return  row.insCompany == '紫金财险' ?true:false
+          label: '撤单',
+          hide: (row) => {
+            return row.insCompany == '紫金财险' ? true : false
           },
-          click:(row)=>this.cancelorder(row)
-        },{
-          label:'更新订单',
-          click:(row)=>this.refreshStatus(row)
+          click: (row) => this.cancelorder(row)
+        }, {
+          label: '更新订单',
+          click: (row) => this.refreshStatus(row)
         },
       ], columns: [
         { prop: "subOrderId", label: "订单号", minWidth: 180 },
@@ -139,6 +140,23 @@ export default {
   },
 
   methods: {
+    //批量更新订单状态
+    refreshStatusBatch(list) {
+      this.$api.letter.batchOrderStatus({ orderNos: list }).then((res) => {
+        if (res.code == '200') {
+          this.$message({
+            type: 'success',
+            message: res.msg,
+          });
+          this.findPage();
+        } else {
+          this.$message({
+            type: 'error',
+            message: res.msg,
+          });
+        }
+      });
+    },
     //导出
     exportSubmit(data) {
       let obj = Object.assign(this.pageRequest, data)
@@ -164,7 +182,7 @@ export default {
       });
     },
     getStatusText(code) {
-      return this.optionsStatus.find(val=>val.dictValue==code).dictTag;
+      return this.optionsStatus.find(val => val.dictValue == code).dictTag;
     },
     handleFormSubmit(data) {
       let obj = Object.assign(this.pageRequest, data)
@@ -306,31 +324,37 @@ export default {
 </script>
 
 <style scoped lang="scss">
-/deep/{
+/deep/ {
   .el-step__description.is-finish,
   .el-step__head.is-finish {
     color: #333;
     border: none;
   }
-  .el-step__title,.el-step__icon-inner{
-    color:var(--themeColor)
+
+  .el-step__title,
+  .el-step__icon-inner {
+    color: var(--themeColor)
   }
-  .el-step__line-inner{
-      height:0;
-      display:none
-    }
-  .is-flex{
 
-    .el-step__icon{
+  .el-step__line-inner {
+    height: 0;
+    display: none
+  }
+
+  .is-flex {
+
+    .el-step__icon {
       background: var(--themeColor)
     }
-    .el-step__icon-inner{
+
+    .el-step__icon-inner {
       color: #fff;
     }
   }
-  .el-step__icon.is-text{
-    border:none;
-    box-shadow: 0px 2px 2px 0px rgba(0,0,0,0.1);
+
+  .el-step__icon.is-text {
+    border: none;
+    box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.1);
   }
 }
 </style>

+ 23 - 101
src/views/Task/External/ExternalOrders.vue

@@ -1,56 +1,27 @@
 <template>
   <div>
     <div class="flex f-c back">
-      <el-form
-        class="demo-ruleForm"
-        :model="salespersonForm"
-        label-width="100px"
-        size="small"
-        style="margin-top: 15px"
-      >
+      <el-form class="demo-ruleForm" :model="salespersonForm" label-width="100px" size="small" style="margin-top: 15px">
         <el-row type="flex" justify="space-between">
           <el-col :span="5">
             <el-form-item label="工号">
-              <el-input
-                placeholder="请输入工号"
-                v-model="operationForm.userId"
-                maxlength="17"
-                type="text"
-                show-word-limit
-              >
-                <el-button
-                  slot="append"
-                  type="primary"
-                  icon="el-icon-search"
-                  @click="toChooseName('un')"
-                  style="
+              <el-input placeholder="请输入工号" v-model="operationForm.userId" maxlength="17" type="text" show-word-limit>
+                <el-button slot="append" type="primary" icon="el-icon-search" @click="toChooseName('un')" style="
                     color: #fff;
                     background-color: #d42426;
                     border-color: #d42426;
-                  "
-                ></el-button>
+                  "></el-button>
               </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="5">
             <el-form-item label="业务员" prop="name">
-              <el-input
-                placeholder="请输入业务员"
-                v-model="operationForm.name"
-                type="text"
-                show-word-limit
-              >
-                <el-button
-                  slot="append"
-                  type="primary"
-                  icon="el-icon-search"
-                  @click="toChooseName('un')"
-                  style="
+              <el-input placeholder="请输入业务员" v-model="operationForm.name" type="text" show-word-limit>
+                <el-button slot="append" type="primary" icon="el-icon-search" @click="toChooseName('un')" style="
                     color: #fff;
                     background-color: #d42426;
                     border-color: #d42426;
-                  "
-                ></el-button>
+                  "></el-button>
               </el-input>
             </el-form-item>
           </el-col>
@@ -75,93 +46,44 @@
       <Ktletter ref="Ktletter" isLetter="3"></Ktletter>
     </div>
     <el-dialog title="业务员信息" :visible.sync="dialogVisible">
-      <el-form
-        :inline="true"
-        class="demo-form-inline"
-        size="small"
-        label-width="80px"
-        :model="salespersonForm"
-      >
+      <el-form :inline="true" class="demo-form-inline" size="small" label-width="80px" :model="salespersonForm">
         <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="工号">
-              <el-input
-                v-model="salespersonForm.userId"
-                placeholder="工号"
-                clearable
-              ></el-input>
+              <el-input v-model="salespersonForm.userId" placeholder="工号" clearable></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="业务员">
-              <el-input
-                v-model="salespersonForm.name"
-                placeholder="业务员"
-                clearable
-              ></el-input>
+              <el-input v-model="salespersonForm.name" placeholder="业务员" clearable></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="手机号">
-              <el-input
-                v-model="salespersonForm.mobile"
-                placeholder="手机号"
-                clearable
-              ></el-input>
+              <el-input v-model="salespersonForm.mobile" placeholder="手机号" clearable></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="9">
             <el-form-item label="身份证号">
-              <el-input
-                v-model="salespersonForm.identity"
-                placeholder="身份证号"
-                clearable
-              ></el-input>
+              <el-input v-model="salespersonForm.identity" placeholder="身份证号" clearable></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="2">
             <el-form-item>
-              <el-button type="primary" size="small" @click="toChooseName('in')"
-                >查询</el-button
-              >
+              <el-button type="primary" size="small" @click="toChooseName('in')">查询</el-button>
             </el-form-item>
           </el-col>
         </el-row>
       </el-form>
-      <el-table
-        size="small"
-        :data="salespersonData"
-        height="690"
-        border
-        style="width: 100%"
-        :header-cell-style="{
-          background: '#F7F7F9 ',
-          fontWeight: '700',
-          color: '#333333',
-        }"
-        highlight-current-row
-        @row-dblclick="reslistCurrentChange"
-      >
-        <el-table-column
-          prop="userId"
-          label="工号"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="name"
-          label="	业务员名称"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="mobile"
-          label="手机号"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="identity"
-          label="身份证号"
-          align="center"
-        ></el-table-column>
+      <el-table size="small" :data="salespersonData" height="690" border style="width: 100%" :header-cell-style="{
+        background: '#F7F7F9 ',
+        fontWeight: '700',
+        color: '#333333',
+      }" highlight-current-row @row-dblclick="reslistCurrentChange">
+        <el-table-column prop="userId" label="工号" align="center"></el-table-column>
+        <el-table-column prop="name" label="	业务员名称" align="center"></el-table-column>
+        <el-table-column prop="mobile" label="手机号" align="center"></el-table-column>
+        <el-table-column prop="identity" label="身份证号" align="center"></el-table-column>
       </el-table>
     </el-dialog>
   </div>
@@ -179,7 +101,7 @@ export default {
       operationForm: {},
     };
   },
-  created() {},
+  created() { },
   mounted() {
     if (this.$route.query.data) {
       this.salespersonForm = {

+ 18 - 1
src/views/Task/TaskPoolChannel/TaskPoolChannel1.vue

@@ -4,7 +4,7 @@
                    @exportSubmit="exportSubmit" :isExport="true"
                    @areaSelectChange="areaSelectChange"></retrievalForm>
     <kt-common-table :data="pageResult" :columns="columns" element-loading-text="加载中..." v-loading="loading"
-      :showBatchDelete="false" @findPage="findPage" button3Name="转发" button3Type="text" @handleButton3="transmit"
+      :showBatchDelete="false" :refreshStatus="true" refreshStatusName="批量更新状态" @refreshStatusBatch="refreshStatusBatch" @findPage="findPage" button3Name="转发" button3Type="text" @handleButton3="transmit"
       :buttonDropdown="dropdownOption" button5Name="详情" button5Type="text" @handleButton5="detailFun" button4Name="转发记录"
       button4Type="text" @handleButton4="forwardingRecords" :operationWidth="300"></kt-common-table>
     <el-dialog title="转发" :visible.sync="dialogVisible" width="30%">
@@ -142,6 +142,23 @@ export default {
   },
 
   methods: {
+     //批量更新订单状态
+    refreshStatusBatch(list) {
+      this.$api.letter.batchOrderStatus({ orderNos: list }).then((res) => {
+        if (res.code == '200') {
+          this.$message({
+            type: 'success',
+            message: res.msg,
+          });
+          this.findPage();
+        } else {
+          this.$message({
+            type: 'error',
+            message: res.msg,
+          });
+        }
+      });
+    },
     //导出
     exportSubmit(data) {
       let obj = Object.assign(this.pageRequest, data)

+ 18 - 11
src/views/Task/daikeComponents/KtLetter.vue

@@ -1028,8 +1028,8 @@
               <el-col :span="2">
                 <span style="color: #d42426; font-weight: bold">
                   {{
-                    sumPremium !=  0  ? "¥" + sumPremium
-                      : "&nbsp;"
+                    sumPremium  ? "¥" + sumPremium
+                      : ""
                   }}
                 </span>
               </el-col>
@@ -4036,6 +4036,7 @@ export default {
 
     localStorage.setItem("carInfo", JSON.stringify(this.carInfo));
     localStorage.setItem("insureList", JSON.stringify(this.insureList));
+
     //--归属信息获取--
     if (this.isLetter == 1 || this.isLetter == 2) {
       var userId = Cookies.get("user");
@@ -4059,7 +4060,8 @@ export default {
     // this.paramsEdit = this.$route.query.data; //接收参数
     // add  by  hxl  2024-12-16
     this.findLeftTreeData(); //获取外部协议的保险保司列表
-    let item ={
+
+    this.totalCompanyList.push({
       agreement:[],
       companyName: "",
       isTaxSource: "",
@@ -4070,8 +4072,7 @@ export default {
       sypremium:"",
       jypremium:"",
       isInquiryFlag:""
-    }
-    this.totalCompanyList.push(item);
+    });
     this.obtainProtocol(this.$route.query.data);
     //初始化
   },
@@ -4110,15 +4111,16 @@ export default {
       };
     },
     sumPremium() {
-      let sum = new Decimal(this.policyNumberForm.jqpremium == "" ? new Decimal(0): new Decimal(this.policyNumberForm.jqpremium))
+      console.log(this.policyNumberForm)
+      let sum = new Decimal(!this.policyNumberForm.jqpremium  ? new Decimal(0): new Decimal(this.policyNumberForm.jqpremium))
         .plus(
-          this.policyNumberForm.taxamount == "" ? new Decimal(0)  : new Decimal(this.policyNumberForm.taxamount)
+          !this.policyNumberForm.taxamount  ? new Decimal(0)  : new Decimal(this.policyNumberForm.taxamount)
         )
         .plus(
-          this.policyNumberForm.sypremium == "" ? new Decimal(0)  : new Decimal(this.policyNumberForm.sypremium)
+          !this.policyNumberForm.sypremium  ? new Decimal(0)  : new Decimal(this.policyNumberForm.sypremium)
         )
         .plus(
-          this.policyNumberForm.jypremium == "" ? new Decimal(0)  : new Decimal(this.policyNumberForm.jypremium)
+          !this.policyNumberForm.jypremium  ? new Decimal(0)  : new Decimal(this.policyNumberForm.jypremium)
         )
         .toString();
       return sum;
@@ -4241,6 +4243,7 @@ export default {
         return;
       }
       if(this.costFlag =='1'){
+      console.log(1)
         if((this.policyNumberForm.jqCostsProportion==null  || this.policyNumberForm.jqCostsProportion =='')
           && (this.policyNumberForm.syCostsProportion==null  || this.policyNumberForm.syCostsProportion =='' )
           && (this.policyNumberForm.noCostsProportion==null  || this.policyNumberForm.noCostsProportion =='' )
@@ -4405,7 +4408,8 @@ export default {
           this.transferDateShow = true;
         }
         //回显交强和商业的时间
-        paramsEdit.risk.map((ele) => {
+        if(paramsEdit.risk){
+          paramsEdit.risk.map((ele) => {
           if (ele.riskCode == "0507") {
             _this.jqchecked = true;
             this.protocolJudge("0507", true);
@@ -4467,6 +4471,7 @@ export default {
             });
           }
         });
+        }
         // this.HistoryList = this.paramsEdit.insAreaCompanyList;
         let params = {
           orderNo: paramsEdit.orderno,
@@ -4492,6 +4497,8 @@ export default {
         _this.imageUploadShow = true;
         this.orderExternalStatus = paramsEdit.orderExternalStatus;
         //回显协议列表数据  add  by  hxl  2024-12-16
+        console.log(this.isLetter3agreementId,'isLetter3agreementId')
+        console.log(insAreaCompanyList,'insAreaCompanyList')
         this.isLetter3agreementId = insAreaCompanyList[0].agreementId;
         this.companyName = insAreaCompanyList[0].inscompany;
         if (this.totalCompanyListBak != null && this.totalCompanyListBak.length > 0) {
@@ -5406,7 +5413,7 @@ export default {
             });
           }
         });
-        if (data) {
+        if (data && data.insAreaCompanyEditingDtos) {
           res.data.forEach((val, index) => {
             data.insAreaCompanyEditingDtos.forEach((ele) => {
               if (val.namesimple == ele.inscompany) {

+ 33 - 6
src/views/Task/daikeComponents/KtLetter1.vue

@@ -1218,7 +1218,11 @@ agreementitem, agreementindex
                   {{ reslistitem.result.quoteErrMsg }}
                 </div>
               </el-col>
-              <div class="baofeijisuan" @click="handleListJisuan(reslistitem, reslistindex)">计算保费</div>
+              <div class="baofeijisuan flex a-c" >
+                <el-button   size="mini" type="text" class="blue_color" v-if="reslistitem.result.orderstatus=='10'"
+                @click="supplementOrder(reslistitem.result.companyId)">补录订单</el-button>
+                <div class="btn" @click="handleListJisuan(reslistitem, reslistindex)">计算保费</div>
+              </div>
             </el-row>
 
             <!-- 选中-方案选择 -->
@@ -2795,6 +2799,8 @@ agreementitem, agreementindex
           </el-table-column>
           <el-table-column label="操作" align="center" min-width="180" fixed="right">
             <template slot-scope="scope">
+              <el-button v-if="scope.row.orderstatus == '10'" type="text" style="color: #2d4d89" size="small"
+              @click="supplementOrder(scope.row.id)">补录订单</el-button>
               <el-button type="text" style="color: #2d4d89" size="small"
                 @click="qoutedetail(scope.row.id)">查看详情</el-button>
               <el-button size="small" type="text" @click="bjdpreview(scope.row.id)">报价单</el-button>
@@ -2833,7 +2839,8 @@ agreementitem, agreementindex
           color: '#333333',
         }" highlight-current-row @row-dblclick="reslistCurrentChange">
         <el-table-column prop="modelCode" label="厂牌型号代码" align="center" width="200"></el-table-column>
-        <el-table-column prop="modelName" label="厂牌型号" align="center" width="300"></el-table-column>
+        <el-table-column prop="modelName" label="厂牌型号" align="center" width="200"></el-table-column>
+        <el-table-column prop="importFlag" label="车辆类型" align="center" width="300"></el-table-column>
         <el-table-column prop="replacementValue" label="新车购置价" align="center" width="100"></el-table-column>
         <el-table-column prop="marketYear" label="年款" align="center" width="100"></el-table-column>
         <el-table-column prop="ratedPassengerCapacity" label="座位数" align="center" width="80"></el-table-column>
@@ -2858,6 +2865,7 @@ agreementitem, agreementindex
         }" highlight-current-row @row-dblclick="reslistCurrentChange">
         <el-table-column prop="modelCode" label="厂牌型号代码" align="center" width="200"></el-table-column>
         <el-table-column prop="modelName" label="厂牌型号" align="center" width="300"></el-table-column>
+        <el-table-column prop="importFlag" label="车辆类型" align="center" width="100"></el-table-column>
         <el-table-column prop="replacementValue" label="新车购置价" align="center" width="100"></el-table-column>
         <el-table-column prop="marketYear" label="年款" align="center" width="100"></el-table-column>
         <el-table-column prop="ratedPassengerCapacity" label="座位数" align="center" width="80"></el-table-column>
@@ -4813,6 +4821,7 @@ export default {
       reslist: [], //车型列表
       userId: "", //出单工号
       carInfo: {
+        importFlag:"",//特种车类
         powerScale: "", ///功率
         licenseNo: "", //车牌号
         brandName: "", //车辆品牌型号
@@ -6253,6 +6262,20 @@ export default {
     }
   },
   methods: {
+     //补录订单
+    supplementOrder(id) {
+      let params = {
+        companyId: id,
+      };
+      this.$api.letter.getByCompanyId(params).then((res) => {
+        if (res.code == "200") {
+          this.$router.push({
+              path: "/task/external/externalOrders",
+              query: { data: res.data },
+            });
+        }
+      })
+    },
     quotechangeDate(value){
       return dayjs(value).format("YYYY-MM-DD HH:mm:ss");
     },
@@ -12622,6 +12645,7 @@ export default {
     },
     //车型列表双击选中事件
     reslistCurrentChange(row, column, event) {
+      this.carInfo.importFlag=row.importFlag;//特种车标识
       this.carInfo.brandName = row.brandCN; //品牌型号
       this.carInfo.modelcname = row.modelName; //品牌型号
       this.carInfo.caryear = row.marketYear; //年款
@@ -15061,17 +15085,20 @@ export default {
 
   .baofeijisuan {
     position: absolute;
-    right: 8.333%;
+    right: 5.333%;
     top: 0;
-    background: linear-gradient(270deg, #0052ff 0%, #6899ff 100%);
-    border-radius: 4px;
     // border: 1px solid rgb(26, 77, 219);
     // color: rgb(26, 77, 219);
-    color: #fff;
+    .btn{
+      background: linear-gradient(270deg, #0052ff 0%, #6899ff 100%);
+      border-radius: 4px;
+      color: #fff;
     font-size: 14px;
     line-height: 20px;
     padding: 4px 8px;
     font-weight: 700;
+    margin-right: 10px;
+    }
   }
 }
 

+ 19 - 2
src/views/Task/daikeComponents/KtOrder.vue

@@ -58,7 +58,7 @@
             <el-radio-group v-model="pageRequest.productid">
               <el-radio label="">全部</el-radio>
               <el-radio v-for="val in productsTypeoptions" :key="val.dictValue" :label="val.dictValue">{{ val.dictTag
-              }}</el-radio>
+                }}</el-radio>
             </el-radio-group>
           </el-form-item>
         </el-col>
@@ -69,7 +69,7 @@
             <el-radio-group v-model="pageRequest.orderStatus">
               <el-radio label="888">全部</el-radio>
               <el-radio v-for="val in optionsStatus" :key="val.dictValue" :label="val.dictValue">{{ val.dictTag
-              }}</el-radio>
+                }}</el-radio>
             </el-radio-group>
           </el-form-item>
         </el-col>
@@ -169,6 +169,8 @@
               <el-button size="mini" type="text" v-if="item.orderstatus == '2'" @click="carcode(item)"
                 class="red_color">二维码</el-button>
               <!-- <el-button  size="mini"  class="red_color" v-if="item.orderstatus == '2' && item.inscompany == '平安财险'" type="text" @click="signature(item)">生成签章</el-button> -->
+              <el-button v-if="item.orderstatus == '10'"  size="mini" type="text" class="blue_color"
+                @click="supplementOrder(item)">补录订单</el-button>
               <el-button size="mini" type="text" class="green_color"
                 @click="OrderDetails(scope.row, item)">查看详情</el-button>
               <el-button size="mini" type="text" :loading="querystatusLoaing" v-if="
@@ -2048,6 +2050,21 @@ export default {
         return "-";
       }
     },
+    //补录订单
+    supplementOrder(item) {
+      let params = {
+        companyId: item.id,
+      };
+      this.$api.letter.getByCompanyId(params).then((res) => {
+        if (res.code == "200") {
+          this.$router.push({
+              path: "/task/external/externalOrders",
+              query: { data: res.data },
+            });
+        }
+      })
+    },
+
     //应用详情
     OrderDetails(dy, item) {
       console.log(dy, item);