|
@@ -108,6 +108,12 @@
|
|
|
</el-card>
|
|
|
<el-dialog v-model="state.dialogVisible" width="500px" draggable :title="noticeType" @close="close">
|
|
|
<el-form :model="state.examineForm" label-width="110px" ref="examineFormRef">
|
|
|
+ <el-form-item label="审核结果" prop="isPass" :rules="[{ required: true, message: '请选择审批结果', trigger: 'change' }]">
|
|
|
+ <el-radio-group v-model="state.examineForm.isPass">
|
|
|
+ <el-radio :value="true">同意</el-radio>
|
|
|
+ <el-radio :value="false">不同意</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="审核理由" prop="reason" :rules="[{ required: true, message: '请填写审核理由', trigger: 'blur' }]">
|
|
|
<el-input v-model="state.examineForm.reason" placeholder="请填写审核理由" type="textarea" :autosize="{ minRows: 4, maxRows: 8 }"></el-input>
|
|
|
</el-form-item>
|
|
@@ -115,8 +121,7 @@
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
|
<el-button @click="state.dialogVisible = false" class="default-button">取 消</el-button>
|
|
|
- <el-button type="primary" @click="onReject(examineFormRef)" :loading="loading">审核驳回</el-button>
|
|
|
- <el-button type="primary" @click="onPass(examineFormRef)" :loading="loading">审核通过</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit(examineFormRef)" :loading="loading">确定</el-button>
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
@@ -126,7 +131,7 @@
|
|
|
</template>
|
|
|
<script setup lang="ts" name="auxiliaryNoticeDetail">
|
|
|
import { reactive, onMounted, ref, defineAsyncComponent } from 'vue';
|
|
|
-import { useRoute, useRouter } from 'vue-router';
|
|
|
+import { useRoute } from 'vue-router';
|
|
|
import { formatDate } from '@/utils/formatTime';
|
|
|
import { bulletinAudit, bulletinDetail, circularAudit, circularDetail, circularRead } from '@/api/auxiliary/notice';
|
|
|
import mittBus from '@/utils/mitt';
|
|
@@ -137,7 +142,10 @@ const ProcessAudit = defineAsyncComponent(() => import('@/components/ProcessAudi
|
|
|
const state = reactive<any>({
|
|
|
dialogVisible: false,
|
|
|
ruleForm: <EmptyObjectType>{},
|
|
|
- examineForm: <EmptyObjectType>{},
|
|
|
+ examineForm: <EmptyObjectType>{
|
|
|
+ isPass:true,
|
|
|
+ reason:'',
|
|
|
+ },
|
|
|
});
|
|
|
const noticeType = ref<any>('通知详情');
|
|
|
const loading = ref<boolean>(false);
|
|
@@ -175,7 +183,6 @@ const onAudit = () => {
|
|
|
state.dialogVisible = true;
|
|
|
};
|
|
|
// 关闭当前页
|
|
|
-const router = useRouter();
|
|
|
const closePage = () => {
|
|
|
state.dialogVisible = false;
|
|
|
mittBus.emit('clearCache', 'auxiliaryNotice');
|
|
@@ -183,8 +190,8 @@ const closePage = () => {
|
|
|
mittBus.emit('onCurrentContextmenuClick', Object.assign({}, { contextMenuClickId: 1, ...route }));
|
|
|
};
|
|
|
const examineFormRef = ref<RefType>();
|
|
|
-// 审核通过
|
|
|
-const onPass = throttle(async (formEl: FormInstance | undefined) => {
|
|
|
+// 审核提交
|
|
|
+const onSubmit = throttle(async (formEl: FormInstance | undefined) => {
|
|
|
if (!formEl) return;
|
|
|
await formEl.validate((valid: boolean) => {
|
|
|
if (!valid) return;
|
|
@@ -192,7 +199,7 @@ const onPass = throttle(async (formEl: FormInstance | undefined) => {
|
|
|
const request = {
|
|
|
reason: state.examineForm.reason,
|
|
|
id: route.params.id,
|
|
|
- isPass: true,
|
|
|
+ isPass:state.examineForm.isPass,
|
|
|
};
|
|
|
switch (noticeType.value) {
|
|
|
case '通知详情':
|
|
@@ -210,57 +217,13 @@ const onPass = throttle(async (formEl: FormInstance | undefined) => {
|
|
|
.then(() => {
|
|
|
closePage();
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
+ .catch(() =>{
|
|
|
state.dialogVisible = false;
|
|
|
loading.value = false;
|
|
|
- });
|
|
|
- break;
|
|
|
- default:
|
|
|
- state.dialogVisible = false;
|
|
|
- loading.value = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- });
|
|
|
-}, 300);
|
|
|
-// 审核驳回
|
|
|
-const onReject = throttle(async (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return;
|
|
|
- await formEl.validate((valid: boolean) => {
|
|
|
- if (!valid) return;
|
|
|
- loading.value = true;
|
|
|
- const request = {
|
|
|
- reason: state.examineForm.reason,
|
|
|
- id: route.params.id,
|
|
|
- isPass: false,
|
|
|
- };
|
|
|
- switch (noticeType.value) {
|
|
|
- case '通知详情':
|
|
|
- circularAudit(request)
|
|
|
- .then(() => {
|
|
|
- closePage();
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- state.dialogVisible = false;
|
|
|
- loading.value = false;
|
|
|
- });
|
|
|
- break;
|
|
|
- case '公告详情':
|
|
|
- bulletinAudit(request)
|
|
|
- .then(() => {
|
|
|
- closePage();
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- state.dialogVisible = false;
|
|
|
- loading.value = false;
|
|
|
- });
|
|
|
- break;
|
|
|
- default:
|
|
|
- state.dialogVisible = false;
|
|
|
- loading.value = false;
|
|
|
- break;
|
|
|
}
|
|
|
- });
|
|
|
-}, 300);
|
|
|
+ })
|
|
|
+},300);
|
|
|
const close = () => {
|
|
|
examineFormRef.value?.resetFields();
|
|
|
examineFormRef.value?.clearValidate();
|