Browse Source

物品领用和今日号源

lighter 1 year ago
parent
commit
fe851b6beb

+ 8 - 0
src/api/single-page/today-clinic-resource.js

@@ -0,0 +1,8 @@
+import request from '../../utils/request'
+
+export function selectTodayClinicResource() {
+    return request({
+        url: '/todayClinicResource/selectTodayClinicResource',
+        method: 'get',
+    })
+}

+ 17 - 0
src/api/utilities/item-apply.js

@@ -0,0 +1,17 @@
+import request from '@/utils/request'
+
+export function selectApplyItems(data) {
+    return request({
+        url: '/itemApply/selectApplyItems',
+        method: 'post',
+        data,
+    })
+}
+
+export function submitSupplies(data) {
+    return request({
+        url: '/itemApply/submitSupplies',
+        method: 'post',
+        data,
+    })
+}

+ 13 - 1
src/router/modules/dashboard.js

@@ -8,6 +8,12 @@ const route = [
         hideMenu: true,
         meta: {title: '登录', hideTabs: true},
     },
+    {
+      path: '/todayClinicResource',
+        component: createNameComponent(() => import('@/views/single-page/TodayClinicResource.vue')),
+        hideMenu: true,
+        meta: {title: '今日号源', hideTabs: true},
+    },
     {
         path: '/myEmrEditor/:pat?/:refresh?',
         component: createNameComponent(() => import('@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/Home.vue')),
@@ -838,11 +844,17 @@ const route = [
         component: Layout,
         meta: {title: '通用工具'},
         children: [
+            {
+                path: 'itemApply',
+                component: createNameComponent(() => import('@/views/utilities/ItemApply.vue')),
+                meta: {title: '物品领用'}
+            },
             {
                 path: 'parseJson',
                 component: createNameComponent(() => import('@/views/utilities/ParseJson.vue')),
                 meta: {title: 'JSON格式化'},
-            }, {
+            },
+            {
                 path: 'pageEditorHelp',
                 component: createNameComponent(() => import('@/views/utilities/page-editor-help/PageEditorHelp.vue')),
                 meta: {title: '页面编辑'}

+ 201 - 0
src/views/single-page/TodayClinicResource.vue

@@ -0,0 +1,201 @@
+<template>
+  <div name="parent_div">
+    <div name="title_div">
+      <img :src="logo">
+      <p id="title">今日开放号源</p>
+      <p id="current_time">{{currentTimeText}}</p>
+    </div>
+    <table id="the_table">
+      <tr>
+        <td id="t1" name="t1">出诊科室</td>
+        <td id="t2" name="t2">出诊医生</td>
+        <td id="t3" name="t3">出诊号别</td>
+        <td id="t4" name="t4">出诊时间</td>
+        <td id="t5" name="t5">医事服务费</td>
+        <td id="t6" name="t6">就诊地点</td>
+      </tr>
+      <tr v-for="item in displayList">
+        <td>{{item.deptName}}</td>
+        <td>{{item.doctorName}}</td>
+        <td>{{item.reqType}}</td>
+        <td>{{item.reqTime}}</td>
+        <td>{{item.reqFee}}</td>
+        <td>{{item.reqAddress}}</td>
+      </tr>
+    </table>
+  </div>
+</template>
+
+<script setup>
+import logo from '@/assets/thyylogo.png'
+import {selectTodayClinicResource} from "@/api/single-page/today-clinic-resource";
+
+const resourceList = ref([])
+const queryResourceData = () => {
+  selectTodayClinicResource().then(res => {
+    resourceList.value = res
+    analyzeStatistics()
+  })
+}
+
+const currentTimeText = ref('')
+
+const displayList = ref([]);
+const pageInfoSize = 4; //每页显示4条信息
+const maxPageNumber = ref(0);
+
+const analyzeStatistics = () => {
+  if (resourceList.value.length === 0) {
+    return
+  }
+  maxPageNumber.value = Math.ceil((resourceList.value.length)/pageInfoSize);
+  splitPageInfo();
+}
+
+const currentPageNumber = ref(1)
+const executeSlice = () => {
+  let leftIndex = (currentPageNumber.value - 1) * 4
+  let rightIndex = currentPageNumber.value * 4
+  if (rightIndex > resourceList.value.length - 1) {
+    rightIndex = resourceList.value.length - 1
+  }
+  displayList.value = resourceList.value.slice(leftIndex, rightIndex);
+  if (currentPageNumber.value < maxPageNumber.value) {
+    currentPageNumber.value += 1
+  } else {
+    currentPageNumber.value = 1
+  }
+}
+
+const splitPageInfo = () => {
+  executeSlice()
+  setInterval(function () {
+    executeSlice()
+  }, 1000 * 20);
+}
+
+onMounted(() => {
+  queryResourceData()
+  setInterval(() => {
+    let date = new Date();
+    let dateStr=date.getFullYear() + "/" +(date.getMonth() + 1) + "/" + date.getDate();
+    let timeStr = date.toLocaleTimeString();
+    let weekStr='星期'+'日一二三四五六'.charAt(new Date().getDay());
+    currentTimeText.value = dateStr + " --- " + timeStr + " --- " + weekStr;
+  }, 1000)
+})
+
+</script>
+
+<style scoped>
+* {
+  margin: 0;
+  padding: 0;
+}
+
+body {
+  height: 100%;
+  background-image: linear-gradient(to bottom, dodgerblue 10%, darkblue 100%);
+}
+
+[name=parent_div] {
+  width: 100%;
+  height: 98%;
+}
+
+[name=title_div] {
+  position: relative;
+  background-image: linear-gradient(to top,white 0%, lightskyblue 100%);
+  display: table;
+  width: 100%;
+  height: 10%;
+}
+
+img {
+  position: relative;
+  margin-left: 20px;
+  height: 75%;
+  width: 20%;
+  margin-top: 5px;
+}
+
+[id=title] {
+  position: absolute;
+  top: 0;
+  left: 17.5%;
+  text-align: center;
+  border-bottom-left-radius: 30%;
+  border-bottom-right-radius: 30%;
+  height: 96%;
+  width: 20%;
+  font-size: 50px;
+  font-weight: bold;
+  background-image: linear-gradient(to top, #8ad2ff 0%, rgba(0, 0, 255, 0.48) 100%);
+}
+
+[id=current_time] {
+  background-image: linear-gradient(to top, #8ad2ff 0%, rgba(0, 0, 255, 0.48) 100%);
+  border-radius: 10px;
+  width: 45%;
+  font-size: 45px;
+  color: black;
+  font-weight: bold;
+  display: table-cell;
+  vertical-align: middle;
+  text-align: center;
+}
+
+table { width: 98%; height: 88%;
+  margin: 1%; min-height: 35px; line-height: 35px;
+  text-align: center; font-size: 60px;
+  /*font-weight: bold;*/
+  border-collapse: collapse;
+}
+
+td {
+  border:3px solid lightgray;
+}
+
+[name=t1],[name=t6] {
+  width: 22%;
+  height: 20%;
+  color: black;
+  background-image: linear-gradient(to top, deepskyblue 0%, lightskyblue 100%);
+  font-size: 45px;
+  font-weight: bold;
+}
+
+[name=t3] {
+  width: 18%;
+  height: 20%;
+  color: black;
+  background-image: linear-gradient(to top, deepskyblue 0%, lightskyblue 100%);
+  font-size: 45px;
+  font-weight: bold;
+}
+
+[name=t5] {
+  width: 14%;
+  height: 20%;
+  color: black;
+  background-image: linear-gradient(to top, deepskyblue 0%, lightskyblue 100%);
+  font-size: 45px;
+  font-weight: bold;
+}
+
+[name=t2],[name=t4]{
+  width: 12%;
+  height: 20%;
+  color: black;
+  background-image: linear-gradient(to top, deepskyblue 0%, lightskyblue 100%);
+  font-weight: bold;
+  font-size: 45px;
+}
+
+[name=content1],[name=content2],[name=content3],[name=content4],[name=content5],[name=content6] {
+  background-image: linear-gradient(to top, #5385fa 0%, #2e43ff 100%);
+  color: orange;
+  /*font-weight: bold;*/
+}
+
+</style>

+ 144 - 27
src/views/utilities/ItemApply.vue

@@ -1,36 +1,153 @@
 <template>
-  <div class="item_apply_container">
-    <div class="item_apply_header">
-      <el-select v-model="itemtype">
-        <el-option label="医用耗材" value="medical"></el-option>
-        <el-option label="后勤耗材" value="normal"></el-option>
+  <page-layer>
+    <template #header>
+      <el-select v-model="queryParams.type" style="width: 120px">
+        <el-option label="医用耗材" :value="1"></el-option>
+        <el-option label="后勤耗材" :value="2"></el-option>
       </el-select>
-    </div>
-  </div>
+      <el-divider direction="vertical"></el-divider>
+      检索方式:
+      <el-select v-model="queryParams.method" style="width: 60px">
+        <el-option label="首拼" value="alpha"></el-option>
+        <el-option label="名称" value="name"></el-option>
+      </el-select>&nbsp;&nbsp;
+      <el-autocomplete v-model="queryParams.content" value-key="name" :fetch-suggestions="searchItem"
+                       :trigger-on-focus="false" clearable style="width: 180px" @select="handleSelectItem"
+                       placeholder="请输入关键字">
+      </el-autocomplete>
+      <el-divider direction="vertical"></el-divider>
+      <el-button type="primary" icon="Document" @click="inputSpecialRemark">特殊情况备注</el-button>
+      <el-button type="success" icon="Check" @click="beforeSubmitSupplies">提交</el-button>
+      <div style="margin-left: 12px; width: 200px;" class="ellipsis-text" :title="specialRemark">{{specialRemark}}</div>
+    </template>
+    <template #main>
+      <el-table :height="tableHeight" :data="queryParams.type === 1 ? medicalSupplies : normalSupplies"
+                stripe highlight-current-row ref="supplyRef">
+        <el-table-column prop="name" label="名称"></el-table-column>
+        <el-table-column label="规格">
+          <template #default="scope">
+            <el-select v-if="scope.row.size" v-model="scope.row.size">
+              <el-option v-for="(size,index) in scope.row.sizes" :key="index"
+                         :label="size.val" :value="size.val"></el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="数量">
+          <template #default="scope">
+            <el-input v-model="scope.row.quantity" type="number" style="width: 80px"></el-input>
+            &nbsp;{{scope.row.unit}}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作">
+          <template #default="scope">
+            <el-button title="删除" @click="deleteRow(scope.$index)" circle type="danger" icon="Delete"></el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </template>
+  </page-layer>
 </template>
 
-<script>
-import { ref } from 'vue'
-export default {
-  setup() {
-    const itemtype = ref('medical')
+<script setup>
+import PageLayer from "@/layout/PageLayer.vue";
+import {computed, ref} from 'vue'
+import {selectApplyItems,submitSupplies} from "@/api/utilities/item-apply";
+import store from "@/store";
+import {ElMessage, ElMessageBox} from "element-plus";
 
-    return {
-      itemtype,
-    }
-  },
+const windowSize = store.state.app.windowSize
+const tableHeight = windowSize.h - 15
+const supplyRef = ref(null)
+const queryParams = reactive({
+  type: 1,
+  method: 'alpha',
+  content: null,
+})
+
+const specialRemark = ref(null)
+
+const medicalSupplies = ref([])
+const normalSupplies = ref([])
+const selectedSuppliesIdList = ref([])
+
+const inputSpecialRemark = () => {
+  ElMessageBox.prompt('请输入特殊情况备注。', '提示', {
+    type: "warning",
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    inputPattern: /\S/,
+    inputErrorMessage: '请输入有效内容',
+  }).then(({value}) => {
+    specialRemark.value = value
+  }).catch(() => {
+  })
 }
-</script>
 
-<style scoped>
-.item_apply_container {
-  width: calc(100% - 40px);
-  height: calc(100% - 20px);
-  margin-left: 20px;
-  margin-top: 10px;
-  background: rgb(219, 219, 219);
+const searchItem = (queryString, cb) => {
+  selectApplyItems(queryParams).then(res => {
+    cb(res)
+  })
 }
-.item_apply_header {
-  padding: 4px;
+
+const handleSelectItem = (item) => {
+  if (selectedSuppliesIdList.value.indexOf(item.id) > -1) {
+    ElMessage({
+      message: '已有相同物品存在,请勿重复添加。',
+      type: 'warning',
+      duration: 2000,
+      showClose: true
+    })
+    return
+  }
+  item.size = item.sizes.length > 0 ? item.sizes[0].val : null;
+  queryParams.type === 1 ? medicalSupplies.value.push(item) : normalSupplies.value.push(item)
+  selectedSuppliesIdList.value.push(item.id)
+  queryParams.content = null
+  supplyRef.value.setCurrentRow(item)
+}
+
+const deleteRow = (index) => {
+  queryParams.type === 1 ? medicalSupplies.value.splice(index, 1)
+      : normalSupplies.value.splice(index, 1)
 }
-</style>
+
+const beforeSubmitSupplies = () => {
+  if (selectedSuppliesIdList.value.length === 0) {
+    ElMessage({
+      message: '没有可以提交的物品,请添加后再提交。',
+      type: 'warning',
+      duration: 2000,
+      showClose: true
+    })
+    return
+  }
+  ElMessageBox.confirm('提交后不可撤回,是否确认提交?', '提示', {
+    type: 'warning',
+    confirmButtonText: '提交',
+  }).then(() => {
+    executeSubmit()
+  }).catch(() => {})
+}
+
+const userInfo = computed(() => {
+  return store.getters['user/info']
+})
+const executeSubmit = () => {
+  const body = {
+    specialRemark: specialRemark.value,
+    userName: userInfo.value.name,
+    codeRs: userInfo.value.codeRs,
+    deptName: userInfo.value.deptName,
+    supplies: queryParams.type === 1 ? medicalSupplies.value : normalSupplies.value
+  };
+  submitSupplies(body).then(() => {
+    ElMessage({
+      message: '提交成功。',
+      type: 'success',
+      duration: 2000,
+      showClose: true
+    })
+  })
+}
+</script>
+