|
|
@@ -168,9 +168,19 @@
|
|
|
</PageMain>
|
|
|
<el-drawer v-model="addUnderwritingRuleShow" :direction="direction" :close-on-click-modal="false" size="50%">
|
|
|
<template #header>
|
|
|
- <h4>添加承保规则</h4>
|
|
|
+ <div>添加承保规则</div>
|
|
|
</template>
|
|
|
<template #default>
|
|
|
+ <el-form :model="rulesAttrListInfo" ref="OperationFormRef" :rules="rulesAttrListInfoRules" label-width="110">
|
|
|
+ <el-form-item prop="startTime" label="生效起始时间">
|
|
|
+ <el-date-picker v-model="rulesAttrListInfo.startTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime"
|
|
|
+ placeholder="生效起始时间" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="endTime" label="生效终止时间">
|
|
|
+ <el-date-picker v-model="rulesAttrListInfo.endTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime"
|
|
|
+ placeholder="生效终止时间" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
<div class="flex a-c j-s ">
|
|
|
<span class="strong title" style="margin-right: 20px;">规则条件</span>
|
|
|
<el-button type="primary" link @click="addRules">
|
|
|
@@ -213,6 +223,7 @@
|
|
|
<script lang='ts' setup>
|
|
|
import api from '@/api';
|
|
|
import { CaretBottom } from '@element-plus/icons-vue'
|
|
|
+import type { FormRules } from "element-plus";
|
|
|
import { ElMessage, ElMessageBox, DrawerProps, TabsInstance } from 'element-plus'
|
|
|
import { ref, reactive } from 'vue'
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
@@ -460,6 +471,8 @@ const ruleFeePosition = ref<TabsInstance['tabPosition']>('left')
|
|
|
const direction = ref<DrawerProps['direction']>('rtl')
|
|
|
const addUnderwritingRule = () => {
|
|
|
addUnderwritingRuleShow.value = true;
|
|
|
+ rulesAttrListInfo.startTime = ''
|
|
|
+ rulesAttrListInfo.endTime = ''
|
|
|
rulesAttrListInfo.rulesAttrList = []
|
|
|
}
|
|
|
//承保规则保存事件
|
|
|
@@ -516,6 +529,8 @@ const ruleEdit = (id: string) => {
|
|
|
addUnderwritingRuleShow.value = true;
|
|
|
api.agreementApi.agreementRulesGet(id).then((res: any) => {
|
|
|
if (res.code == '200') {
|
|
|
+ rulesAttrListInfo.startTime = res.data.startTime;
|
|
|
+ rulesAttrListInfo.endTime = res.data.endTime;
|
|
|
rulesAttrListInfo.rulesAttrList = processArray(res.data.costsAttrLinks);
|
|
|
console.log(rulesAttrListInfo.rulesAttrList)
|
|
|
} else {
|
|
|
@@ -583,7 +598,7 @@ const columns = [
|
|
|
let info = row.ptlAgreementCostTypeList.find((val: any) => val.costType == '交强险');
|
|
|
if (info) {
|
|
|
return `入口:${info.inlet.toFixed(2)}% 出口:${info.export.toFixed(2)}%\n加投:${info.addThrow.toFixed(2)}% 手续费:${info.commission.toFixed(2)}%`
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return '-'
|
|
|
}
|
|
|
}
|
|
|
@@ -593,7 +608,7 @@ const columns = [
|
|
|
let info = row.ptlAgreementCostTypeList.find((val: any) => val.costType == '商业险');
|
|
|
if (info) {
|
|
|
return `入口:${info.inlet.toFixed(2)}% 出口:${info.export.toFixed(2)}%\n加投:${info.addThrow.toFixed(2)}% 手续费:${info.commission.toFixed(2)}%`
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return '-'
|
|
|
}
|
|
|
}
|
|
|
@@ -603,7 +618,7 @@ const columns = [
|
|
|
let info = row.ptlAgreementCostTypeList.find((val: any) => val.costType == '驾意险');
|
|
|
if (info) {
|
|
|
return `入口:${info.inlet.toFixed(2)}% 出口:${info.export.toFixed(2)}%\n加投:${info.addThrow.toFixed(2)}% 手续费:${info.commission.toFixed(2)}%`
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return '-'
|
|
|
}
|
|
|
}
|
|
|
@@ -730,14 +745,26 @@ const costitemDel = (id: string) => {
|
|
|
interface rulesAttrListInfo {
|
|
|
id: string,
|
|
|
agreementId: string,
|
|
|
+ startTime: string,
|
|
|
+ endTime: string,
|
|
|
rulesAttrList: any[],
|
|
|
}
|
|
|
const ruleConditionVisible = ref(false);//规则条件弹窗
|
|
|
const rulesAttrListInfo = reactive<rulesAttrListInfo>({
|
|
|
id: '',
|
|
|
agreementId: "",
|
|
|
+ startTime: "",
|
|
|
+ endTime: "",
|
|
|
rulesAttrList: []
|
|
|
});//规则条件列表数据
|
|
|
+const rulesAttrListInfoRules = ref<FormRules>({
|
|
|
+ startTime: [
|
|
|
+ { required: true, trigger: "change", message: "请选择生效起始时间" }
|
|
|
+ ],
|
|
|
+ endTime: [
|
|
|
+ { required: true, trigger: "change", message: "请选择生效终止时间" }
|
|
|
+ ],
|
|
|
+});
|
|
|
const ruleConditionSave = (list: string[]) => {//获取规则条件选中集合
|
|
|
rulesAttrListInfo.rulesAttrList = list;
|
|
|
ruleConditionVisible.value = false;
|