原创

基于node.js和Vue3的医院信息管理挂号系统毕业设计,附源码

实现的功能:

管理员、医生、用户三种角色;

管理员对整个系统进行管理,包括医生管理、药品管理、科室管理、公告管理等;

医生实现了患者管理、药品管理、住院人员管理等功能;

用户可以自行注册登录,可以进行自助挂号、查看病历等;

用到的技术:

后端 node.js,MySQL数据库;

前端 Vue3。

部分代码展示

  common.request({
    loading: false,
    url: common.urlMap.addNmOrder,
    data: order.value,
    success: function (res) {
      common.msg(res.data.msg)
      if (res.data.code == 200) {
        pay.value = true
        showOrder.value = false
      }
    },
    fail: function (res) {
      common.err('网络异常')
    }
  })
}
function getOrder(item) {
  if (user.value.type != 3) {
    common.err('仅患者可挂号')
    return
  }

  if (!user.value.uid) {
    common.err('挂号前请登录')
    return
  }

  order.value = {
    realName: user.value.realName,
    nickName: user.value.nickName,
    title: '挂号预约',
    state: '0',
    type: '0',
    subId: item.id,
    docId: '',
    orderPrice: 10,
    creater: user.value.uid,
    validFlag: 1,
    userId: '',
    orderTime: new Date()
  }
  showOrder.value = true
  changeSub2(item.id)
  common.request({
    loading: false,
    url: common.urlMap.findSysUserList,
    data: {
      validFlag: 1,
      type: 4,
      pid: user.value.uid
    },
    success: function (res) {
      //common.msg(res.data.msg);
      if (res.data.code == 200) {
        userList.value = res.data.data
      }
    },
    fail: function (res) {
      common.err('网络异常')
    }
  })
}
function changeSub(e) {
  changeSub2(e)
  order.value.docId = ''
}
function changeDoc(e) {
  var emp = {
    workTime: '',
    job: ''
  }
  hotList.value.map(function (item) {
    if (item.uid == e) {
      emp = item
    }
  })
  if (emp) {
    order.value.orderPrice = emp.job == '医师' ? 10 : 30
  }
  orderTime = new Date(getDateStr('yyyy-MM-dd', new Date()) + ' ' + emp.workTime.split('-')[0])
  timeRange = emp.workTime.split('-')
}

function getDateStr(fmt, date) {
  // author: meizz
  var o = {
    'M+': date.getMonth() + 1, // 月份
    'd+': date.getDate(), // 日
    'h+': date.getHours(), // 小时
    'm+': date.getMinutes(), // 分
    's+': date.getSeconds(), // 秒
    'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
    S: date.getMilliseconds() // 毫秒
  }
  if (/(y+)/.test(fmt))
    fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
  for (var k in o)
    if (new RegExp('(' + k + ')').test(fmt))
      fmt = fmt.replace(
        RegExp.$1,
        RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
      )
  return fmt
}

function changeSub2(sub) {
  hotList2.value = []
  for (let i = 0; i < hotList.value.length; i++) {
    if (hotList.value[i].sub == sub) {
      hotList2.value.push(hotList.value[i])
    }
  }
}

function wr() {
  pay.value = false
  showOrder.value = false
}

getGroupList()
getTopBar()
getDoctor()
user.value = common.getUserInfo()
</script>

