Pārlūkot izejas kodu

🎨 按要求增加各级审核结果显示

快乐的梦鱼 3 nedēļas atpakaļ
vecāks
revīzija
a300266e96

+ 9 - 0
src/api/collect/AssessmentContent.ts

@@ -498,15 +498,24 @@ export class SelfAssessmentDetail extends DataModel<SelfAssessmentDetail> {
 4=设区市文旅部门、省非遗中心审核完成,
 5=省文化和旅游厅审核完成 */
   progress = 0;
+  /** 自我评估: 1=优秀,2=合格,3=不合格,4=丧失传承能力,5=取消资格 */
   self = null as number|null;
   sign = '' as string|null;
+  /** 项目保护单位意见: 1=优秀,2=合格,3=不合格,4=丧失传承能力,5=取消资格 */
   ichUnit = null as number|null;
+  /** 项目保护单位评分 */
   unitPoints = 0 as number;
+  /** 县(区)文旅部门审核意见: 1=优秀,2=合格,3=不合格,4=丧失传承能力,5=取消资格 */
   county = null as number|null;
+  /** 县(区)文旅部门评分 */
   countyPoints = 0 as number;
+  /** 设区市文旅部门、省非遗中心审核意见: 1=优秀,2=合格,3=不合格,4=丧失传承能力,5=取消资格 */
   district = null as number|null;
+  /** 设区市文旅部门、省非遗中心评分 */
   districtPoints = 0 as number;
+  /** 省文化和旅游厅意见: 1=优秀,2=合格,3=不合格,4=丧失传承能力,5=取消资格 */
   province = null as number|null;
+  /** 省文化和旅游厅评分 */
   provincePoints = 0 as number;
   createtime = '' as string;
   updatetime = '' as string;

+ 6 - 0
src/pages/collect/assessment/components/SelfAssessmentFormDisplay.vue

@@ -7,6 +7,11 @@
       :current-form-check-items="currentFormCheckItems"
       :readonly="readonly"
     />
+    <a-divider />
+    <SelfAssessmentResultBlock
+      :current-form="currentForm"
+      :readonly="true"
+    />
   </div>
 </template>
 
@@ -14,6 +19,7 @@
 import { computed, ref } from 'vue';
 import type { CheckItemInfo, SelfAssessmentCheckItemAnswer, SelfAssessmentDetail } from '@/api/collect/AssessmentContent';
 import SelfAssessmentFormBlock from './SelfAssessmentFormBlock.vue';
+import SelfAssessmentResultBlock from './SelfAssessmentResultBlock.vue';
 
 const props = withDefaults(defineProps<{
   currentForm: SelfAssessmentDetail;

+ 63 - 0
src/pages/collect/assessment/components/SelfAssessmentResultBlock.vue

@@ -0,0 +1,63 @@
+<template>
+  <div>
+    <a-typography-title :level="4">各级审核意见</a-typography-title>
+    <div v-for="sec in sections" :key="sec.key" class="mb-6">
+      <a-typography-text strong>{{ sec.title }}</a-typography-text>
+      <a-space class="mt-2 ml-2" wrap>
+        <a-radio-group
+          :value="currentForm[sec.opinionField]"
+          :disabled="readonly"
+          @update:value="(v: number) => updateField(sec.opinionField, v)"
+        >
+          <a-radio v-for="opt in opinionOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</a-radio>
+        </a-radio-group>
+      </a-space>
+      <div class="mt-2 flex items-center gap-2">
+        <a-typography-text>评分:</a-typography-text>
+        <a-input-number
+          v-if="currentForm[sec.pointsField]"
+          :value="currentForm[sec.pointsField]"
+          :disabled="readonly"
+          :min="0"
+          :max="200"
+          placeholder="请输入评分"
+          @update:value="(v: number | null) => updateField(sec.pointsField, v ?? 0)"
+        />
+        <span v-else>(待审核填写)</span>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts">
+import type { SelfAssessmentDetail } from '@/api/collect/AssessmentContent';
+
+type OpinionField = 'ichUnit' | 'county' | 'district' | 'province';
+type PointsField = 'unitPoints' | 'countyPoints' | 'districtPoints' | 'provincePoints';
+
+const props = withDefaults(defineProps<{
+  currentForm: SelfAssessmentDetail;
+  readonly?: boolean;
+}>(), {
+  readonly: true,
+});
+
+const opinionOptions = [
+  { label: '优秀', value: 1 },
+  { label: '合格', value: 2 },
+  { label: '不合格', value: 3 },
+  { label: '丧失传承能力', value: 4 },
+  { label: '取消资格', value: 5 },
+];
+
+const sections: { key: string; title: string; opinionField: OpinionField; pointsField: PointsField }[] = [
+  { key: 'ichUnit', title: '1. 项目保护单位意见', opinionField: 'ichUnit', pointsField: 'unitPoints' },
+  { key: 'county', title: '2. 县(区)文旅部门审核意见', opinionField: 'county', pointsField: 'countyPoints' },
+  { key: 'district', title: '3. 设区市文旅部门、省非遗中心审核意见', opinionField: 'district', pointsField: 'districtPoints' },
+  { key: 'province', title: '4. 省文化和旅游厅意见', opinionField: 'province', pointsField: 'provincePoints' },
+];
+
+function updateField(field: OpinionField | PointsField, value: number) {
+  (props.currentForm as any)[field] = value;
+}
+</script>

+ 0 - 21
src/pages/collect/assessment/evaluation-form.vue

@@ -36,19 +36,6 @@
               :readonly="false"
             />
             <a-divider />
-            <a-typography-title :level="4">各级审核意见(待终审填写)</a-typography-title>
-            <div v-for="(sec, secIdx) in externalReviewSectionTitles" :key="secIdx" class="mb-6">
-              <a-typography-text strong>{{ sec.title }}</a-typography-text>
-              <a-input v-model:value="sec.suggestion" :disabled="sec.disabled" placeholder="(待终审填写)" class="mt-2" />
-              <a-space class="mt-2" wrap>
-                <a-checkbox v-for="(label, i) in externalReviewScoreRow1" :key="`r1-${i}`" disabled :checked="false">{{ label }}</a-checkbox>
-              </a-space>
-              <a-space class="mt-2" wrap>
-                <a-checkbox v-for="(label, i) in externalReviewScoreRow2" :key="`r2-${i}`" disabled :checked="false">{{ label }}</a-checkbox>
-              </a-space>
-              <div class="text-end text-secondary mt-2 text-sm">填写单位(盖章) 年 月 日</div>
-            </div>
-            <a-divider />
             <a-space direction="vertical" class="w-full" size="middle">
               <a-button type="primary" block :loading="submitLoading" @click="saveForm">保存评估表</a-button>
               <a-button v-if="!authStore.isAdmin && currentForm?.progress === 0" type="primary" block :loading="submitLoading" @click="submitForm">提交审核</a-button>
@@ -101,14 +88,6 @@ const checkItemList = ref([] as CheckItemInfo[]);
 const blockRef = ref<InstanceType<typeof SelfAssessmentFormDisplay> | null>(null);
 const submitLoading = ref(false);
 
-const externalReviewSectionTitles = ref([
-  { title: '1. 项目保护单位意见', suggestion: '', disabled: true },
-  { title: '2. 县(区)文旅部门审核意见', suggestion: '', disabled: true },
-  { title: '3. 设区市文旅部门、省非遗中心审核意见', suggestion: '', disabled: true },
-]);
-const externalReviewScoreRow1 = ['优秀', '合格', '不合格'] as const;
-const externalReviewScoreRow2 = ['丧失传承能力', '取消资格'] as const;
-
 const levelTitle = computed(() => {
   if (currentForm.value?.level === 23) return '国家级';
   if (currentForm.value?.level === 24) return '省级';