Browse Source

reactor:对接中心待办件;

zhangchong 1 year ago
parent
commit
40b6de15e5
3 changed files with 76 additions and 262 deletions
  1. 2 1
      src/api/business/order.ts
  2. 27 0
      src/api/todo/center.ts
  3. 47 261
      src/views/todo/center/index.vue

+ 2 - 1
src/api/business/order.ts

@@ -219,4 +219,5 @@ export const provinceReturn = (data: object) => {
 		method: 'post',
 		data
 	});
-}
+}
+

+ 27 - 0
src/api/todo/center.ts

@@ -0,0 +1,27 @@
+/*
+ * @Author: zc
+ * @description 业务办理-中心待办件
+ */
+import request from '@/utils/request';
+/**
+ * @description 中心待办件基础信息
+ * @param {object} params
+ */
+export const centerTodoBase = (params?: object) => {
+  return request({
+    url: `/api/v1/Order/waited/center/base`,
+    method: 'get',
+    params
+  });
+}
+/**
+ * @description 中心待办件
+ * @param {object} params
+ */
+export const centerTodo = (params: object) => {
+  return request({
+    url: `/api/v1/Order/waited/center`,
+    method: 'get',
+    params
+  });
+}

+ 47 - 261
src/views/business/center/todo.vue → src/views/todo/center/index.vue

@@ -1,14 +1,6 @@
 <template>
-	<div class="business-center-todo-container layout-pd">
+	<div class="todo-center-container layout-pd">
 		<el-card shadow="never">
-			<div class="flex-center-align mb20">
-				<span style="color: var(--el-text-color-regular); display: inline-block; width: 100px; text-align: right; padding-right: 12px">快捷查询</span>
-				<el-radio-group v-model="fastSearch" @change="fastSearchChange">
-					<el-radio-button label="all">全部</el-radio-button>
-					<el-radio-button label="city">市工单</el-radio-button>
-					<el-radio-button label="province">省工单</el-radio-button>
-				</el-radio-group>
-			</div>
 			<el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent label-width="100px">
 				<el-row :gutter="10">
 					<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
@@ -31,7 +23,7 @@
 								start-placeholder="开始时间"
 								end-placeholder="结束时间"
 								:shortcuts="shortcuts"
-								@change="timeStartChangeEx"
+								@change="timeStartChangeSc"
 								value-format="YYYY-MM-DD[T]HH:mm:ss"
 							/>
 						</el-form-item>
@@ -55,39 +47,24 @@
 					</transition>
 					<transition name="el-zoom-in-top">
 						<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol">
-							<el-form-item label="当前办理节点" prop="CurrentStepCode">
-								<el-select v-model="state.queryParams.CurrentStepCode" placeholder="请选择当前办理节点" clearable class="w100" @change="handleQuery">
-									<el-option v-for="item in state.currentStepOptions" :value="item.key" :key="item.key" :label="item.value" />
+							<el-form-item label="当前办理节点" prop="StepName">
+								<el-select v-model="state.queryParams.StepName" placeholder="请选择当前办理节点" clearable class="w100" @change="handleQuery">
+									<el-option v-for="item in state.stepNamesOptions" :value="item" :key="item" :label="item" />
 								</el-select>
 							</el-form-item>
 						</el-col>
 					</transition>
 					<transition name="el-zoom-in-top">
 						<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol">
-							<el-form-item label="接办部门" prop="OrgCodes">
-								<el-cascader
-									:options="state.orgsOptions"
-									filterable
-									:show-all-levels="false"
-									:props="{ checkStrictly: true, value: 'id', label: 'name', emitPath: false, multiple: true }"
-									placeholder="请选择接办部门"
-									clearable
-									class="w100"
-									v-model="state.queryParams.OrgCodes"
-									ref="cascadeRef"
-									@change="changeOrg"
-									collapse-tags
-									collapse-tags-tooltip
-									:max-collapse-tags="2"
-								>
-								</el-cascader>
+							<el-form-item label="接办部门" prop="ActualHandleOrgName">
+								<el-input v-model="state.queryParams.ActualHandleOrgName" placeholder="接办部门名称" clearable @keyup.enter="handleQuery" />
 							</el-form-item>
 						</el-col>
 					</transition>
 					<transition name="el-zoom-in-top">
 						<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol">
