Просмотр исходного кода

任务提交业务逻辑处理完成

yuanmingze 1 месяц назад
Родитель
Сommit
e4f3271f3c

+ 0 - 6
src/pages-task/points-package-record/index.vue

@@ -173,7 +173,6 @@ import { onLoad, onReachBottom } from '@dcloudio/uni-app'
 import { useToast } from '@wot-ui/ui'
 import { useToast } from '@wot-ui/ui'
 import dayjs from 'dayjs'
 import dayjs from 'dayjs'
 
 
-import { getDictTypeApi } from '@/services/modules/common'
 import {
 import {
   getUserScorePackageListApi,
   getUserScorePackageListApi,
   pkgWithdrawApi,
   pkgWithdrawApi,
@@ -202,11 +201,6 @@ enum RecordTab {
 
 
 type Nullable<T> = T | null | undefined
 type Nullable<T> = T | null | undefined
 
 
-interface DictItem {
-  label: string
-  value: string | number
-}
-
 /**
 /**
  * 列表分页响应结构
  * 列表分页响应结构
  */
  */

+ 1 - 2
src/pages-task/task-form/components/LongText.vue

@@ -12,8 +12,7 @@
           :placeholder="'请输入' + taskFieldConfig.taskFiledValue"
           :placeholder="'请输入' + taskFieldConfig.taskFiledValue"
           :disabled="props.disabled"
           :disabled="props.disabled"
           clearable
           clearable
-          auto-height
-          custom-style="min-height: 300rpx; width: 100%; padding-bottom: 56rpx; box-sizing: border-box;"
+          custom-style="--wot-textarea-inner-min-height: 220rpx; min-height: 300rpx; width: 100%; padding-bottom: 56rpx; box-sizing: border-box;"
         />
         />
 
 
         <text class="word-limit"> {{ currentLength }}/{{ maxLength }} </text>
         <text class="word-limit"> {{ currentLength }}/{{ maxLength }} </text>

+ 2 - 0
src/pages-task/task-form/composables/useTaskForm.ts

@@ -36,10 +36,12 @@ export const MULTIPLE_SELECT_DRUG_TASK_TYPE_IDS = new Set([
   '2',
   '2',
   '3',
   '3',
   '4',
   '4',
+  '19',
   '64',
   '64',
   '75',
   '75',
   '76',
   '76',
   '81',
   '81',
+  '85',
 ])
 ])
 
 
 /**
 /**

+ 5 - 8
src/pages-task/task-form/composables/useTaskFormAction.ts

@@ -23,6 +23,7 @@ type FormAction = 'save' | 'submit'
 
 
 const PACKAGE_FIELD_ALIASES = ['scorePackage', 'approvalResult'] as const
 const PACKAGE_FIELD_ALIASES = ['scorePackage', 'approvalResult'] as const
 const IMAGE_FIELD_TYPE = 'img'
 const IMAGE_FIELD_TYPE = 'img'
+const TEXT_LENGTH_FIELD_TYPES = new Set(['text', 'readonlytext', 'longtext'])
 const SUCCESS_TOAST_DURATION = 3000
 const SUCCESS_TOAST_DURATION = 3000
 
 
 const ACTION_API_MAP = {
 const ACTION_API_MAP = {
@@ -145,8 +146,6 @@ export const useTaskFormAction = ({
 
 
     const configuredMinSize = normalizeSizeLimit(field.taskFiledMinsize)
     const configuredMinSize = normalizeSizeLimit(field.taskFiledMinsize)
 
 
-    const maxSize = normalizeSizeLimit(field.taskFiledMaxsize)
-
     const minSize = field.isMustfill === '1' ? (configuredMinSize ?? 1) : configuredMinSize
     const minSize = field.isMustfill === '1' ? (configuredMinSize ?? 1) : configuredMinSize
 
 
     if (imageCount === 0 && field.isMustfill !== '1') {
     if (imageCount === 0 && field.isMustfill !== '1') {
@@ -159,12 +158,6 @@ export const useTaskFormAction = ({
       return false
       return false
     }
     }
 
 
-    if (maxSize !== null && imageCount > maxSize) {
-      showMessage(`${field.taskFiledValue}最多上传${maxSize}张`)
-
-      return false
-    }
-
     return true
     return true
   }
   }
 
 
@@ -178,6 +171,10 @@ export const useTaskFormAction = ({
       return true
       return true
     }
     }
 
 
+    if (!TEXT_LENGTH_FIELD_TYPES.has(field.taskFiledType)) {
+      return true
+    }
+
     const contentLength = getContentLength(value)
     const contentLength = getContentLength(value)
 
 
     const minSize = normalizeSizeLimit(field.taskFiledMinsize)
     const minSize = normalizeSizeLimit(field.taskFiledMinsize)

+ 6 - 1
src/pages-task/task-form/composables/useTaskSelectHandlers.ts

@@ -68,6 +68,7 @@ const PACKAGE_DEPENDENT_FIELD_ALIASES: Readonly<Record<string, readonly string[]
   '2': ['drugs'],
   '2': ['drugs'],
   '3': ['drugs'],
   '3': ['drugs'],
   '4': ['drugs'],
   '4': ['drugs'],
+  '19': ['drugs'],
   '14': ['surveyCategory'],
   '14': ['surveyCategory'],
   '31': ['surveyCategory'],
   '31': ['surveyCategory'],
   '37': ['surveyCategory'],
   '37': ['surveyCategory'],
@@ -76,7 +77,7 @@ const PACKAGE_DEPENDENT_FIELD_ALIASES: Readonly<Record<string, readonly string[]
   '75': ['drugs', 'hospitalOrPharmacy', 'hospitalOrPharmacyAddress'],
   '75': ['drugs', 'hospitalOrPharmacy', 'hospitalOrPharmacyAddress'],
   '76': ['drugs', 'hospitalOrPharmacy', 'hospitalOrPharmacyAddress'],
   '76': ['drugs', 'hospitalOrPharmacy', 'hospitalOrPharmacyAddress'],
   '81': ['drugs', 'hospitalOrPharmacy', 'address'],
   '81': ['drugs', 'hospitalOrPharmacy', 'address'],
-  '85': ['hospital', 'level'],
+  '85': ['drugs', 'hospital', 'level'],
 }
 }
 
 
 const normalizeTaskTypeId = (taskTypeId: unknown): string => {
 const normalizeTaskTypeId = (taskTypeId: unknown): string => {
@@ -444,6 +445,10 @@ export const useTaskSelectHandlers = ({
       invalidateFieldOptionsByAlias('drugs')
       invalidateFieldOptionsByAlias('drugs')
     }
     }
 
 
+    if (fieldTaskTypeId === '85' && field.alias === 'topic') {
+      setFieldTextByAlias('result', event.selectedItem.description ?? '')
+    }
+
     if (field.alias === 'meetingType' && MEETING_TASK_TYPE_IDS.has(fieldTaskTypeId)) {
     if (field.alias === 'meetingType' && MEETING_TASK_TYPE_IDS.has(fieldTaskTypeId)) {
       clearFieldValueByAlias('scorePackage')
       clearFieldValueByAlias('scorePackage')
       clearFieldValueByAlias('drugs')
       clearFieldValueByAlias('drugs')