Просмотр исходного кода

补录订单增加批改记录菜单;
批改相关更换文件位置、修改名称;

郭鹏飞 1 год назад
Родитель
Сommit
c4be162162

+ 20 - 2
src/router/modules/additionalOrder.ts

@@ -51,7 +51,6 @@ const routes: RouteRecordRaw = {
       //   },
       // ]
     },
-
     {
       path: 'order',
       name: 'MyOrder',
@@ -73,7 +72,6 @@ const routes: RouteRecordRaw = {
           },
       ]
     },
-
     {
       path: 'temporarily',
       name: 'Temporarily',
@@ -82,6 +80,26 @@ const routes: RouteRecordRaw = {
         title: '暂存订单管理',
         // auth:['role.add','role.view','role.delete','role.edit']
       },
+    },
+    {
+      path: 'record',
+      name: 'AdditionalRecord',
+      component: () => import('@/views/additionalOrder/adjust/adjustRecord.vue'),
+      meta: {
+        title: '批改记录',
+      },
+      children: [
+        {
+          path: 'detail',
+          name: 'AdditionalRecordDetail',
+          component: () => import('@/views/orderBatchAdjust/recordDetail.vue'),
+          meta: {
+            title: '记录详情',
+            menu: false,
+            activeMenu: '/additionalOrder/record',
+          },
+        }
+      ]
     }
   ],
 }

+ 2 - 2
src/router/modules/insurancePolicy.ts

