|
@@ -1,41 +1,38 @@
|
|
|
<template>
|
|
|
- <el-dialog v-model="state.dialogVisible" draggable title="退回审批" width="40%" append-to-body destroy-on-close @close="close">
|
|
|
- <div class="collapse-container" v-loading="state.loading">
|
|
|
- <el-form label-width="110px" ref="ruleFormRef" :model="state.ruleForm">
|
|
|
- <el-row :gutter="35">
|
|
|
- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
|
|
|
- <el-form-item label="审批结果" prop="isPass" :rules="[{ required: true, message: '请选择审批结果', trigger: 'change' }]">
|
|
|
- <el-radio-group v-model="state.ruleForm.isPass">
|
|
|
- <el-radio :label="true">同意</el-radio>
|
|
|
- <el-radio :label="false">不同意</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
- <el-form-item label="审批意见" prop="opinion" :rules="[{ required: true, message: '请填写特提审批意见', trigger: 'blur' }]">
|
|
|
- <el-input v-model="state.ruleForm.opinion" type="textarea" :autosize="{ minRows: 6, maxRows: 10 }" placeholder="请填写特提审批意见" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- <template #footer>
|
|
|
+ <el-dialog v-model="state.dialogVisible" draggable title="退回审批" width="40%" append-to-body destroy-on-close @close="close">
|
|
|
+ <div class="collapse-container" v-loading="state.loading">
|
|
|
+ <el-form label-width="110px" ref="ruleFormRef" :model="state.ruleForm">
|
|
|
+ <el-row :gutter="35">
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
|
|
|
+ <el-form-item label="审批结果" prop="isPass" :rules="[{ required: true, message: '请选择审批结果', trigger: 'change' }]">
|
|
|
+ <el-radio-group v-model="state.ruleForm.isPass">
|
|
|
+ <el-radio :label="true">同意</el-radio>
|
|
|
+ <el-radio :label="false">不同意</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
+ <el-form-item label="审批意见" prop="opinion" :rules="[{ required: true, message: '请填退回审批意见', trigger: 'blur' }]">
|
|
|
+ <el-input v-model="state.ruleForm.opinion" type="textarea" :autosize="{ minRows: 6, maxRows: 10 }" placeholder="请填退回审批意见" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
<span class="dialog-footer">
|
|
|
<el-button @click="closeDialog" class="default-button">取 消</el-button>
|
|
|
<el-button type="primary" @click="onAudit(ruleFormRef)" :loading="state.loading">确 定</el-button>
|
|
|
</span>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
<script setup lang="ts" name="SpecialDialogAudit">
|
|
|
import { defineAsyncComponent, reactive, ref } from 'vue';
|
|
|
import { ElMessage, FormInstance } from 'element-plus';
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
import { useUserInfo } from '@/stores/userInfo';
|
|
|
-import { formatDate } from '@/utils/formatTime';
|
|
|
-import { specialApplyBase, specialApprove, specialDetail } from '@/api/business/special';
|
|
|
-import { transformFile } from '@/utils/tools';
|
|
|
-import { orderTimeConfig } from '@/api/business/order';
|
|
|
+import { returnAuditAddBatch } from '@/api/business/return';
|
|
|
|
|
|
// 引入组件
|
|
|
const AnnexList = defineAsyncComponent(() => import('@/components/AnnexList/index.vue'));
|
|
@@ -44,96 +41,56 @@ const AnnexList = defineAsyncComponent(() => import('@/components/AnnexList/inde
|
|
|
const emit = defineEmits(['updateList']);
|
|
|
// 定义变量内容
|
|
|
const state = reactive<any>({
|
|
|
- dialogVisible: false, // 是否显示弹窗
|
|
|
- loading: false, // 是否显示加载
|
|
|
- ruleForm: {
|
|
|
- nextStepCode: null, // 特提节点
|
|
|
- nextHandlers: [], // 处理对象
|
|
|
- timeLimitUnit: 2, // 期满时间单位
|
|
|
- orgId: null, // 部门id
|
|
|
- orgName: null, // 部门名称
|
|
|
- alterTime: false, // 是否修改期满时间
|
|
|
- opinion: '', // 审批意见
|
|
|
- isPass: true, // 是否通过
|
|
|
- },
|
|
|
- detail: {}, // 详情信息
|
|
|
- workflowId: null, // 工作流id
|
|
|
+ dialogVisible: false, // 是否显示弹窗
|
|
|
+ loading: false, // 是否显示加载
|
|
|
+ ruleForm: {
|
|
|
+ opinion: '', // 审批意见
|
|
|
+ isPass: true, // 是否通过
|
|
|
+ },
|
|
|
});
|
|
|
const ruleFormRef = ref<RefType>();
|
|
|
const storesUserInfo = useUserInfo();
|
|
|
const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
|
|
|
-const steps = ref<EmptyArrayType>([]); // 特提节点
|
|
|
-const stepsItems = ref<EmptyArrayType>([]); // 处理对象
|
|
|
-const specialTimeType = ref<EmptyArrayType>([]); // 期满时间单位
|
|
|
+const ids = ref<any>([]);
|
|
|
// 打开弹窗
|
|
|
const openDialog = async (val: any) => {
|
|
|
- state.loading = true;
|
|
|
- try {
|
|
|
- console.log(val);
|
|
|
- state.dialogVisible = true;
|
|
|
- state.loading = false;
|
|
|
- } catch (e) {
|
|
|
- console.log(e);
|
|
|
- } finally {
|
|
|
- state.loading = false;
|
|
|
- }
|
|
|
+ state.loading = false;
|
|
|
+ ids.value = val;
|
|
|
+ state.dialogVisible = true;
|
|
|
};
|
|
|
// 关闭弹窗
|
|
|
const closeDialog = () => {
|
|
|
- state.dialogVisible = false;
|
|
|
+ state.dialogVisible = false;
|
|
|
};
|
|
|
const close = () => {
|
|
|
- ruleFormRef.value?.clearValidate();
|
|
|
- ruleFormRef.value?.resetFields();
|
|
|
- steps.value = [];
|
|
|
- stepsItems.value = [];
|
|
|
+ ruleFormRef.value?.clearValidate();
|
|
|
};
|
|
|
|
|
|
// 审批
|
|
|
const onAudit = (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return;
|
|
|
- formEl.validate((valid: boolean) => {
|
|
|
- if (!valid) return;
|
|
|
- state.loading = true;
|
|
|
- let request: {};
|
|
|
- if (state.ruleForm.isPass) {
|
|
|
- request = {
|
|
|
- id: state.detail.id,
|
|
|
- orderId: state.detail.orderId,
|
|
|
- timeLimit: state.ruleForm.timeLimit,
|
|
|
- timeLimitUnit: state.ruleForm.timeLimitUnit,
|
|
|
- cause: state.detail.cause,
|
|
|
- opinion: state.ruleForm.opinion,
|
|
|
- workflowId: state.workflowId,
|
|
|
- state: 1, // 审核结果 0 待审核 1 审核通过 2 审核不通过
|
|
|
- nextStepCode: state.ruleForm.nextStepCode,
|
|
|
- nextStepName: state.ruleForm.nextStepName,
|
|
|
- nextHandlers: state.ruleForm.nextHandlers,
|
|
|
- };
|
|
|
- } else {
|
|
|
- request = {
|
|
|
- id: state.detail.id,
|
|
|
- orderId: state.detail.orderId,
|
|
|
- cause: state.detail.cause,
|
|
|
- opinion: state.ruleForm.opinion,
|
|
|
- workflowId: state.workflowId,
|
|
|
- state: 2, // 审核结果 0 待审核 1 审核通过 2 审核不通过
|
|
|
- };
|
|
|
- }
|
|
|
- specialApprove(request)
|
|
|
- .then(() => {
|
|
|
- state.loading = false;
|
|
|
- closeDialog();
|
|
|
- emit('updateList');
|
|
|
- ElMessage.success('操作成功');
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- state.loading = false;
|
|
|
- });
|
|
|
- });
|
|
|
+ if (!formEl) return;
|
|
|
+ formEl.validate((valid: boolean) => {
|
|
|
+ if (!valid) return;
|
|
|
+ state.loading = true;
|
|
|
+ const request = {
|
|
|
+ ids: ids.value,
|
|
|
+ auditContent: state.ruleForm.opinion,
|
|
|
+ state: state.ruleForm.isPass ? 1 : 2, // 审核结果 0 待审核 1 审核通过 2 审核不通过
|
|
|
+ };
|
|
|
+ returnAuditAddBatch(request)
|
|
|
+ .then(() => {
|
|
|
+ state.loading = false;
|
|
|
+ closeDialog();
|
|
|
+ emit('updateList');
|
|
|
+ ElMessage.success('操作成功');
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ state.loading = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
};
|
|
|
defineExpose({
|
|
|
- openDialog,
|
|
|
- closeDialog,
|
|
|
+ openDialog,
|
|
|
+ closeDialog,
|
|
|
});
|
|
|
</script>
|