浏览代码

reactor:回访待办新增排序;

zhangchong 1 月之前
父节点
当前提交
58a7ebdad4
共有 1 个文件被更改,包括 14 次插入1 次删除
  1. 14 1
      src/views/business/visit/todo.vue

+ 14 - 1
src/views/business/visit/todo.vue

@@ -1,7 +1,7 @@
 <template>
 	<div class="business-visit-todo-container layout-padding">
 		<div class="layout-padding-auto layout-padding-view pd20">
-			<vxe-grid v-bind="gridOptions" ref="gridRef" @checkbox-all="selectAllChangeEvent" @checkbox-change="selectChangeEvent">
+			<vxe-grid v-bind="gridOptions" ref="gridRef" v-on="gridEvents" @checkbox-all="selectAllChangeEvent" @checkbox-change="selectChangeEvent">
 				<template #form>
 					<el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline label-width="100px" :disabled="gridOptions.loading">
 						<el-form-item label="数据范围" prop="QuerySelf" v-auth="'business:visit:todo:querySelf'">
@@ -255,6 +255,8 @@ const state = reactive<any>({
 		CreationTimeEnd: null,
 		AiVisitResult: null, //智能回访结果
 		IsAiVisit: null, // IsAiVisit
+		SortField: null,
+		SortRule: null,
 	},
 	tableData: [], //表单
 	loading: false, // 加载
@@ -340,18 +342,21 @@ const gridOptions = reactive<any>({
 			title: '受理时间',
 			width: 160,
 			formatter: 'formatDate',
+			sortable: true,
 		},
 		{
 			field: 'order.filedTime',
 			title: '办结时间',
 			width: 160,
 			formatter: 'formatDate',
+			sortable: true,
 		},
 		{
 			field: 'publishTime',
 			title: '发布时间',
 			width: 160,
 			formatter: 'formatDate',
+			sortable: true,
 		},
 		{
 			field: 'creationTime',
@@ -404,6 +409,14 @@ const getBaseData = () => {
 		aiVisitResultOptions.value = res.result?.aiVisitResult ?? [];
 	});
 };
+const gridEvents = {
+	sortChange(val: any) {
+		state.queryParams.SortField = val.order ? val.field : null;
+		// 0 升序 1 降序
+		state.queryParams.SortRule = val.order ? (val.order == 'desc' ? 1 : 0) : null;
+		handleQuery();
+	},
+};
 // 手动查询,将页码设置为1
 const handleQuery = () => {
 	if (state.queryParams.VisitStateQuery !== 2) {