-							<el-form-item label="工单状态" prop="Statuses">
-								<el-select v-model="state.queryParams.Statuses" placeholder="请选择工单状态" clearable class="w100" multiple>
+							<el-form-item label="工单状态" prop="Status">
+								<el-select v-model="state.queryParams.Status" placeholder="请选择工单状态" clearable class="w100" @change="handleQuery">
 									<el-option v-for="item in state.orderStatusOptions" :value="item.key" :key="item.key" :label="item.value" />
 								</el-select>
 							</el-form-item>
@@ -95,15 +72,17 @@
 					</transition>
 					<transition name="el-zoom-in-top">
 						<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol">
-							<el-form-item label="受理人" prop="NameOrNo">
-								<el-input v-model="state.queryParams.NameOrNo" placeholder="受理人/坐席工号" clearable @keyup.enter="handleQuery" />
+							<el-form-item label="受理人" prop="AcceptorName">
+								<el-input v-model="state.queryParams.AcceptorName" placeholder="受理人" clearable @keyup.enter="handleQuery" />
 							</el-form-item>
 						</el-col>
 					</transition>
 					<transition name="el-zoom-in-top">
 						<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol">
-							<el-form-item label="超期状态" prop="NameOrNo">
-								<el-input v-model="state.queryParams.NameOrNo" placeholder="受理人/坐席工号" clearable @keyup.enter="handleQuery" />
+							<el-form-item label="超期状态" prop="ExpiredStatus">
+								<el-select v-model="state.queryParams.ExpiredStatus" placeholder="请选择超期状态" clearable class="w100" @change="handleQuery">
+									<el-option v-for="item in state.expiredStatusOptions" :value="item.key" :key="item.key" :label="item.value" />
+								</el-select>
 							</el-form-item>
 						</el-col>
 					</transition>
@@ -135,30 +114,8 @@
 				:total="state.total"
 				v-model:page-index="state.queryParams.PageIndex"
 				v-model:page-size="state.queryParams.PageSize"
-				@export-current="exportCurrent"
-				@export-all="exportAll"
 				:key="Math.random()"
 			>
-				<!-- 表格 header 按钮 -->
-				<template #tableHeader="scope">
-					<el-button
-						type="primary"
-						@click="onProvinceReturn"
-						v-auth="'business:order:returnBatch'"
-						:disabled="!scope.isSelected"
-						v-show="fastSearch === 'province'"
-						:loading="state.loading"
-						>省退回申请
-					</el-button>
-					<el-button type="primary" @click="onCreateRepeatEvent" :loading="state.loading">创建重复性事件 </el-button>
-					<el-button type="primary" @click="onObserve" v-auth="'business:order:observe'" :disabled="!scope.isSelected" :loading="state.loading"
-						>设置观察件
-					</el-button>
-					<el-button type="primary" @click="onEnd" v-auth="'business:order:end'" :disabled="!scope.isSelected" :loading="state.loading"
-						>设置终结件
-					</el-button>
-					<!--					<el-button type="primary" @click="onJbExport" :disabled="!scope.isSelected" :loading="state.loading">交办单导出 </el-button>-->
-				</template>
 				<template #expiredStatus="{ row }">
 					<span :class="'overdue-status-' + row.expiredStatus" :title="row.expiredStatusText"></span>
 				</template>
@@ -183,31 +140,23 @@
 				</template>
 			</ProTable>
 		</el-card>
-
-		<!-- 编辑重复性事件 -->
-		<repeat-event-edit ref="repeatEventEditRef" @updateList="queryList" />
 		<!-- 工单省退回 -->
 		<order-return ref="orderReturnRef" @updateList="queryList" />
 	</div>
 </template>
-<script setup lang="tsx" name="centerTodo">
+<script setup lang="tsx" name="todoCenter">
 import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
 import type { FormInstance } from 'element-plus';
-import { ElMessage, ElMessageBox, ElNotification } from 'element-plus';
+import { ElMessage, ElMessageBox } from 'element-plus';
 import { shortcuts } from '@/utils/constants';
 import other from '@/utils/other';
 import { useRoute, useRouter } from 'vue-router';
 import { formatDate } from '@/utils/formatTime';
