浏览代码

reactor:对接发布待办,回访待办平移功能;编辑发布能修改门户是否公开;

zhangchong 10 月之前
父节点
当前提交
deeb627e0f

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

@@ -46,3 +46,34 @@ export const migrationOrderChange = (data: object) => {
     data
   });
 }
+/**
+ * @description 查询发布和回访平移待办理人
+ */
+export const migrationOrderList = () => {
+  return request({
+    url: `/api/v1/Order/published/migration`,
+    method: 'get',
+  });
+}
+/**
+ * @description 发布平移
+ * @param {object} data
+ */
+export const migrationOrderPublish = (data: object) => {
+  return request({
+    url: `/api/v1/Order/publish/migration`,
+    method: 'post',
+    data
+  });
+}
+/**
+ * @description 回访平移
+ * @param {object} data
+ */
+export const migrationOrderVisit = (data: object) => {
+  return request({
+    url: `/api/v1/Order/visit/migration`,
+    method: 'post',
+    data
+  });
+}

+ 1 - 1
src/views/business/publish/component/Order-publish-edit.vue

@@ -145,6 +145,7 @@ const state = reactive<any>({
 		arrangeTitle: '', // 整改后标题
 		arrangeContent: '', // 整改后内容
 		arrangeOpinion: '', // 整改后结果
+    publishState:null, // 门户是否公开
 	},
 	orderDetail: {}, // 工单详情
 	publishDetail: {}, // 发布详情
@@ -162,7 +163,6 @@ const openDialog = async (row: any) => {
 		state.orderDetail = row.order ?? {};
 		const [res, response] = await Promise.all([baseData(row.order.id), publishOrderDetail(row.id)]);
 		state.ruleForm = response.result ?? {};
-
 		state.publishDetail = res.result ?? {};
 		idNamesArray.value = res.result?.idNames ?? [];
 		state.loading = false;

+ 17 - 9
src/views/business/publish/todo.vue

@@ -41,6 +41,9 @@
 					<el-button type="primary" @click="publishMultiple" v-auth="'business:publish:todo:multiple'" :disabled="!scope.isSelected">
 						<SvgIcon name="iconfont icon-tianjiawenjian" class="mr5" />批量发布
 					</el-button>
+					<el-button type="primary" @click="onMigration" v-auth="'business:publish:todo:migration'" :disabled="!scope.isSelected">
+						<SvgIcon name="ele-Rank" class="mr5" />平级移动
+					</el-button>
 				</template>
 				<template #title="{ row }">
 					<order-detail :order="row" @updateList="queryList">{{ row.title }}</order-detail>
@@ -48,12 +51,14 @@
 				<!-- 表格操作 -->
 				<template #operation="{ row }">
 					<el-button link type="primary" @click="publish(row)" title="发布工单" v-auth="'business:publish:todo:publish'"> 发布 </el-button>
-          <el-button link type="primary" @click="onTranslation(row)" title="平移功能" v-auth="'business:publish:todo:translation'"> 平移 </el-button>
+					<order-detail :order="row" @updateList="queryList" />
 				</template>
 			</ProTable>
 		</el-card>
 		<!-- 工单发布详情 -->
 		<order-publish ref="orderPublishRef" @updateList="queryList" />
+		<!-- 工单平移 -->
+		<order-migration ref="orderMigrationRef" @updateList="queryList" />
 	</div>
 </template>
 <script setup lang="tsx" name="businessPublishTodo">
@@ -64,6 +69,7 @@ import { batchPublishOrder, publishList } from '@/api/todo/publish';
 // 引入组件
 const OrderPublish = defineAsyncComponent(() => import('@/views/business/publish/component/Order-publish.vue')); // 发布
 const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
+const OrderMigration = defineAsyncComponent(() => import('@/views/todo/center/Order-migration.vue')); // 工单平移
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive({
@@ -86,7 +92,7 @@ const selectable = (row: any) => {
 };
 // 表格配置项
 const columns = ref<any[]>([
-	{ type: 'selection', selectable: selectable, fixed: 'left', width: 55,align: 'center' },
+	{ type: 'selection', selectable: selectable, fixed: 'left', width: 55, align: 'center' },
 	{ prop: 'no', label: '工单编码', width: 150 },
 	{ prop: 'isProvinceText', label: '省/市工单', width: 100 },
 	{ prop: 'statusText', label: '发布状态', width: 100 },
@@ -124,8 +130,8 @@ const columns = ref<any[]>([
 ]);
 // 手动查询,将页码设置为1
 const handleQuery = () => {
-  state.queryParams.PageIndex = 1;
-  queryList();
+	state.queryParams.PageIndex = 1;
+	queryList();
 };
 /** 获取列表 */
 const queryList = () => {
@@ -139,13 +145,13 @@ const queryList = () => {
 		.catch(() => {
 			state.loading = false;
 		});
-}
+};
 /** 重置按钮操作 */
 const resetQuery = (formEl: FormInstance | undefined) => {
 	if (!formEl) return;
 	formEl.resetFields();
 	queryList();
-}
+};
 // 批量发布
 const publishMultiple = () => {
 	const ids = proTableRef.value.selectedList.map((item: any) => item.id);
@@ -171,9 +177,11 @@ const publish = (row: any) => {
 	orderPublishRef.value.openDialog(row);
 };
 // 平移功能
-const onTranslation = (row: any) => {
-
-}
+const orderMigrationRef = ref<RefType>();
+const onMigration = () => {
+	const ids = proTableRef.value.selectedList.map((item: any) => item.id);
+	orderMigrationRef.value.openDialog('publishTodo', ids);
+};
 onMounted(() => {
 	queryList();
 });

+ 11 - 3
src/views/business/visit/index.vue

@@ -5,8 +5,13 @@
 			<el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent>
 				<el-row :gutter="20">
 					<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
-						<el-form-item label="关键字" prop="Keyword">
-							<el-input v-model="state.queryParams.Keyword" placeholder="工单编码/标题" clearable @keyup.enter="handleQuery" />
+						<el-form-item label="工单标题" prop="Keyword">
+							<el-input v-model="state.queryParams.Keyword" placeholder="工单标题" clearable @keyup.enter="handleQuery" />
+						</el-form-item>
+					</el-col>
+					<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
+						<el-form-item label="工单编码" prop="No">
+							<el-input v-model="state.queryParams.No" placeholder="工单编码" clearable @keyup.enter="handleQuery" />
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
@@ -17,7 +22,8 @@
 							</el-select>
 						</el-form-item>
 					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
+          <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="IsCountersign">
 							<el-select v-model="state.queryParams.IsCountersign" placeholder="请选择是否会签" @change="handleQuery" class="w100">
 								<el-option label="是" value="true" />
@@ -25,6 +31,7 @@
 							</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="VisitState">
@@ -184,6 +191,7 @@ const state = reactive({
 		Keyword: null, // 关键字
 		VisitState: null, // 回访状态
 		VisitType: null, // 回访方式
+		No: null,
 	},
 	tableData: [], //表单
 	loading: false, // 加载

+ 30 - 10
src/views/business/visit/todo.vue

@@ -5,8 +5,13 @@
 			<el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent>
 				<el-row :gutter="20">
 					<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
-						<el-form-item label="关键字" prop="Keyword">
-							<el-input v-model="state.queryParams.Keyword" placeholder="工单编码/标题" clearable @keyup.enter="handleQuery" />
+						<el-form-item label="工单标题" prop="Keyword">
+							<el-input v-model="state.queryParams.Keyword" placeholder="工单标题" clearable @keyup.enter="handleQuery" />
+						</el-form-item>
+					</el-col>
+					<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
+						<el-form-item label="工单编码" prop="No">
+							<el-input v-model="state.queryParams.No" placeholder="工单编码" clearable @keyup.enter="handleQuery" />
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
@@ -17,14 +22,16 @@
 							</el-select>
 						</el-form-item>
 					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
-						<el-form-item label="是否会签" prop="IsCountersign">
-							<el-select v-model="state.queryParams.IsCountersign" placeholder="请选择是否会签" @change="handleQuery" class="w100">
-								<el-option label="是" value="true" />
-								<el-option label="否" value="false" />
-							</el-select>
-						</el-form-item>
-					</el-col>
+					<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="IsCountersign">
+								<el-select v-model="state.queryParams.IsCountersign" placeholder="请选择是否会签" @change="handleQuery" class="w100">
+									<el-option label="是" value="true" />
+									<el-option label="否" value="false" />
+								</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="VisitType">
@@ -66,6 +73,9 @@
 					<el-button type="primary" @click="multiplePeople" :disabled="!scope.isSelected" v-auth="'business:visit:todo:multiplePeople'">
 						<SvgIcon name="ele-User" class="mr5" />分配回访人</el-button
 					>
+					<el-button type="primary" @click="onMigration" v-auth="'business:visit:todo:migration'" :disabled="!scope.isSelected">
+						<SvgIcon name="ele-Rank" class="mr5" />平级移动
+					</el-button>
 				</template>
 				<template #title="{ row }">
 					<order-detail :order="row.order" @updateList="queryList">{{ row.order?.title }}</order-detail>
@@ -84,6 +94,8 @@
 		<visit-detail ref="visitDetailRef" @updateList="queryList" />
 		<!--  分配回访人  -->
 		<assign-return-visitors ref="assignReturnVisitorsRef" @updateList="queryList" />
+		<!-- 工单平移 -->
+		<order-migration ref="orderMigrationRef" @updateList="queryList" />
 	</div>
 </template>
 
@@ -98,6 +110,7 @@ import { visitSearchBaseData } from '@/api/business/visit';
 const VisitDetail = defineAsyncComponent(() => import('/src/views/business/visit/component/Visit-detail.vue')); // 回访
 const AssignReturnVisitors = defineAsyncComponent(() => import('@/views/business/visit/component/Assign-return-visitors.vue')); // 分配回访人
 const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
+const OrderMigration = defineAsyncComponent(() => import('@/views/todo/center/Order-migration.vue')); // 工单平移
 
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
@@ -172,6 +185,7 @@ const state = reactive({
 		IsCountersign: null, // 是否会签
 		VisitState: '2', // 回访状态 待回访
 		VisitType: null, // 回访方式
+		No: null,
 	},
 	tableData: [], //表单
 	loading: false, // 加载
@@ -242,6 +256,12 @@ const visitDetailRef = ref<RefType>();
 const onManpower = (row: any) => {
 	visitDetailRef.value.openDialog(row);
 };
+// 平移功能
+const orderMigrationRef = ref<RefType>();
+const onMigration = () => {
+	const ids = proTableRef.value.selectedList.map((item: any) => item.id);
+	orderMigrationRef.value.openDialog('visitTodo', ids);
+};
 onMounted(() => {
 	getBaseData();
 	queryList();

+ 66 - 9
src/views/todo/center/Order-migration.vue

@@ -21,6 +21,7 @@
 			v-model:radio="tableRadio"
 			@current-change="handleSelectionChange"
 			row-key="userId"
+			max-height="500px"
 		>
 		</ProTable>
 		<template #footer>
@@ -36,7 +37,7 @@
 import { reactive, ref } from 'vue';
 import { ElMessage, FormInstance } from 'element-plus';
 import { throttle } from '@/utils/tools';
-import { migrationOrder, migrationOrderChange } from '@/api/todo/center';
+import { migrationOrder, migrationOrderChange, migrationOrderList, migrationOrderPublish, migrationOrderVisit } from '@/api/todo/center';
 
 // 定义子组件向父组件传值/事件
 const emit = defineEmits(['updateList']);
@@ -56,7 +57,7 @@ const state = reactive<any>({
 const proTableRef = ref<RefType>(); // 表格ref
 // 表格配置项
 const columns = ref<any[]>([
-	{ type: 'radio', fixed: 'left', width: 80, label: '请选择' },
+	{ type: 'radio', fixed: 'left', width: 80, label: '请选择', align: 'center' },
 	{ prop: 'username', label: '用户名称' },
 	{ prop: 'orgName', label: '任职部门' },
 	{ prop: 'roleNames', label: '用户职位' },
@@ -67,7 +68,7 @@ const queryList = async () => {
 	state.dialogVisible = true;
 	loading.value = true;
 	switch (migrationType.value) {
-		case '中心待办':
+		case 'centerTodo':
 			const { result } = await migrationOrder(dataRow.value.id);
 			stepId.value = result.stepId;
 			state.tableData = result.handlers;
@@ -78,7 +79,16 @@ const queryList = async () => {
 			}
 			loading.value = false;
 			break;
-		case '发布待办':
+		case 'publishTodo':
+    case 'visitTodo':
+			const response = await migrationOrderList();
+			state.tableData = response.result;
+			if (state.queryParams.name) {
+				state.tableData = state.tableData.filter((data: any) => {
+					return String(data['username']).toLowerCase().indexOf(state.queryParams.name) > -1;
+				});
+			}
+			loading.value = false;
 			break;
 		default:
 			break;
@@ -108,9 +118,19 @@ const ruleFormRef = ref<RefType>();
 const migrationType = ref<string>(''); // 移动类型
 const stepId = ref<string>(''); // 平移ID
 const dataRow = ref<EmptyObjectType>({}); // 当前数据
-const openDialog = async (type: string, row: any) => {
+const orderIds = ref<string[]>([]); // 工单ID
+const openDialog = async (type: string, formData: any) => {
 	migrationType.value = type;
-	dataRow.value = row;
+	switch (type) {
+		case 'centerTodo':
+			dataRow.value = formData;
+			break;
+		case 'publishTodo' || 'visitTodo':
+			orderIds.value = formData;
+			break;
+		default:
+			break;
+	}
 	try {
 		await queryList();
 	} catch (error) {
@@ -124,9 +144,8 @@ const closeDialog = () => {
 // 保存
 const onSubmit = throttle(async () => {
 	loading.value = true;
-
 	switch (migrationType.value) {
-		case '中心待办':
+		case 'centerTodo': // 中心待办
 			const request = {
 				stepId: stepId.value,
 				handler: selectRow.value,
@@ -146,7 +165,45 @@ const onSubmit = throttle(async () => {
 					loading.value = false;
 				});
 			break;
-		case '发布待办':
+		case 'publishTodo': // 发布待办
+			const publishRequest = {
+				orderIds: orderIds.value,
+				userId: tableRadio.value,
+			};
+			migrationOrderPublish(publishRequest)
+				.then(() => {
+					ElMessage({
+						message: '平移成功',
+						type: 'success',
+					});
+					closeDialog();
+					emit('updateList');
+					loading.value = false;
+				})
+				.catch((err: any) => {
+					console.log(err);
+					loading.value = false;
+				});
+			break;
+		case 'visitTodo': // 回访待办
+			const visitRequest = {
+				orderIds: orderIds.value,
+				userId: tableRadio.value,
+			};
+			migrationOrderVisit(visitRequest)
+				.then(() => {
+					ElMessage({
+						message: '平移成功',
+						type: 'success',
+					});
+					closeDialog();
+					emit('updateList');
+					loading.value = false;
+				})
+				.catch((err: any) => {
+					console.log(err);
+					loading.value = false;
+				});
 			break;
 		default:
 			break;

+ 3 - 3
src/views/todo/center/index.vue

@@ -137,7 +137,7 @@
 					<el-button link type="success" @click="onOrderEdit(row)" title="编辑工单" v-if="row.canEdit" v-auth="'todo:center:edit'">
 						修改
 					</el-button>
-          <el-button link type="primary" @click="onTranslation(row)" title="平级移动" v-auth="'todo:center:migration'"> 平级移动 </el-button>
+          <el-button link type="primary" @click="onMigration(row)" title="平级移动" v-auth="'todo:center:migration'"> 平级移动 </el-button>
 				</template>
 			</ProTable>
 		</el-card>
@@ -356,8 +356,8 @@ const onJbExport = () => {
 };
 // 平移功能
 const orderMigrationRef = ref<RefType>();
-const onTranslation = (row: any) => {
-  orderMigrationRef.value.openDialog('中心待办',row)
+const onMigration = (row: any) => {
+  orderMigrationRef.value.openDialog('centerTodo',row)
 }
 // 表格导出
 const exportTable = (val: any, isExportAll = false) => {