Browse Source

承保规则复制

祁鹏飞 2 months ago
parent
commit
d153af26c1
2 changed files with 24 additions and 8 deletions
  1. 2 0
      src/api/modules/agreement.ts
  2. 22 8
      src/views/quoteConfig/agreement/agreementDetails.vue

+ 2 - 0
src/api/modules/agreement.ts

@@ -46,6 +46,8 @@ const agreementApi = (axiosInstance: ApiInstance) => ({
   agreementRulesGet: (id: any) => axiosInstance.get(`agreementRules/rulesGet?ruleId=${id}`),
   //删除承保规则
   agreementRulesDelete: (id: any) => axiosInstance.delete(`agreementRules/rulesDelete?id=${id}`,),
+  //复制承保规则
+  rulesCopy: (agreementId: any,ruleId:any) => axiosInstance.delete(`agreementRules/rulesCopy?agreementId=${agreementId}&ruleId=${ruleId}`,),
 
   /**
    *  费用管理接口

+ 22 - 8
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,9 +117,10 @@
                   <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="CopyDocument" @click="ruleCopy(item.id)">复制</el-button>
                     <el-button link type="primary" :icon="Delete" @click="ruleDel(item.id)">删除</el-button>
                     <el-button link type="primary" :icon="Edit" @click="ruleEdit(item.id)">编辑</el-button>
                     <el-button v-if="!item.ruleFeeShow" link type="default"
@@ -148,7 +149,7 @@
                   <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">
@@ -274,7 +275,7 @@ import { Fileonload, formatFileSize, processFileName } from '@/utils/composables
 import authDrawer from "./components/agreementAuth.vue";
 import ruleFeeDialog from "./components/ruleFeeDialog.vue";
 import ruleFeeDialogEdit from "./components/ruleFeeDialogEdit.vue";
-import { Delete, Edit } from '@element-plus/icons-vue'
+import { Delete, Edit,CopyDocument } from '@element-plus/icons-vue'
 interface Agreement {
   [key: string]: string | number; // 协议名称
 }
@@ -607,7 +608,7 @@ const ruleEdit = (id: string) => {
 }
 //添加车牌和车牌地区
 const processArray = (array: any[]) => {
-  return array.map((val,i) => {
+  return array.map((val, i) => {
     const rulesAttrList = val.costsAttrLinks.map(v => {
       switch (v.attrType) {
         case 'inputNumber':
@@ -628,7 +629,7 @@ const processArray = (array: any[]) => {
       return v;
     })
     return {
-      timeId: new Date().getTime()+i,
+      timeId: new Date().getTime() + i,
       rulesAttrList,
     }
   });
@@ -680,6 +681,19 @@ const ruleDel = (id: string) => {
       });
     })
 }
+//删除规则
+const ruleCopy = (id: string) => {
+  api.agreementApi.rulesCopy(agreementInfo.value.id,id).then((res: any) => {
+    if (res.code == '200') {
+      agreementRulesList();
+      ElMessage({
+        type: 'success',
+        message: res.msg,
+        plain: true,
+      })
+    }
+  });
+}
 //添加费用
 const ruleFeeVisible = ref(false);//规则费用弹窗
 const ruleFeeEditVisible = ref(false);//编辑弹窗