فهرست منبع

feature:增加入室预约证书校验、去掉首页物料技术委托按钮

liuzhenlin 5 ماه پیش
والد
کامیت
8646975cba
3فایلهای تغییر یافته به همراه24 افزوده شده و 7 حذف شده
  1. 5 1
      src/api/platform/home/index.ts
  2. 15 2
      src/view/entry/index.vue
  3. 4 4
      src/view/home/index.vue

+ 5 - 1
src/api/platform/home/index.ts

@@ -9,7 +9,7 @@
 import request from '/@/utils/micro_request.js';
 const basePath = import.meta.env.VITE_PLATFORM_API;
 export function usePlatformApi() {
-	return {
+  return {
     // 平台管理
     // 列表
     create(params?: Object) {
@@ -70,6 +70,10 @@ export function usePlatformApi() {
     // 一键分配
     batchAssign(params?: Object) {
       return request.postRequest(basePath, 'PlatPlatformCellAssign', 'BatchAssign', params)
+    },
+    // 入室获取用户是否有证书
+    onCheckUserCertificate(params?: Object) {
+      return request.postRequest(basePath, 'PlatPlatform', 'CheckUserCertificate', params)
     }
   }
 }

+ 15 - 2
src/view/entry/index.vue

@@ -176,9 +176,12 @@
   import { onMounted, reactive, ref } from 'vue'
   import { useRouter, useRoute } from 'vue-router'
   import { usePlatformAppointApi } from '/@/api/platform/appoint'
+  import { usePlatformApi } from '/@/api/platform/home'
   // import EntryAdd from './add.vue'
+  import { showNotify } from 'vant'
 
   const platformAppointApi = usePlatformAppointApi()
+  const platformApi = usePlatformApi()
   const router = useRouter()
   const route = useRoute()
   const offset = ref({ x: -80, y: 450 })
@@ -235,8 +238,18 @@
       },
     })
   }
-  const onClick = () => {
-    router.push('/entry/add')
+  const onClick = async () => {
+    const [err, res]: ToResponse = await to(platformApi.onCheckUserCertificate({}))
+    if (err) return
+    const { check, message } = res.data
+    if (check) {
+      router.push('/entry/add')
+    } else {
+      showNotify({
+        type: 'warning',
+        message,
+      })
+    }
   }
   onMounted(() => {
     const type = route.query.type

+ 4 - 4
src/view/home/index.vue

@@ -35,10 +35,10 @@
           <img src="../../assets/img/入室预约.png" alt="" />
           <p>入室预约</p>
         </li> -->
-        <li v-auth="'h5-home-tech'">
+        <!-- <li v-auth="'h5-home-tech'">
           <img src="../../assets/img/技术委托.png" alt="" />
           <p>技术委托</p>
-        </li>
+        </li> -->
         <li @click="onRouterPush('/training')" v-auth="'h5-home-training'">
           <img src="../../assets/img/培训考试.png" alt="" />
           <p>培训考试</p>
@@ -47,10 +47,10 @@
           <img src="../../assets/img/动物笼位.png" alt="" />
           <p>动物笼位</p>
         </li>
-        <li v-auth="'h5-home-reagent'">
+        <!-- <li v-auth="'h5-home-reagent'">
           <img src="../../assets/img/试剂耗材.png" alt="" />
           <p>试剂耗材</p>
-        </li>
+        </li> -->
         <!-- <li v-auth="'h5-home-more'">
           <img src="../../assets/img/更多应用.png" alt="" />
           <p>更多应用</p>