소스 검색

reactor:工单退回到话务部后班长有代办按钮 工单受理页面;

zhangchong 8 달 전
부모
커밋
b02c36ba95
1개의 변경된 파일62개의 추가작업 그리고 25개의 파일을 삭제
  1. 62 25
      src/views/todo/seats/accept/zgAccept.vue

+ 62 - 25
src/views/todo/seats/accept/zgAccept.vue

@@ -415,6 +415,14 @@
 										<el-button type="primary" @click="submit(ruleFormRef)" :loading="buttonLoading" v-if="canHandle && isSaveSuccess">
 											办理
 										</el-button>
+										<el-button
+											type="primary"
+											@click="agentHandle(ruleFormRef)"
+											:loading="buttonLoading"
+											v-if="state.ruleForm?.canInsteadHandle && isSaveSuccess"
+											v-auth="'business:order:handle:instead'"
+										>代办</el-button
+										>
 										<el-text class="ml12" type="danger" tag="b">注意:工单内容填写或者修改后请先保存再办理。</el-text>
 									</el-form-item>
 								</el-col>
@@ -916,48 +924,62 @@ const canHandle = computed(() => {
 });
 // 流程审批
 const processAuditRef = ref<RefType>();
-const processOrder = (orderDetail: any) => {
+const processOrder = (orderDetail: any,isAgent=false) => {
 	buttonLoading.value = false;
-	if (orderDetail.workflowId) {
-		// 如果已经有流程id 说明已经发起过流程 先更新工单数据  直接调用工单办理
-		orderEdit(orderDetail).then(() => {
-			const params = {
-				id: orderDetail.workflowId,
-				processType: '工单办理',
-				orderDetail,
-				extra: {
-					dialogTitle: '工单办理',
-					inputPlaceholder: '办理意见',
-					annexName: '办理附件',
-				},
-			};
-			processAuditRef.value.openDialog(params);
-		});
-	} else {
-		// 如果没有流程id 说明没有发起过流程  调用工单受理
+	if(isAgent){ // 代办
 		const params = {
-			id: '',
-			processType: '工单受理',
+			id: orderDetail.workflowId,
+			processType: '工单代办',
+			orderDetail,
 			extra: {
-				dialogTitle: '工单受理',
+				dialogTitle: '工单代办',
 				inputPlaceholder: '办理意见',
 				annexName: '办理附件',
 			},
-			orderDetail,
 		};
 		processAuditRef.value.openDialog(params);
+	}else{
+		if (orderDetail.workflowId) {
+			// 如果已经有流程id 说明已经发起过流程 先更新工单数据  直接调用工单办理
+			orderEdit(orderDetail).then(() => {
+				const params = {
+					id: orderDetail.workflowId,
+					processType: '工单办理',
+					orderDetail,
+					extra: {
+						dialogTitle: '工单办理',
+						inputPlaceholder: '办理意见',
+						annexName: '办理附件',
+					},
+				};
+				processAuditRef.value.openDialog(params);
+			});
+		} else {
+			// 如果没有流程id 说明没有发起过流程  调用工单受理
+			const params = {
+				id: '',
+				processType: '工单受理',
+				extra: {
+					dialogTitle: '工单受理',
+					inputPlaceholder: '办理意见',
+					annexName: '办理附件',
+				},
+				orderDetail,
+			};
+			processAuditRef.value.openDialog(params);
+		}
 	}
 };
-const handleForm = (orderDetail: any) => {
+const handleForm = (orderDetail: any,isAgent=false) => {
 	if (orderDetail.orderExtension?.orderTypeCode) {
 		if (ExpandFormRef.value.state.validated) {
-			processOrder(orderDetail);
+			processOrder(orderDetail,isAgent);
 		} else {
 			ExpandFormRef.value.openDialog(true);
 			buttonLoading.value = false;
 		}
 	} else {
-		processOrder(orderDetail);
+		processOrder(orderDetail,isAgent);
 	}
 };
 // 提交
@@ -975,6 +997,21 @@ const submit = throttle((formEl: FormInstance | undefined) => {
 		handleForm(orderDetail);
 	});
 }, 300);
+// 代办
+const agentHandle = throttle((formEl: FormInstance | undefined) => {
+	if (!formEl) return;
+	formEl.validate((valid: boolean) => {
+		if (!valid) return;
+		buttonLoading.value = true;
+		const orderDetail = {
+			...state.ruleForm,
+			repeatableEventDetails: repeatableEventDetails.value,
+			files: filesFormat.value,
+		};
+		deleteUnnecessaryProperties(orderDetail);
+		handleForm(orderDetail,true);
+	});
+}, 300);
 // 选中常用意见
 const chooseAdvice = (item: any) => {
 	state.ruleForm.content += item.content;