Explorar o código

Merge branch 'bugfix/20250711' of wanglj/labsop_h5 into master

徐凯 hai 5 meses
pai
achega
39e09287fa

+ 71 - 0
src/api/instr/inst/useAppoint.ts

@@ -0,0 +1,71 @@
+import request from '/@/utils/micro_request.js'
+const basePath = import.meta.env.VITE_INSTR_ADMIN
+// 参数设置
+export function useUseAppointApi() {
+  return {
+    //预约列表
+    list(query?: object) {
+      return request.postRequest(basePath, 'TusInstrumentAppointment', 'GetList', query)
+    },
+    //按权限查预约列表
+    getListByPermission(query?: object) {
+      return request.postRequest(basePath, 'TusInstrumentAppointment', 'GetListByInst', query)
+    },
+    // 导出预约列表
+    exportExcel(query?: object) {
+      return request.postRequest(basePath, 'TusInstrumentAppointment', 'ExportExcel', query)
+    },
+    // 预约
+    add(query?: object) {
+      return request.postRequest(basePath, 'TusInstrumentAppointment', 'Create', query)
+    },
+    // 编辑预约
+    update(query?: object) {
+      return request.postRequest(basePath, 'TusInstrumentAppointment', 'UpdateById', query)
+    },
+    // 取消预约
+    cancelAppoint(query?: object) {
+      return request.postRequest(basePath, 'TusInstrumentAppointment', 'AdminCancel', query)
+    },
+    // 取消预约
+    userCancelAppoint(query?: object) {
+      return request.postRequest(basePath, 'TusInstrumentAppointment', 'UserCancel', query)
+    },
+    // 获取全部预约情况
+    getAppointInfo(query?: object) {
+      return request.postRequest(basePath, 'TusInstrumentAppointment', 'AppointInfo', query)
+    },
+    // 获取设备预约情况
+    getInstrAppointInfo(query?: object) {
+      return request.postRequest(basePath, 'TusInstrumentAppointment', 'GetEntityById', query)
+    },
+    // 获取用户信息
+    getUserId(query?: object) {
+      return request.postRequest(basePath, 'MyAppointment', 'UserInfo', query)
+    },
+    // 获取用户是否㤇资质申请
+    getNeedGrant(query?: object) {
+      return request.postRequest(basePath, 'TusInstrumentAppointment', 'NeedGrantRequest', query)
+    },
+    // 统计预约记录
+    getAppointReportStatistic(query?: object) {
+      return request.postRequest(basePath, 'TusInstrument', 'Statistic', query)
+    },
+    // 统计预约记录
+    onStatisticExport(query?: object) {
+      return request.postRequest(basePath, 'TusInstrument', 'StatisticExport', query)
+    },
+    // 预约记录
+    getZunYiAppointRecord(query?: object) {
+      return request.postRequest(basePath, 'ZunyiCustom', 'GetAppointmentList', query)
+    },
+    // 预约记录详情
+    getZunYiAppointEntityById(query?: object) {
+      return request.postRequest(basePath, 'ZunyiCustom', 'GetEntityById', query)
+    },
+    // Export预约记录
+    getZunYiAppointRecordExport(query?: object) {
+      return request.postRequest(basePath, 'ZunyiCustom', 'GetAppointmentListExport', query)
+    },
+  }
+}

+ 1 - 1
src/view/entry/detail.vue

@@ -134,7 +134,7 @@
         <h4>审批记录</h4>
         <FlowTable
           :id="state.form.id"
-          :businessCode="`${state.form.id}`"
+          :businessCode="`${route.query.id}`"
           defCode="plat_platform_appoint"
         />
       </div>

+ 70 - 0
src/view/todo/component/instrument_appointment.vue

@@ -0,0 +1,70 @@
+<template>
+  <div class="cert-dialog-container">
+    <van-cell-group>
+      <van-cell title="仪器名称" title-class="cell-title" :value="state.form.instName" />
+      <van-cell title="所属平台" title-class="cell-title" :value="state.form.laboratoryName" />
+      <van-cell title="仪器类型" title-class="cell-title" :value="state.form.instClassDesc" />
+      <van-cell title="计费方式" title-class="cell-title" :value="state.form.costType" />
+      <van-cell title="预约人" title-class="cell-title" :value="state.form.userName" />
+    </van-cell-group>
+  </div>
+</template>
+
+<script setup lang="ts" name="systemProDialog">
+  import to from 'await-to-js'
+  import { reactive, ref, onMounted } from 'vue'
+
+  import { useUseAppointApi } from '/@/api/instr/inst/useAppoint'
+
+  // 定义子组件向父组件传值/事件
+  const emit = defineEmits(['refresh'])
+  const props = defineProps({
+    code: {
+      type: String,
+      default: '',
+    },
+  })
+
+  const useAppointApi = useUseAppointApi()
+
+  // 定义变量内容
+  const certDialogFormRef = ref()
+  const state = reactive({
+    form: {
+      instName: '',
+      laboratoryName: '',
+      instClassDesc: '',
+      costType: '',
+      appointeeInstrumentName: '',
+      userName: '',
+    },
+  })
+
+  const getDetail = async () => {
+    const costTypeMap: Record<number, string> = {
+      10: '按预约时间计费',
+      20: '按使用时间计费',
+      30: '按使用次数计费',
+      40: '按阶梯计费',
+      50: '按管数计费',
+    }
+
+    const [err, res]: ToResponse = await to(useAppointApi.getZunYiAppointEntityById({ id: Number(props.code) }))
+    if (err) return
+    state.form = {
+      ...res?.data,
+      costType: costTypeMap[res?.data?.costType],
+    }
+  }
+
+  onMounted(() => {
+    getDetail()
+  })
+</script>
+
+<style scoped lang="scss">
+  .add-record-title {
+    display: flex;
+    justify-content: space-between;
+  }
+</style>

+ 4 - 6
src/view/todo/detail.vue

@@ -20,12 +20,9 @@
       <van-cell title="申请人" title-class="cell-title" :value="state.form.startUserName" />
       <van-cell title="申请时间" title-class="cell-title" :value="state.form.startTime" />
     </van-cell-group>
-    <!-- <h4>附件信息</h4>
-    <van-cell-group>
-      <van-cell title="文件名称" :value="state.form.instTitle" />
-      <van-cell title="文件类型" :value="state.form.instTitle" />
-      <van-cell title="文件" :value="state.form.defName" />
-    </van-cell-group> -->
+    <h4>附件信息</h4>
+    <InstrumentAppointment v-if="state.form.defCode === 'instrument_appointment'" :code="state.form.businessCode" />
+    
     <h4>审批记录</h4>
     <FlowTable :id="state.form.id" :businessCode="state.form.businessCode" :defCode="state.form.defCode" />
     <h4 v-if="state.type === 'approval'">审批意见</h4>
@@ -71,6 +68,7 @@
   import { useFlowApi } from '/@/api/execution/flow'
 import { showNotify } from 'vant'
   const FlowTable = defineAsyncComponent(() => import('/@/components/FlowTable.vue'))
+  const InstrumentAppointment = defineAsyncComponent(() => import('/@/view/todo/component/instrument_appointment.vue'))
   const executionApi = useExecutionApi()
   const flowApi = useFlowApi()
   const router = useRouter()