|
@@ -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;
|