Procházet zdrojové kódy

💊 修复回退无效问题

快乐的梦鱼 před 2 týdny
rodič
revize
5887fc56c4

+ 15 - 2
src/pages/collect/assessment/argeement-sign-list.vue

@@ -142,6 +142,7 @@ import VChart from "vue-echarts";
 import CommonListBlock, { type DropdownCommonItem } from '@/components/content/CommonListBlock.vue';
 import AssessmentContentApi, { type UserAgreementListRow } from '@/api/collect/AssessmentContent';
 import { LEVEL_NATIONAL, LEVEL_PROVINCE, LEVEL_DISTRICT } from '@/api/collect/AssessmentConsts';
+import { Modal } from 'ant-design-vue';
 
 const dataStats = ref<Awaited<ReturnType<typeof AssessmentContentApi.getDataCount>>|null>(null);
 
@@ -262,7 +263,13 @@ function handleEditCheckForm(item: any) {
 }
 
 function handleReviewCheckForm(item: any) {
-  if (!item.checkFormId || !item.userId) return;
+  if (!item.checkFormId || !item.userId)  {
+    Modal.warning({
+      title: '错误',
+      content: '!没有返回checkFormId',
+    });
+    return;
+  };
   router.push({
     name: 'CollectEvaluationFormReview',
     query: {
@@ -317,7 +324,13 @@ function handleEdit(item: any) {
 }
 
 function handleReview(item: any) {
-  if (!item.agreementId || !item.userId) return;
+  if (!item.agreementId || !item.userId) {
+    Modal.warning({
+      title: '错误',
+      content: '!没有返回agreementId',
+    });
+    return;
+  }
   router.push({
     name: 'CollectAgreementSignReview',
     query: {

+ 1 - 1
src/pages/collect/assessment/argeement-sign-review.vue

@@ -71,7 +71,7 @@
                         :disabled="!canSubmitReview"
                         @click="submitReview"
                       >
-                        {{ isNoProgressChange ? '提交意见' : '通过审核' }}
+                        通过审核
                       </a-button>
                     </a-form-item>
                   </div>

+ 10 - 5
src/pages/collect/assessment/evaluation-form-list-block.vue

@@ -188,7 +188,7 @@ import { ref, watch } from 'vue';
 import { useRoute, useRouter } from 'vue-router';
 import { useMemorizeVar } from '@/composeables/useMemorizeVar';
 import { useReview } from './composeables/Review';
-import { message } from 'ant-design-vue';
+import { message, Modal } from 'ant-design-vue';
 import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
 import  AssessmentContentApi, { SelfAssessmentDetail } from '@/api/collect/AssessmentContent';
 import CommonListBlock, { type DropdownCommonItem } from '@/components/content/CommonListBlock.vue';
@@ -284,7 +284,6 @@ function agreementProgressLabel(progress: number | null | undefined) {
 }
 
 function handleEditAgreement(item: any) {
-  console.log(item);
   router.push({
     name: 'CollectAgreementSign',
     query: { id: item.agreementId && item.agreementId > 0 ? item.agreementId : 0, userId: item.userId ?? 0 },
@@ -292,7 +291,13 @@ function handleEditAgreement(item: any) {
 }
 
 function handleReviewAgreement(item: any) {
-  if (!item.agreementId || !item.userId) return;
+  if (!item.agreementId || !item.userId) {
+    Modal.warning({
+      title: '错误',
+      content: '!没有返回agreementId',
+    });
+    return;
+  }
   router.push({
     name: 'CollectAgreementSignReview',
     query: {
@@ -332,7 +337,7 @@ async function loadSelfAssessmentAdminList(page: number, pageSize: number, searc
 }
 
 function handleReviewSelfAssessment(item: SelfAssessmentDetail) {
- /*  const cid = item.checkId;
+  const cid = item.checkId;
   const uid = item.userId;
   if (!cid || !uid) {
     message.warning('缺少自查表 ID 或传承人用户 ID');
@@ -345,7 +350,7 @@ function handleReviewSelfAssessment(item: SelfAssessmentDetail) {
       userId: String(uid),
       ...(item.progress != null && item.progress !== undefined ? { progress: String(item.progress) } : {}),
     },
-  }); */
+  });
 }
 
 async function handleDownloadZip() {

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

@@ -67,89 +67,106 @@
                 :message="`${getRejectTypeText(currentForm.rejectType)}已退回: ${currentForm.rejectReason}`"
               />
               <a-form v-else layout="vertical" size="middle">
-                
                 <div class="flex flex-col md:flex-row lg:flex-row w-full gap-3 py-3">
-                  <div
-                    v-for="{ gid, def } in displayFieldDefs"
-                    :key="gid"
-                    class="flex flex-col flex-1"
-                  >
-                    <div class="flex flex-row gap-3">
-                      <a-form-item :required="gid === currentUserGroupId" :label="`${def.label} — 审核意见`">
+                  <!-- 单用户组审核 -->
+                  <template v-if="displayFieldDefs.length === 0">
+                    <div class="flex flex-col flex-1">     
+                      <a-form-item required label="不通过回退:回退原因">
+                        <a-textarea
+                          v-model:value="rejectReason"
+                          allow-clear
+                          placeholder="请输入回退原因"
+                          :rows="5"
+                          :maxlength="500"
+                          show-count
+                        />
+                      </a-form-item>
+                    </div>
+                    <div v-if="displayFieldDefs.length === 0" class="flex flex-col flex-1">
+                      <a-form-item required :label="isNoProgressChange ? `提交意见:${reviewLevelLabel}` : `审核通过:${reviewLevelLabel}`">
                         <a-select
-                          :value="reviewFields[gid]?.opinion"
+                          :value="reviewFields[currentUserGroupId]?.opinion"
                           allow-clear
                           placeholder="请选择审核意见"
                           :options="opinionSelectOptions"
-                          @update:value="(v: number | null) => reviewFields[gid].opinion = v"
+                          :disabled="alreadySubmitted"
+                          @update:value="(v: number | null) => reviewFields[currentUserGroupId].opinion = v"
                         />
                       </a-form-item>
-                      <a-form-item :label="`${def.label} — 评分`">
+                      <a-form-item label="评分">
                         <a-input-number
-                          :value="reviewFields[gid]?.points"
+                          :value="reviewFields[currentUserGroupId]?.points"
                           :min="0"
                           :max="100"
                           class="w-full"
                           placeholder="请填写分数"
-                          @update:value="(v: number | null) => reviewFields[gid].points = v"
+                          :disabled="alreadySubmitted"
+                          @update:value="(v: number | null) => reviewFields[currentUserGroupId].points = v"
                         />
                       </a-form-item>
                     </div>
-                    <a-form-item :label="`${def.label} — 修改意见`">
-                      <a-textarea
-                        :value="reviewFields[gid]?.reason"
-                        @update:value="(v: string | null) => reviewFields[gid].reason = v"
-                        allow-clear
-                        placeholder="请输入修改意见/回退原因"
-                        :rows="5"
-                        :maxlength="500"
-                        show-count
-                      />
-                    </a-form-item>
-                    <a-alert
-                      v-if="alreadySubmitted && gid === currentUserGroupId"
-                      type="success"
-                      show-icon
-                      class="mb-4"
-                      message="当前角色已提交意见"
-                    />
-                  </div>
-                  <div v-if="displayFieldDefs.length === 0" class="flex flex-col flex-1">
-                    <a-form-item required :label="isNoProgressChange ? `提交意见:${reviewLevelLabel}` : `审核通过:${reviewLevelLabel}`">
-                      <a-select
-                        :value="reviewFields[currentUserGroupId]?.opinion"
-                        allow-clear
-                        placeholder="请选择审核意见"
-                        :options="opinionSelectOptions"
-                        :disabled="alreadySubmitted"
-                        @update:value="(v: number | null) => reviewFields[currentUserGroupId].opinion = v"
-                      />
-                    </a-form-item>
-                    <a-form-item label="评分">
-                      <a-input-number
-                        :value="reviewFields[currentUserGroupId]?.points"
-                        :min="0"
-                        :max="100"
-                        class="w-full"
-                        placeholder="请填写分数"
-                        :disabled="alreadySubmitted"
-                        @update:value="(v: number | null) => reviewFields[currentUserGroupId].points = v"
-                      />
-                    </a-form-item>
-                  </div>
-                  <div v-if="displayFieldDefs.length <= 1 && (!isNoProgressChange || reviewProgressInfo?.canReject)" class="flex flex-col flex-1">     
-                    <a-form-item required label="不通过回退:回退原因">
-                      <a-textarea
-                        :value="reviewFields[currentUserGroupId].reason"
-                        @update:value="(v: string | null) => reviewFields[currentUserGroupId].reason = v"
-                        allow-clear
-                        placeholder="请输入回退原因"
-                        :rows="5"
-                        :maxlength="500"
-                        show-count
+                  </template>
+                  <!-- 多用户组审核 -->
+                  <template v-else>
+                    <div v-if="displayFieldDefs.length <= 1 && (!isNoProgressChange || reviewProgressInfo?.canReject)" class="flex flex-col flex-1">     
+                      <a-form-item required label="不通过回退:回退原因">
+                        <a-textarea
+                          :value="reviewFields[currentUserGroupId].reason"
+                          @update:value="(v: string | null) => reviewFields[currentUserGroupId].reason = v"
+                          allow-clear
+                          placeholder="请输入回退原因"
+                          :rows="5"
+                          :maxlength="500"
+                          show-count
+                        />
+                      </a-form-item>
+                    </div>
+                    <div
+                      v-for="{ gid, def } in displayFieldDefs"
+                      :key="gid"
+                      class="flex flex-col flex-1"
+                    >
+                      <div class="flex flex-row gap-3">
+                        <a-form-item :required="gid === currentUserGroupId" :label="`${def.label} — 审核意见`">
+                          <a-select
+                            :value="reviewFields[gid]?.opinion"
+                            allow-clear
+                            placeholder="请选择审核意见"
+                            :options="opinionSelectOptions"
+                            @update:value="(v: number | null) => reviewFields[gid].opinion = v"
+                          />
+                        </a-form-item>
+                        <a-form-item :label="`${def.label} — 评分`">
+                          <a-input-number
+                            :value="reviewFields[gid]?.points"
+                            :min="0"
+                            :max="100"
+                            class="w-full"
+                            placeholder="请填写分数"
+                            @update:value="(v: number | null) => reviewFields[gid].points = v"
+                          />
+                        </a-form-item>
+                      </div>
+                      <a-form-item :label="`${def.label} — 修改意见`">
+                        <a-textarea
+                          :value="reviewFields[gid]?.reason"
+                          @update:value="(v: string | null) => reviewFields[gid].reason = v"
+                          allow-clear
+                          placeholder="请输入修改意见/回退原因"
+                          :rows="5"
+                          :maxlength="500"
+                          show-count
+                        />
+                      </a-form-item>
+                      <a-alert
+                        v-if="alreadySubmitted && gid === currentUserGroupId"
+                        type="success"
+                        show-icon
+                        class="mb-4"
+                        message="当前角色已提交意见"
                       />
-                    </a-form-item>
-                  </div>
+                    </div>
+                  </template>
                 </div>
                 <div class="flex row w-full gap-3">
                   <template v-if="!alreadySubmitted || isMulitRole">