Browse Source

服务号添加在架药品查询,修改主页目录结构

lighter 8 months ago
parent
commit
58964bf86e

+ 9 - 2
src/api/import-drug-purchase.js

@@ -1,10 +1,17 @@
 import request from '../utils/request'
 
-export function submitNewItem(data) {
+export function importDrugPurchase(data) {
   return request({
-    url: '/importDrug/submitNewItem',
+    url: '/drugConsult/importDrugPurchase',
     method: 'post',
     data,
   })
 }
 
+export function onShelfDrugInquiry(name) {
+  return request({
+    url: '/drugConsult/onShelfDrugInquiry',
+    method: 'get',
+    params: {name},
+  })
+}

+ 13 - 3
src/router/index.js

@@ -205,6 +205,11 @@ export const constantRoutes = [
     component: () => import('../views/hospital-service/inpatient-service/DisplayPrepaid.vue'),
     meta: { title: '预交金' },
   },
+  {
+    path: '/medicineConsult',
+    component: () => import('../views/hospital-service/medicine-consult/ChooseConsultBranch.vue'),
+    meta: { title: '药品咨询' },
+  },
   {
     path: '/selfService',
     component: () => import('../views/hospital-service/self-service/SelfService.vue'),
@@ -241,9 +246,14 @@ export const constantRoutes = [
     meta: { title: '未成功的预约' },
   },
   {
-    path: '/importDrugService/:phoneNo',
-    component: () => import('../views/hospital-service/self-service/import-drug/ImportDrugService.vue'),
-    meta: { title: '进口药咨询' },
+    path: '/importDrugPurchase/:phoneNo',
+    component: () => import('../views/hospital-service/medicine-consult/import-drug/ImportDrugPurchase.vue'),
+    meta: { title: '药品申购' },
+  },
+  {
+    path: '/onShelfInquiry',
+    component: () => import('../views/hospital-service/medicine-consult/on-shelf-inquiry/OnShelfInquiry.vue'),
+    meta: { title: '在架药品查询' },
   },
   {
     path: '/selectAppointmentRecordPatient',

+ 2 - 2
src/views/hospital-service/HospitalServiceHome.vue

@@ -144,9 +144,9 @@
       </van-row>
       <div style="height: 10px"></div>
       <van-row gutter="5">
-        <van-col span="6" @click="routeTo('/onlineConsult')">
+        <van-col span="6" @click="routeTo('/medicineConsult')">
           <img src="@/assets/hospital-service/online-consult.png"/>
-          <div class="icon-label">在线咨询</div>
+          <div class="icon-label">药品咨询</div>
         </van-col>
         <van-col span="6" @click="routeTo('/selectTargetPatient')">
           <img src="@/assets/hospital-service/appointmentmanagement.png"/>

+ 37 - 0
src/views/hospital-service/medicine-consult/ChooseConsultBranch.vue

@@ -0,0 +1,37 @@
+<template>
+  <window-size>
+    <van-cell
+        title="药品申购"
+        label="咨询、代购各类进口药品"
+        is-link
+        center
+        @click="routeTo('/importDrugPurchase/'+defaultCard.phone)">
+    </van-cell>
+    <van-cell
+        title="在架药品查询"
+        label="咨询各类在架药品信息"
+        is-link
+        center
+        @click="routeTo('/onShelfInquiry')">
+    </van-cell>
+    <van-cell
+        title="人工咨询"
+        label="在线咨询医院工作人员"
+        is-link
+        center
+        @click="routeTo('/onlineConsult')">
+    </van-cell>
+  </window-size>
+</template>
+
+<script setup>
+import router from "@/router";
+import store from "@/store";
+
+const defaultCard = store.getters.getDefaultCard
+
+const routeTo = (val) => {
+  router.push(val)
+}
+
+</script>

+ 29 - 8
src/views/hospital-service/self-service/import-drug/ImportDrugService.vue → src/views/hospital-service/medicine-consult/import-drug/ImportDrugPurchase.vue

@@ -2,6 +2,14 @@
   <window-size>
     <van-form @submit="onSubmit" style="margin-top: 12px">
       <van-cell-group inset>
+        <van-field
+            v-model="request.phoneNo"
+            name="phoneNo"
+            label="联系电话"
+            placeholder="请填写手机号"
+            required
+            :rules="[{required: true, message: '请填写您的手机号'}]"
+        />
         <van-field
             v-model="request.drugName"
             name="drugName"
@@ -10,6 +18,15 @@
             required
             :rules="[{required: true, message: '请填写药品名称'}]"
         />
+        <van-field
+            v-model="request.drugQuantity"
+            name="drugQuantity"
+            label="药品数量"
+            placeholder="请填写药品数量"
+            type="digit"
+            required
+            :rules="[{validator, message: '请填写药品数量'}]"
+        />
         <van-field
             v-model="request.drugFactory"
             name="drugFactory"
@@ -19,12 +36,10 @@
             :rules="[{required: true, message: '请填写药品生产厂家'}]"
         />
         <van-field
-            v-model="request.phoneNo"
-            name="phoneNo"
-            label="联系电话"
-            placeholder="请填写手机号"
-            required
-            :rules="[{required: true, message: '请填写您的手机号'}]"
+            v-model="request.drugSpecification"
+            name="drugSpecification"
+            label="药品规格"
+            placeholder="请填写药品规格"
         />
         <van-field name="uploader" label="药品照片">
           <template #input>
@@ -54,7 +69,7 @@
 import router from "@/router";
 import {reactive, ref} from "vue";
 import {resize} from "@/utils/image";
-import {submitNewItem} from "@/api/import-drug-purchase";
+import {importDrugPurchase} from "@/api/import-drug-purchase";
 import {showDialog} from "vant";
 
 const phoneNo = router.currentRoute.value.params.phoneNo
@@ -63,14 +78,20 @@ const files = ref([])
 const request = reactive({
   phoneNo: phoneNo,
   drugName: null,
+  drugQuantity: null,
   drugFactory: null,
+  drugSpecification: null,
   expContent: null,
   drugImg: null
 })
 
+function validator(val) {
+  return val > 0
+}
+
 function executeSubmit(img) {
   request.drugImg = img
-  submitNewItem(request).then((res) => {
+  importDrugPurchase(request).then((res) => {
     showDialog({
       title: '提交成功',
       message: res,

+ 62 - 0
src/views/hospital-service/medicine-consult/on-shelf-inquiry/OnShelfInquiry.vue

@@ -0,0 +1,62 @@
+<template>
+  <window-size>
+    <div>
+      <van-search
+          v-model="drugName"
+          show-action
+          shape="round"
+          background="#4fc08d"
+          label="药品名称"
+          placeholder="请输入搜索关键词"
+          @search="onSearch"
+      >
+        <template #action>
+          <van-button size="small" @click="onSearch">搜索</van-button>
+        </template>
+      </van-search>
+    </div>
+    <div class="card-list">
+      <van-empty :image="empty" description="暂无药品数据" v-if="showEmpty"></van-empty>
+      <div v-for="drug in drugList">
+        <DrugCard :drug="drug" />
+      </div>
+    </div>
+  </window-size>
+</template>
+
+<script setup>
+import {computed, ref} from "vue";
+import {showToast} from "vant";
+import {onShelfDrugInquiry} from "@/api/import-drug-purchase";
+import empty from "@/assets/empty.png";
+import DrugCard from "@/views/hospital-service/medicine-consult/on-shelf-inquiry/component/DrugCard.vue";
+
+const showEmpty = computed(() => {
+  return drugList.value.length === 0;
+});
+
+const drugName = ref(null)
+const drugList = ref([])
+function onSearch() {
+  if (!drugName.value) {
+    showToast({
+      message: '请输入搜索关键词',
+      position: 'top',
+    })
+    return;
+  }
+  onShelfDrugInquiry(drugName.value).then(res => {
+    drugList.value = res
+  }).catch(() => {
+    drugList.value = []
+  })
+}
+
+</script>
+
+<style lang="scss" scoped>
+.card-list {
+  height: calc(100% - 60px);
+  overflow-y: auto;
+}
+</style>

+ 79 - 0
src/views/hospital-service/medicine-consult/on-shelf-inquiry/component/DrugCard.vue

@@ -0,0 +1,79 @@
+<template>
+  <div class="on-shelf-drug-card">
+    <div class="flex-line">
+      <div class="drug-name">
+        {{drug.name}}
+      </div>
+      <div class="drug-type">
+        {{drug.clazz}}
+      </div>
+    </div>
+    <div class="drug-spec">
+      <div>
+        规格:{{drug.unit}}
+      </div>
+      <div>
+        单价:¥{{drug.price}}
+      </div>
+    </div>
+    <div class="yb-code">
+      <div>
+        生产厂家:{{drug.manu}}
+      </div>
+      <div>
+        医保编码:{{drug.nationalCode}}
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+const props = defineProps({
+  drug: {
+    type: Object,
+    required: true
+  }
+})
+</script>
+
+<style lang="scss">
+.on-shelf-drug-card {
+  width: calc(100% - 48px);
+  height: max-content;
+  background-color: whitesmoke;
+  margin: 12px;
+  padding: 12px;
+  border-radius: 6px;
+  position: relative;
+
+  .flex-line {
+    display: flex;
+    .drug-name {
+      font-weight: bold;
+      font-size: 16px;
+      width: max-content;
+    }
+    .drug-type {
+      background-color: gray;
+      font-size: 12px;
+      color: white;
+      padding: 1px 4px;
+      border-radius: 4px;
+      margin-left: 12px;
+    }
+  }
+
+  .drug-spec {
+    font-size: 14px;
+    margin-top: 8px;
+    margin-left: 16px;
+    color: gray;
+  }
+
+  .yb-code {
+    color: black;
+    margin-top: 8px;
+    font-size: 12px;
+  }
+}
+</style>

+ 0 - 8
src/views/hospital-service/self-service/SelfService.vue

@@ -7,18 +7,10 @@
         center
         @click="simpleRoute('/healthCartCategory/', '/selectHealthCartPatient')">
     </van-cell>
-    <van-cell
-        title="进口药咨询"
-        label="咨询、代购各类进口药品"
-        is-link
-        center
-        @click="routeTo('/importDrugService/'+defaultCard.phone)">
-    </van-cell>
   </window-size>
 </template>
 
 <script setup>
-
 import router from "@/router";
 import store from "@/store";