فهرست منبع

fix: 移动端-笼位申请,体重一直校验“最小体重不能大于最大体重”;移动端-笼位申请,申请详情页回显的预约信息错误;移动端-笼位申请,移动端笼位申请没有需要获取证书的校验

Lambert 2 ماه پیش
والد
کامیت
be630b6206

+ 0 - 13
components.d.ts

@@ -13,34 +13,22 @@ declare module 'vue' {
     RouterView: typeof import('vue-router')['RouterView']
     SelectInst: typeof import('./src/components/select-inst.vue')['default']
     SelectInstAppointRecord: typeof import('./src/components/select-inst-appoint-record.vue')['default']
-    VanActionBar: typeof import('vant/es')['ActionBar']
-    VanActionBarButton: typeof import('vant/es')['ActionBarButton']
-    VanActionBarIcon: typeof import('vant/es')['ActionBarIcon']
-    VanBackTop: typeof import('vant/es')['BackTop']
     VanButton: typeof import('vant/es')['Button']
     VanCalendar: typeof import('vant/es')['Calendar']
     VanCell: typeof import('vant/es')['Cell']
     VanCellGroup: typeof import('vant/es')['CellGroup']
     VanCheckbox: typeof import('vant/es')['Checkbox']
-    VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup']
-    VanCol: typeof import('vant/es')['Col']
-    VanDatePicker: typeof import('vant/es')['DatePicker']
     VanDialog: typeof import('vant/es')['Dialog']
-    VanEmpty: typeof import('vant/es')['Empty']
     VanField: typeof import('vant/es')['Field']
     VanFloatingBubble: typeof import('vant/es')['FloatingBubble']
     VanForm: typeof import('vant/es')['Form']
     VanIcon: typeof import('vant/es')['Icon']
-    VanImage: typeof import('vant/es')['Image']
     VanList: typeof import('vant/es')['List']
     VanNotify: typeof import('vant/es')['Notify']
     VanPicker: typeof import('vant/es')['Picker']
-    VanPickerGroup: typeof import('vant/es')['PickerGroup']
     VanPopup: typeof import('vant/es')['Popup']
     VanRadio: typeof import('vant/es')['Radio']
     VanRadioGroup: typeof import('vant/es')['RadioGroup']
-    VanRow: typeof import('vant/es')['Row']
-    VanSearch: typeof import('vant/es')['Search']
     VanStep: typeof import('vant/es')['Step']
     VanStepper: typeof import('vant/es')['Stepper']
     VanSteps: typeof import('vant/es')['Steps']
@@ -52,7 +40,6 @@ declare module 'vue' {
     VanTabs: typeof import('vant/es')['Tabs']
     VanTag: typeof import('vant/es')['Tag']
     VanTextEllipsis: typeof import('vant/es')['TextEllipsis']
-    VanTimePicker: typeof import('vant/es')['TimePicker']
     VanUploader: typeof import('vant/es')['Uploader']
   }
 }

+ 4 - 0
src/api/platform/animal/index.ts

@@ -114,5 +114,9 @@ export function usePlatAnimalCageApplicationApi() {
     deletePlatAnimalTakeawayReback(params?: Object) {
       return request.postRequest(basePath, 'PlatAnimalTakeawayReback', 'Delete', params)
     },
+    // 证书判断
+    checkAnimalCert(params?: Object) {
+      return request.postRequest(basePath, 'PlatAnimalCageApplication', 'CheckAnimalCert', params);
+    },
   }
 }

+ 10 - 5
src/view/animal/application/components/Application.vue