-import { listBaseData, orderList, provinceReturn } from '@/api/business/order';
-import { addObserve } from '@/api/query/observe';
-import { addEnd } from '@/api/query/end';
-import { treeArea } from '@/api/auxiliary/area';
+import { centerTodo, centerTodoBase } from '@/api/todo/center';
 import { orderSign } from '@/api/todo/order';
 
 // 引入组件
 const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
-const RepeatEventEdit = defineAsyncComponent(() => import('@/views/business/repeatEvent/components/Repeat-event-edit.vue')); // 编辑重复性事件
-const HotSpotSelect = defineAsyncComponent(() => import('@/components/Hotspot/index.vue')); // 选择热点
 const OrderReturn = defineAsyncComponent(() => import('@/views/business/return/components/Apply.vue')); // 工单退回
 
 // 定义变量内容
@@ -216,55 +165,26 @@ const state = reactive<any>({
 		PageIndex: 1, // 当前页
 		PageSize: 10, // 每页条数
 		// 查询条件
-		No: null, // 工单编码
-		CurrentStepCode: null, // 当前办理节点
-		IsOverTime: null, // 是否超期
-		Keyword: null, // 关键字
-		OrgCodes: [], // 机构
-		NameOrNo: null, // 受理坐席
-		crTime: [], // 创建时间
-		CreationTimeStart: null, // 创建时间 开始
-		CreationTimeEnd: null, // 创建时间 结束
-		TransferPhone: null, // 转派人
-		EmergencyLevel: [], // 紧急程度
-		exTime: [], // 过期时间
-		ExpiredTimeStart: null, //办理期限 开始
-		ExpiredTimeEnd: null, //办理期限 结束
-		Statuses: [], // 状态
-		doneTime: [], // 办结时间
-		PushTypeCode: null, //推送类型
-		IsProvinceOrder: null, // 省市工单
+		No: null, // 工单编号
+		exTime: [], // 生成时间
+		StCreationTime: null, // 生成开始时间
+		EnCreationTime: null, // 生成结束时间
+		crTime: [], // 受理时间
+		StartTimeEnd: null, // 受理开始时间
+		EndTimeEnd: null, // 受理结束时间
+		AcceptorName: null, // 受理人
+		ActualHandleOrgName: null, // 接办部门
+		Status: null, // 工单状态
+		ExpiredStatus: null, // 超期状态
+		StepName: null, // 当前节点名称
 	},
 	tableData: [], //表单
 	loading: false, // 加载
 	total: 0, // 总数
-	acceptTypeOptions: [], //受理类型
-	channelOptions: [], // 来源频道
-	emergencyLevelOptions: [], // 紧急程度
-	orderStatusOptions: [], // 工单状态
-	currentStepOptions: [], // 当前办理节点
-	identityTypeOptions: [], // 来电主体
-	orgsOptions: [], // 部门
-	pushTypeOptions: [], //推送分类
-	orgData: [], // 机构数据
-	areaOptions: [], // 省市区数据
+	expiredStatusOptions: [], //超期状态
+	orderStatusOptions: [], //工单状态
+	stepNamesOptions: [], //步骤名称
 });
-const fastSearch = ref('all'); // tab位置
-const fastSearchChange = (val: string) => {
-	fastSearch.value = val;
-	switch (val) {
-		case 'all':
-			state.queryParams.IsProvinceOrder = null;
-			break;
-		case 'city':
-			state.queryParams.IsProvinceOrder = false;
-			break;
-		case 'province':
-			state.queryParams.IsProvinceOrder = true;
-			break;
-	}
-	handleQuery();
-};
 const ruleFormRef = ref<RefType>(); // 表单ref
 const searchCol = ref(true); // 展开/收起
 // 展开/收起
