Преглед на файлове

feat: 主观题检查新增打回按钮

zhangjie преди 7 часа
родител
ревизия
3190c1e7db
променени са 4 файла, в които са добавени 71 реда и са изтрити 14 реда
  1. 9 1
      src/api/api-types/marking.d.ts
  2. 2 0
      src/api/marking.ts
  3. 20 3
      src/components/shared/SendBackMark.vue
  4. 40 10
      src/modules/quality/subjective-check/index.vue

+ 9 - 1
src/api/api-types/marking.d.ts

@@ -203,7 +203,13 @@ export namespace Marking {
 
   type RejectMarkHistory = BaseDefine<{ description?: string; id: number; reason?: string }>
   // type RejectCustomQueryTask = BaseDefine<{ description?: string; reason?: string; taskId: number }>
-  type RejectCustomQueryTask = BaseDefine<{ description?: string; reason?: string; taskIds: any; sendDeputy?: boolean }>
+  type RejectCustomQueryTask = BaseDefine<{
+    description?: string
+    reason?: string
+    taskIds: any[]
+    sendDeputy?: boolean
+  }>
+  type RejectSubjectiveCheck = BaseDefine<{ description?: string; taskId: number; reason?: string }>
 
   interface ArbitrationListItem {
     chiefName: string
@@ -363,6 +369,8 @@ export namespace Marking {
     getMarkScoreHistoryListWithTask: GetMarkScoreHistoryListWithTask
     /** 打回 */
     rejectMarkHistory: RejectMarkHistory
+    /** 主观题校验 - 打回 */
+    rejectSubjectiveCheck: RejectSubjectiveCheck
     rejectCustomQueryTask: RejectCustomQueryTask
     /** 仲裁卷列表 */
     getArbitrationList: GetArbitrationList

+ 2 - 0
src/api/marking.ts

@@ -48,6 +48,8 @@ const MarkingApi: DefineApiModule<Marking.ApiMap> = {
   getMarkScoreHistoryListWithTask: '/api/mark/history/task',
   /** 打回 */
   rejectMarkHistory: '/api/problem/history/reject',
+  /** 主观题校验 - 打回 */
+  rejectSubjectiveCheck: '/api/subjective/check/reject',
   // rejectCustomQueryTask: '/api/custom/query/reject',
   rejectCustomQueryTask: {
     url: '/api/custom/query/reject',

+ 20 - 3
src/components/shared/SendBackMark.vue

@@ -51,8 +51,8 @@ const props = withDefaults(
   defineProps<{
     modelValue: boolean
     id: number | undefined
-    // 问题卷 | 系统抽查 | 自查卷
-    type?: 'problem' | 'system-check' | 'self-check' | 'custom-check'
+    // 问题卷 | 系统抽查 | 自查卷 | 主观题校验
+    type?: 'problem' | 'system-check' | 'self-check' | 'custom-check' | 'subject-check'
   }>(),
   { type: 'problem' }
 )
@@ -115,6 +115,7 @@ const items: any = computed(() => {
 })
 
 const { fetch: rejectMarkHistory } = useFetch('rejectMarkHistory')
+const { fetch: rejectSubjectiveCheck } = useFetch('rejectSubjectiveCheck')
 
 const { fetch: rejectSystemSpotPaper } = useFetch('rejectSystemSpotPaper')
 
@@ -123,6 +124,7 @@ const { fetch: rejectCustomCheckData } = useFetch('rejectCustomQueryTask')
 
 const ApiMap = {
   problem: rejectMarkHistory,
+  'subject-check': rejectSubjectiveCheck,
   'system-check': rejectSystemSpotPaper,
   'self-check': rejectSelfCheckData,
   'custom-check': rejectCustomCheckData,
@@ -146,8 +148,23 @@ const onSendBack = async () => {
         params.sendDeputy = model.sendDeputy?.length > 0
       }
       await rejectCustomCheckData(params)
+    } else if (props.type === 'subject-check') {
+      let params: any = {
+        description: model.description,
+        reason: model.reason,
+        taskId: props.id,
+      }
+      if (needRejectMessage.value && !['MARKER', 'DEPUTY'].includes(mainStore.myUserInfo?.role || '')) {
+        params.sendDeputy = model.sendDeputy?.length > 0
+      }
+      await ApiMap[props.type](params)
     } else {
-      await ApiMap[props.type]({ description: model.description, reason: model.reason, id: props.id })
+      const params: any = {
+        description: model.description,
+        reason: model.reason,
+        id: props.id,
+      }
+      await ApiMap[props.type](params)
     }
     // }
     visible.value = false

+ 40 - 10
src/modules/quality/subjective-check/index.vue

@@ -7,15 +7,25 @@
       @click="onOperationClick"
     >
       <!-- <el-button type="primary" size="small" class="m-l-base" @click="onEditScore">修改给分</el-button> -->
-      <el-button
-        type="primary"
-        size="small"
-        class="m-l-base m-r-auto"
-        :disabled="!currentSubjectiveCheck"
-        :loading="confirmLoading"
-        @click="onConfirm"
-        >提交确认</el-button
-      >
+      <div style="flex-grow: 2">
+        <el-button
+          :disabled="!currentSubjectiveCheck?.taskId"
+          class="m-l-base m-r-auto"
+          size="small"
+          type="primary"
+          @click="onSendBack"
+          >打回</el-button
+        >
+        <el-button
+          type="primary"
+          size="small"
+          class="m-l-base m-r-auto"
+          :disabled="!currentSubjectiveCheck"
+          :loading="confirmLoading"
+          @click="onConfirm"
+          >提交确认</el-button
+        >
+      </div>
     </mark-header>
     <div class="flex flex-1 overflow-hidden p-base mark-container">
       <splitpanes class="default-theme" style="height: 100%" @resize="setPaneSize">
@@ -142,6 +152,12 @@
     v-model="visibleHistory"
     :task="currentViewHistory"
   ></mark-history-list>
+  <send-back-mark
+    :id="currentSubjectiveCheck?.taskId"
+    v-model="sendBackVisible"
+    type="subject-check"
+    @rejected="onRejected"
+  ></send-back-mark>
 </template>
 
 <script setup lang="ts" name="QualitySubjectiveCheck">
@@ -164,6 +180,7 @@ import MarkHeader from '@/components/shared/MarkHeader.vue'
 import ScoringPanelWithConfirm from '@/components/shared/ScoringPanelWithConfirm.vue'
 import ImagePreview from '@/components/shared/ImagePreview.vue'
 import SvgIcon from '@/components/common/SvgIcon.vue'
+import SendBackMark from '@/components/shared/SendBackMark.vue'
 
 import type { SetImgBgOption } from '@/hooks/useSetImgBg'
 import type { ExtractMultipleApiResponse, ExtractApiParams } from '@/api/api'
@@ -205,6 +222,19 @@ const currentHistoryColumns = computed<any>(() => [
   { label: '评卷时间', prop: 'markTime', width: 130 },
 ])
 
+/** 打回弹窗 */
+const sendBackVisible = ref<boolean>(false)
+/** 打回 */
+const onSendBack = () => {
+  sendBackVisible.value = true
+}
+/** 打回成功 */
+const onRejected = () => {
+  onRefresh()
+  ElMessage.success('打回成功')
+  // fetchTable()
+}
+
 /** 给分板 */
 const editScoreVisible = ref<boolean>(true)
 
@@ -254,7 +284,7 @@ const operationHandles: Partial<Record<OperationType, (...args: any) => void>> =
   rotate: onRotate,
   'front-color': setFrontColor,
   'background-color': setBackgroundColor,
-  refresh: onRefresh,
+  // refresh: onRefresh,
   standard: onViewStandard,
 }