Parcourir la source

Merge branch 'feature/ZUNYIYIKED-227' of wanglj/labsop_h5 into master

徐凯 il y a 5 mois
Parent
commit
d0d1a6bcab

+ 2 - 1
src/api/execution/index.ts

@@ -9,6 +9,7 @@
 import request from '/@/utils/micro_request'
 const basePath = import.meta.env.VITE_WORKFLOW
 const sciPath = import.meta.env.VITE_SCI
+const platformPath = import.meta.env.VITE_PLATFORM_API
 // 参数设置
 export function useExecutionApi() {
   return {
@@ -42,7 +43,7 @@ export function useExecutionApi() {
     },
     // 审批
     approve(query?: object) {
-      return request.postRequest(sciPath, 'Workflow', 'Approve', query);
+      return request.postRequest(platformPath, 'Workflow', 'Approve', query);
     },
     // 审批撤回
     withdraw(query?: object) {

+ 16 - 7
src/view/entry/add.vue

@@ -31,12 +31,9 @@
           placeholder="申请平台"
         >
           <template #input>
-            <van-checkbox
-              v-model="item.isChecked"
-              name="10"
-            >
-              {{ item.platformName }}
-            </van-checkbox>
+            <van-radio-group v-model="selectPlatform">
+              <van-radio :name="item.platformType">{{ item.platformName }}</van-radio>
+            </van-radio-group>
           </template>
         </van-field>
         <van-field
@@ -53,6 +50,7 @@
             v-model="item.cellType"
             label="拟培养细胞种类"
             placeholder="拟培养细胞种类"
+            :rules="[{ required: item.isChecked, message: '请输入拟培养细胞种类' }]"
             :disabled="!item.isChecked"
           />
           <van-field
@@ -197,7 +195,7 @@
 
 <script name="home" lang="ts" setup>
   import to from 'await-to-js'
-  import { onMounted, reactive, ref } from 'vue'
+  import { onMounted, reactive, ref, watch } from 'vue'
   import { useRouter, useRoute } from 'vue-router'
   import { useDictApi } from '/@/api/system/dict'
   import { formatDate } from '/@/utils/formatTime'
@@ -262,6 +260,17 @@
   })
   const createEntryPayload = ref({})
 
+  const selectPlatform = ref('') // 10: 细胞 20: 分子
+
+  watch(selectPlatform, (newVal) => {
+    if (newVal === '10' || newVal === '20') {
+      state.form.platformList = state.form.platformList.map((item) => ({
+        ...item,
+        isChecked: item.platformType === newVal,
+      }))
+    }
+  })
+
   const confirmAppoint = async () => {
     const [err]: ToResponse = await to(platformAppointApi.create(createEntryPayload.value))
     if (err) {

+ 1 - 1
src/view/entry/components/details.vue

@@ -190,7 +190,7 @@
       await nextTick()
       state.form = res?.data
     } else if (type === 'get') {
-      const [err, res]: ToResponse = await to(Api.getDetail({ id: row?.id }))
+      const [err, res]: ToResponse = await to(Api.getDetail({ id: row?.appointId }))
       if (err) return
       await nextTick()
       state.form = res?.data

+ 178 - 63
src/view/entry/detail.vue

@@ -24,7 +24,10 @@
           </div>
           <footer>
             <div class="flex flex-top mt-auto">
-              <img class="i-r-icon" src="../../assets/img/user.png" />
+              <img
+                class="i-r-icon"
+                src="../../assets/img/user.png"
+              />
               <div class="detailTxt">{{ state.form.createdName }}</div>
             </div>
             <div class="flex flex-top">
@@ -36,75 +39,114 @@
     </header>
     <div class="content">
       <div class="card">
-        <h4>申请入室平台</h4>
-        <ul v-if="state.form.platPlatformAppointCellRes && state.form.platPlatformAppointCellRes.length">
+        <h4>申请人信息</h4>
+        <ul>
           <li>
-            <label>申请平台</label>
-            <span>{{ state.form.platPlatformAppointCellRes[0].platformName }}</span>
+            <div class="label">申请人姓名:</div>
+            <div class="value">{{ state.form.memberName }}</div>
           </li>
           <li>
-            <label>申请时长</label>
-            <span>{{ state.form.platPlatformAppointCellRes[0].platformTime }}个月</span>
+            <div class="label">人员类型:</div>
+            <div class="value">{{ getDictLabel(userTypeList, state.form.memberType) }}</div>
           </li>
           <li>
-            <label>拟培养细胞种类</label>
-            <span>{{ state.form.cellType }}</span>
+            <div class="label">申请人手机号:</div>
+            <div class="value">{{ state.form.memberPhone }}</div>
           </li>
           <li>
-            <label>细胞房预约需求</label>
-            <span>{{ state.form.cellSourceType == '10' ? '普通' : '层流' }}</span>
+            <div class="label">申请人科室:</div>
+            <div class="value">{{ state.form.deptName }}</div>
           </li>
         </ul>
-        <ul
-          v-if="
-            state.form.platPlatformAppointMolecularRes && state.form.platPlatformAppointMolecularRes.length
-          "
-        >
+      </div>
+
+      <div class="card">
+        <h4>申请人课题组信息</h4>
+        <ul>
+          <li>
+            <div class="label">课题组:</div>
+            <div class="value">{{ state.form.pgName }}</div>
+          </li>
+          <li>
+            <div class="label">课题组负责人:</div>
+            <div class="value">{{ state.form.mentorName }}</div>
+          </li>
           <li>
-            <label>申请平台</label>
-            <span>{{ state.form.platPlatformAppointMolecularRes[0].platformName }}</span>
+            <div class="label">课题组负责人科室:</div>
+            <div class="value">{{ state.form.mentorDeptName }}</div>
           </li>
           <li>
-            <label>申请时长</label>
-            <span>{{ state.form.platPlatformAppointMolecularRes[0].platformTime }}个月 </span>
+            <div class="label">课题组负责人电话:</div>
+            <div class="value">{{ state.form.mentorPhone }}</div>
           </li>
           <li>
-            <label>其他需求</label>
-            <span>{{ state.form.platOtherNeed }}</span>
+            <div class="label">课题组负责人电话:</div>
+            <div class="value">{{ state.form.mentorPhone }}</div>
           </li>
         </ul>
       </div>
+
       <div class="card">
-        <h4>申请人信息</h4>
-        <ul>
+        <h4>申请入室平台</h4>
+        <ul v-if="state.form.platPlatformAppointCellRes && state.form.platPlatformAppointCellRes.length">
           <li>
-            <label>申请人姓名</label>
-            <span>{{ state.form.memberName }}</span>
+            <div class="label">申请平台:</div>
+            <div class="value">{{ state.form.platPlatformAppointCellRes[0].platformName }}</div>
           </li>
           <li>
-            <label>人员类型</label>
-            <span>{{ getDictLabel(userTypeList, state.form.memberType) }}</span>
+            <div class="label">申请时长:</div>
+            <div class="value">{{ state.form.platPlatformAppointCellRes[0].platformTime }}个月</div>
           </li>
           <li>
-            <label>申请人手机号</label>
-            <span>{{ state.form.memberPhone }}</span>
+            <div class="label">费用:</div>
+            <div class="value">{{ state.form.platPlatformAppointCellRes[0].price }}元</div>
           </li>
           <li>
-            <label>申请人科室</label>
-            <span>{{ state.form.deptName }}</span>
+            <div class="label">拟培养细胞种类:</div>
+            <div class="value">{{ state.form.cellType }}</div>
           </li>
           <li>
-            <label>课题组</label>
-            <span>{{ state.form.pgName }}</span>
+            <div class="label">细胞房预约需求:</div>
+            <div class="value">{{ state.form.cellSourceType == '10' ? '普通' : '层流' }}</div>
+          </li>
+        </ul>
+        <ul v-if="state.form.platPlatformAppointMolecularRes && state.form.platPlatformAppointMolecularRes.length">
+          <li>
+            <div class="label">申请平台:</div>
+            <div class="value">{{ state.form.platPlatformAppointMolecularRes[0].platformName }}</div>
+          </li>
+          <li>
+            <div class="label">申请时长:</div>
+            <div class="value">{{ state.form.platPlatformAppointMolecularRes[0].platformTime }}个月</div>
+          </li>
+          <li>
+            <div class="label">费用:</div>
+            <div class="value">{{ state.form.platPlatformAppointMolecularRes[0].price }}元</div>
+          </li>
+          <li>
+            <div class="label">其他需求:</div>
+            <div class="value">{{ state.form.platOtherNeed }}</div>
           </li>
         </ul>
       </div>
+
       <div class="card">
         <h4>审批记录</h4>
-        <FlowTable :id="state.form.id" :businessCode="`${state.form.id}`" defCode="plat_platform_appoint" />
+        <FlowTable
+          :id="state.form.id"
+          :businessCode="`${state.form.id}`"
+          defCode="plat_platform_appoint"
+        />
       </div>
-      <div class="card" v-if="state.form.appointStatus === '20'">
-        <van-form class="mb20" ref="formRef" required="auto">
+      <div
+        class="card"
+        v-if="state.form.appointStatus === '20'"
+      >
+        <van-form
+          class="mb20"
+          ref="formRef"
+          required="auto"
+        >
           <van-cell-group>
             <van-field
               v-model="state.auditForm.approveDesc"
@@ -121,7 +163,10 @@
               :rules="[{ required: true, message: '请选择审批结果' }]"
             >
               <template #input>
-                <van-radio-group v-model="state.auditForm.approveResult" direction="horizontal">
+                <van-radio-group
+                  v-model="state.auditForm.approveResult"
+                  direction="horizontal"
+                >
                   <van-radio name="10">通过</van-radio>
                   <van-radio name="20">不通过</van-radio>
                 </van-radio-group>
@@ -131,18 +176,56 @@
         </van-form>
       </div>
     </div>
-    <van-action-bar v-if="state.form.appointStatus === '10'" placeholder>
-      <van-action-bar-icon icon="wap-home-o" text="首页" @click="onRouterPush('/home')" />
-      <van-action-bar-icon icon="send-gift-o" text="入室申请" @click="onRouterPush('/entry')" />
-      <van-action-bar-button class="w100" type="primary" text="上传缴费单" @click="openUpload()" />
+    <van-action-bar
+      v-if="state.form.appointStatus === '10'"
+      placeholder
+    >
+      <van-action-bar-icon
+        icon="wap-home-o"
+        text="首页"
+        @click="onRouterPush('/home')"
+      />
+      <van-action-bar-icon
+        icon="send-gift-o"
+        text="入室申请"
+        @click="onRouterPush('/entry')"
+      />
+      <van-action-bar-button
+        class="w100"
+        type="primary"
+        text="上传缴费单"
+        @click="openUpload()"
+      />
     </van-action-bar>
-    <van-action-bar v-else-if="state.form.appointStatus === '20'" placeholder>
-      <van-action-bar-icon icon="wap-home-o" text="首页" @click="onRouterPush('/home')" />
-      <van-action-bar-icon icon="send-gift-o" text="入室申请" @click="onRouterPush('/entry')" />
-      <van-action-bar-button class="w100" type="primary" text="审核" @click="onAudit()" />
+    <van-action-bar
+      v-else-if="state.form.appointStatus === '20'"
+      placeholder
+    >
+      <van-action-bar-icon
+        icon="wap-home-o"
+        text="首页"
+        @click="onRouterPush('/home')"
+      />
+      <van-action-bar-icon
+        icon="send-gift-o"
+        text="入室申请"
+        @click="onRouterPush('/entry')"
+      />
+      <van-action-bar-button
+        class="w100"
+        type="primary"
+        text="审核"
+        @click="onAudit()"
+      />
     </van-action-bar>
   </div>
-  <van-popup v-model:show="showBottom" round closeable position="bottom" :style="{ height: '90vh' }">
+  <van-popup
+    v-model:show="showBottom"
+    round
+    closeable
+    position="bottom"
+    :style="{ height: '90vh' }"
+  >
     <template #default>
       <div class="upload-container">
         <div class="content">
@@ -153,15 +236,34 @@
           <h4>信息上传</h4>
           <div class="file-card">
             <h4>缴费单</h4>
-            <van-uploader v-model="state.uploadForm.billList" :after-read="afterRead" preview-size="60" :preview-full-image="false" :max-count="1" />
+            <van-uploader
+              v-model="state.uploadForm.billList"
+              :after-read="afterRead"
+              preview-size="60"
+              :preview-full-image="false"
+              :max-count="1"
+            />
           </div>
           <div class="file-card">
             <h4>其它附件</h4>
-            <van-uploader v-model="state.uploadForm.fileList" :after-read="afterRead" preview-size="60" :preview-full-image="false" multiple />
+            <van-uploader
+              v-model="state.uploadForm.fileList"
+              :after-read="afterRead"
+              preview-size="60"
+              :preview-full-image="false"
+              multiple
+            />
           </div>
         </div>
         <footer>
-          <van-button type="primary" class="w100" round @click="onSubmit">提交</van-button>
+          <van-button
+            type="primary"
+            class="w100"
+            round
+            @click="onSubmit"
+          >
+            提交
+          </van-button>
         </footer>
       </div>
     </template>
@@ -223,22 +325,22 @@
       approveStatus: '',
       appointStatus: '',
       platPlatformAppointCellRes: [],
-      platPlatformAppointMolecularRes: []
+      platPlatformAppointMolecularRes: [],
     },
     uploadForm: {
       billList: [] as any[],
-      fileList: [] as any[]
+      fileList: [] as any[],
     },
     auditForm: {
       id: 0,
       approveResult: '',
-      approveDesc: ''
+      approveDesc: '',
     },
     queryParams: {
       pageNum: 1,
       pageSize: 10,
-      appointStatus: []
-    }
+      appointStatus: [],
+    },
   })
   const getDicts = () => {
     Promise.all([dictApi.getDictDataByType('sys_user_type')]).then(([type]) => {
@@ -247,8 +349,17 @@
   }
   //详情
   const getDetail = async (id: number) => {
+    const { entryType, platformType } = route.query
+
     state.detailsLoading = true
-    const [err, res]: ToResponse = await to(platformAppointApi.getDetail({ id }))
+
+    let request = platformAppointApi.getDetail
+
+    if (entryType === 'manageGetDetail' || entryType === 'audit') {
+      request = platformType === '10' ? platformAppointApi.getCellEntityById : platformAppointApi.getMolecularEntityById
+    }
+    
+    const [err, res]: ToResponse = await to(request({ id }))
     state.detailsLoading = false
     if (err) return
     if (res?.code === 200) {
@@ -293,7 +404,7 @@
     params.fileList = [...params.billList, ...params.fileList].map((item) => {
       return {
         fileName: item.name,
-        fileUrl: item.url
+        fileUrl: item.url,
       }
     })
     delete params.billList
@@ -302,10 +413,10 @@
     if (err) return
     showNotify({
       type: 'success',
-      message: '操作成功'
+      message: '操作成功',
     })
     router.push({
-      path: '/entry'
+      path: '/entry',
     })
   }
   const onAudit = async () => {
@@ -317,10 +428,10 @@
     if (err) return
     showNotify({
       type: 'success',
-      message: '操作成功'
+      message: '操作成功',
     })
     router.push({
-      path: '/entry'
+      path: '/entry',
     })
   }
   onMounted(() => {
@@ -423,9 +534,13 @@
       }
       > ul {
         li {
-          display: flex;
-          align-items: center;
+          /* display: flex;
+          align-items: center; */
           padding: 6px 0;
+          .label {
+            color: #969799;
+            margin-bottom: 8px;
+          }
           label {
             width: 100px;
             min-width: 80px;

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

@@ -35,7 +35,7 @@
         <van-cell
           v-for="item in state.list"
           :key="item"
-          @click="toDetail(item.id)"
+          @click="toDetail(item.appointId, item.platformType)"
         >
           <template #default>
             <div class="list">
@@ -230,11 +230,13 @@
       state.finished = true
     }
   }
-  const toDetail = (id: number) => {
+  const toDetail = (id: number, platformType: string) => {
     router.push({
       path: '/entry/detail',
       query: {
         id,
+        entryType: 'getDetail',
+        platformType,
       },
     })
   }

+ 6 - 3
src/view/entry/manage.vue

@@ -86,7 +86,7 @@
         <van-cell
           v-for="item in state.list"
           :key="item"
-          @click="toDetail(item.id)"
+          @click="toDetail(item.appointId, item.platformType, 'manageGetDetail')"
         >
           <template #default>
             <div class="list">
@@ -234,6 +234,7 @@
                   v-auth="'platform_entry_bill'"
                   link
                   type="primary"
+                  style="margin-right: 10px"
                   v-if="
                     item.appointStatus === ApplicationStatus.PENDING_UPLOAD &&
                     item.downLoadButton &&
@@ -257,7 +258,7 @@
                   link
                   type="primary"
                   v-if="item.appointStatus === '20'"
-                  @click.stop="onAudit(item)"
+                  @click.stop="toDetail(item.appointId, item.platformType, 'audit')"
                 >
                   审核
                 </van-button>
@@ -372,11 +373,13 @@
     }
   }
 
-  const toDetail = (id: number) => {
+  const toDetail = (id: number, platformType: string, entryType: string) => {
     router.push({
       path: '/entry/detail',
       query: {
         id,
+        entryType,
+        platformType,
       },
     })
   }