Browse Source

fix: bug fix

chenhao 2 years ago
parent
commit
2829dc0790

+ 1 - 1
src/components/shared/ScoringPanel.vue

@@ -117,7 +117,7 @@ const questionList = computed(() => {
 })
 
 const allowSubmit = computed(() => {
-  return scoreValues.value?.length === questionList.value?.length
+  return questionList.value?.length && scoreValues.value?.length === questionList.value?.length
 })
 
 const onSubmit = () => {

+ 7 - 1
src/components/shared/SendBackMark.vue

@@ -10,7 +10,7 @@
 
 <script setup lang="ts" name="SendBackMark">
 /** 打回弹窗 */
-import { reactive, withDefaults } from 'vue'
+import { reactive, withDefaults, watch } from 'vue'
 import { ElFormItem } from 'element-plus'
 import BaseDialog from '@/components/element/BaseDialog.vue'
 import BaseForm from '../element/BaseForm.vue'
@@ -45,6 +45,12 @@ const model = reactive({
   description: '',
 })
 
+watch(visible, () => {
+  if (!visible.value) {
+    elFormRef?.value?.resetFields()
+  }
+})
+
 const rules = {
   reason: [{ required: true, message: '请选择打回原因' }],
 }

+ 9 - 6
src/modules/expert/assess/index.vue

@@ -149,11 +149,15 @@ watch(dataModel, () => {
 
 const { fetch: getForceCheckGroupList, result: forceCheckGroup } = useFetch('getForceCheckGroupList')
 
-watch(dataModel, () => {
-  if (dataModel.subject && dataModel.question) {
-    getForceCheckGroupList({ subjectCode: dataModel.subject, mainNumber: dataModel.question })
-  }
-})
+watch(
+  dataModel,
+  () => {
+    if (dataModel.subject && dataModel.question) {
+      getForceCheckGroupList({ subjectCode: dataModel.subject, mainNumber: dataModel.question })
+    }
+  },
+  { immediate: true }
+)
 
 const { defineColumn, _ } = useForm()
 
@@ -174,7 +178,6 @@ const formItems = computed<EpFormItem[]>(() => [
     slotType: 'select',
     slot: {
       options: forceCheckGroup.value?.map((d) => ({ value: d.forceGroupNumber, label: `第${d.forceGroupNumber}组` })),
-      onChange: changeModelValue('question'),
     },
   }),
   { rowKey: 'row-1', slotName: 'search', labelWidth: '10px', colProp: { span: 4 } },

+ 15 - 8
src/modules/expert/expert/index.vue

@@ -56,7 +56,7 @@
 <script setup lang="ts" name="ExpertExpert">
 /** 专家卷浏览-专家挑选卷 */
 import { reactive, ref, computed, watch, nextTick } from 'vue'
-import { ElButton } from 'element-plus'
+import { ElButton, ElMessage } from 'element-plus'
 import { ROLE_OPTION } from '@/constants/dicts'
 import { useSetImgBg } from '@/hooks/useSetImgBg'
 import useFetch from '@/hooks/useFetch'
@@ -113,6 +113,8 @@ const onDelete = async () => {
     if (currentExpertPaper.value) {
       await useFetch('deletePaper').fetch({ id: currentExpertPaper.value.id })
       await onSearch()
+    } else {
+      ElMessage.warning('未选择试卷')
     }
   } catch (error) {
     console.error(error)
@@ -174,11 +176,15 @@ watch(dataModel, () => {
 
 const { fetch: getForceCheckGroupList, result: forceCheckGroup } = useFetch('getForceCheckGroupList')
 
-watch(dataModel, () => {
-  if (dataModel.subject && dataModel.question) {
-    getForceCheckGroupList({ subjectCode: dataModel.subject, mainNumber: dataModel.question })
-  }
-})
+watch(
+  dataModel,
+  () => {
+    if (dataModel.subject && dataModel.question) {
+      getForceCheckGroupList({ subjectCode: dataModel.subject, mainNumber: dataModel.question })
+    }
+  },
+  { immediate: true }
+)
 
 const { defineColumn, _ } = useForm()
 
@@ -265,9 +271,10 @@ const onSearch = async () => {
 
 const { fetch: updateMarkScore } = useFetch('updateMarkScore')
 
-const onSubmit = () => {
+const onSubmit = async () => {
   if (currentExpertPaper.value) {
-    updateMarkScore({ id: currentExpertPaper.value.id, scores: modelScore.value })
+    await updateMarkScore({ id: currentExpertPaper.value.id, scores: modelScore.value })
+    await onSearch()
   }
 }
 

+ 3 - 2
src/modules/marking/arbitration/index.vue

@@ -216,9 +216,10 @@ const onSearch = async () => {
 /** 仲裁卷打分 */
 const { fetch: markArbitrationPaper } = useFetch('markArbitrationPaper')
 
-const onSubmit = () => {
+const onSubmit = async () => {
   if (currentArbitration.value) {
-    markArbitrationPaper({ id: currentArbitration.value.id, scores: modelScore.value })
+    await markArbitrationPaper({ id: currentArbitration.value.id, scores: modelScore.value })
+    onSearch()
   }
 }
 

+ 3 - 2
src/modules/marking/problem/index.vue

@@ -235,9 +235,10 @@ const onSearch = async () => {
 /** 问题卷打分 */
 const { fetch: markProblemPaper } = useFetch('markProblemPaper')
 
-const onSubmit = () => {
+const onSubmit = async () => {
   if (currentProblem.value) {
-    markProblemPaper({ id: currentProblem.value.id, scores: modelScore.value })
+    await markProblemPaper({ id: currentProblem.value.id, scores: modelScore.value })
+    await onSearch()
   }
 }
 

+ 6 - 4
src/modules/quality/subjective-check/index.vue

@@ -261,18 +261,20 @@ const onSearch = async () => {
 
 /** 给分 */
 const { fetch: subjectiveCheckMark } = useFetch('subjectiveCheckMark')
-const onSubmit = () => {
+const onSubmit = async () => {
   if (currentSubjectiveCheck.value) {
-    subjectiveCheckMark({ taskId: currentSubjectiveCheck.value.taskId, scores: modelScore.value })
+    await subjectiveCheckMark({ taskId: currentSubjectiveCheck.value.taskId, scores: modelScore.value })
+    await onSearch()
   }
 }
 
 /** 确认 */
 const { fetch: subjectiveCheckConfirm } = useFetch('subjectiveCheckConfirm')
 
-const onConfirm = () => {
+const onConfirm = async () => {
   if (currentSubjectiveCheck.value) {
-    subjectiveCheckConfirm({ taskId: currentSubjectiveCheck.value.taskId })
+    await subjectiveCheckConfirm({ taskId: currentSubjectiveCheck.value.taskId })
+    await onSearch()
   }
 }