|
|
@@ -0,0 +1,727 @@
|
|
|
+<!-- 模板区域 -->
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <PageMain>
|
|
|
+ <div class="headers">
|
|
|
+ <div class="flex f-c a-start">
|
|
|
+ <div class="flex j-s a-c" style="width: 100%;">
|
|
|
+ <span class="title">{{ agreementInfo.agreementTitle }}</span>
|
|
|
+ <div>
|
|
|
+ <el-button type="default" @click="agreementAuth">协议授权</el-button>
|
|
|
+ <el-button type="default" plain @click="agreementEdit">编辑</el-button>
|
|
|
+ <el-dropdown trigger="click" @command="dropdownCommand" style="margin-left: 10px;">
|
|
|
+ <el-button plain>
|
|
|
+ 更多 <el-icon class="el-icon--right">
|
|
|
+ <CaretBottom />
|
|
|
+ </el-icon></el-button>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item command="启用" v-if="agreementInfo.isEnable == '1'">启用</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="禁用" v-else>禁用</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="删除">删除</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="分配管理人">复制协议</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px;" class="flex">
|
|
|
+ <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>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-descriptions :column="3" style="margin-top: 10px;">
|
|
|
+ <el-descriptions-item label="协议号:">{{ agreementInfo.agreementCode }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="协议名称:">{{ agreementInfo.agreementTitle }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="归属机构:">{{ agreementInfo.deptName }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="授权机构:">{{ authDeptlength }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="添加人:">
|
|
|
+ {{ agreementInfo.createBy }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="添加时间:">
|
|
|
+ {{ agreementInfo.createTime }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </div>
|
|
|
+ </PageMain>
|
|
|
+ <PageMain class="agreement ">
|
|
|
+ <el-tabs v-model="activeName" class="demo-tabs">
|
|
|
+ <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 label="协议简称:">{{ agreementInfo.agreementAbbreviation
|
|
|
+ }}</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="是否含增值税结算:">
|
|
|
+ {{ agreementInfo.withTax }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="结算周期:">T{{ agreementInfo.moneyTime }} </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="协议描述:">{{ agreementInfo.agreementName }}</el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ <el-descriptions title="其他信息" class="m-top-20" :column="3">
|
|
|
+ <el-descriptions-item label="协议归属:">{{ agreementInfo.deptName }} </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="保险公司:"> {{ agreementInfo.companyId }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="协议类型:">{{ agreementInfo.agreementType }} </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="管理人:"> {{ agreementInfo.custodianId }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="对接人:"> {{ agreementInfo.dockingPerson }} </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="对接人手机号:"> {{ agreementInfo.dockingPhone }} </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="费用管理" name="costManagement">
|
|
|
+ <span class="strong m-right-20">对接人</span>
|
|
|
+ <el-button type="primary" @click="addUnderwritingRule" plain>
|
|
|
+ 添加对接人
|
|
|
+ <template #icon>
|
|
|
+ <el-icon>
|
|
|
+ <Plus />
|
|
|
+ </el-icon>
|
|
|
+ </template>
|
|
|
+ </el-button>
|
|
|
+ <div class="flex f-c RuleContainer" v-if="contactPersonList">
|
|
|
+ <div class="list-item" v-for="(item, index) in contactPersonList" :key="index">
|
|
|
+ <div class="header-title flex f-c ">
|
|
|
+ <div class="flex a-c j-s">
|
|
|
+ <div class="flex a-c">
|
|
|
+ <img src="../../../assets/images/fee.png" alt="">
|
|
|
+ <span class="strong m-left-10">{{ item.contactPerson
|
|
|
+ }}</span>
|
|
|
+ <span class="strong m-left-10">{{ item.contactMobile }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="flex">
|
|
|
+ <el-button link type="primary" :icon="Delete"
|
|
|
+ @click="contactPersonDel(item.contactMobile)">删除</el-button>
|
|
|
+ <el-button link type="primary" :icon="Edit" @click="contactPersonEdit(item)">编辑</el-button>
|
|
|
+ <el-button v-if="!item.contactPersonShow" link type="default"
|
|
|
+ @click="item.contactPersonShow = !item.contactPersonShow">展开<el-icon class="m-left-10">
|
|
|
+ <ArrowDownBold />
|
|
|
+ </el-icon> </el-button>
|
|
|
+ <el-button v-else link type="default"
|
|
|
+ @click="item.contactPersonShow = !item.contactPersonShow">收起<el-icon class="m-left-10">
|
|
|
+ <ArrowUpBold />
|
|
|
+ </el-icon></el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="header-content" v-if="item.contactPersonShow">
|
|
|
+ <ComplexTable :tableData="item.costExternalListVo" :columns="columns" :maxHeight="400"
|
|
|
+ :showIndex="false" :columnwidth="200" :showSelect="false">
|
|
|
+ <template v-slot:operation="scope">
|
|
|
+ <el-button type="primary" link @click="itemEdit(scope.operationData.id)"> 编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" link @click="itemDel(scope.operationData.id)"> 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </ComplexTable>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <Empty v-else />
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </PageMain>
|
|
|
+ <!-- 协议授权弹窗 -->
|
|
|
+ <auth-Drawer :Drawer="agreementAuthDrawer" @cancel="agreementAuthDrawer = false" @save="DrawerSave"
|
|
|
+ @query="Drawerquery" :deptlist="deptauthList" :checkedKeys="checkedKeys" :checkedIds="checkedIds"></auth-Drawer>
|
|
|
+ <!-- 规则费用抽屉组件 -->
|
|
|
+ <contactPersonFeeDialog v-show="addcontactPersonShow" :ruleFeeVisible="addcontactPersonShow"
|
|
|
+ :title='contactPersontitle' :agreementInfo="agreementInfo" @save="contactPersonSave"
|
|
|
+ :contactPersonEditInfo="contactPersonEditInfo" addMethod="details" @cancel="addcontactPersonShow = false" />
|
|
|
+ <!-- 规则费用编辑组件 -->
|
|
|
+ <contactPersonFeeDialogEdit :ruleFeeVisible="ruleFeeEditVisible" :headerTitle="ruleFeeHeaderTitle"
|
|
|
+ :agreementInfo="agreementInfo" :costitemEditInfo="costitemEditInfo" @save="ruleFeeEditSave"
|
|
|
+ @cancel="ruleFeeEditVisible = false" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<!-- 行为区域 -->
|
|
|
+<script lang='ts' setup>
|
|
|
+import api from '@/api';
|
|
|
+import { CaretBottom } from '@element-plus/icons-vue'
|
|
|
+import { ElMessage, ElMessageBox, } from 'element-plus'
|
|
|
+import { ref, reactive } from 'vue'
|
|
|
+import { useRoute, useRouter } from 'vue-router';
|
|
|
+import { loadDicts, getDict } from '@/utils/composables/dictService';//字典组件
|
|
|
+import authDrawer from "./components/agreementAuth.vue";
|
|
|
+import contactPersonFeeDialog from "./components/contactPersonFeeDialog.vue";
|
|
|
+import contactPersonFeeDialogEdit from "./components/contactPersonFeeDialogEdit.vue";
|
|
|
+import { Delete, Edit } from '@element-plus/icons-vue'
|
|
|
+interface Agreement {
|
|
|
+ [key: string]: string | number; // 协议名称
|
|
|
+}
|
|
|
+const agreementInfo = ref<Agreement>({}); // 初始值为 null
|
|
|
+const route = useRoute();
|
|
|
+const router = useRouter();
|
|
|
+const id = ref(route.query.id as string);//id参数
|
|
|
+const activeName = ref('costManagement')//默认标签页
|
|
|
+const authDeptlength = ref<number>(0);
|
|
|
+onBeforeMount(async () => {
|
|
|
+ await loadDicts(['agreement_type', 'valid_status', 'is_enable', 'with_tax', 'audit_status', 'insurance_type']);//获取多个字典
|
|
|
+
|
|
|
+ if (id.value) {
|
|
|
+ detailsInfo();//协议信息
|
|
|
+ costExternalList();//对接人列表
|
|
|
+ }
|
|
|
+})
|
|
|
+//协议详情
|
|
|
+const detailsInfo = () => {
|
|
|
+ api.agreementApi.agreementGet(id.value).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ agreementInfo.value = res.data.agreement;
|
|
|
+
|
|
|
+ authDeptlength.value = res.data.dept.length;
|
|
|
+ imageUrl.value = res.data.agreement.fileUrl;
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//编辑跳转
|
|
|
+const agreementEdit = () => {
|
|
|
+ router.push({
|
|
|
+ name: 'ExternalagreementAdd',
|
|
|
+ query: {
|
|
|
+ id: id.value
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+//协议授权
|
|
|
+//检索事件
|
|
|
+const imageUrl = ref('');//协议文件
|
|
|
+const agreementAuthDrawer = ref(false)//授权弹窗
|
|
|
+const deptauthList = ref([]);//授权机构列表
|
|
|
+const checkedKeys = ref<string[]>([])//授权机构回显数据
|
|
|
+const checkedIds = ref<string[]>([])//授权机构回显id
|
|
|
+const Drawerquery = (name: any) => {
|
|
|
+ agreementAuth(name)
|
|
|
+}
|
|
|
+//授权保存
|
|
|
+const DrawerSave = (list: any) => {
|
|
|
+ api.agreementApi.authSave({ deptIds: list, id: id.value }).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ plain: true,
|
|
|
+ })
|
|
|
+ agreementAuthDrawer.value = false;
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+//协议授权机构获取
|
|
|
+const agreementAuth = (deptName: any) => {
|
|
|
+ let name = typeof deptName === 'string' ? deptName : '';
|
|
|
+ api.agreementApi.agreementdeptTree(id.value, name).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ agreementAuthDrawer.value = true;
|
|
|
+ deptauthList.value = res.data;
|
|
|
+ checkedKeys.value = getUncheckedIds(res.data);
|
|
|
+ checkedIds.value = getUncheckedIds(res.data);
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+// 递归回显数据
|
|
|
+function getUncheckedIds(data: any[]): string[] {
|
|
|
+ let ids: string[] = [];
|
|
|
+
|
|
|
+ data.forEach((item) => {
|
|
|
+ if (item.isCheck === 1) {
|
|
|
+ ids.push(item.id); // 如果 isCheck 为 0,添加 id
|
|
|
+ }
|
|
|
+ if (item.children && item.children.length > 0) {
|
|
|
+ // 如果有子项,递归调用
|
|
|
+ ids = ids.concat(getUncheckedIds(item.children));
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return ids;
|
|
|
+}
|
|
|
+
|
|
|
+//更多操作集合
|
|
|
+const dropdownCommand = (e: any) => {
|
|
|
+ switch (e) {
|
|
|
+ case '启用':
|
|
|
+ api.agreementApi.sysUpAndDown({ ids: [id.value], opType: '0' }).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ plain: true,
|
|
|
+ })
|
|
|
+ router.push({
|
|
|
+ name: 'reload',
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case '禁用':
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ '确定要禁用该协议吗,禁用后,该协议不在支持报价出单,并且已核保待缴费,待支付的订单,都将失效,请确认是否禁用?',
|
|
|
+ '禁用协议',
|
|
|
+ {
|
|
|
+ confirmButtonText: '确定禁用',
|
|
|
+ type: 'error',
|
|
|
+ center: true,
|
|
|
+ confirmButtonClass: 'el-button--danger',
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ api.agreementApi.sysUpAndDown({ ids: [id.value], opType: '1' }).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ plain: true,
|
|
|
+ })
|
|
|
+ router.push({
|
|
|
+ name: 'reload',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ break;
|
|
|
+ case '删除':
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ '确定要删除该协议吗,删除后,该协议不在支持报价出单,并且已核保待缴费,待支付的订单,都将失效,请确认是否删除?',
|
|
|
+ '删除协议',
|
|
|
+ {
|
|
|
+ confirmButtonText: '确定删除',
|
|
|
+ type: 'error',
|
|
|
+ center: true,
|
|
|
+ confirmButtonClass: 'el-button--danger',
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ api.agreementApi.agreementDelete({ ids: [id.value] }).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ plain: true,
|
|
|
+ })
|
|
|
+ router.back()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case '复制协议':
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+// 添加承保规则
|
|
|
+const addcontactPersonShow = ref(false);//添加对接人
|
|
|
+const contactPersonList = ref();//协议下对接人费用
|
|
|
+const contactPersontitle = ref();//弹窗title
|
|
|
+const addUnderwritingRule = () => {//添加对接人
|
|
|
+ addcontactPersonShow.value = true;
|
|
|
+ contactPersontitle.value = '添加';
|
|
|
+}
|
|
|
+
|
|
|
+//对接人列表
|
|
|
+const costExternalList = () => {
|
|
|
+ api.agreementApi.costExternalList({ ptlAgreementId: id.value }).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ res.data.map((val: any) => {
|
|
|
+ val.contactPersonShow = false;
|
|
|
+ return val;
|
|
|
+ })
|
|
|
+ contactPersonList.value = res.data;
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+//修改对接人所有费用
|
|
|
+interface contactPersonEditInfo{
|
|
|
+ ptlAgreementId: string,
|
|
|
+ contactPerson: string,
|
|
|
+ contactMobile: string,
|
|
|
+ ptlAgreementCostExternalAddList: any[],
|
|
|
+}
|
|
|
+const contactPersonEditInfo = reactive<contactPersonEditInfo>({
|
|
|
+ ptlAgreementId: "",//协议id
|
|
|
+ contactPerson: "",//对接人
|
|
|
+ contactMobile: "",//手机号
|
|
|
+ ptlAgreementCostExternalAddList: [],//费用集合
|
|
|
+})
|
|
|
+const contactPersonEdit = (item: any) => {
|
|
|
+ api.agreementApi.selectByAgreementIdAll({ ptlAgreementId: id.value, contactPerson: item.contactPerson, contactMobile: item.contactMobile }).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ const dict = getDict('insurance_type');//获取险种字典
|
|
|
+ const difference = getObjectArrayDifference(dict, res.data, "label", 'productName');//获取编辑数据和字典数组差集
|
|
|
+ const differenceArray:any = dataCompletion(difference);//差集对象赋值
|
|
|
+ contactPersonEditInfo.ptlAgreementId = id.value;
|
|
|
+ contactPersonEditInfo.contactPerson = item.contactPerson;
|
|
|
+ contactPersonEditInfo.contactMobile = item.contactMobile;
|
|
|
+ contactPersonEditInfo.ptlAgreementCostExternalAddList =[...res.data,...differenceArray];
|
|
|
+ contactPersontitle.value = '编辑';
|
|
|
+ addcontactPersonShow.value = true;
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+//匹配编辑和新增数组差集
|
|
|
+const getObjectArrayDifference = (arr1: any, arr2: any, key: string, key1: string) => {
|
|
|
+ console.log(arr1, arr2)
|
|
|
+ return arr1.filter((item1: any) =>
|
|
|
+ !arr2.some((item2: any) => item2[key1] === item1[key])
|
|
|
+ );
|
|
|
+}
|
|
|
+/**
|
|
|
+ * @param dataCompletion 编辑数据补全
|
|
|
+ * @param list 差集数组
|
|
|
+ */
|
|
|
+const dataCompletion = (list: any) => {
|
|
|
+ let array = list.map((val: any) => {
|
|
|
+ const filteredList: any = filterCostTypeList(val.label);//根据险种匹配列表
|
|
|
+ let list = JSON.parse(JSON.stringify(filteredList)); // 深拷贝
|
|
|
+ return {
|
|
|
+ productName: val.label,
|
|
|
+ productId: val.value,
|
|
|
+ effectiveTime: "",//生效时间
|
|
|
+ failureTime: "",//失效时间
|
|
|
+ auditMethod: "",//审核方式
|
|
|
+ isInquiry: "0",//是否线询
|
|
|
+ costDescribe: "",//费用描述
|
|
|
+ costExternalTypeAdds: list,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return array;
|
|
|
+}
|
|
|
+
|
|
|
+// 过滤方法
|
|
|
+const filterCostTypeList = (name: string) => {
|
|
|
+ const ptlAgreementCostTypeList = [
|
|
|
+ {
|
|
|
+ costType: "交强险",
|
|
|
+ inlet: 0,
|
|
|
+ export: 0,
|
|
|
+ totalCost: 0,
|
|
|
+ other: 0,
|
|
|
+ level1: 0,
|
|
|
+ level5: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ costType: "商业险",
|
|
|
+ inlet: 0,
|
|
|
+ export: 0,
|
|
|
+ totalCost: 0,
|
|
|
+ other: 0,
|
|
|
+ level1: 0,
|
|
|
+ level5: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ costType: "驾意险",
|
|
|
+ inlet: 0,
|
|
|
+ export: 0,
|
|
|
+ totalCost: 0,
|
|
|
+ other: 0,
|
|
|
+ level1: 0,
|
|
|
+ level5: 0,
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ return ptlAgreementCostTypeList.filter(item => {
|
|
|
+ if (name === "单交" && item.costType === "商业险") {
|
|
|
+ return false; // 当 name 为 "单交" 且 costType 为 "商业险" 时,返回 false,不包含该项
|
|
|
+ }
|
|
|
+ if (name === "单三" && item.costType === "商业险") {
|
|
|
+ return false; // 当 name 为 "单交" 且 costType 为 "商业险" 时,返回 false,不包含该项
|
|
|
+ }
|
|
|
+ if (name === "单商" && item.costType === "交强险") {
|
|
|
+ return false; // 当 name 为 "商业" 且 costType 为 "交强险" 时,返回 false,不包含该项
|
|
|
+ }
|
|
|
+ return true; // 其他情况返回 true,保留该项
|
|
|
+ });
|
|
|
+};
|
|
|
+//删除规则
|
|
|
+const contactPersonDel = (contactMobile: string) => {
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ '确定要删除该对接人吗,删除后,该对接人的费用也将同步删除,请确认是否删除?',
|
|
|
+ '删除对接人',
|
|
|
+ {
|
|
|
+ confirmButtonText: '确定删除',
|
|
|
+ type: 'error',
|
|
|
+ center: true,
|
|
|
+ confirmButtonClass: 'el-button--danger',
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ api.agreementApi.deleteByPtlAgreementIdAndMobile({ ptlAgreementId: id.value, contactMobile: contactMobile }).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ costExternalList();
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ plain: true,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+}
|
|
|
+//添加费用
|
|
|
+const ruleFeeEditVisible = ref(false);//编辑弹窗
|
|
|
+const ruleFeeHeaderTitle = ref();//编辑弹窗title
|
|
|
+const costitemEditInfo = ref();
|
|
|
+const columns = [
|
|
|
+ { prop: "productName", label: "险种", width: '200' },
|
|
|
+ {
|
|
|
+ prop: "isInquiry", label: "是否现询", width: '200', formatter: (row: any) => {
|
|
|
+ if (row.isInquiry == '0') {
|
|
|
+ return "是"
|
|
|
+ } else {
|
|
|
+ return "否"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "costExternalTypeAdds", label: "交强险费用", width: '300', formatter: (row: any) => {
|
|
|
+ let info = row.costExternalTypeAdds.find((val: any) => val.costType == '交强险');
|
|
|
+ if (info) {
|
|
|
+ return `入口:${info.inlet.toFixed(2)}% 出口:${info.export.toFixed(2)}%\n一级:${info.level1.toFixed(2)}% 五级:${info.level5.toFixed(2)}%`
|
|
|
+ }else {
|
|
|
+ return '-'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "costExternalTypeAdds", label: "商业险费用", width: '300', formatter: (row: any) => {
|
|
|
+ let info = row.costExternalTypeAdds.find((val: any) => val.costType == '商业险');
|
|
|
+ if (info) {
|
|
|
+ return `入口:${info.inlet.toFixed(2)}% 出口:${info.export.toFixed(2)}%\n一级:${info.level1.toFixed(2)}% 五级:${info.level5.toFixed(2)}%`
|
|
|
+ }else {
|
|
|
+ return '-'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "costExternalTypeAdds", label: "驾意险费用", width: '300', formatter: (row: any) => {
|
|
|
+ let info = row.costExternalTypeAdds.find((val: any) => val.costType == '驾意险');
|
|
|
+ if (info) {
|
|
|
+ return `入口:${info.inlet.toFixed(2)}% 出口:${info.export.toFixed(2)}%\n一级:${info.level1.toFixed(2)}% 五级:${info.level5.toFixed(2)}%`
|
|
|
+ }else {
|
|
|
+ return '-'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: "effectiveTime", label: "有效期", width: '200',
|
|
|
+ formatter: (row: any) => {
|
|
|
+ return `起${row.effectiveTime}\n止${row.failureTime}`
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "isEnabled", label: "费用状态", width: '200', component: "Tag",
|
|
|
+ formatter: (row: any) => {
|
|
|
+ let name = getDict('is_enable').find(val => val.value == row.isEnabled).label
|
|
|
+ if (name) {
|
|
|
+ return { type: 'danger', text: name };
|
|
|
+ } else {
|
|
|
+ return { type: 'primary', text: name };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "effective", label: "有效状态", width: '200',
|
|
|
+ component: "Tag",
|
|
|
+ formatter: (row: any) => {
|
|
|
+ if (row.effective) {
|
|
|
+ return { type: 'danger', text: '有效' };
|
|
|
+ } else {
|
|
|
+ return { type: 'danger', text: '无效' };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
+//费用提交
|
|
|
+const contactPersonSave = (data: object) => {
|
|
|
+ if (contactPersontitle.value == '编辑') {
|
|
|
+ api.agreementApi.ptlAgreementCostExternalupdate(data).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ addcontactPersonShow.value = false;
|
|
|
+ costExternalList();
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ api.agreementApi.ptlAgreementCostExternalsave(data).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ addcontactPersonShow.value = false;
|
|
|
+ costExternalList();
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+//费用编辑
|
|
|
+const ruleFeeEditSave = (data: object) => {
|
|
|
+ api.agreementApi.FeeupdateById(data).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ plain: true,
|
|
|
+ })
|
|
|
+ ruleFeeEditVisible.value=false;
|
|
|
+ costExternalList();
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+//编辑删除费用
|
|
|
+const itemEdit = (id: string) => {
|
|
|
+ api.agreementApi.FeegetById(id).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ ruleFeeHeaderTitle.value = res.data.productName;
|
|
|
+ costitemEditInfo.value = res.data;
|
|
|
+ ruleFeeEditVisible.value = true;
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//删除费用
|
|
|
+const itemDel = (id: string) => {
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ '确定要删除该费用,请确认是否删除?',
|
|
|
+ '删除费用',
|
|
|
+ {
|
|
|
+ confirmButtonText: '确定删除',
|
|
|
+ type: 'error',
|
|
|
+ center: true,
|
|
|
+ confirmButtonClass: 'el-button--danger',
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ api.agreementApi.deleteById([id]).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ costExternalList();
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ plain: true,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+}
|
|
|
+</script>
|
|
|
+<!-- 样式区域 -->
|
|
|
+<style lang='scss' scoped>
|
|
|
+:deep(.demo-tabs .el-tabs__item) {
|
|
|
+ height: 60px;
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: bold !important;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.ruleFee .el-tabs__item) {
|
|
|
+ height: 40px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 500 !important;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.agreement .p-5) {
|
|
|
+ padding-top: 0;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-descriptions__cell) {
|
|
|
+ width: 33.33%;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.my-label) {
|
|
|
+ font-weight: bold !important;
|
|
|
+}
|
|
|
+
|
|
|
+.headers {
|
|
|
+ .title {
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.RuleContainer {
|
|
|
+ margin-top: 20px;
|
|
|
+
|
|
|
+ .list-item {
|
|
|
+ padding: 18px 16px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ border: 1px solid #e5e5e5;
|
|
|
+ border-radius: 10px;
|
|
|
+
|
|
|
+ .empty {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #666;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.agreementNotice {
|
|
|
+ width: max-content;
|
|
|
+ padding: 18px 24px;
|
|
|
+ border: 1px solid #eee;
|
|
|
+ border-radius: 4px;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ background-color: #fafafa;
|
|
|
+ }
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ span:first-child {
|
|
|
+ margin-bottom: 2px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+
|
|
|
+ span:last-child {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+
|
|
|
+ .fileBtn {
|
|
|
+ margin-left: 40px;
|
|
|
+
|
|
|
+ .btn-icon {
|
|
|
+ margin: 0 10px;
|
|
|
+ font-size: 20px;
|
|
|
+ color: #999;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ color: #00a0f4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.title {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ &::before {
|
|
|
+ display: inline-block;
|
|
|
+ width: 4px;
|
|
|
+ height: 18px;
|
|
|
+ margin-right: 20px;
|
|
|
+ content: "";
|
|
|
+ background-color: #0083ff;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|