@@ -284,7 +204,7 @@ const selectable = (row: any) => {
 // 表格配置项
 const columns = ref<any[]>([
 	{ type: 'selection', fixed: 'left', width: 55, selectable: selectable },
-	{ prop: 'expiredStatus', label: '超期状态', align: 'center',width: 80 },
+	{ prop: 'expiredStatus', label: '超期状态', align: 'center', width: 80 },
 	{ prop: 'no', label: '工单编码', width: 150 },
 	{ prop: 'isProvince', label: '省/市工单', width: 100 },
 	{ prop: 'actualHandleStepName', label: '办理节点', width: 150 },
@@ -338,12 +258,6 @@ const columns = ref<any[]>([
 	},
 	{ prop: 'operation', label: '操作', fixed: 'right', width: 160, align: 'center' },
 ]);
-// 获取选择组织name值
-const cascadeRef = ref<RefType>();
-const changeOrg = () => {
-	let currentNode = cascadeRef.value.getCheckedNodes();
-	state.queryParams.orgCode = currentNode[0]?.data.orgCode ?? '';
-};
 const handleTimeChange = (val: string[], startKey: string, endKey: string) => {
 	if (val) {
 		state.queryParams[startKey] = val[0];
@@ -356,35 +270,24 @@ const handleTimeChange = (val: string[], startKey: string, endKey: string) => {
 };
 // 受理时间
 const timeStartChangeCr = (val: string[]) => {
-	handleTimeChange(val, 'CreationTimeStart', 'CreationTimeEnd');
+	handleTimeChange(val, 'StartTimeEnd', 'StartTimeSt');
 };
-// 过期时间
-const timeStartChangeEx = (val: string[]) => {
-	handleTimeChange(val, 'ExpiredTimeStart', 'ExpiredTimeEnd');
-};
-// 办结时间
-const timeStartChangeDone = (val: string[]) => {
-	handleTimeChange(val, 'ActualHandleTimeStart', 'ActualHandleTimeEnd');
+// 生成时间
+const timeStartChangeSc = (val: string[]) => {
+	handleTimeChange(val, 'StCreationTime', 'EndCreationTime');
 };
 // 获取查询条件基础信息
 const getBaseData = async () => {
 	try {
-		const res: any = await listBaseData();
+		const res: any = await centerTodoBase();
 		const mappings: any = {
-			acceptTypeOptions: 'acceptTypeOptions',
-			channelOptions: 'channelOptions',
-			emergencyLevelOptions: 'emergencyLevelOptions',
-			orgsOptions: 'orgsOptions',
-			pushTypeOptions: 'pushTypeOptions',
-			orderStatusOptions: 'orderStatusOptions',
-			identityTypeOptions: 'identityTypeOptions',
-			currentStepOptions: 'currentStepOptions',
+			expiredStatusOptions: 'expiredStatus',
+			orderStatusOptions: 'orderStatus',
+			stepNamesOptions: 'stepNames',
 		};
 		for (const key in mappings) {
 			state[key] = res.result?.[mappings[key]] ?? [];
 		}
-		const area = await treeArea();
-		state.areaOptions = area?.result ?? []; //省市区数据
 	} catch (error) {
 		console.log(error);
 	}
@@ -399,10 +302,8 @@ const queryList = () => {
 	let request = other.deepClone(state.queryParams);
 	Reflect.deleteProperty(request, 'crTime'); // 删除无用的参数
 	Reflect.deleteProperty(request, 'exTime'); // 删除无用的参数
-	Reflect.deleteProperty(request, 'doneTime'); // 删除无用的参数
-	Reflect.deleteProperty(request, 'AreaCode'); // 删除无用的参数
 	state.loading = true;
-	orderList(request)
+	centerTodo(request)
 		.then((response: any) => {
 			state.tableData = response?.result.items ?? [];
 
@@ -417,102 +318,12 @@ const queryList = () => {
 const resetQuery = (formEl: FormInstance | undefined) => {
 	if (!formEl) return;
 	formEl.resetFields();
-	state.queryParams.CreationTimeStart = null;
-	state.queryParams.CreationTimeEnd = null;
-	state.queryParams.ExpiredTimeStart = null;
-	state.queryParams.ExpiredTimeEnd = null;
-	state.queryParams.ActualHandleTimeStart = null;
-	state.queryParams.ActualHandleTimeEnd = null;
-	state.queryParams.IsSensitiveWord = null;
-	state.queryParams.IsProvinceOrder = null;
-	fastSearch.value = 'all';
-	checkList.value = [];
-	state.queryParams.AreaCodes = [];
+	state.queryParams.StCreationTime = null;
+	state.queryParams.EndCreationTime = null;
+	state.queryParams.StartTimeEnd = null;
+	state.queryParams.StartTimeSt = null;
 	queryList();
 };
-// 设置终结件
-const onObserve = () => {
-	const titles = proTableRef.value.selectedList.map((item: any) => item.title).join(',');
-	const ids = proTableRef.value.selectedList.map((item: any) => {
-		return {
-			orderId: item.id,
-		};
-	});
-	ElMessageBox.confirm(`确定要将【${titles}】设置观察件吗?`, '提示', {
-		confirmButtonText: '确定',
-		cancelButtonText: '取消',
-		type: 'warning',
-		draggable: true,
-		autofocus: false,
-	})
-		.then(() => {
-			addObserve({ orderIds: ids }).then(() => {
-				ElMessage.success('操作成功');
-				queryList();
-			});
-		})
-		.catch(() => {});
-};
-// 设置终结件
-const onEnd = () => {
-	const titles = proTableRef.value.selectedList.map((item: any) => item.title).join(',');
-	const ids = proTableRef.value.selectedList.map((item: any) => {
-		return {
-			orderId: item.id,
-		};
-	});
-	ElMessageBox.confirm(`确定要将【${titles}】设置终结件吗?`, '提示', {
-		confirmButtonText: '确定',
-		cancelButtonText: '取消',
-		type: 'warning',
-		draggable: true,
-		autofocus: false,
-	})
-		.then(() => {
-			addEnd({ orderIds: ids }).then(() => {
-				ElMessage.success('操作成功');
-				queryList();
-			});
-		})
-		.catch(() => {});
-};
-// 省退回申请
-const onProvinceReturn = () => {
-	const titles = proTableRef.value.selectedList.map((item: any) => item.title).join(',');
-	const ids = proTableRef.value.selectedList.map((item: any) => {
-		return {
-			orderId: item.id,
-		};
-	});
-	ElMessageBox.prompt(`【${titles}】的退回原因`, '提示', {
-		confirmButtonText: '确定',
-		cancelButtonText: '取消',
-		draggable: true,
-		autofocus: false,
-		inputPlaceholder: '请填写退回原因,不超过50字符',
-		inputErrorMessage: '请填写退回原因',
-		inputType: 'textarea',
-		inputValidator: (value) => {
-			if (value) return true;
-			else return '请填写退回原因';
-		},
-	})
-		.then(({ value }) => {
-			provinceReturn({ orderIds: ids, content: value }).then((res: any) => {
-				ElNotification({
-					title: '退回完成',
-					dangerouslyUseHTMLString: true,
-					message: `<div>
-  <div>总退回条数:${res.result.count}条;</>
-  <div>成功条数:${res.result.successCount}条;</div>
-  <div>失败条数:${res.result.errorCount}条;</div>
-</div>`,
-				});
-				queryList();
-			});
-		})
-		.catch(() => {});
-};
 // 签收工单
 const onSign = (row: any) => {
 	ElMessageBox.confirm(`您确定要要签收【${row.title}】,是否继续?`, '提示', {
@@ -531,11 +342,6 @@ const onSign = (row: any) => {
 		})
 		.catch(() => {});
 };
-// 创建重复性事件
-const repeatEventEditRef = ref<RefType>();
-const onCreateRepeatEvent = () => {
-	repeatEventEditRef.value.openDialog();
-};
 // 编辑工单
 const onOrderEdit = (row: any) => {
 	router.push({
@@ -547,26 +353,6 @@ const onOrderEdit = (row: any) => {
 		},
 	});
 };
-const exportCurrent = () => {
-	console.log('导出当前页', proTableRef.value);
-};
-const exportAll = () => {
-	console.log('导出全部', proTableRef.value);
-};
-// 交办单导出
-const onJbExport = () => {
-	const ids = proTableRef.value.selectedList.map((item: any) => item.id);
-	ElMessageBox.confirm(`您确定导出选中的${proTableRef.value.selectedList.length}个工单的交办单,是否继续?`, '提示', {
-		confirmButtonText: '确认',
-		cancelButtonText: '取消',
-		type: 'warning',
-		draggable: true,
-		cancelButtonClass: 'default-button',
-		autofocus: false,
-	})
-		.then(() => {})
-		.catch(() => {});
-};
 onMounted(() => {
 	getBaseData();
 	queryList();