|
|
@@ -37,7 +37,7 @@
|
|
|
<a-button type="link" @click.stop="router.push({ name: 'CollectEvaluationForm', query: { id: item.checkId ?? item.id, userId: item.userId } })">编辑</a-button>
|
|
|
<a-button
|
|
|
type="primary"
|
|
|
- v-if="item.checkId && item.progress != null && item.progress >= 1 && item.progress < 5"
|
|
|
+ v-if="canReview(item)"
|
|
|
@click.stop="handleReviewSelfAssessment(item)"
|
|
|
>
|
|
|
审核
|
|
|
@@ -76,13 +76,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref } from 'vue';
|
|
|
+import { computed, ref } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { message } from 'ant-design-vue';
|
|
|
import { ExclamationCircleOutlined, InfoCircleOutlined } from '@ant-design/icons-vue';
|
|
|
import CommonListBlock, { type DropdownCommonItem } from '@/components/content/CommonListBlock.vue';
|
|
|
-import AssessmentContentApi from '@/api/collect/AssessmentContent';
|
|
|
+import AssessmentContentApi, { SelfAssessmentDetail } from '@/api/collect/AssessmentContent';
|
|
|
import { useMemorizeVar } from '@/composeables/useMemorizeVar';
|
|
|
+import { useAuthStore } from '@/stores/auth';
|
|
|
+import { GROUP_TO_REVIEW_PROGRESS } from './composeables/GroupData';
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
@@ -126,6 +128,18 @@ const checkLogReviewTypeOptions: DropdownCommonItem[] = [
|
|
|
{ id: 5, name: '省文化和旅游厅' },
|
|
|
];
|
|
|
|
|
|
+
|
|
|
+const authStore = useAuthStore();
|
|
|
+const currentUserGroups = computed(() => authStore.userInfo?.adminGroup || []);
|
|
|
+
|
|
|
+function canReview(item: SelfAssessmentDetail) {
|
|
|
+ const currentUserGroup = currentUserGroups.value.find((group) => GROUP_TO_REVIEW_PROGRESS[group.id]);
|
|
|
+ const currentUserReviewProgress = GROUP_TO_REVIEW_PROGRESS[currentUserGroup?.id ?? 0] ?? 0;
|
|
|
+ return item.checkId
|
|
|
+ && item.progress != null && item.progress >= 1 && item.progress < 5 //必须已经提交
|
|
|
+ && item.progress < currentUserReviewProgress; // 当前审核阶段未完成
|
|
|
+}
|
|
|
+
|
|
|
function selfAssessmentProgressLabel(progress: number | null | undefined) {
|
|
|
if (progress === null || progress === undefined)
|
|
|
return '未填写';
|
|
|
@@ -193,7 +207,7 @@ async function loadCheckLogList(page: number, pageSize: number, searchText: stri
|
|
|
};
|
|
|
}
|
|
|
|
|
|
-function handleReviewSelfAssessment(item: { checkId: number | null; userId: number | null; progress?: number | null }) {
|
|
|
+function handleReviewSelfAssessment(item: SelfAssessmentDetail) {
|
|
|
const cid = item.checkId;
|
|
|
const uid = item.userId;
|
|
|
if (!cid || !uid) {
|