|
|
@@ -0,0 +1,236 @@
|
|
|
+<!-- 模板区域 -->
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <PageMain>
|
|
|
+ <div class="headers">
|
|
|
+ <span class="strong">天勤恒邦吕梁协议 - 非晋M - 0136</span>
|
|
|
+ <el-descriptions :column="2" 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>
|
|
|
+ <div class="content m-top-20 flex a-c">
|
|
|
+ <span>出单费用{{ feeData.length }}条</span>
|
|
|
+ <div class="grayBlock m-right-10 m-left-20 flex a-c j-s">
|
|
|
+ <span class="m-right-20" style="line-height: 14px;">有效状态</span>
|
|
|
+ <el-dropdown trigger="click" @command="validStateCommand">
|
|
|
+ <el-button link style="font-size: 14px;color: #333;"> {{ valid_statusName ? valid_statusName : '全部'
|
|
|
+ }}<el-icon>
|
|
|
+ <arrow-down />
|
|
|
+ </el-icon>
|
|
|
+ </el-button>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item :command="item.label" v-for="(item, index) in getDict('valid_status')" :key="index">{{
|
|
|
+ item.label }}</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
+ <div class="grayBlock m-right-10 m-left-20 flex a-c j-s">
|
|
|
+ <span class="m-right-20" style="line-height: 14px;">费用状态</span>
|
|
|
+ <el-dropdown placement="bottom-start" @command="agreementStatusCommand">
|
|
|
+ <el-button link style="font-size: 14px;color: #333;">{{ is_enableName ? is_enableName : '全部' }}<el-icon>
|
|
|
+ <arrow-down />
|
|
|
+ </el-icon>
|
|
|
+ </el-button>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item :command="item.label" v-for="(item, index) in is_enable" :key="index">{{ item.label
|
|
|
+ }}</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <ComplexTable :tableData="feeData" :columns="columns" :showIndex="false" :columnwidth="200" :showOperation="false"
|
|
|
+ :showSelect="true" uniqueIdName="costId" @selectionChange="selectionChange">
|
|
|
+ </ComplexTable>
|
|
|
+
|
|
|
+ </PageMain>
|
|
|
+ <FixedActionBar>
|
|
|
+ <ElButton @click="router.back()">
|
|
|
+ 取消
|
|
|
+ </ElButton>
|
|
|
+ <ElButton type="primary" @click="agreementcopy" :disabled="!sysUpAndDownList.length">
|
|
|
+ 复制协议
|
|
|
+ </ElButton>
|
|
|
+ </FixedActionBar>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<!-- 行为区域 -->
|
|
|
+<script lang='ts' setup>
|
|
|
+import { ref, reactive } from 'vue'
|
|
|
+import api from '@/api'
|
|
|
+import { useRoute, useRouter } from 'vue-router';
|
|
|
+import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
+import { loadDicts, getDict } from '@/utils/composables/dictService';//字典组件
|
|
|
+const route = useRoute();
|
|
|
+const router = useRouter();
|
|
|
+const id = ref(route.query.id as string);//id参数
|
|
|
+interface Agreement {
|
|
|
+ [key: string]: string | number; // 协议名称
|
|
|
+}
|
|
|
+const agreementInfo = ref<Agreement>({}); // 初始值为 null
|
|
|
+const authDeptlength = ref<number>(0);
|
|
|
+const feeData = ref([]);//费用数据
|
|
|
+const valid_status = ref();
|
|
|
+const valid_statusName = ref();
|
|
|
+const is_enable = ref();
|
|
|
+const is_enableName = ref();
|
|
|
+const sysUpAndDownList = ref<string[]>([])//选中id
|
|
|
+const formInline = reactive({
|
|
|
+ validState: '',//协议信息
|
|
|
+ agreementStatus: "",//归属
|
|
|
+})
|
|
|
+const columns = [
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: "costRules", label: "规则明细", width: '500',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "productName", label: "保险产品", width: '120',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "isEnabled", label: "费用状态", width: '100', component: "Tag",
|
|
|
+ formatter: (row: any) => {
|
|
|
+ let name = getDict('is_enable').find(val => val.value == row.isEnabled).label
|
|
|
+ if (name) {
|
|
|
+ return { type: 'primary', text: name };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "approved", label: "有效状态", width: '120', component: "Tag", formatter: (row: any) => {
|
|
|
+ if (row.isValid == '0') {
|
|
|
+ return { type: 'primary', text: '生效中' }
|
|
|
+ } else {
|
|
|
+ return { type: 'danger', text: '已失效' }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { prop: "effectiveTime", label: "生效时间", width: '200' },
|
|
|
+ { prop: "failureTime", label: "失效时间", width: '200' },
|
|
|
+ {
|
|
|
+ prop: "ruleConditions", label: "交强费用", width: '300', formatter: (row: any) => {
|
|
|
+ let info = row.ruleConditions.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 {
|
|
|
+ return '-';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "ruleConditions", label: "商业费用", width: '300', formatter: (row: any) => {
|
|
|
+ let info = row.ruleConditions.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 {
|
|
|
+ return '-';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "ruleConditions", label: "驾意险费用", width: '300', formatter: (row: any) => {
|
|
|
+ let info = row.ruleConditions.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 {
|
|
|
+ return '-';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+];
|
|
|
+onBeforeMount(async () => {
|
|
|
+ await loadDicts(['valid_status', 'is_enable']);//获取多个字典
|
|
|
+ if (id.value) {
|
|
|
+ detailsInfo();//协议信息
|
|
|
+ findpage();
|
|
|
+ valid_status.value = getDict('valid_status')
|
|
|
+ is_enable.value = getDict('is_enable')
|
|
|
+ }
|
|
|
+})
|
|
|
+//协议详情
|
|
|
+const detailsInfo = () => {
|
|
|
+ api.agreementApi.agreementGet(id.value).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ res.data.agreement.fileName = processFileName(res.data.agreement.fileName)
|
|
|
+ res.data.agreement.fileSize = formatFileSize(res.data.agreement.fileSize);
|
|
|
+ agreementInfo.value = res.data.agreement;
|
|
|
+ authDeptlength.value = res.data.dept.length;
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+//费用数据查询
|
|
|
+function findpage() {
|
|
|
+ api.agreementApi.queryByFeePage({ pages: 1, size: 100, ...formInline }).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ feeData.value = res.data.records;
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+//费用复制
|
|
|
+const agreementcopy = () => {
|
|
|
+ api.agreementApi.agreementCopy({id:id.value,costIds:sysUpAndDownList.value}).then((res: any) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ plain: true,
|
|
|
+ })
|
|
|
+ router.back()
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+//多选事件
|
|
|
+const selectionChange = (val: any) => {
|
|
|
+ console.log(val)
|
|
|
+ sysUpAndDownList.value = val;
|
|
|
+}
|
|
|
+const validStateCommand = (e: any) => {
|
|
|
+ let info = valid_status.value.find((val: any) => val.label == e);
|
|
|
+ valid_statusName.value = info.label;
|
|
|
+ formInline.validState = info.value;
|
|
|
+ findpage();
|
|
|
+
|
|
|
+}
|
|
|
+const agreementStatusCommand = (e: any) => {
|
|
|
+ let info = is_enable.value.find((val: any) => val.label == e);
|
|
|
+ is_enableName.value = info.label;
|
|
|
+ formInline.agreementStatus = info.value;
|
|
|
+ findpage();
|
|
|
+}
|
|
|
+</script>
|
|
|
+<!-- 样式区域 -->
|
|
|
+<style lang='scss' scoped>
|
|
|
+.headers {
|
|
|
+ border-bottom: 1px solid #f2f2f2;
|
|
|
+}
|
|
|
+
|
|
|
+.grayBlock {
|
|
|
+ padding: 8px 10px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #666;
|
|
|
+ background: #f2f2f2;
|
|
|
+ border-radius: 4px;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-descriptions__cell) {
|
|
|
+ width: 33.33%;
|
|
|
+}
|
|
|
+</style>
|