祁鹏飞 3 месяцев назад
Родитель
Сommit
d67e580550
1 измененных файлов с 21 добавлено и 10 удалено
  1. 21 10
      src/views/quoteConfig/agreement/agreementDetails.vue

+ 21 - 10
src/views/quoteConfig/agreement/agreementDetails.vue

@@ -29,7 +29,7 @@
             <el-tag type="primary" style="margin-right: 20px;">{{
               getDict('is_enable').find(val => val.value == agreementInfo.isEnable)?.label}}</el-tag>
             <el-tag type="success">{{getDict('valid_status').find(val => val.value == agreementInfo.validStatus)?.label
-            }}</el-tag>
+              }}</el-tag>
           </div>
         </div>
         <el-descriptions :column="3" style="margin-top: 10px;">
@@ -51,9 +51,9 @@
         <el-tab-pane label="协议信息" name="agreementInfo">
           <el-descriptions title="基本信息" class="m-top-20" :column="3">
             <el-descriptions-item label="协议名称:">{{ agreementInfo.agreementTitle
-              }}</el-descriptions-item>
+            }}</el-descriptions-item>
             <el-descriptions-item label="协议简称:">{{ agreementInfo.agreementAbbreviation
-              }}</el-descriptions-item>
+            }}</el-descriptions-item>
             <el-descriptions-item label="协议生效时间:">{{ agreementInfo.startDate }}</el-descriptions-item>
             <el-descriptions-item label="协议失效时间:">{{ agreementInfo.endDate }}</el-descriptions-item>
             <el-descriptions-item label="是否含增值税结算:">
@@ -117,7 +117,7 @@
                   <div class="flex a-c">
                     <img src="../../../assets/images/fee.png" alt="">
                     <span style="margin-right: 30px;font-size: 16px;" class="strong m-left-10">承保规则一{{ index + 1
-                    }}</span>
+                      }}</span>
                   </div>
                   <div class="flex">
                     <el-button link type="primary" :icon="Delete" @click="ruleDel(item.id)">删除</el-button>
@@ -142,15 +142,17 @@
                     </el-icon>
                   </template>
                 </el-button>
-                <el-tabs :tab-position="ruleFeePosition" class="ruleFee" v-if="item.costVoList">
+                <el-tabs v-model="item.ruleFeeActive" :tab-position="ruleFeePosition" class="ruleFee"
+                  v-if="item.costVoList">
                   <el-tab-pane v-for="(costitem, costindex) in item.costVoList" :key="costindex"
                     :label="costitem.productName" :name="costitem.productName">
                     <span class="strong">{{ costitem.productName }}费用({{ costitem.ptlAgreementCostVoList.length
-                      }}条)</span>
+                    }}条)</span>
                     <ComplexTable :tableData="costitem.ptlAgreementCostVoList" :columns="columns" :maxHeight="250"
                       :showIndex="false" :columnwidth="200" :showSelect="false">
                       <template v-slot:operation="scope">
-                        <el-button type="primary" link @click="costitemEdit(scope.operationData.id, item)"> 编辑
+                        <el-button type="primary" link
+                          @click="costitemEdit(scope.operationData.id, item, index, costindex)"> 编辑
                         </el-button>
                         <el-button type="primary" link @click="costitemDel(scope.operationData.id)"> 删除
                         </el-button>
@@ -698,13 +700,22 @@ const ruleFeeEditSave = (data: object) => {
         message: res.msg,
         plain: true,
       })
-      agreementRulesList()
-    } else {
+      const ptlAgreementCostVoList = RulesList.value[index1.value].costVoList[costindex1.value].ptlAgreementCostVoList
+
+      const ruleIndex = ptlAgreementCostVoList.findIndex(v => v.id === data.id)
+      const ruleObj = ptlAgreementCostVoList[ruleIndex]
+      ptlAgreementCostVoList[ruleIndex] = { ...data, costRules: ruleObj.costRules }
+      ruleFeeEditVisible.value = false;
+
     }
   });
 }
+const index1 = ref(0)
+const costindex1 = ref(0)
 //编辑删除费用
-const costitemEdit = (id: string, item: any) => {
+const costitemEdit = (id: string, item: any, index: number, costindex: number) => {
+  index1.value = index;
+  costindex1.value = costindex;
   RulesInfo.value = item;
   api.agreementApi.AgreementFeeById(id).then((res: any) => {
     if (res.code == '200') {