Explorar o código

支持复制费用时不选择险种直接复制

祁鹏飞 hai 1 mes
pai
achega
0e0ba400c0
Modificáronse 1 ficheiros con 29 adicións e 14 borrados
  1. 29 14
      src/views/quoteConfig/agreement/agreementDetails.vue

+ 29 - 14
src/views/quoteConfig/agreement/agreementDetails.vue

@@ -120,9 +120,10 @@
                       }}</span>
                   </div>
                   <div class="flex">
+                    <el-button link type="primary" :icon="CopyDocument" @click="handleCopy(item, {})">复制费用</el-button>
                     <el-button link type="primary" :icon="View"
                       @click="operatorTrajectoryRef.operAtorTrajectory(item.id)">查看轨迹</el-button>
-                    <el-button link type="primary" :icon="CopyDocument" @click="ruleCopy(item.id)">复制</el-button>
+                    <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"
@@ -150,17 +151,23 @@
                   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>
-                    <el-button type="primary" link @click="handleUpdateValidDate()"> 批量设置有效期
-                    </el-button>
-                    <el-button type="primary" link @click="handleUpdateCostRatio()"> 批量设置比例
-                    </el-button>
-                    <el-button type="primary" link @click="handleCopy(item, costitem)"> 批量复制
-                    </el-button>
-                    <ComplexTable showSelect :tableData="costitem.ptlAgreementCostVoList" :columns="columns"
-                      :showIndex="false" tableheight="auto" :columnwidth="200" @selectionChange="(arr) => costIds = arr"
-                      @select-all="(arr) => costIds = arr">
+                    <div class="flex justify-between items-center">
+                      <div class="">
+                        <span class="strong">{{ costitem.productName }}费用({{ costitem.ptlAgreementCostVoList.length
+                        }}条)</span>
+                        <el-button type="primary" link @click="handleUpdateValidDate()"> 批量设置有效期
+                        </el-button>
+                        <el-button type="primary" link @click="handleUpdateCostRatio()"> 批量设置比例
+                        </el-button>
+                        <el-button type="primary" link @click="handleCopy(item, costitem)"> 批量复制
+                        </el-button>
+                      </div>
+                      <el-input v-model="item.searchInput" style="width: 240px" placeholder="输入费用规则筛选" />
+                    </div>
+                    <ComplexTable showSelect
+                      :tableData="costitem.ptlAgreementCostVoList.filter(v => v.costDescribe.includes(item.searchInput || '') || v.costRules.includes(item.searchInput || ''))"
+                      :columns="columns" :showIndex="false" tableheight="auto" :columnwidth="200"
+                      @selectionChange="(arr) => costIds = arr" @select-all="(arr) => costIds = arr">
                       <template #customSlot="{ data, bodyCell }">
                         <div class="whitespace-normal">{{ data.costRules }}</div>
                       </template>
@@ -173,6 +180,7 @@
                         </el-button>
                         <el-button type="primary" link @click="costitemDel(scope.operationData.id)"> 删除
                         </el-button>
+
                       </template>
                     </ComplexTable>
                   </el-tab-pane>
@@ -206,7 +214,6 @@
         </el-form>
         <div class="flex a-c j-s ">
           <span class="strong title" style="margin-right: 20px;">规则条件</span>
-
         </div>
         <div class="bg-[#FAFAFA] p-20px m-t-20px" v-for="rules in rulesAttrListInfo.rulesGroups" :key="rules.timeId">
           <!-- 规则选择容器 -->
@@ -648,9 +655,17 @@ const agreementRulesList = () => {
       RulesList.value = res.data.map(v => {
         const index = RulesList.value.findIndex(k => k.id === v.id)
         const ruleFeeShow = RulesList.value[index]?.ruleFeeShow
-        const ruleFeeActive = RulesList.value[index]?.ruleFeeActive
+        const ruleFeeActive = RulesList.value[index]?.ruleFeeActive ?? v.costVoList[0]?.productName
+        const arr = v.costVoList.map(k => k.ptlAgreementCostVoList)
+        const costAll = {
+          ids: "",
+          productId: "1",
+          productName: "全部",
+          ptlAgreementCostVoList: arr.flat()
+        }
         return {
           ...v,
+          costVoList: [...v.costVoList, costAll],
           ruleFeeShow,
           ruleFeeActive,
         }