变更申请同意和驳回完成
This commit is contained in:
@@ -47,3 +47,20 @@ export function myTasksAddItemApi(change_id:number,data: any) {
|
|||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 驳回变更
|
||||||
|
export function rejectApi(data: {change_id:number,opinion:string}) {
|
||||||
|
return request({
|
||||||
|
url: `/api/approvals/reject`,
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 同意变更
|
||||||
|
export function agreeApi(data: {change_id:number,opinion:string}) {
|
||||||
|
return request({
|
||||||
|
url: `/api/approvals/agree`,
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,12 +9,28 @@ import { AiError, aiTypeJudge } from "@/service/api/ai";
|
|||||||
import { systemConfigApi } from '@/service/api/system';
|
import { systemConfigApi } from '@/service/api/system';
|
||||||
import { getChangeDetailApi } from '@/service/api/change';
|
import { getChangeDetailApi } from '@/service/api/change';
|
||||||
import previewComponent from '@/components/previewFile/index.vue'
|
import previewComponent from '@/components/previewFile/index.vue'
|
||||||
|
import { rejectApi,agreeApi } from '@/service/api/myTasks';
|
||||||
|
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
const { routerPushByKey } = useRouterPush();
|
const { routerPushByKey } = useRouterPush();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const loading = ref<boolean>(false);
|
const loading = ref<boolean>(false);
|
||||||
|
// 驳回弹框
|
||||||
|
const rejectModal = ref<boolean>(false);
|
||||||
|
// 驳回原因
|
||||||
|
const rejectReason = ref<string>('');
|
||||||
|
// 驳回loading
|
||||||
|
const rejectSaving = ref<boolean>(false);
|
||||||
|
// 驳回快捷
|
||||||
|
const rejectQuick = ref<string[]>([
|
||||||
|
"变更前后对比不完整",
|
||||||
|
"缺少支撑材料或核算数据",
|
||||||
|
"风险分析不充分,请补充识别",
|
||||||
|
"连带变更未识别完整",
|
||||||
|
"变更等级判定依据不足",
|
||||||
|
"所需材料清单不全",
|
||||||
|
]);
|
||||||
// 审批意见
|
// 审批意见
|
||||||
const comment = ref<string>('');
|
const comment = ref<string>('');
|
||||||
// 返回键
|
// 返回键
|
||||||
@@ -266,12 +282,6 @@ const openPreview = (file:any) => {
|
|||||||
previewModal.value = true;
|
previewModal.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 催办
|
|
||||||
const handleReminder = (m: any) => {
|
|
||||||
window.$message?.info('还差接口')
|
|
||||||
window.$message?.success(`已催办 ${m.user_name}(系统消息 + 企业微信 + 短信),连续 2 次未响应将上报部门负责人`)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 匹配评分依据
|
// 匹配评分依据
|
||||||
const matchBasis = (items:any,score: number) => {
|
const matchBasis = (items:any,score: number) => {
|
||||||
return items.find((item:any) => item.score === score)?.label || '';
|
return items.find((item:any) => item.score === score)?.label || '';
|
||||||
@@ -376,6 +386,34 @@ const getConfig = async () => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 打开驳回弹框
|
||||||
|
const openReject = () => {
|
||||||
|
rejectReason.value = '';
|
||||||
|
rejectModal.value = true;
|
||||||
|
}
|
||||||
|
// 驳回保存
|
||||||
|
const rejectSave = async () => {
|
||||||
|
if (!rejectReason.value) {
|
||||||
|
return window.$message?.warning('请输入驳回意见');
|
||||||
|
}
|
||||||
|
rejectSaving.value = true;
|
||||||
|
const {error} = await rejectApi({change_id:currentId.value,opinion:rejectReason.value});
|
||||||
|
if(!error){
|
||||||
|
rejectModal.value = false;
|
||||||
|
window.$message?.success('驳回成功');
|
||||||
|
}
|
||||||
|
rejectSaving.value = false;
|
||||||
|
}
|
||||||
|
// 同意保存
|
||||||
|
const agreeSave = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
const {error} = await agreeApi({change_id:currentId.value,opinion:comment.value});
|
||||||
|
if(!error){
|
||||||
|
window.$message?.success('同意成功');
|
||||||
|
}
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if(route.query){
|
if(route.query){
|
||||||
if(route.query.key){
|
if(route.query.key){
|
||||||
@@ -408,7 +446,7 @@ onMounted(() => {
|
|||||||
<NTag size="small" type="info" class="font-mono text-xs">编号:{{ currentInfo?.change_no }}</NTag>
|
<NTag size="small" type="info" class="font-mono text-xs">编号:{{ currentInfo?.change_no }}</NTag>
|
||||||
<!-- 审批中 -->
|
<!-- 审批中 -->
|
||||||
<NButton
|
<NButton
|
||||||
v-if="currentStatus === 'APPROVING' && isAiOn"
|
v-if="isAiOn"
|
||||||
ghost
|
ghost
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -697,11 +735,11 @@ onMounted(() => {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center py-3 px-3 border rounded-md mt-3 gap-3">
|
<div class="flex items-center py-3 px-3 border rounded-md mt-3 gap-3">
|
||||||
<NButton class="text-xs hover:underline" text type="primary">AI辅助</NButton>
|
<NButton v-if="isAiOn" class="text-xs hover:underline" text type="primary" @click="aiDrawer = !aiDrawer">AI辅助</NButton>
|
||||||
<NInput v-model:value="comment" type="textarea" size="small" :autosize="{ minRows: 1}" placeholder="审批意见(采纳的 AI 建议自动纳入,可修改,随审批提交留痕)" />
|
<NInput v-model:value="comment" type="textarea" size="small" :autosize="{ minRows: 1}" placeholder="审批意见(采纳的 AI 建议自动纳入,可修改,随审批提交留痕)" />
|
||||||
<div class="ml-auto flex gap-2">
|
<div class="ml-auto flex gap-2">
|
||||||
<NButton class="text-xs" size="small" type="error">拒绝</NButton>
|
<NButton class="text-xs" size="small" type="error" @click="openReject">驳回</NButton>
|
||||||
<NButton class="text-xs" size="small" type="success">同意</NButton>
|
<NButton class="text-xs" size="small" type="success" @click="agreeSave">同意</NButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</NCard>
|
</NCard>
|
||||||
@@ -977,6 +1015,39 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</NModal>
|
</NModal>
|
||||||
|
<!-- 驳回弹框 -->
|
||||||
|
<NModal
|
||||||
|
v-model:show="rejectModal"
|
||||||
|
preset="card"
|
||||||
|
:auto-focus="false"
|
||||||
|
:style="{ width: '450px', height: 'auto' }"
|
||||||
|
:segmented="{ content: true, footer: true }"
|
||||||
|
>
|
||||||
|
<template #header>
|
||||||
|
<h3 class="text-sm font-bold text-slate-800">驳回变更申请</h3>
|
||||||
|
</template>
|
||||||
|
<template #default>
|
||||||
|
<p class="text-xs leading-5 text-slate-500">
|
||||||
|
快捷批注模板(点选填入,可叠加,仍可手动修改)
|
||||||
|
</p>
|
||||||
|
<div class="flex flex-wrap gap-2 mt-1">
|
||||||
|
<NTag v-for="item in rejectQuick" :key="item" class="cursor-pointer" size="small" type="error" @click="rejectReason += item + ';'">{{ item }}</NTag>
|
||||||
|
</div>
|
||||||
|
<NInput
|
||||||
|
class="mt-3"
|
||||||
|
v-model:value="rejectReason"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 3 }"
|
||||||
|
placeholder="驳回意见(必填),将退回至申请人/指定节点…"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<div class="flex justify-end gap-[10px]">
|
||||||
|
<NButton size="small" @click="rejectModal = false">取消</NButton>
|
||||||
|
<NButton size="small" type="primary" :loading="rejectSaving" @click="rejectSave">确定</NButton>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</NModal>
|
||||||
</NSpin>
|
</NSpin>
|
||||||
</NSpace>
|
</NSpace>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -659,6 +659,7 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="space-y-3">
|
<div class="space-y-3">
|
||||||
|
{{ previewFile }}
|
||||||
<div class="flex flex-wrap gap-x-4 gap-y-1 text-xs text-slate-400">
|
<div class="flex flex-wrap gap-x-4 gap-y-1 text-xs text-slate-400">
|
||||||
<span>上传人:{{ previewFile?.user_name }}</span>
|
<span>上传人:{{ previewFile?.user_name }}</span>
|
||||||
<span>上传时间:{{ previewFile?.created_at?.slice(0, 16) }}</span>
|
<span>上传时间:{{ previewFile?.created_at?.slice(0, 16) }}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user