@@ -259,11 +259,13 @@ const rules = {
   weight: [{
     validator: () => {
       const value = state.form.weight
+      const min = Number(value.min)
+      const max = Number(value.max)
       console.log("体重范围:", value)
-      if (!value || value.min === null || value.min === '' || value.max === null || value.max === '') {
-        return '体重范围不能为空';
-      } else if (value.min > value.max) {
-        return '最小体重不能大于最大体重';
+      if (!value || isNaN(min) || isNaN(max)) {
+        return '体重范围不能为空'
+      } else if (min > max) {
+        return '最小体重不能大于最大体重'
       }
       return true;
     },
@@ -307,6 +309,7 @@ const defaultFormData = {
   ethicsCheckFile: [],
   ethicsAdviceFile: [],
   deptName: '',
+  deptId: '',
   phone: '',
   totalNumber: 0,
 }
@@ -577,7 +580,9 @@ const onSubmit = async () => {
   // json 字符串化
   state.form.age= JSON.stringify(state.form.age);
   state.form.weight = JSON.stringify(state.form.weight);
-
+  state.form.deptName = userInfos.value.deptName;
+  state.form.deptId = userInfos.value.deptId;
+  state.form.phone = userInfos.value.phone;
 
   const params = {
     ...deepClone(state.form),

+ 9 - 8
src/view/animal/application/components/Detail.vue

@@ -23,7 +23,7 @@
             <van-field v-model="state.form.variety" label="品种品系" readonly placeholder="请选择" />
             <van-field v-model="levelName" label="饲养区域" readonly placeholder="请选择" />
             <van-field :modelValue="state.form.age.min === state.form.age.max ? state.form.age.min : `${state.form.age.min} - ${state.form.age.max}`" label="周龄" readonly />
-            <van-field :modelValue="state.form.age.min === state.form.age.max ? state.form.age.min : `${state.form.age.min} - ${state.form.age.max}`" label="体重" readonly />
+            <van-field :modelValue="state.form.weight.min === state.form.weight.max ? state.form.weight.min : `${state.form.weight.min} - ${state.form.weight.max}`" label="体重" readonly />
             <van-field v-model="state.form.maleNumber" label="雄性" readonly type="digit" />
             <van-field v-model="state.form.famaleNumber" label="雌性" readonly type="digit" />
             <van-field v-model="state.form.totalNumber" label="合计" readonly type="digit" />
@@ -291,6 +291,7 @@ const levelName = computed(() => {
       ethicsCheckFile: res?.data?.ethicsCheckFile ? JSON.parse(res?.data?.ethicsCheckFile) : [],
       ethicsAdviceFile: res?.data?.ethicsAdviceFile ? JSON.parse(res?.data?.ethicsAdviceFile) : [],
       geneIdentificationFile: res?.data?.geneIdentificationFile ? JSON.parse(res?.data?.geneIdentificationFile) : [],
+      totalNumber: res?.data?.maleNumber + res?.data?.famaleNumber
     }
 
   }
@@ -307,13 +308,13 @@ const levelName = computed(() => {
     initForm,
   })
 
-  watch(
-    () => [state.form.maleNumber, state.form.famaleNumber],
-    ([maleNumber, famaleNumber]) => {
-      state.form.totalNumber = (maleNumber || 0) + (famaleNumber || 0)
-    },
-    { immediate: true },
-  )
+  // watch(
+  //   () => [state.form.maleNumber, state.form.famaleNumber],
+  //   ([maleNumber, famaleNumber]) => {
+  //     state.form.totalNumber = (maleNumber || 0) + (famaleNumber || 0)
+  //   },
+  //   { immediate: true },
+  // )
 </script>
 <style lang="scss" scoped>
 .detail-drawer-container {

+ 10 - 2
src/view/animal/application/index.vue

@@ -257,6 +257,7 @@
   import { usePlatAnimalCageApplicationApi } from '/@/api/platform/animal'
   import { ApproveStatus, ReturnStatus, LeavelList, ApproveStatusList } from '/@/constants/pageConstants'
   import { useUserInfos } from '/@/hooks/useUserInfos'
+  import { ElMessage } from 'element-plus'
 
   const ApplicationModal = defineAsyncComponent(() => import('/@/view/animal/application/components/Application.vue'))
   const DetailModal = defineAsyncComponent(() => import('/@/view/animal/application/components/Detail.vue'))
@@ -415,8 +416,15 @@
     returnCageDialogRef.value.handleOpenRefundableDialog(row.id)
   }
 
-  const handleApplication = () => {
-    cageApplicationModalRef.value.openDialog()
+  const handleApplication = async () => {
+    const response = await platAnimalCageApplicationApi.checkAnimalCert({});
+    const { check, message } = response?.data;
+    console.log("1111", check)
+    if (check) {
+      cageApplicationModalRef.value.openDialog();
+    } else {
+      ElMessage.error(message + ' ')
+    }
   }
 
   const handleRefresh = () => {