Browse Source

feat(动物笼位申请): 新增分笼选择和备注字段,优化到期判断逻辑

- 在动物笼位申请表单中增加“是否分笼”选择字段和“备注”输入字段
- 在申请详情和待办组件中显示分笼状态和备注信息
- 将到期判断逻辑从“前10天内”改为“未到期即可显示”
- 在待办组件中显示申请人手机号信息
张旭伟 6 ngày trước cách đây
mục cha
commit
7347727c70

+ 5 - 0
src/constants/pageConstants.ts

@@ -63,6 +63,11 @@ export enum FeedingSpecial {
   HAVE_FEEDING_SPECIAL = '10',
   NO_FEEDING_SPECIAL = '20',
 }
+// 动物房分笼
+export enum AnimalPurpose {
+  NEED_SPLIT_CAGE = '10', // 需要分笼
+  NO_NEED_SPLIT_CAGE = '20', // 不需要分笼
+}
 
 export enum MyCageType {
   MINE_CAGE = 'mineCage',

+ 19 - 2
src/view/animal/application/components/Application.vue

@@ -124,8 +124,16 @@
               </van-cell-group>
             </template>
 
-            <h4 class="mb8 mt20">特殊要求和附件</h4>
+            <h4 class="mb8 mt20">特殊要求</h4>
             <van-cell-group>
+              <van-field label="是否分笼">
+                <template #input>
+                  <van-radio-group v-model="state.form.animalPurpose" direction="horizontal">
+                    <van-radio :name="AnimalPurpose.NEED_SPLIT_CAGE">有</van-radio>
+                    <van-radio :name="AnimalPurpose.NO_NEED_SPLIT_CAGE">无</van-radio>
+                  </van-radio-group>
+                </template>
+              </van-field>
               <van-field label="是否有特殊饲养要求">
                 <template #input>
                   <van-radio-group v-model="state.form.hasFeedingSpecial" direction="horizontal">
@@ -138,6 +146,12 @@
                 v-model="state.form.feedingSpecialDesc" label="特殊饲养要求" placeholder="输入特殊饲养要求,如每天更换垫料等" required
                 :rules="rules.feedingSpecialDesc" />
             </van-cell-group>
+             <h4 class="mb8 mt20">备注</h4>
+            <van-cell-group>
+              <van-field
+                v-model="state.form.remark" label="备注" placeholder="输入备注" 
+                />
+            </van-cell-group>
 
             <h4 class="mb8 mt20">附件上传</h4>
             <van-cell-group>
@@ -212,7 +226,7 @@ import type { FormInstance } from 'vant/es'
 import dayjs from 'dayjs'
 import { storeToRefs } from 'pinia'
 import { usePlatAnimalCageApplicationApi } from '/@/api/platform/animal'
-import { LeavelList, SUPPORT_FILE_UPLOAD_TYPE_MAX } from '/@/constants/pageConstants'
+import { LeavelList, SUPPORT_FILE_UPLOAD_TYPE_MAX ,AnimalPurpose} from '/@/constants/pageConstants'
 import { deepClone } from '/@/utils/other'
 import { useUserInfo } from '/@/stores/userInfo'
 import { ProcurementChannels, FeedingSpecial, UploadFileType } from '/@/constants/pageConstants'
@@ -378,6 +392,7 @@ const defaultFormData = {
   licenseNumberFile: [],
   animalTestDateFile: [],
   geneIdentificationFile: [],
+  animalPurpose: AnimalPurpose.NO_NEED_SPLIT_CAGE,
   hasFeedingSpecial: FeedingSpecial.HAVE_FEEDING_SPECIAL,
   feedingSpecialDesc: '',
   ethicsCheckFile: [],
@@ -386,6 +401,8 @@ const defaultFormData = {
   deptId: '',
   phone: '',
   totalNumber: 0,
+  remark: '',
+
 }
 
 const state = reactive({

+ 19 - 3
src/view/animal/application/components/Detail.vue

@@ -45,8 +45,16 @@
             <van-field v-model="state.form.comeTime" label="动物到达时间" readonly placeholder="请选择到达时间" />
           </van-cell-group>
 
-          <h4 class="section-title">特殊要求和附件</h4>
+          <h4 class="section-title">特殊要求</h4>
           <van-cell-group inset>
+            <van-cell title="是否分笼">
+              <template #value>
+                <van-radio-group v-model="state.form.animalPurpose" direction="horizontal" disabled>
+                  <van-radio :name="AnimalPurpose.NEED_SPLIT_CAGE">需要分笼</van-radio>
+                  <van-radio :name="AnimalPurpose.NO_NEED_SPLIT_CAGE">不需要分笼</van-radio>
+                </van-radio-group>
+              </template>
+            </van-cell>
             <van-cell title="是否有特殊饲养要求">
               <template #value>
                 <van-radio-group v-model="state.form.hasFeedingSpecial" direction="horizontal" disabled>
@@ -58,7 +66,13 @@
             <van-field v-model="state.form.feedingSpecialDesc" label="特殊饲养要求" readonly type="textarea" rows="3"
               placeholder="请输入特殊饲养要求" />
           </van-cell-group>
-
+          <h4  class="section-title">备注</h4>
+            <van-cell-group>
+              <van-field
+                v-model="state.form.remark" label="备注" placeholder="输入备注" 
+                />
+            </van-cell-group>
+            <h4  class="section-title">附件</h4>
           <!-- 附件列表 -->
           <van-cell-group v-if="state.form.licenseNumberFile && JSON.stringify(state.form.licenseNumberFile) !== '[]'"
             inset class="mt10">
@@ -175,7 +189,7 @@ import { nextTick, reactive, ref, defineAsyncComponent, watch, computed } from '
   import dayjs from 'dayjs'
 
   import { usePlatAnimalCageApplicationApi } from '/@/api/platform/animal'
-  import { ApproveStatusList, ProcurementChannels, FeedingSpecial, LeavelList } from '/@/constants/pageConstants'
+  import { ApproveStatusList, ProcurementChannels, FeedingSpecial, LeavelList ,AnimalPurpose} from '/@/constants/pageConstants'
 
   const FlowTable = defineAsyncComponent(() => import('/@/components/FlowTable.vue'))
 
@@ -247,6 +261,7 @@ const levelName = computed(() => {
       animalTestDateFile: [],
       envTestDateFile: [],
       hasFeedingSpecial: FeedingSpecial.HAVE_FEEDING_SPECIAL,
+      animalPurpose: AnimalPurpose.NO_NEED_SPLIT_CAGE,
       feedingSpecialDesc: '',
       cageAppointFile: [],
       ethicsCheckFile: [],
@@ -258,6 +273,7 @@ const levelName = computed(() => {
       level: null,
       startDate: '',
       totalNumber: 0,
+      remark: '',
     },
     disabled: false,
   })

+ 6 - 6
src/view/entry/mine.vue

@@ -477,15 +477,15 @@
     renewalEditRef.value.openDialog('add', row)
   }
 
-  // 判断endtime是否在当前月份的前10天内
-  const isEndTimeInFirstTenDays = (startTime: string,endTime: string) => {
-    if (!startTime || !endTime) return false;
+// 判断当前时间是否在结束时间之前(没有到期都可以显示)
+const isEndTimeInFirstTenDays = (startTime: string, endTime: string) => {
+  if (!startTime || !endTime) return false;
   const startDate = dayjs(startTime).startOf('day');
-  const endDate10 = dayjs(endTime).date(10).endOf('day');
+  const endDate = dayjs(endTime).endOf('day');
   const today = dayjs();
   const todayStart = today.startOf('day');
-  return todayStart.valueOf() >= startDate.valueOf() && todayStart.valueOf() <= endDate10.valueOf();
-  }
+  return todayStart.valueOf() >= startDate.valueOf() && todayStart.valueOf() <= endDate.valueOf();
+};
 
   onMounted(() => {
     getDicts()

+ 16 - 1
src/view/todo/component/plat_cage_applications.vue

@@ -5,6 +5,10 @@
         title="申请人姓名"
         :value="state.form.userName"
       />
+      <van-cell
+        title="申请人手机号"
+        :value="state.form.userPhone"
+      />
       <van-cell
         title="课题名称"
         :value="state.form.projectGroupName"
@@ -64,6 +68,10 @@
           <span>{{ dayjs(state.form.comeTime).format('YYYY-MM-DD') }}</span>
         </template>
       </van-cell>
+       <van-cell
+        title="是否分笼"
+        :value="state.form.animalPurpose === AnimalPurpose.NEED_SPLIT_CAGE ? '是' : '否'"
+      />
       <van-cell
         title="是否有特殊饲养要求"
         :value="checkSpecialFeedingRequirements"
@@ -73,6 +81,10 @@
         title="饲养要求描述"
         :value="state.form.feedingSpecialDesc"
       />
+      <van-cell
+        title="备注"
+        :value="state.form.remark"
+      />
       <van-cell
         v-if="state.form.buyFrom==='20'"
         title="外购来源单位"
@@ -158,7 +170,7 @@
   import dayjs from 'dayjs'
 
   import { usePlatAnimalCageApplicationApi } from '/@/api/platform/animal'
-  import { ProcurementChannels, FeedingSpecial } from '/@/constants/pageConstants'
+  import { ProcurementChannels, FeedingSpecial, AnimalPurpose } from '/@/constants/pageConstants'
 
   const checkProcurementChannels = computed(() => {
     return state.form.buyFrom === ProcurementChannels.PURCHASED_BY_OTHERS ? '动物房代购' : '自行购买'
@@ -223,6 +235,7 @@
   const state = reactive({
     form: {
       userName: '',
+      userPhone: '',
       number: 0,
       approveStatus: '',
       categoryName: '',
@@ -241,6 +254,7 @@
       feedingSpecialDesc: '',
       licenseNumberFile: '',
       animalTestDateFile: '',
+      animalPurpose: '',
       envTestDateFile: '',
       cageAppointFile: '',
       ethicsCheckFile: '',
@@ -248,6 +262,7 @@
       geneIdentificationFile: '',
       startDate: '',
       level: '',
+      remark: '',
     },
     disabled: false,
   })