Kaynağa Gözat

📦 按要求在详情中增加审核修改意见

快乐的梦鱼 1 ay önce
ebeveyn
işleme
bbca2cc2b2

+ 6 - 2
src/api/collect/AssessmentContent.ts

@@ -505,7 +505,6 @@ export class SelfAssessmentDetail extends DataModel<SelfAssessmentDetail> {
   address = '' as string|null;
   content : Record<string, any>|null = null;
   weigh = 0 as number;
-  reasons = [] as string[]|null;
   awardTime = dayjs();
   deductContent = '' as string|null;
   deductPoints = 0 as number;
@@ -566,6 +565,8 @@ export class SelfAssessmentDetail extends DataModel<SelfAssessmentDetail> {
   rejectType = 0 as number;
   /** 退回原因 */
   rejectReason = '' as string;
+  /** 退回意见 reasons [键值-角色组id : 退回意见] */
+  reasons = {} as Record<number, string>;
 }
 
 /** 传承协议详情 */
@@ -709,8 +710,10 @@ export interface IchCheckReviewPayload {
   rejectType?: number;
   /** 退回原因 */
   rejectReason?: string;
-  /** 退回意见reasons [键值-角色组id : 退回意见] */
+  /** 退回意见 reasons [键值-角色组id : 退回意见] */
   reasons?:Record<number, string>;
+
+  sendMsg?: boolean;
 }
 
 /** 证明材料修改与新增请求体(POST /ich/check/saveAnnex) */
@@ -1039,6 +1042,7 @@ export class AssessmentContentApi extends AppServerRequestModule<DataModel> {
       reject_type: payload.rejectType || 0,
       reject_reason: payload.rejectReason,
       reasons: payload.reasons,
+      send_msg: payload.sendMsg === false ? 0 : undefined,
     });
   }
 

+ 84 - 49
src/pages/collect/assessment/components/SelfAssessmentResultBlock.vue

@@ -1,53 +1,59 @@
 <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-tag 
-        v-if="currentForm.rejectType === sec.rejectTypeValue"
-        :title="currentForm.rejectReason"
-        color="red"
-        class="ml-2!"
-      >
-        被退回
-        <span v-if="currentForm.rejectReason" class="ml-2 max-w-100 truncate">原因:{{ currentForm.rejectReason }}</span>
-      </a-tag>
-      <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 v-if="currentForm.rejectType === sec.rejectTypeValue && currentForm.rejectReason" class="mt-2 ml-2">
-        <a-alert type="warning" show-icon>
-          <template #message>退回原因:{{ currentForm.rejectReason }}</template>
-        </a-alert>
-      </div>
+    <a-table
+      :columns="columns"
+      :data-source="tableData"
+      :pagination="false"
+      bordered
+      size="small"
+    >
+      <template #bodyCell="{ column, record }">
+        <template v-if="column.dataIndex === 'opinion'">
+          <span v-if="record.opinionValue">{{ getOpinionLabel(record.opinionValue) }}</span>
+          <span v-else class="text-gray-400">(待审核)</span>
+        </template>
+        <template v-else-if="column.dataIndex === 'points'">
+          <template v-if="!readonly && record.editable">
+            <a-input-number
+              :value="currentForm[record.pointsField as PointsField]"
+              :min="0"
+              :max="200"
+              placeholder="请输入评分"
+              @update:value="(v: number | null) => updateField(record.pointsField, v ?? 0)"
+            />
+          </template>
+          <template v-else>
+            <span v-if="record.pointsValue">{{ record.pointsValue }}</span>
+            <span v-else class="text-gray-400">(待审核填写)</span>
+          </template>
+        </template>
+        <template v-else-if="column.dataIndex === 'reason'">
+          <span v-if="record.reason" class="text-orange-600">{{ record.reason }}</span>
+          <span v-else class="text-gray-400">暂无</span>
+        </template>
+        <template v-else-if="column.dataIndex === 'reject'">
+          <a-tag v-if="currentForm.rejectType === record.rejectTypeValue" color="red">
+            被退回
+          </a-tag>
+        </template>
+      </template>
+    </a-table>
+    <div v-if="currentForm.rejectType && currentForm.rejectReason" class="mt-4">
+      <a-alert type="warning" show-icon>
+        <template #message>退回原因:{{ currentForm.rejectReason }}</template>
+      </a-alert>
     </div>
   </div>
 </template>
 
 <script setup lang="ts">
