소스 검색

流程调整

zhangchong 2 년 전
부모
커밋
edc6000802

+ 0 - 11
src/api/knowledge/index.ts

@@ -146,17 +146,6 @@ export const KnowledgeOntheshelf = (Id: string) => {
 		method: 'put',
 	});
 };
-/**
- * @description: 知识库撤销
- * @param {string} workFlowId
- * @return {*}
- */
-export const KnowledgeRevoke = (workFlowId: string) => {
-	return request({
-		url: `/api/v1/Knowledge/revoke?workFlowId=${workFlowId}`,
-		method: 'put',
-	});
-};
 /**
  * @description: 知识申请-关联知识-获取知识列表
  * @param {object} params

+ 20 - 19
src/api/system/workflow.ts

@@ -12,7 +12,7 @@ import request from '/@/utils/request';
  * @param {object} params
  * @return {*}
  */
- export const workflowList = (params?: object) => {
+export const workflowList = (params?: object) => {
 	return request({
 		url: '/api/v1/Workflow/definition',
 		method: 'get',
@@ -24,7 +24,7 @@ import request from '/@/utils/request';
  * @param {object} data
  * @return {*}
  */
- export const workflowAdd = (data: object) => {
+export const workflowAdd = (data: object) => {
 	return request({
 		url: '/api/v1/Workflow/definition',
 		method: 'post',
@@ -59,7 +59,7 @@ export const workflowUpdate = (data: object) => {
  * @param {string} id
  * @return {*}
  */
- export const workflowDelete = (id: object) => {
+export const workflowDelete = (id: object) => {
 	return request({
 		url: `/api/v1/Workflow/definition/${id}`,
 		method: 'delete'
@@ -70,7 +70,7 @@ export const workflowUpdate = (data: object) => {
  * @param {string} id
  * @return {*}
  */
- export const publishOnList = (id: string) => {
+export const publishOnList = (id: string) => {
 	return request({
 		url: `/api/v1/Workflow/definition/${id}/publish`,
 		method: 'post'
@@ -81,7 +81,7 @@ export const workflowUpdate = (data: object) => {
  * @param {object} data
  * @return {*}
  */
- export const publish = (data: object) => {
+export const publish = (data: object) => {
 	return request({
 		url: '/api/v1/Workflow/definition/publish',
 		method: 'post',
@@ -93,7 +93,7 @@ export const workflowUpdate = (data: object) => {
  * @param {string} id
  * @return {*}
  */
- export const workflowEnable= (id: string) => {
+export const workflowEnable = (id: string) => {
 	return request({
 		url: `/api/v1/Workflow/definition/${id}/enable`,
 		method: 'post',
@@ -104,7 +104,7 @@ export const workflowUpdate = (data: object) => {
  * @param {string} id
  * @return {*}
  */
- export const workflowDisable = (id: string) => {
+export const workflowDisable = (id: string) => {
 	return request({
 		url: `/api/v1/Workflow/definition/${id}/disable`,
 		method: 'post'
@@ -149,7 +149,7 @@ export const WorkflowHasdefine = (moduleCode?: string) => {
  * @param {object} params
  * @return {*}
  */
- export const workflowPaged = (params?: object) => {
+export const workflowPaged = (params?: object) => {
 	return request({
 		url: '/api/v1/Workflow',
 		method: 'get',
@@ -161,7 +161,7 @@ export const WorkflowHasdefine = (moduleCode?: string) => {
  * @param {string} workflowId
  * @return {*}
  */
- export const workflowNextsteps = (workflowId: string) => {
+export const workflowNextsteps = (workflowId: string) => {
 	return request({
 		url: `/api/v1/Workflow/${workflowId}/nextsteps`,
 		method: 'get',
@@ -172,7 +172,7 @@ export const WorkflowHasdefine = (moduleCode?: string) => {
  * @param {object} data
  * @return {*}
  */
- export const workflowNext = (data: object) => {
+export const workflowNext = (data: object) => {
 	return request({
 		url: '/api/v1/Workflow/next',
 		method: 'post',
@@ -184,7 +184,7 @@ export const WorkflowHasdefine = (moduleCode?: string) => {
  * @param {object} data
  * @return {*}
  */
- export const workflowPrevious = (data: object) => {
+export const workflowPrevious = (data: object) => {
 	return request({
 		url: '/api/v1/Workflow/previous',
 		method: 'post',
@@ -196,7 +196,7 @@ export const WorkflowHasdefine = (moduleCode?: string) => {
  * @param {object} data
  * @return {*}
  */
- export const workflowJump = (data: object) => {
+export const workflowJump = (data: object) => {
 	return request({
 		url: '/api/v1/Workflow/jump',
 		method: 'post',
@@ -208,7 +208,7 @@ export const WorkflowHasdefine = (moduleCode?: string) => {
  * @param {string} workflowId
  * @return {*}
  */
- export const workflowGetJump = (workflowId: string) => {
+export const workflowGetJump = (workflowId: string) => {
 	return request({
 		url: `/api/v1/Workflow/${workflowId}/jump`,
 		method: 'get'
@@ -216,13 +216,14 @@ export const WorkflowHasdefine = (moduleCode?: string) => {
 };
 /**
  * @description: 终止流程
- * @param {string} workflowId
+ * @param {object} data
  * @return {*}
  */
- export const workflowRerminate = (workflowId: string) => {
+export const workflowRerminate = (data: object) => {
 	return request({
-		url: `/api/v1/Workflow/${workflowId}/terminate`,
+		url: `/api/v1/Workflow/terminate`,
 		method: 'post',
+		data
 	});
 };
 /**
@@ -230,7 +231,7 @@ export const WorkflowHasdefine = (moduleCode?: string) => {
  * @param {string} workflowId
  * @return {*}
  */
- export const workflowRecallParams = (workflowId: string) => {
+export const workflowRecallParams = (workflowId: string) => {
 	return request({
 		url: `/api/v1/Workflow/${workflowId}/recall`,
 		method: 'get',
@@ -241,7 +242,7 @@ export const WorkflowHasdefine = (moduleCode?: string) => {
  * @param {object} data
  * @return {*}
  */
- export const workflowRecall = (data: object) => {
+export const workflowRecall = (data: object) => {
 	return request({
 		url: `/api/v1/Workflow/recall`,
 		method: 'post',
@@ -253,7 +254,7 @@ export const WorkflowHasdefine = (moduleCode?: string) => {
  * @param {object} data
  * @return {*}
  */
- export const supplement = (data: object) => {
+export const supplement = (data: object) => {
 	return request({
 		url: '/api/v1/Workflow/supplement',
 		method: 'post',

+ 9 - 2
src/components/ExpandText/index.vue

@@ -145,7 +145,7 @@ onMounted(() => {
 		<div
 			class="collapse-content"
 			ref="content"
-			:style="{ position: state.isShow ? 'unset' : 'absolute', top: 0, lineHeight: state.isShow ? '' : props.defaultHeight+'px' }"
+			:style="{ position: state.isShow ? 'unset' : 'absolute', top: 0, lineHeight: state.isShow ? '' : props.defaultHeight + 'px' }"
 		>
 			<slot></slot>
 		</div>
@@ -153,7 +153,14 @@ onMounted(() => {
 			v-if="!hideControll"
 			v-show="state.controllVisible"
 			class="collapse-controll"
-			:style="{ backgroundColor: backgroundColor, position: 'absolute', bottom: '0', right: '0',height:props.defaultHeight+'px',lineHeight:props.defaultHeight+'px' }"
+			:style="{
+				backgroundColor: backgroundColor,
+				position: 'absolute',
+				bottom: '0',
+				right: '0',
+				height: props.defaultHeight + 'px',
+				lineHeight: props.defaultHeight + 'px',
+			}"
 		>
 			<el-button link type="primary" @click="handleControll">
 				{{ state.isShow ? foldText : unfoldText }}

+ 40 - 12
src/views/knowledge/knowledge/delApply/index.vue

@@ -79,7 +79,7 @@
 							type="danger"
 							@click="onRecall(row)"
 							title="撤回申请"
-							v-auth="'knowledge:recall'"
+							v-auth="'system:workflow:stop'"
 							v-if="[1].includes(row.workFlowApplyStatus)"
 						>
 							撤回申请
@@ -91,7 +91,12 @@
 				</template>
 			</el-table>
 			<!-- 分页 -->
-			<pagination :total="state.total" v-model:page="state.queryParams.PageIndex" v-model:limit="state.queryParams.PageSize" @pagination="queryList" />
+			<pagination
+				:total="state.total"
+				v-model:page="state.queryParams.PageIndex"
+				v-model:limit="state.queryParams.PageSize"
+				@pagination="queryList"
+			/>
 		</el-card>
 		<!-- 审核记录 -->
 		<ProcessRecord ref="processRecordRef" />
@@ -106,7 +111,8 @@ import { auth } from '/@/utils/authFunction';
 import { formatDate } from '/@/utils/formatTime';
 // 引入节流
 import { throttle } from '/@/utils/tools';
-import { KnowledgeDeletelist, KnowledgeRevoke, deleteBase } from '/@/api/knowledge';
+import { KnowledgeDeletelist, deleteBase } from '/@/api/knowledge';
+import { workflowRerminate } from '/@/api/system/workflow';
 
 // 引入组件
 const ProcessRecord = defineAsyncComponent(() => import('/@/views/knowledge/component/ProcessRecord.vue'));
@@ -198,18 +204,40 @@ const onRecord = (row: any) => {
 };
 // 撤回
 const onRecall = (row: any) => {
-	ElMessageBox.confirm(`是否确定要撤回申请?`, '提示', {
-		confirmButtonText: '确',
+	ElMessageBox.prompt('撤回原因', '提示', {
+		confirmButtonText: '确',
 		cancelButtonText: '取消',
-		type: 'warning',
+		inputPlaceholder: '请输入撤回原因,不超过50字符',
 		draggable: true,
-		cancelButtonClass: 'default-button',
+		inputErrorMessage: '请输入撤回原因',
+		inputType: 'textarea',
+		inputValidator: (value) => {
+			if (value) return true;
+			else return '请输入撤回原因';
+		},
 	})
-		.then(() => {
-			KnowledgeRevoke(row.workflowId).then(() => {
-				ElMessage.success('操作成功');
-				queryList();
-			});
+		.then(({ value }) => {
+			let req = {
+				workflowId: row.workflowId,
+				opinion: value,
+			};
+			ElMessageBox.confirm(`是否确定要撤回申请?`, '提示', {
+				confirmButtonText: '确认',
+				cancelButtonText: '取消',
+				type: 'warning',
+				draggable: true,
+				cancelButtonClass: 'default-button',
+				autofocus: false,
+			})
+				.then(() => {
+					workflowRerminate(req)
+						.then(() => {
+							ElMessage.success('操作成功');
+							queryList();
+						})
+						.catch(() => {});
+				})
+				.catch(() => {});
 		})
 		.catch(() => {});
 };

+ 36 - 13
src/views/knowledge/knowledge/index.vue

@@ -230,7 +230,7 @@
 										>
 											查看审核记录
 										</el-button>
-										<el-button link type="danger" @click="onRecall(row)" title="撤回" v-if="[1].includes(row.status)" v-auth="'knowledge:recall'">
+										<el-button link type="danger" @click="onRecall(row)" title="撤回" v-if="[1].includes(row.status)" v-auth="'system:workflow:stop'">
 											撤回
 										</el-button>
 										<el-button
@@ -288,7 +288,8 @@ import type { FormInstance } from 'element-plus';
 import { formatDate } from '/@/utils/formatTime';
 import { throttle, commonEeum } from '/@/utils/tools';
 import { auth } from '/@/utils/authFunction';
-import { KnowledgePaged, KnowledgeRevoke, KnowledgeOffshelf, KnowledgeOntheshelf, baseData } from '/@/api/knowledge';
+import { KnowledgePaged, KnowledgeOffshelf, KnowledgeOntheshelf, baseData } from '/@/api/knowledge';
+import { workflowRerminate } from '/@/api/system/workflow';
 import { getOrgList } from '/@/api/system/organize';
 import { treelist } from '/@/api/knowledge/type';
 import { hotspottype } from '/@/api/business/order';
@@ -617,20 +618,42 @@ const ontheshelf = (row: any) => {
 
 // 撤回
 const onRecall = (row: any) => {
-	ElMessageBox.confirm(`是否确定要撤回?撤回成功后请到【我的草稿箱】中进行查看和管理`, '提示', {
-		confirmButtonText: '确',
+	ElMessageBox.prompt('撤回原因', '提示', {
+		confirmButtonText: '确',
 		cancelButtonText: '取消',
-		type: 'warning',
+		inputPlaceholder: '请输入撤回原因,不超过50字符',
 		draggable: true,
-		cancelButtonClass: 'default-button',
+		inputErrorMessage: '请输入撤回原因',
+		inputType: 'textarea',
+		inputValidator: (value) => {
+			if (value) return true;
+			else return '请输入撤回原因';
+		},
 	})
-		.then(() => {
-			KnowledgeRevoke(row.workflowId).then(() => {
-				ElMessage.success('操作成功');
-				handleQuery();
-				state.queryParams.OrgCode = '';
-				getOrgListApi();
-			});
+		.then(({ value }) => {
+			let req = {
+				workflowId: row.workflowId,
+				opinion: value,
+			};
+			ElMessageBox.confirm(`是否确定要撤回?撤回成功后请到【我的草稿箱】中进行查看和管理`, '提示', {
+				confirmButtonText: '确认',
+				cancelButtonText: '取消',
+				type: 'warning',
+				draggable: true,
+				cancelButtonClass: 'default-button',
+				autofocus: false,
+			})
+				.then(() => {
+					workflowRerminate(req)
+						.then(() => {
+							ElMessage.success('操作成功');
+							handleQuery();
+							state.queryParams.OrgCode = '';
+							getOrgListApi();
+						})
+						.catch(() => {});
+				})
+				.catch(() => {});
 		})
 		.catch(() => {});
 };

+ 97 - 29
src/views/system/config/workflow/index.vue

@@ -14,7 +14,7 @@
 						v-show="state.activeName === 'example'"
 					>
 						<el-form-item label="关键字查询" prop="Keyword">
-							<el-input v-model="state.queryParams.Keyword" placeholder="流程标题/流程ID" style="width: 300px" clearable @keyup.enter="getList" />
+							<el-input v-model="state.queryParams.Keyword" placeholder="流程标题/流程ID" style="width: 300px" clearable @keyup.enter="queryList" />
 						</el-form-item>
 						<el-form-item label="业务模块" prop="ModuleCode">
 							<el-select v-model="state.queryParams.ModuleCode" class="w100" placeholder="请选择业务模块">
@@ -22,7 +22,9 @@
 							</el-select>
 						</el-form-item>
 						<el-form-item>
-							<el-button type="primary" @click="getList" :loading="state.loading" v-waves> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
+							<el-button type="primary" @click="queryList" :loading="state.loading" v-waves>
+								<SvgIcon name="ele-Search" class="mr5" />查询
+							</el-button>
 							<el-button @click="resetQuery(ruleFormRef)" v-waves class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
 						</el-form-item>
 					</el-form>
@@ -52,14 +54,43 @@
 							<el-table-column label="操作" width="150" fixed="right" align="center">
 								<!-- 草稿0 启用1 禁用2 -->
 								<template #default="scope">
-									<el-button link type="primary" @click="onEditTemp(scope.row)" title="修改"  v-auth="'system:workflow:template:edit'"> 修改 </el-button>
-									<el-button link type="success" v-if="scope.row.status === 0" @click="onReleaseTemp(scope.row)" title="发布"  v-auth="'system:workflow:template:release'"> 发布 </el-button>
+									<el-button link type="primary" @click="onEditTemp(scope.row)" title="修改" v-auth="'system:workflow:template:edit'">
+										修改
+									</el-button>
+									<el-button
+										link
+										type="success"
+										v-if="scope.row.status === 0"
+										@click="onReleaseTemp(scope.row)"
+										title="发布"
+										v-auth="'system:workflow:template:release'"
+									>
+										发布
+									</el-button>
 									<!-- <el-button link type="warning" v-if="scope.row.status === 2" @click="tempEnable(scope.row)" title="启用" v-auth="'system:workflow:template:enable'">
 										启用
 									</el-button> -->
-									<el-button link type="danger" v-if="scope.row.status === 1" @click="tempDisable(scope.row)" title="禁用"  v-auth="'system:workflow:template:disable'"> 禁用 </el-button>
+									<el-button
+										link
+										type="danger"
+										v-if="scope.row.status === 1"
+										@click="tempDisable(scope.row)"
+										title="禁用"
+										v-auth="'system:workflow:template:disable'"
+									>
+										禁用
+									</el-button>
 									<!-- 发布之后不能修改 -->
-									<el-button link v-if="scope.row.status === 0" type="danger" @click="onDeleteTemp(scope.row)" title="删除"  v-auth="'system:workflow:template:delete'"> 删除 </el-button>
+									<el-button
+										link
+										v-if="scope.row.status === 0"
+										type="danger"
+										@click="onDeleteTemp(scope.row)"
+										title="删除"
+										v-auth="'system:workflow:template:delete'"
+									>
+										删除
+									</el-button>
 								</template>
 							</el-table-column>
 						</template>
@@ -83,8 +114,24 @@
 							<el-table-column prop="currentStepName" label="当前环节" show-overflow-tooltip width="170"></el-table-column>
 							<el-table-column label="操作" width="140" fixed="right" align="center">
 								<template #default="{ row }">
-									<el-button link type="primary" @click="onLink(row)" title="跳转" v-if="[0, 1, 3].includes(row.status)"  v-auth="'system:workflow:template:jump'"> 跳转 </el-button>
-									<el-button link type="danger" @click="onStopProcess(row)" title="终止流程" v-if="[0, 1, 3].includes(row.status)"  v-auth="'system:workflow:template:stop'">
+									<el-button
+										link
+										type="primary"
+										@click="onLink(row)"
+										title="跳转"
+										v-if="[0, 1, 3].includes(row.status)"
+										v-auth="'system:workflow:jump'"
+									>
+										跳转
+									</el-button>
+									<el-button
+										link
+										type="danger"
+										@click="onStopProcess(row)"
+										title="终止流程"
+										v-if="[0, 1, 3].includes(row.status)"
+										v-auth="'system:workflow:stop'"
+									>
 										终止流程
 									</el-button>
 								</template>
@@ -99,12 +146,12 @@
 						:total="state.total"
 						v-model:page="state.queryParams.PageIndex"
 						v-model:limit="state.queryParams.PageSize"
-						@pagination="getList"
+						@pagination="queryList"
 					/>
 				</div>
 			</el-tabs>
 		</div>
-		<workflowJump ref="workflowJumpRef" @updateList="getList" />
+		<workflowJump ref="workflowJumpRef" @updateList="queryList" />
 	</div>
 </template>
 
@@ -167,7 +214,7 @@ const ruleFormRef = ref<FormInstance>();
 const workflowJumpRef = ref(null as any);
 const router = useRouter();
 /** 获取列表 */
-const getList = () => {
+const queryList = () => {
 	switch (state.activeName) {
 		case 'template':
 			state.loading = true;
@@ -201,11 +248,11 @@ const getList = () => {
 const resetQuery = throttle((formEl: FormInstance | undefined) => {
 	if (!formEl) return;
 	formEl.resetFields();
-	getList();
+	queryList();
 }, 1000);
 // 切换tab 查询列表
 const handleClick = () => {
-	getList();
+	queryList();
 };
 // 新增模板
 const onAddTemp = () => {
@@ -239,7 +286,7 @@ const onDeleteTemp = (row: any) => {
 		.then(() => {
 			workflowDelete(row.id).then(() => {
 				ElMessage.success('删除成功');
-				getList();
+				queryList();
 			});
 		})
 		.catch(() => {});
@@ -260,7 +307,7 @@ const onReleaseTemp = async (row: any) => {
 			.then(() => {
 				publishOnList(row.id).then(() => {
 					ElMessage.success('发布成功');
-					getList();
+					queryList();
 				});
 			})
 			.catch(() => {});
@@ -276,7 +323,7 @@ const onReleaseTemp = async (row: any) => {
 			.then(() => {
 				publishOnList(row.id).then(() => {
 					ElMessage.success('发布成功');
-					getList();
+					queryList();
 				});
 			})
 			.catch(() => {});
@@ -295,7 +342,7 @@ const tempEnable = (row: any) => {
 		.then(() => {
 			workflowEnable(row.id).then(() => {
 				ElMessage.success('启用成功');
-				getList();
+				queryList();
 			});
 		})
 		.catch(() => {});
@@ -313,7 +360,7 @@ const tempDisable = (row: any) => {
 		.then(() => {
 			workflowDisable(row.id).then(() => {
 				ElMessage.success('禁用成功');
-				getList();
+				queryList();
 			});
 		})
 		.catch(() => {});
@@ -324,25 +371,46 @@ const onLink = (row: any) => {
 };
 // 终止流程
 const onStopProcess = (row: any) => {
-	ElMessageBox.confirm(`终止后,当前处理人将无法处理该流程,确定终止?`, '提示', {
-		confirmButtonText: '确',
+	ElMessageBox.prompt('终止原因', '提示', {
+		confirmButtonText: '确',
 		cancelButtonText: '取消',
-		type: 'warning',
+		inputPlaceholder: '请输入终止原因,不超过50字符',
 		draggable: true,
-		cancelButtonClass: 'default-button',
-		autofocus: false,
+		inputErrorMessage: '请输入终止原因',
+		inputType: 'textarea',
+		inputValidator: (value) => {
+			if (value) return true;
+			else return '请输入终止原因';
+		},
 	})
-		.then(() => {
-			workflowRerminate(row.id).then(() => {
-				ElMessage.success('操作成功');
-				getList();
-			});
+		.then(({ value }) => {
+			let req = {
+				workflowId: row.id,
+				opinion: value,
+			};
+			ElMessageBox.confirm(`终止后,当前处理人将无法处理该流程,确定终止?`, '提示', {
+				confirmButtonText: '确认',
+				cancelButtonText: '取消',
+				type: 'warning',
+				draggable: true,
+				cancelButtonClass: 'default-button',
+				autofocus: false,
+			})
+				.then(() => {
+					workflowRerminate(req)
+						.then(() => {
+							ElMessage.success('操作成功');
+							queryList();
+						})
+						.catch(() => {});
+				})
+				.catch(() => {});
 		})
 		.catch(() => {});
 };
 //
 onMounted(async () => {
-	getList();
+	queryList();
 	// 获取页面基础信息
 	const res: any = await baseData();
 	state.moduleOptions = res.result?.moduleOptions ?? [];