<template>
  <div>
    <div id="app" v-cloak>
      <div class="top-bar bg-white">
        <div class="top-logo" style="padding-left: calc(50% - 560px)">
          <img width="50px" height="50px" src="../../../public/logo.png" />
          <div style="padding-left: 10px">
            <span style="color: #ff9c0a">糯 </span><span class="text-blue">米 </span
            ><span style="color: white">医 院</span>
          </div>
        </div>
        <div class="v-flex v-c-center" style="padding-right: calc(50% - 560px)">
          <el-avatar size="medium" :src="picPath + (user.uid ? 'nuoMi.png' : 'unknow.png')" />
          <div class="text-shadow text-blue" style="padding-left: 15px">{{
            user.uid ? user.nickName + '[' + getUserType(user.type) + ']' : '未登录'
          }}</div>
        </div>
      </div>

      <div class="tab-list" style="padding-left: calc(50% - 560px)">
        <div class="tab-item">首页</div>
      </div>

      <div class="bottom-view" style="width: 1210px; margin-left: calc(50% - 560px)">
        <div class="l-block-top bg-s" style="width: 828px; margin: 10px 5px">
          <div class="bg-white padding-10" style="min-height: calc(100vh - 160px); margin-left: 0">
            <ElCollapse v-model="activeNames">
              <ElCollapseItem title="医院简介" name="1">
                <div v-for="(item, index) in pushList" :key="index">
                  {{ item.type == 1 ? item.content : '' }}
                </div>
              </ElCollapseItem>
            </ElCollapse>
            <ElCollapse v-model="activeNames2">
              <ElCollapseItem title="就医指南" name="2">
                <div v-for="(item, index) in pushList" :key="index">
                  {{ item.type == 2 ? item.content : '' }}
                </div>
              </ElCollapseItem>
            </ElCollapse>
            <div class="text-bold text-15 margin-b margin-t"
              ><span class="margin-l">医师阵容</span></div
            >
            <div class="v-flex" style="flex-wrap: wrap; width: 100%">
              <div
                class="v-flex v-r-left"
                v-for="item in hotList"
                :key="item.id"
                style="width: 245px; margin: 8px"
              >
                <div style="width: 100px; height: 130px">
                  <img :src="picPath + item.pic" class="item-pic" />
                </div>
                <div class="text-12 bookItem">
                  <div class="">{{ item.realName }}</div>
                  <div class=""
                    ><span class="text-gray">科室:</span>{{ item.nmHospSub.groupName }}</div
                  >
                  <div class=""><span class="text-gray">职称:</span>{{ item.job }}</div>
                  <div class="text-ellipsis-3"
                    ><span class="text-gray">简介:</span>{{ item.memo }}</div
                  >
                  <div class=""><span class="text-gray">坐诊时间:</span>{{ item.workTime }}</div>
                </div>
              </div>
            </div>
            <!--                <div class="v-flex v-r-center">-->
            <!--                    <div>-->
            <!--                        <span v-if="page!=1" class="padding-10 text-blue hover-green" @click="getBookList(-1)">上一页</span>-->
            <!--                        <span class="padding-10">{{page}}</span>-->
            <!--                        <span v-if="next" class="padding-10 text-blue hover-green" @click="getBookList(1)">下一页</span>-->
            <!--                    </div>-->

            <!--                </div>-->
          </div>
        </div>
        <div class="l-block-top" style="width: 338px; margin: 10px 5px">
          <div class="bg-white margin-b padding-20 bg-s" style="height: 130px">
            <div v-if="!user.uid" class="v-flex v-c-center v-r-center" style="height: 100%">
              <ElForm label-position="left" label-width="60px" size="small">
                <ElFormItem label="用户名">
                  <el-input
                    size="small"
                    placeholder="请输入用户名"
                    suffix-icon="el-icon-user"
                    v-model="nick"
                  />
                </ElFormItem>
                <ElFormItem label="密码">
                  <el-input
                    size="small"
                    placeholder="请输入密码"
                    suffix-icon="el-icon-set-up"
                    type="password"
                    v-model="pass"
                  />
                </ElFormItem>
                <div class="v-flex v-r-center">
                  <div style="margin-right: 50px">
                    <ElButton size="small" type="primary" @click="login">登录</ElButton>
                  </div>
                  <ElButton @click="resign" size="small">注册</ElButton>
                </div>
              </ElForm>
            </div>

            <div v-if="user.uid">
              <div class="v-flex v-r-between padding-10 bg-s">
                <div class="v-flex v-r-left">
                  <el-avatar
                    :src="picPath + (user.uid ? (user.pic ? user.pic : 'nuoMi.png') : 'unknow.png')"
                  />
                  <div>
                    <div v-if="user.uid" class="text-shadow text-blue" style="padding-left: 15px">{{
                      user.nickName
                    }}</div>
                    <div
                      v-if="user.uid"
                      class="text-shadow text-green text-12"
                      style="padding-left: 15px"
                      >{{ getUserType(user.type) }}</div
                    >
                  </div>
                </div>
                <div style="line-height: 40px">
                  <div v-if="user.uid" @click="changeInfo" class="text-shadow text-green text-12"
                    >修改信息</div
                  >
                </div>
                <div style="line-height: 40px">
                  <div v-if="user.uid" @click="logOut" class="text-shadow text-red text-12"
                    >退出登录</div
                  >
                </div>
              </div>
              <div class="v-flex v-r-between padding-10">
                <div class="text-gray"><span class="padding-l text-yellow"></span></div>
                <div class="text-gray"><span class="padding-l text-yellow"></span></div>
                <div @click="jumpManager" class="text-blue">{{
                  user.type == 3 ? '个人中心' : '管理中心'
                }}</div>
              </div>
            </div>
          </div>

演示视频链接

源码展示链接

正文到此结束
本文目录