+import { computed } from 'vue';
 import type { SelfAssessmentDetail } from '@/api/collect/AssessmentContent';
+import { GROUP_PROTECT_UNIT, GROUP_DISTRICT, GROUP_DISTRICT_CENTER, GROUP_DISTRICT_ST, GROUP_DISTRICT_ND, GROUP_DISTRICT_RD, GROUP_DISTRICT_TH, GROUP_DISTRICT_FI, GROUP_PROVINCE } from '../composeables/GroupData';
 
-type OpinionField = 'ichUnit' | 'county' | 'district' | 'province' | 'districtSt' | 'districtNd' | 'districtRd' | 'districtTh';
-type PointsField = 'unitPoints' | 'countyPoints' | 'districtPoints' | 'provincePoints' | 'districtStPoints' | 'districtNdPoints' | 'districtRdPoints' | 'districtThPoints';
+type OpinionField = 'ichUnit' | 'county' | 'district' | 'province' | 'districtSt' | 'districtNd' | 'districtRd' | 'districtTh' | 'districtFi';
+type PointsField = 'unitPoints' | 'countyPoints' | 'districtPoints' | 'provincePoints' | 'districtStPoints' | 'districtNdPoints' | 'districtRdPoints' | 'districtThPoints' | 'districtFiPoints';
 
 const props = withDefaults(defineProps<{
   currentForm: SelfAssessmentDetail;
@@ -64,17 +70,46 @@ const opinionOptions = [
   { label: '取消资格', value: 5 },
 ];
 
-const sections: { key: string; title: string; opinionField: OpinionField; pointsField: PointsField; rejectTypeValue: number }[] = [
-  { key: 'ichUnit', title: '1. 项目保护单位意见', opinionField: 'ichUnit', pointsField: 'unitPoints', rejectTypeValue: 2 },
-  { key: 'county', title: '2. 县(区)文旅部门审核意见', opinionField: 'county', pointsField: 'countyPoints', rejectTypeValue: 3 },
-  { key: 'district', title: '3. 设区市文旅部门、省非遗中心审核意见', opinionField: 'district', pointsField: 'districtPoints', rejectTypeValue: 4 },
-  { key: 'districtSt', title: '3-1. 项目负责人意见', opinionField: 'districtSt', pointsField: 'districtStPoints', rejectTypeValue: -1 },
-  { key: 'districtNd', title: '3-2. 部门主任意见', opinionField: 'districtNd', pointsField: 'districtNdPoints', rejectTypeValue: -1 },
-  { key: 'districtRd', title: '3-3. 分管领导意见', opinionField: 'districtRd', pointsField: 'districtRdPoints', rejectTypeValue: -1 },
-  { key: 'districtTh', title: '3-4. 工服处意见', opinionField: 'districtTh', pointsField: 'districtThPoints', rejectTypeValue: 4 },
-  { key: 'province', title: '4. 省文化和旅游厅意见', opinionField: 'province', pointsField: 'provincePoints', rejectTypeValue: 5 },
+function getOpinionLabel(value: number | null | undefined) {
+  if (!value) return '';
+  return opinionOptions.find(o => o.value === value)?.label ?? '';
+}
+
+const sections: { key: string; title: string; opinionField: OpinionField; pointsField: PointsField; rejectTypeValue: number; groupId: number }[] = [
+  { key: 'ichUnit', title: '1. 项目保护单位意见', opinionField: 'ichUnit', pointsField: 'unitPoints', rejectTypeValue: 2, groupId: GROUP_PROTECT_UNIT },
+  { key: 'county', title: '2. 县(区)文旅部门审核意见', opinionField: 'county', pointsField: 'countyPoints', rejectTypeValue: 3, groupId: GROUP_DISTRICT },
+  { key: 'district', title: '3. 设区市文旅部门、省非遗中心审核意见', opinionField: 'district', pointsField: 'districtPoints', rejectTypeValue: 4, groupId: GROUP_DISTRICT_CENTER },
+  { key: 'districtSt', title: '3.1 项目负责人意见', opinionField: 'districtSt', pointsField: 'districtStPoints', rejectTypeValue: -1, groupId: GROUP_DISTRICT_ST },
+  { key: 'districtNd', title: '3.2 部门主任意见', opinionField: 'districtNd', pointsField: 'districtNdPoints', rejectTypeValue: -1, groupId: GROUP_DISTRICT_ND },
+  { key: 'districtRd', title: '3.3 分管领导意见', opinionField: 'districtRd', pointsField: 'districtRdPoints', rejectTypeValue: -1, groupId: GROUP_DISTRICT_RD },
+  { key: 'districtTh', title: '4.1 工服处意见', opinionField: 'districtTh', pointsField: 'districtThPoints', rejectTypeValue: 4, groupId: GROUP_DISTRICT_TH },
+  { key: 'districtFi', title: '4.2 工服处-分管领导意见', opinionField: 'districtFi', pointsField: 'districtFiPoints', rejectTypeValue: -1, groupId: GROUP_DISTRICT_FI },
+  { key: 'province', title: '5. 省文化和旅游厅意见', opinionField: 'province', pointsField: 'provincePoints', rejectTypeValue: 5, groupId: GROUP_PROVINCE },
+];
+
+const columns = [
+  { title: '审核环节', dataIndex: 'title', width: 220 },
+  { title: '审核意见', dataIndex: 'opinion', width: 120 },
+  { title: '评分', dataIndex: 'points', width: 120 },
+  { title: '退回/修改意见', dataIndex: 'reason', width: 200 },
 ];
 
+const tableData = computed(() => {
+  const reasons = props.currentForm.reasons || {};
+  return sections.map(sec => ({
+    key: sec.key,
+    title: sec.title,
+    opinionField: sec.opinionField,
+    pointsField: sec.pointsField,
+    opinionValue: props.currentForm[sec.opinionField] as number | null,
+    pointsValue: props.currentForm[sec.pointsField] as number | null,
+    rejectTypeValue: sec.rejectTypeValue,
+    groupId: sec.groupId,
+    reason: reasons[sec.groupId] || '',
+    editable: !props.readonly,
+  }));
+});
+
 function updateField(field: OpinionField | PointsField, value: number) {
   (props.currentForm as any)[field] = value;
 }

+ 8 - 8
src/pages/collect/assessment/evaluation-form-review.vue

@@ -152,26 +152,25 @@
                 </div>
                 <div class="flex row w-full gap-3">
                   <template v-if="!alreadySubmitted || isMulitRole">
-                    <div class="flex flex-col flex-1">
+                    <div v-if="isMulitRole" class="flex flex-col flex-1">
                       <a-button
                         block
-                        type="primary"
                         :loading="submitLoading"
                         :disabled="!canSubmitReview"
-                        @click="submitReview"
+                        @click="saveReasions"
                       >
-                        {{ isNoProgressChange ? '提交意见' : '通过审核' }}
+                        保存意见
                       </a-button>
                     </div>
-                    <div v-if="isMulitRole" class="flex flex-col flex-1">
+                    <div class="flex flex-col flex-1">
                       <a-button
                         block
                         type="primary"
                         :loading="submitLoading"
                         :disabled="!canSubmitReview"
-                        @click="saveReasions"
+                        @click="submitReview"
                       >
-                        保存意见
+                        {{ isNoProgressChange ? '提交意见' : '通过审核' }}
                       </a-button>
                     </div>
                     <div v-if="reviewProgressInfo?.canReject" class="flex flex-col flex-1">
@@ -424,7 +423,8 @@ async function saveReasions() {
     await AssessmentContentApi.reviewSelfAssessment({
       id: f.id,
       progress: f.progress,
-      reasons
+      reasons,
+      sendMsg: false
     });
     message.success('保存成功');
   } catch (e) {