基于node.js和Vue3的医院信息管理挂号系统

        随着时代的发展,无线互联网技术的应用和普及给人们的生活带来了极大的改变,现在信息技术不仅可以提高我们的工作效率,还能有效的规避一些错误风险,节约人力成本。我国国民一方面对健康的要求越来越重视了,另一方面现代人的健康问题日益严重,所以医院信息管理也不再是可有可无的事情了。针对传统医院管理模式中,医院各个部门的协调缓慢、在医院办理业务耗费大量时间排队、部门间数据的存储和查看费时费力等一系列问题。设计医院信息管理系统亟待解决目前我国各大医院存在的这些问题。

        医院信息管理系统是典型的管理信息系统(HIS),其开发主要包括后台数据库的开发与维护、其中包括前端应用程序的开发。以前需要建立一个具有强大数据一致性、完整性和数据安全性的数据库。在后者中,应用程序必须具备所有功能并易于使用。使用计算机管理患者和医生与人工管理相比,具有检索速度快、检索方便、可靠性高、存储容量大、安全性好、使用寿命长、成本低等无可比拟的优点,这些优点可以大大提高患者及医生信息管理的效率,大大提高医疗设施财务管理的科学化、正规化管理和尖端科学技术,这是提升服务的重要条件。

 

实现的功能:

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

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

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

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

 

用到的技术:

后端 node.js,MySQL数据库;

前端 Vue3。

部分代码展示

function login() {
  if (nick.value == '' || pass.value == '') {
    common.err('请填写用户ID和密码')
    return
  }
  common.request({
    data: {
      nickName: nick.value,
      password: window.btoa(pass.value)
    },
    url: common.urlMap.login,
    success: function (res) {
      if (res.data.code == 200) {
        try {
          user.value = res.data.data
          getUserData()
          localStorage.setItem('userInfo', JSON.stringify(res.data.data))
        } catch (e) {
          user.value.uid = ''
          localStorage.removeItem('userInfo')
        }
      } else {
        common.err(res.data.msg)
      }
    },
    fail: function (res) {
      common.err('网络异常')
    }
  })
}
function getUserData() {
  common.request({
    loading: false,
    url: common.urlMap.findSysUser,
    data: { uid: user.value.uid },
    success: function (res) {
      if (res.data.code == 200) {
        if (res.data.data) {
          userItem = res.data.data
        }
      }
    },
    fail: function (res) {
      common.err('网络异常')
    }
  })
}
function logOut() {
  localStorage.removeItem('userInfo')
  user.value.uid = ''
  common.request({
    url: common.urlMap.logout
  })
}
function jumpManager() {
  if (user.value.type == 1) {
    window.location.href = '/public/pages/index.html'
  } else if (user.value.type == 2) {
    window.location.href = '/public/pages/index2.html'
  } else {
    location.href = '/public/pages/view/manager/myInfo.html'
  }
}

function getTypeName(typeId) {
  for (let i = 0; i < typeList.value.length; i++) {
    if (typeList[i].id == typeId) {
      return typeList[i].groupName
    }
  }
  return ''
}
function listenPage(id) {
  window.location.href = './view/manager/bookItem.html?id=' + id
}
function resign() {
  reNick = ''
  pass1.value = ''
  pass2.value = ''
  showRe.value = true
}
function resignSub() {
  addUser.value.nickName = addUser.value.nickName.replace(/\s/g, '')

  if (!addUser.value.nickName || !pass1.value || !pass2.value) {
    common.err('请填写完整')
    return
  }

  if (pass1.value != pass2.value) {
    common.err('两次密码不一致')
    return
  }

  if (pass1.value.length > 12 || pass1.value.length < 6) {
    common.err('密码长度应为6-12位')
    return
  }

  addUser.value.password = btoa(pass1.value)

  if (addUser.value.uid) {
    common.request({
      url: common.urlMap.editSysUser,
      data: addUser.value,
      success: function (res) {
        if (res.data.code == 200) {
          common.msg('修改成功,请重新登录')
          showRe.value = false
          user.value.uid = ''
        } else {
          common.msg(res.data.msg)
        }
      },
      fail: function (res) {
        common.err('网络异常')
      }
    })
  } else {
    common.request({
      headers: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: addUser.value,
      url: common.urlMap.regist,
      success: function (res) {
        if (res.data.code == 200) {
          common.msg('注册成功,请登录')
          showRe.value = false
        } else {
          common.err(res.data.msg)
        }
      },
      fail: function (res) {
        common.err('网络异常')
      }
    })
  }
}
function addOrder() {
  var textArr = ['realName', 'nickName', 'subId', 'docId', 'orderPrice', 'orderTime']
  for (var key in order.value) {
    if (!order.value[key] && textArr.indexOf(key) > -1) {
      common.err('请填写完整')
      return
    }
  }

  if (order.value.orderTime.getTime() < new Date().getTime()) {
    common.err('预约时间应晚于当前时间')
    return
  }

  var cutDate = getDateStr('yyyy-MM-dd', order.value.orderTime)

  var begin = new Date(cutDate + ' ' + timeRange[0])
  var end = new Date(cutDate + ' ' + timeRange[1])

  if (
    order.value.orderTime.getTime() > end.getTime() ||
    order.value.orderTime.getTime() < begin.getTime()
  ) {
    common.err('预约时间不在医师值班时间内')
    return
  }
  order.value.orderTime = getDateStr('yyyy-MM-dd hh:mm', order.value.orderTime)

  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>

基于node.js和Vue3医疗医院信息管理挂号系统

猜你喜欢

转载自blog.csdn.net/qq_28245905/article/details/131695298
今日推荐