|
|
@@ -170,7 +170,7 @@
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</PageMain>
|
|
|
- <el-drawer v-model="addUnderwritingRuleShow" :direction="direction" size="50%">
|
|
|
+ <el-drawer v-model="addUnderwritingRuleShow" :direction="direction" size="50%">
|
|
|
<template #header>
|
|
|
<div>添加承保规则</div>
|
|
|
</template>
|
|
|
@@ -190,8 +190,21 @@
|
|
|
</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">
|
|
|
- 添加条件
|
|
|
+ <el-button type="primary" link @click="addRules('or')">
|
|
|
+ 添加或者条件
|
|
|
+ <template #icon>
|
|
|
+ <el-icon>
|
|
|
+ <Plus />
|
|
|
+ </el-icon>
|
|
|
+ </template>
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div class="" v-for="rules in rulesAttrListInfo.rulesGroups" :key="rules.timeId">
|
|
|
+ <!-- 规则选择容器 -->
|
|
|
+ <rule-Condition-Container :rulesAttrList="rules.rulesAttrList" @Del="(index) => rulesAttrDel(index, rules)"
|
|
|
+ @selectChange="(index) => rulesAttrselectChange(index, rules)" />
|
|
|
+ <el-button type="primary" link @click="addRules('and', rules)">
|
|
|
+ 添加并且条件
|
|
|
<template #icon>
|
|
|
<el-icon>
|
|
|
<Plus />
|
|
|
@@ -199,9 +212,6 @@
|
|
|
</template>
|
|
|
</el-button>
|
|
|
</div>
|
|
|
- <!-- 规则选择容器 -->
|
|
|
- <rule-Condition-Container :rulesAttrList="rulesAttrListInfo.rulesAttrList" @Del="rulesAttrDel"
|
|
|
- @selectChange="rulesAttrselectChange" />
|
|
|
</template>
|
|
|
<template #footer>
|
|
|
<div class="flex a-c j-c">
|
|
|
@@ -216,7 +226,7 @@
|
|
|
:checkedIds="checkedIds"></auth-Drawer>
|
|
|
<!-- 规则条件弹窗 -->
|
|
|
<RuleCondition ref="RuleConditionRefs" :ruleConditionVisible="ruleConditionVisible"
|
|
|
- @cancel="ruleConditionVisible = false" @save="ruleConditionSave" :attrIdList="rulesAttrListInfo.rulesAttrList" />
|
|
|
+ @cancel="ruleConditionVisible = false" @save="ruleConditionSave" :attrIdList="attrIdList" />
|
|
|
<!-- 规则费用抽屉组件 -->
|
|
|
<ruleFeeDialog v-if="ruleFeeVisible" :ruleFeeVisible="ruleFeeVisible" :agreementInfo="agreementInfo"
|
|
|
:RulesInfo="RulesInfo" @save="ruleFeeSave" @cancel="ruleFeeVisible = false" />
|
|
|
@@ -271,7 +281,17 @@ const activeName = ref('agreementInfo')//默认标签页
|
|
|
const authDeptlength = ref<number>(0);
|
|
|
|
|
|
let RuleConditionRefs = ref()
|
|
|
-const addRules = () => {
|
|
|
+
|
|
|
+let logicJudge = ref('')
|
|
|
+let timeId = ref('')
|
|
|
+let attrIdList = ref([])
|
|
|
+const addRules = (val: string, rules: any = {}) => {
|
|
|
+ logicJudge.value = val
|
|
|
+ attrIdList.value = []
|
|
|
+ if (val === 'and') {
|
|
|
+ timeId.value = rules.timeId
|
|
|
+ attrIdList.value = rules.rulesAttrList
|
|
|
+ }
|
|
|
ruleConditionVisible.value = true
|
|
|
RuleConditionRefs.value.ruleAttr(agreementInfo.value.companyId)
|
|
|
}
|
|
|
@@ -501,7 +521,7 @@ const addUnderwritingRule = () => {
|
|
|
rulesAttrListInfo.startTime = ''
|
|
|
rulesAttrListInfo.endTime = ''
|
|
|
rulesAttrListInfo.inputDescription = ''
|
|
|
- rulesAttrListInfo.rulesAttrList = []
|
|
|
+ rulesAttrListInfo.rulesGroups = []
|
|
|
}
|
|
|
//承保规则保存事件
|
|
|
const UnderwritingRuleSave = () => {
|
|
|
@@ -568,32 +588,38 @@ const ruleEdit = (id: string) => {
|
|
|
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 {
|
|
|
+ rulesAttrListInfo.parentId = res.data.parentId;
|
|
|
+ rulesAttrListInfo.rulesGroups = processArray(res.data.rulesGroups);
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
//添加车牌和车牌地区
|
|
|
const processArray = (array: any[]) => {
|
|
|
return array.map((val) => {
|
|
|
- switch (val.attrType) {
|
|
|
- case 'inputNumber':
|
|
|
- case 'datetime':
|
|
|
- if (!val.operator) {
|
|
|
- val.operator = '1'; // 设置默认值
|
|
|
- }
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- if (val.attrCode == 'LicenseNo') {
|
|
|
- val.dictLabal = licensePlateNumber.value;
|
|
|
- }
|
|
|
- if (val.attrCode == 'LicenseArea') {
|
|
|
- val.dictLabal = licensePlateRegion.value;
|
|
|
+ const rulesAttrList = val.costsAttrLinks.map(v => {
|
|
|
+ switch (v.attrType) {
|
|
|
+ case 'inputNumber':
|
|
|
+ case 'datetime':
|
|
|
+ if (!v.operator) {
|
|
|
+ v.operator = '1'; // 设置默认值
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (v.attrCode == 'LicenseNo') {
|
|
|
+ v.dictLabal = licensePlateNumber.value;
|
|
|
+ }
|
|
|
+ if (v.attrCode == 'LicenseArea') {
|
|
|
+ v.dictLabal = licensePlateRegion.value;
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ })
|
|
|
+ return {
|
|
|
+ timeId: new Date().getTime(),
|
|
|
+ rulesAttrList,
|
|
|
}
|
|
|
- return val;
|
|
|
});
|
|
|
};
|
|
|
//删除规则
|
|
|
@@ -857,7 +883,7 @@ interface rulesAttrListInfo {
|
|
|
startTime: string,
|
|
|
endTime: string,
|
|
|
inputDescription: string,
|
|
|
- rulesAttrList: any[],
|
|
|
+ rulesGroups: any[],
|
|
|
}
|
|
|
const ruleConditionVisible = ref(false);//规则条件弹窗
|
|
|
const rulesAttrListInfo = reactive<rulesAttrListInfo>({
|
|
|
@@ -866,7 +892,7 @@ const rulesAttrListInfo = reactive<rulesAttrListInfo>({
|
|
|
startTime: "",
|
|
|
endTime: "",
|
|
|
inputDescription: "",
|
|
|
- rulesAttrList: []
|
|
|
+ rulesGroups: []
|
|
|
});//规则条件列表数据
|
|
|
const rulesAttrListInfoRules = ref<FormRules>({
|
|
|
startTime: [
|
|
|
@@ -876,23 +902,30 @@ const rulesAttrListInfoRules = ref<FormRules>({
|
|
|
{ required: true, trigger: "change", message: "请选择生效终止时间" }
|
|
|
],
|
|
|
});
|
|
|
-const ruleConditionSave = (list: string[]) => {//获取规则条件选中集合
|
|
|
- rulesAttrListInfo.rulesAttrList = list;
|
|
|
+const ruleConditionSave = (rulesAttrList: string[]) => {//获取规则条件选中集合
|
|
|
+ if (logicJudge.value === 'or') {
|
|
|
+ rulesAttrListInfo.rulesGroups.push({ timeId: new Date().getTime(), rulesAttrList })
|
|
|
+ }
|
|
|
+ if (logicJudge.value === 'and') {
|
|
|
+ const obj = rulesAttrListInfo.rulesGroups.find(v => v.timeId === timeId.value)
|
|
|
+ obj.rulesAttrList = list
|
|
|
+ }
|
|
|
+ // rulesAttrListInfo.rulesAttrList = list;
|
|
|
ruleConditionVisible.value = false;
|
|
|
}
|
|
|
//条件删除
|
|
|
-const rulesAttrDel = (index: number) => {
|
|
|
- rulesAttrListInfo.rulesAttrList.splice(index, 1)
|
|
|
+const rulesAttrDel = (index: number, rules) => {
|
|
|
+ rules.rulesAttrList.splice(index, 1)
|
|
|
}
|
|
|
//多选框事件数据格式处理
|
|
|
-const rulesAttrselectChange = (item: any) => {
|
|
|
- rulesAttrListInfo.rulesAttrList[item.index].min = '';
|
|
|
+const rulesAttrselectChange = (item: any, rules) => {
|
|
|
+ rules.rulesAttrList[item.index].min = '';
|
|
|
item.e.map((ele: any) => {
|
|
|
- rulesAttrListInfo.rulesAttrList[item.index].min += ele + ',';
|
|
|
+ rules.rulesAttrList[item.index].min += ele + ',';
|
|
|
})
|
|
|
// 去掉最后一个逗号
|
|
|
- if (rulesAttrListInfo.rulesAttrList[item.index].min.endsWith(',')) {
|
|
|
- rulesAttrListInfo.rulesAttrList[item.index].min = rulesAttrListInfo.rulesAttrList[item.index].min.slice(0, -1);
|
|
|
+ if (rules.rulesAttrList[item.index].min.endsWith(',')) {
|
|
|
+ rules.rulesAttrList[item.index].min = rules.rulesAttrList[item.index].min.slice(0, -1);
|
|
|
}
|
|
|
}
|
|
|
//协议文件处理
|