@@ -66,7 +66,7 @@ const routes: RouteRecordRaw = {
     {
       path: 'record',
       name: 'InsurancePolicyRecord',
-      component: () => import('@/views/insurancePolicy/record.vue'),
+      component: () => import('@/views/insurancePolicy/adjustRecord.vue'),
       meta: {
         title: '批改记录',
       },
@@ -74,7 +74,7 @@ const routes: RouteRecordRaw = {
         {
           path: 'detail',
           name: 'InsurancePolicyRecordDetail',
-          component: () => import('@/views/insurancePolicy/recordDetail.vue'),
+          component: () => import('@/views/orderBatchAdjust/recordDetail.vue'),
           meta: {
             title: '记录详情',
             menu: false,

+ 2 - 2
src/views/insurancePolicy/record.vue → src/views/additionalOrder/adjust/adjustRecord.vue

@@ -1,6 +1,5 @@
 <script setup lang="ts">
 import api from '@/api';
-import { ref, reactive } from 'vue';
 import { useRoute, useRouter } from 'vue-router';
 import { dictData } from '@/views/localDict/index';
 import { loadDicts, getDict } from '@/utils/composables/dictService';
@@ -27,7 +26,7 @@ const pageInfo = ref<PageInfo>({
 	sizes: [10, 20, 30, 40, 50],
 	total: 0,
 });
-const columns = [
+const columns: any = [
 	{
 		prop: "orderNo", label: "订单号", width: 200,
 	},
@@ -127,6 +126,7 @@ const initialForm = {
 	time: [],
 	endDate: '',
 	startDate: '',
+	entryStatus: 3
 };
 const formInline = ref<any>({ ...initialForm });
 

+ 4 - 3
src/views/additionalOrder/order/index.vue

@@ -350,8 +350,8 @@
 
 <script setup lang="ts">
 import api from '@/api';
-import DialogInsuranceEdit from '@/views/insurancePolicy/modules/DialogInsuranceEdit.vue';
-import DialogInsuranceCancel from '@/views/insurancePolicy/modules/DialogInsuranceCancel.vue';
+import DialogInsuranceEdit from '@/views/orderBatchAdjust/DialogInsuranceEdit.vue';
+import DialogInsuranceCancel from '@/views/orderBatchAdjust/DialogInsuranceCancel.vue';
 import { useRouter } from 'vue-router';
 import { dictData } from '@/views/localDict/index';
 import { ElMessage, ElMessageBox } from "element-plus";
@@ -535,11 +535,12 @@ const initCompany = () => {
 const onClick = (type: any, row: any) => {
   api.insurancePolicyApi.adjustAdd({
     type: type,
-    orderNo: row.orderNo,
+    orderNo: row.id,
   }).then((res: any) => {
     if(res.code == 200) {
       formData.value = {
         ...row,
+        orderNo: row.id,
         adjustId: res.data.id,
         tableList: type === 1 ? res.data.changeInfoVosList : res.data.infoVosList
       };

+ 246 - 0
src/views/insurancePolicy/adjustRecord.vue

@@ -0,0 +1,246 @@
+<script setup lang="ts">
+import api from '@/api';
+import { useRoute, useRouter } from 'vue-router';
+import { dictData } from '@/views/localDict/index';
+import { loadDicts, getDict } from '@/utils/composables/dictService';
+import { downloadByData } from '@/utils/composables/download';
+
+interface PageInfo {
+  pageNum: number;
+  pageSize: number;
+  sizes: number[];
+  total: number;
+}
+// router
+const route = useRoute();
+const router = useRouter();
+// state
+const typeData = dictData.ADJUST_TYPEDATA;
+const statusData = dictData.ADJUST_STATUSDATA;
+const companyData = ref([]);
+// table
+const tableData = ref([]);
+const pageInfo = ref<PageInfo>({
+	pageNum: 1,
+	pageSize: 10,
+	sizes: [10, 20, 30, 40, 50],
+	total: 0,
+});
+const columns: any = [
+	{
+		prop: "orderNo", label: "订单号", width: 200,
+	},
+	{ 
+		prop: "licenseNo", label: "车牌号", width: 100,
+	},
+	{ 
+		prop: "companyName", label: "保险公司", width: 200,
+	},
+	{
+		prop: "premium", label: "保费", width: 150,
+		formatter: (row: any) => {
+			return '¥' + row.premium
+		}
+	},
+	{
+		prop: "status", label: "批单状态", width: 150, component: "Tag",
+		formatter: (row: any) => {
+			// let name = getDict('is_enable').find(val => val.value == 1).label;
+			// 批单状态 0.订单批改中 1.待审核 2.审核通过 3.退回修改 4.拒绝批改
+			let name = statusData.find(val => val.value == row.status)?.label;
+			let type = 'primary';
+			if (row.status === 4) {
+				type = 'danger';
+			} else if (row.status === 3) {
+				type = 'warning';
+			}
+			return { type: type, text: name };
+		}
+	},
+	{ 
+		prop: "type", label: "批改类型", width: 150,
+		formatter: (row: any) => {
+			let name = typeData.find(val => val.value == row.type)?.label;
+			return name;
+		}
+	},
+	{ 
+		prop: "changePremium", label: "保费变化", width: 150,
+		formatter: (row: any) => {
+			if (!row.afterPremium) {
+				return '--';
+			}
+			let val = (((row.premium * 100) - (row.afterPremium * 100)) / 100);
+			return val > 0 ? `-¥${val}` : `¥${Math.abs(val)}`;
+		}
+	},
+	{ 
+		prop: "afterPremium", label: "批改后保费", width: 150,
+		formatter: (row: any) => {
+			return row.afterPremium ? `¥${row.afterPremium}` : '--';
+		}
+	},
+	{ 
+		prop: "createBy", label: "批改人", width: 150,
+	},
+	{ 
+		prop: "createTime", label: "批改时间", width: 200,
+	},
+];
+// search
+const fields = computed(() => {
+	return [
+		{
+			label: "订单号", model: "orderNo", type: "input", placeholder: "输入订单号查找",
+		},
+		{
+			label: "车牌号", model: "licenseNo", type: "input", placeholder: "输入车牌号查找",
+		},
+		{
+			label: "保险公司", model: "companyId", type: "select", filterable: true, options: companyData.value,
+		},
+		{
+			label: "业务员信息", model: "salesman", type: "input", placeholder: "输入业务员姓名、手机号查找",
+		},
+		{
+			label: "录入类型", model: "entryStatus", type: "select", closeable: false, options: dictData.ADJUST_ENTRYSTATUSDATA,
+		},
+		{
+			label: "批改状态", model: "status", type: "select", options: statusData,
+		},
+		{
+			label: "批改类型", model: "type", type: "select", options: typeData,
+		},
+		{
+			label: "批改时间", model: "time", type: "date", dateType: "datetimerange", startplaceholder: "开始时间", endplaceholder: "结束时间",
+			onChange: (value: any) => {
+				if (value) {
+					formInline.value.endDate = value[1];
+					formInline.value.startDate = value[0];
+				} else {
+					formInline.value.endDate = '';
+					formInline.value.startDate = '';
+				}
+			}
+		},
+	]
+});
+const initialForm = {
+	time: [],
+	endDate: '',
+	startDate: '',
+	entryStatus: 1
+};
+const formInline = ref<any>({ ...initialForm });
+
+// 生命周期
+onBeforeMount(async () => {
+	// 路由参数
+	if (route.query.orderNo) formInline.value.orderNo = route.query.orderNo;
+	// 获取多个字典
+	// await loadDicts(['valid_status', 'is_enable', 'audit_status', 'insurance_type']);
+	api.insuranceApi.leftList('').then((res: any) => {
+        if(res.code == 200) {
+            companyData.value = res.data.map((item: any) => ({
+				label: item.name,
+				value: item.id
+			}));
+        }
+    });
+	// table数据
+	getData();
+});
+
+// 分页数据
+const getData = () => {
+	const { time, ...params } = formInline.value;
+	api.insurancePolicyApi.adjustList({ 
+		pages: pageInfo.value.pageNum, 
+		size: pageInfo.value.pageSize, 
+		...params
+	}).then((res: any) => {
+		if (res.code == '200') {
+			tableData.value = res.data.records;
+			// 分页
+			pageInfo.value.total = res.data.total;
+			pageInfo.value.pageNum = res.data.current;
+			pageInfo.value.pageSize = res.data.size;
+		}
+	});
+};
+// 搜索事件
+const searchForm = () => {
+	getData();
+}
+const resetForm = () => {
+	formInline.value = { ...initialForm };
+	getData();
+}
+// 分页事件
+const getList = (item: PageInfo) => {
+	pageInfo.value.pageNum = item.pageNum;
+	pageInfo.value.pageSize = item.pageSize;
+	getData();
+};
+// 多选事件
+const selectionChange = (val: any) => {
+	console.log('sel', val)
+};
+// 导出事件
+const exportLoading = ref(false);
+const handleExport = () => {
+	exportLoading.value = true;
+	const { time, ...params } = formInline.value;
+    api.insurancePolicyApi.exportAdjustList(params).then((res: any) => {
+        const fileName = '批改明细' + new Date().getTime() + '.xlsx';
+		downloadByData(res, fileName, 'application/vnd.ms-excel');
+    }).finally(() => {
+		exportLoading.value = false;
+	});
+}
+// 详情
+const toDetail = (e: any) => {
+    router.push({
+        path: '/insurancePolicy/record/detail',
+        query: {
+            id: e.operationData.id,
+			orderNo: e.operationData.orderNo,
+        }
+    });
+	// window.open(`/#/insurancePolicy/record/detail?id=${e.operationData.id}&orderNo=${e.operationData.orderNo}`, '_blank');
+}
+
+defineOptions({
+	name: 'InsurancePolicyRecord',
+})
+</script>
+
+<template>
+	<PageMain class="vh100">
+		<SearchForm :isOffset="true"
+			:fields="fields" :formInline="formInline" 
+			:onSearch="searchForm" :onReset="resetForm" 
+		/>
+		<ComplexTable 
+			:columns="columns" :columnwidth="200" 
+			:showIndex="false" :showSelect="true"
+			:pageInfo="pageInfo" 
+			:tableData="tableData" 
+			@getList="getList" 
+			@selectionChange="selectionChange">
+			<template v-slot:table-title-btn>
+				<el-button class="radius-2px width-100" type="primary" :loading="exportLoading" @click="handleExport">导出</el-button>
+			</template>
+			<template v-slot:operation="scope">
+				<el-button type="primary" link 
+					@click="toDetail(scope)">
+					详情
+				</el-button>
+			</template>
+		</ComplexTable>
+	</PageMain>
+</template>
+
+<style lang="scss" scoped>
+/* 样式 */
+</style>

+ 6 - 6
src/views/insurancePolicy/order.vue

@@ -153,8 +153,8 @@
 
 <script setup lang="ts">
 import api from '@/api';
-import DialogInsuranceEdit from './modules/DialogInsuranceEdit.vue';
-import DialogInsuranceCancel from './modules/DialogInsuranceCancel.vue';
+import DialogInsuranceEdit from '@/views/orderBatchAdjust/DialogInsuranceEdit.vue';
+import DialogInsuranceCancel from '@/views/orderBatchAdjust/DialogInsuranceCancel.vue';
 import { dictData } from '@/views/localDict/index';
 import { ElMessage } from "element-plus";
 import { useRouter } from 'vue-router';
@@ -226,7 +226,7 @@ const handleCancel = () => {
   initData()
 }
 // 详情
-const toDetail = (orderNo) => {
+const toDetail = (orderNo: any) => {
     router.push({
         path: '/insurancePolicy/order/insurancePolicyOrderDetail',
         query: {
@@ -236,7 +236,7 @@ const toDetail = (orderNo) => {
 }
 
 // 编辑
-const toEdit = (row) => {
+const toEdit = (row: any) => {
     router.push({
         name: 'InsurancePolicy',
         query: {
@@ -248,7 +248,7 @@ const toEdit = (row) => {
 // 支付码
 let payCodeShow = ref(false)
 let payCodeUrl = ref('')
-const payCode = (scope) => {
+const payCode = (scope: any) => {
     payCodeShow.value = true
     api.insurancePolicyApi.getQrCode(scope.row.orderNo).then((res: any) => {
         if(res.code == 200) {
@@ -263,7 +263,7 @@ const payCode = (scope) => {
     })
 }
 
-const uploadStatus = (row) => {
+const uploadStatus = (row: any) => {
   api.insurancePolicyApi.getOrderStatus({
       order:{ordersNo: row.orderNo}
   }).then((res: any) => {

+ 2 - 2
src/views/insurancePolicy/orderDetail.vue

@@ -1033,8 +1033,8 @@ import { useRoute, useRouter } from 'vue-router'
 import { ElMessage } from "element-plus";
 
 import QrcodeVue from 'qrcode.vue';
-import DialogInsuranceEdit from './modules/DialogInsuranceEdit.vue';
-import DialogInsuranceCancel from './modules/DialogInsuranceCancel.vue';
+import DialogInsuranceEdit from '@/views/orderBatchAdjust/DialogInsuranceEdit.vue';
+import DialogInsuranceCancel from '@/views/orderBatchAdjust/DialogInsuranceCancel.vue';
 
 const myRoute = useRoute()
 const myRouter = useRouter()

+ 14 - 0
src/views/localDict/index.ts

@@ -31,4 +31,18 @@ export const dictData = {
             value: 4,
         },
     ],
+    ADJUST_ENTRYSTATUSDATA: [
+        {
+            label: '车险录入',
+            value: 1,
+        },
+        {
+            label: '待客录单',
+            value: 2,
+        },
+        // {
+        //     label: '外部订单',
+        //     value: 3,
+        // },
+    ],
 };

+ 0 - 0
src/views/insurancePolicy/modules/DialogInsuranceCancel.vue → src/views/orderBatchAdjust/DialogInsuranceCancel.vue


+ 1 - 1
src/views/insurancePolicy/modules/DialogInsuranceEdit.vue → src/views/orderBatchAdjust/DialogInsuranceEdit.vue

@@ -284,7 +284,7 @@ watch(() => props.data.tableList, (val) => {
 			// 批增数据被返回时会带着数据,所以清空
 			type: '',
 			// 投保数据被返回时是null,所以修改
-			amount: !item.amount ? '投保' : item.amount,
+			amount: !item.amount || item.amount == 1 ? '投保' : item.amount,
 			// state: 0 退保 
 			state: item.kindType === 0 || (item.kindCode === 'A' || item.kindCode === 'SY_WBDWGZ') ? 0 : 1
 		}

+ 2 - 2
src/views/insurancePolicy/recordDetail.vue → src/views/orderBatchAdjust/recordDetail.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import api from '@/api';
-import DialogInsuranceEdit from './modules/DialogInsuranceEdit.vue';
-import DialogInsuranceCancel from './modules/DialogInsuranceCancel.vue';
+import DialogInsuranceEdit from './DialogInsuranceEdit.vue';
+import DialogInsuranceCancel from './DialogInsuranceCancel.vue';
 import { dictData } from '@/views/localDict/index';
 import { useRoute, useRouter } from 'vue-router';
 import { ElMessage } from 'element-plus';