|
@@ -51,6 +51,13 @@
|
|
|
message="当前账号用户组无权在此环节审核"
|
|
message="当前账号用户组无权在此环节审核"
|
|
|
/>
|
|
/>
|
|
|
<a-alert
|
|
<a-alert
|
|
|
|
|
+ v-else-if="alreadySubmitted"
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ show-icon
|
|
|
|
|
+ class="mb-4"
|
|
|
|
|
+ message="当前角色已提交意见,无需重复提交"
|
|
|
|
|
+ />
|
|
|
|
|
+ <a-alert
|
|
|
v-else-if="currentForm.rejectType > 0"
|
|
v-else-if="currentForm.rejectType > 0"
|
|
|
type="warning"
|
|
type="warning"
|
|
|
show-icon
|
|
show-icon
|
|
@@ -60,7 +67,7 @@
|
|
|
<a-form v-else layout="vertical" size="middle">
|
|
<a-form v-else layout="vertical" size="middle">
|
|
|
<div class="flex flex-col md:flex-row lg:flex-row w-full gap-3">
|
|
<div class="flex flex-col md:flex-row lg:flex-row w-full gap-3">
|
|
|
<div class="flex flex-col flex-1">
|
|
<div class="flex flex-col flex-1">
|
|
|
- <a-form-item required :label="`审核通过:${reviewLevelLabel}`">
|
|
|
|
|
|
|
+ <a-form-item required :label="isNoProgressChange ? `提交意见:${reviewLevelLabel}` : `审核通过:${reviewLevelLabel}`">
|
|
|
<a-select
|
|
<a-select
|
|
|
v-model:value="reviewOpinion"
|
|
v-model:value="reviewOpinion"
|
|
|
allow-clear
|
|
allow-clear
|
|
@@ -74,11 +81,11 @@
|
|
|
:min="0"
|
|
:min="0"
|
|
|
:max="100"
|
|
:max="100"
|
|
|
class="w-full"
|
|
class="w-full"
|
|
|
- placeholder="可选"
|
|
|
|
|
|
|
+ placeholder="请填写分数"
|
|
|
/>
|
|
/>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="flex flex-col flex-1">
|
|
|
|
|
|
|
+ <div v-if="!isNoProgressChange || reviewProgressInfo?.canReject" class="flex flex-col flex-1">
|
|
|
<a-form-item required label="不通过回退:回退原因">
|
|
<a-form-item required label="不通过回退:回退原因">
|
|
|
<a-textarea
|
|
<a-textarea
|
|
|
v-model:value="rejectReason"
|
|
v-model:value="rejectReason"
|
|
@@ -100,10 +107,10 @@
|
|
|
:disabled="!canSubmitReview"
|
|
:disabled="!canSubmitReview"
|
|
|
@click="submitReview"
|
|
@click="submitReview"
|
|
|
>
|
|
>
|
|
|
- 通过审核
|
|
|
|
|
|
|
+ {{ isNoProgressChange ? '提交意见' : '通过审核' }}
|
|
|
</a-button>
|
|
</a-button>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="flex flex-col flex-1">
|
|
|
|
|
|
|
+ <div v-if="!isNoProgressChange || reviewProgressInfo?.canReject" class="flex flex-col flex-1">
|
|
|
<a-button
|
|
<a-button
|
|
|
block
|
|
block
|
|
|
danger
|
|
danger
|
|
@@ -140,7 +147,7 @@ import SelfAssessmentFormDisplay from './components/SelfAssessmentFormDisplay.vu
|
|
|
import { useSimpleDataLoader } from '@/composeables/useSimpleDataLoader';
|
|
import { useSimpleDataLoader } from '@/composeables/useSimpleDataLoader';
|
|
|
import { useAuthStore } from '@/stores/auth';
|
|
import { useAuthStore } from '@/stores/auth';
|
|
|
import { useMemorizeVar } from '@/composeables/useMemorizeVar';
|
|
import { useMemorizeVar } from '@/composeables/useMemorizeVar';
|
|
|
-import { GROUP_TO_REVIEW_PROGRESS, PROGRESS_SUBMIT_LABELS } from './composeables/GroupData.ts';
|
|
|
|
|
|
|
+import { GROUP_TO_REVIEW_PROGRESS, GROUP_DISTRICT_ST, GROUP_DISTRICT_ND, GROUP_DISTRICT_RD, GROUP_DISTRICT_TH, PROGRESS_SUBMIT_LABELS } from './composeables/GroupData.ts';
|
|
|
import { isInMiniProgram } from '@/composeables/MiniProgramIng.ts';
|
|
import { isInMiniProgram } from '@/composeables/MiniProgramIng.ts';
|
|
|
import { useReview } from './composeables/Review.ts';
|
|
import { useReview } from './composeables/Review.ts';
|
|
|
|
|
|
|
@@ -179,6 +186,7 @@ const reviewPoints = ref<number | null>(null);
|
|
|
const rejectReason = ref<string | null>(null);
|
|
const rejectReason = ref<string | null>(null);
|
|
|
|
|
|
|
|
const opinionSelectOptions = [
|
|
const opinionSelectOptions = [
|
|
|
|
|
+ { label: '请选择', value: 0 },
|
|
|
{ label: '优秀', value: 1 },
|
|
{ label: '优秀', value: 1 },
|
|
|
{ label: '合格', value: 2 },
|
|
{ label: '合格', value: 2 },
|
|
|
{ label: '不合格', value: 3 },
|
|
{ label: '不合格', value: 3 },
|
|
@@ -187,7 +195,22 @@ const opinionSelectOptions = [
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
const currentProgress = computed(() => currentForm.value?.progress ?? 0);
|
|
const currentProgress = computed(() => currentForm.value?.progress ?? 0);
|
|
|
-const { reviewProgressInfo, canSubmitReview, reviewLevelLabel, progressHint } = useReview(currentProgress);
|
|
|
|
|
|
|
+const { reviewProgressInfo, canSubmitReview, reviewLevelLabel, progressHint, isNoProgressChange } = useReview(currentProgress);
|
|
|
|
|
+
|
|
|
|
|
+const currentUserGroupId = computed(() => {
|
|
|
|
|
+ const groups = currentUserGroups.value;
|
|
|
|
|
+ return groups.find((g) => GROUP_TO_REVIEW_PROGRESS[g.id])?.id ?? 0;
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+/** 当前子角色是否已提交过意见(不可重复提交) */
|
|
|
|
|
+const alreadySubmitted = computed(() => {
|
|
|
|
|
+ const f = currentForm.value;
|
|
|
|
|
+ if (!f) return false;
|
|
|
|
|
+ const gid = currentUserGroupId.value;
|
|
|
|
|
+ if (gid === GROUP_DISTRICT_ST) return (f.districtSt ?? 0) > 0;
|
|
|
|
|
+ if (gid === GROUP_DISTRICT_ND) return (f.districtNd ?? 0) > 0;
|
|
|
|
|
+ return false;
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
function levelTitleFromForm(f: SelfAssessmentDetail) {
|
|
function levelTitleFromForm(f: SelfAssessmentDetail) {
|
|
|
if (f.level === 23) return '国家级';
|
|
if (f.level === 23) return '国家级';
|
|
@@ -213,21 +236,36 @@ async function loadCheckItems(f: SelfAssessmentDetail) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function applyPrefillFromDetail(f: SelfAssessmentDetail) {
|
|
function applyPrefillFromDetail(f: SelfAssessmentDetail) {
|
|
|
- const t = reviewProgressInfo.value.target;
|
|
|
|
|
|
|
+ const gid = currentUserGroupId.value;
|
|
|
if (!canSubmitReview.value)
|
|
if (!canSubmitReview.value)
|
|
|
return;
|
|
return;
|
|
|
- if (t === 2) {
|
|
|
|
|
- reviewOpinion.value = f.ichUnit ?? null;
|
|
|
|
|
- reviewPoints.value = f.unitPoints || null;
|
|
|
|
|
- } else if (t === 3) {
|
|
|
|
|
- reviewOpinion.value = f.county ?? null;
|
|
|
|
|
- reviewPoints.value = f.countyPoints || null;
|
|
|
|
|
- } else if (t === 4) {
|
|
|
|
|
- reviewOpinion.value = f.district ?? null;
|
|
|
|
|
- reviewPoints.value = f.districtPoints || null;
|
|
|
|
|
- } else if (t === 5) {
|
|
|
|
|
- reviewOpinion.value = f.province ?? null;
|
|
|
|
|
- reviewPoints.value = f.provincePoints || null;
|
|
|
|
|
|
|
+ if (gid === GROUP_DISTRICT_ST) {
|
|
|
|
|
+ reviewOpinion.value = f.districtSt ?? null;
|
|
|
|
|
+ reviewPoints.value = f.districtStPoints || null;
|
|
|
|
|
+ } else if (gid === GROUP_DISTRICT_ND) {
|
|
|
|
|
+ reviewOpinion.value = f.districtNd ?? null;
|
|
|
|
|
+ reviewPoints.value = f.districtNdPoints || null;
|
|
|
|
|
+ } else if (gid === GROUP_DISTRICT_RD) {
|
|
|
|
|
+ reviewOpinion.value = f.districtRd ?? null;
|
|
|
|
|
+ reviewPoints.value = f.districtRdPoints || null;
|
|
|
|
|
+ } else if (gid === GROUP_DISTRICT_TH) {
|
|
|
|
|
+ reviewOpinion.value = f.districtTh ?? null;
|
|
|
|
|
+ reviewPoints.value = f.districtThPoints || null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const t = reviewProgressInfo.value.target;
|
|
|
|
|
+ if (t === 2) {
|
|
|
|
|
+ reviewOpinion.value = f.ichUnit ?? null;
|
|
|
|
|
+ reviewPoints.value = f.unitPoints || null;
|
|
|
|
|
+ } else if (t === 3) {
|
|
|
|
|
+ reviewOpinion.value = f.county ?? null;
|
|
|
|
|
+ reviewPoints.value = f.countyPoints || null;
|
|
|
|
|
+ } else if (t === 4) {
|
|
|
|
|
+ reviewOpinion.value = f.district ?? null;
|
|
|
|
|
+ reviewPoints.value = f.districtPoints || null;
|
|
|
|
|
+ } else if (t === 5) {
|
|
|
|
|
+ reviewOpinion.value = f.province ?? null;
|
|
|
|
|
+ reviewPoints.value = f.provincePoints || null;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -305,7 +343,7 @@ async function submitReview() {
|
|
|
message.warning('当前账号用户组无权提交审核');
|
|
message.warning('当前账号用户组无权提交审核');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (reviewOpinion.value == null) {
|
|
|
|
|
|
|
+ if (reviewOpinion.value == null || reviewOpinion.value === 0) {
|
|
|
message.warning('请选择审核意见');
|
|
message.warning('请选择审核意见');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -313,21 +351,30 @@ async function submitReview() {
|
|
|
message.warning('请输入审核评分');
|
|
message.warning('请输入审核评分');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- const t = reviewProgressInfo.value.target;
|
|
|
|
|
- const base = { id: f.id, progress: t };
|
|
|
|
|
|
|
+ const gid = currentUserGroupId.value;
|
|
|
const points = reviewPoints.value;
|
|
const points = reviewPoints.value;
|
|
|
const op = reviewOpinion.value;
|
|
const op = reviewOpinion.value;
|
|
|
|
|
+ const noProgressChange = isNoProgressChange.value;
|
|
|
|
|
+ const base = { id: f.id, progress: noProgressChange ? f.progress : reviewProgressInfo.value.target };
|
|
|
try {
|
|
try {
|
|
|
submitLoading.value = true;
|
|
submitLoading.value = true;
|
|
|
- if (t === 2)
|
|
|
|
|
|
|
+ if (gid === GROUP_DISTRICT_ST)
|
|
|
|
|
+ await AssessmentContentApi.reviewSelfAssessment({ ...base, districtSt: op, districtStPoints: points });
|
|
|
|
|
+ else if (gid === GROUP_DISTRICT_ND)
|
|
|
|
|
+ await AssessmentContentApi.reviewSelfAssessment({ ...base, districtNd: op, districtNdPoints: points });
|
|
|
|
|
+ else if (gid === GROUP_DISTRICT_RD)
|
|
|
|
|
+ await AssessmentContentApi.reviewSelfAssessment({ ...base, districtRd: op, districtRdPoints: points });
|
|
|
|
|
+ else if (gid === GROUP_DISTRICT_TH)
|
|
|
|
|
+ await AssessmentContentApi.reviewSelfAssessment({ ...base, districtTh: op, districtThPoints: points });
|
|
|
|
|
+ else if (base.progress === 2)
|
|
|
await AssessmentContentApi.reviewSelfAssessment({ ...base, ichUnit: op, unitPoints: points });
|
|
await AssessmentContentApi.reviewSelfAssessment({ ...base, ichUnit: op, unitPoints: points });
|
|
|
- else if (t === 3)
|
|
|
|
|
|
|
+ else if (base.progress === 3)
|
|
|
await AssessmentContentApi.reviewSelfAssessment({ ...base, county: op, countyPoints: points });
|
|
await AssessmentContentApi.reviewSelfAssessment({ ...base, county: op, countyPoints: points });
|
|
|
- else if (t === 4)
|
|
|
|
|
|
|
+ else if (base.progress === 4)
|
|
|
await AssessmentContentApi.reviewSelfAssessment({ ...base, district: op, districtPoints: points });
|
|
await AssessmentContentApi.reviewSelfAssessment({ ...base, district: op, districtPoints: points });
|
|
|
else
|
|
else
|
|
|
await AssessmentContentApi.reviewSelfAssessment({ ...base, province: op, provincePoints: points });
|
|
await AssessmentContentApi.reviewSelfAssessment({ ...base, province: op, provincePoints: points });
|
|
|
- message.success('审核提交成功');
|
|
|
|
|
|
|
+ message.success(noProgressChange ? '意见提交成功' : '审核提交成功');
|
|
|
loader.load();
|
|
loader.load();
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
Modal.error({ title: '审核提交失败', content: formatErr(e) });
|
|
Modal.error({ title: '审核提交失败', content: formatErr(e) });
|