123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813 |
- <template>
- <view>
- <nav-bar :navbarData="navbarData"></nav-bar>
- <view :style="`margin-top: ${height * 2 - 20}rpx; height: calc(100vh - ${height * 2 - 2}rpx)`">
- <view class="userbg" :style="`background-image:url(${imgDomain}/images/icon/bg_patients_bg.png)`">
- <view class="search">
- <van-row>
- <view class="searchcontent">
- <input
- type="text"
- class="search-input"
- placeholder="输入电话,登记号,身份证,姓名,病案号搜索"
- placeholder-style="color: #999"
- @input="handleInput"
- />
- </view>
- <view class="scan" @tap="scan">
- <image :src="`${imgDomain}/images/icon/ydhl_scan.png`" class="custom-icon" />
- </view>
- </van-row>
- </view>
- <view class="user" :style="`background-image:url(${imgDomain}/images/icon/bg_user.png)`">
- <view class="usericon">
- <image class="icon" :src="`${imgDomain}/images/icon/avatar_nurse.png`"></image>
- </view>
- <view class="userinfo">
- <view class="date">{{ dateStr }}</view>
- <view class="username">
- {{ userData.userName }}
- <span class="but-span">
- <view class="userout" @tap="userOutFun">退出登录</view>
- <view class="changeloc" @tap="changeloc">切换科室</view>
- </span>
- </view>
- </view>
- </view>
- <progress :percent="percent" activeColor="#D52424" stroke-width="1"></progress>
- </view>
- <view class="wardtitle">
- <text style="padding-left: 3px">在院患者 ({{ userData.locDesc }})</text>
- </view>
- <view class="patcontent">
- <view
- class="patlist"
- @tap="gotoPatMainPage(item)"
- v-for="(item, index) in wardPatList"
- :key="index"
- >
- <van-cell
- :icon="item.patSexCode === '1' ? `${imgDomain}/images/icon/gender-male.png` : `${imgDomain}/images/icon/gender-female.png`"
- use-label-slot
- >
- <van-row slot="title" class="topinfo">
- <van-col span="4">{{ item.admBedCode }}</van-col>
- <van-col span="15">
- <view style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap">
- {{ item.patName }}
- </view>
- </van-col>
- <van-col span="5">
- <view class="paticon">
- <view
- :style="`width:18px;height:18px;background:url(${imgDomain}/images/mobilenurse/bedicon.png);background-position: ${getposition(iconitem)}`"
- v-for="(iconitem, iconindex) in item.admIcon"
- :key="iconindex"
- ></view>
- </view>
- </van-col>
- </van-row>
- <van-row slot="label" class="bottominfo">
- <van-col span="19">入院时间: {{ item.admDatetime }}</van-col>
- <van-col span="5">
- <view v-if="item.nurseLv === '特级'" class="nurse-lv-css-red">{{ item.nurseLv }}</view>
- <view v-if="item.nurseLv === '一级'" class="nurse-lv-css-pink">{{ item.nurseLv }}</view>
- <view v-if="item.nurseLv === '二级'" class="nurse-lv-css-blue">{{ item.nurseLv }}</view>
- <view v-if="item.nurseLv === '三级'" class="nurse-lv-css-greenyellow">{{ item.nurseLv }}</view>
- </van-col>
- </van-row>
- </van-cell>
- </view>
- </view>
- </view>
- <van-action-sheet
- :show="showchangeLoc"
- title="请选择科室"
- @close="onClose"
- @cancel="onClose"
- >
- <van-cell
- :title="loc.logonGroupDesc"
- :label="loc.logonHospDesc"
- :value="loc.logonLocDesc"
- value-class="locclass"
- :class="curLoc === index ? 'locitemcur' : 'locitem'"
- label-class="label"
- title-class="title"
- @tap="changeToLoc(loc, index)"
- v-for="(loc, index) in locList"
- :key="index"
- ></van-cell>
- </van-action-sheet>
- </view>
- </template>
- <script setup>
- import { ref, onMounted, onUnmounted, computed } from 'vue';
- import { httpconfig } from '../../config/httpconfig';
- import WXBizDataCrypt from '../../utils/WXBizDataCrypt';
- import { onLoad ,onShow } from '@dcloudio/uni-app';
- import Util from '../../utils/util.js';
- import Common from '../../utils/common.js';
- import { $http } from '../../config/https';
- import navBar from '@/pages/components/navbar/index';
- // 工具函数(替代原wxs模块)
- const getspan = (widh) => {
- return widh.replace("px", "");
- };
- const findPat = (patinfo, searchData) => {
- if (!searchData) return 1;
- const searchStr = searchData.toUpperCase();
- return (
- patinfo.patName.includes(searchData) ||
- patinfo.admBedCode.includes(searchData) ||
- patinfo.patID.includes(searchData) ||
- patinfo.patNameSpell.includes(searchStr) ||
- patinfo.patNo.includes(searchStr) ||
- patinfo.patMedicalNo.includes(searchStr) ||
- patinfo.admID === searchData
- ) ? 1 : 0;
- };
- const getposition = (iconitem) => {
- return `-${(iconitem.position % 10 - 1) * 18}px -${Math.floor(iconitem.position / 10) * 18}px`;
- };
- // 响应式数据
- const height = ref('');
- const navbarData = ref({
- background: '',
- title: '普瑞眼科移动护理',
- height: '100',
- bottom: true,
- isGoBack: false,
- cleanPat: 'Y'
- });
- const userData = ref(uni.getStorageSync('userData') || {});
- const patInfo = ref(uni.getStorageSync('patInfo') || {});
- const patColums = ref([]);
- const templateList = ref([{
- icon: `${httpconfig.imgDomain}/images/icon/mine-address.png`,
- title: '巡视单',
- value: '',
- url: ''
- }]);
- const timer = ref(null);
- const dateStr = ref('2020年11月15日 14:25 星期三');
- const searchData = ref('');
- const countTime = ref(1500);
- const searchWaiting = ref(false);
- const showchangeLoc = ref(false);
- const imgDomain = ref(httpconfig.imgDomain);
- const locList = ref([]);
- const curLoc = ref(-1);
- const wardPatList = ref('');
- const percent = ref(0);
- const downLineShow = ref(true);
- onShow(() => {
- try {
- const pages = getCurrentPages()
- if (pages.length > 0) {
- const currentPage = pages[pages.length - 1]
- const currentRoute = currentPage.route // 当前页面路由
- // 更新全局变量
- if (uni.$appGlobal) {
- uni.$appGlobal.globalData.value.currentRoute = currentRoute
- }
- }
- } catch (err) {
- console.error('更新当前路由失败:', err)
- }
- })
- // 生命周期
- onMounted(() => {
- // 页面显示时执行
- if (!imgDomain.value) {
- imgDomain.value = uni.getStorageSync('appUrlAddress');
- }
-
- const storedUserData = uni.getStorageSync('userData');
- const storedPatInfo = uni.getStorageSync('patInfo');
- if (storedUserData) {
- userData.value = storedUserData;
- patInfo.value = storedPatInfo;
- }
-
- getAuthorityApply();
- if (patColums.value.length === 0) {
- getPatInfoColumns();
- }
- showTime();
- getAppVersion();
- });
- onUnmounted(() => {
- if (timer.value) {
- clearInterval(timer.value);
- }
- });
- // 方法定义
- const getAppVersion = () => {
- const appInfo = uni.getAppBaseInfo();
- const appVersion = appInfo.appVersion;
-
- $http.post('urlDeault',this, {
- code: '02010011',
- data: {
- params: [{ propId: '76||377' }]
- },
- success: (res) => {
- if (+res.errorCode === 0) {
- const setValue = res.result.rows[0].setValue;
- if (setValue > appVersion) {
- uni.showModal({
- title: `检测到新版本V${setValue}`,
- content: '是否立即下载更新?',
- complete: (res) => {
- if (res.confirm) {
- downAppApk(setValue);
- }
- }
- });
- }
- }
- }
- });
- };
- const downAppApk = (setValue) => {
- const appUrlAddress = uni.getStorageSync('appUrlAddress');
- const downloadTask = uni.downloadFile({
- url: `${appUrlAddress}/images/apk/ydhl-${setValue}.apk`,
- success: (downloadResult) => {
- plus.runtime.install(
- downloadResult.tempFilePath,
- { force: true },
- () => {
- uni.showToast({ title: '更新成功,重启中', icon: 'none' });
- plus.runtime.restart();
- }
- );
- },
- fail: (res) => {
- uni.showToast({ title: `download apk fail: ${res}`, icon: 'none' });
- },
- complete: () => {
- downloadTask.offProgressUpdate();
- }
- });
- downloadTask.onProgressUpdate((res) => {
- percent.value = res.progress;
- });
- };
- const gotoPatMainPage = (patInfoData) => {
- Util.getPatInfo(patInfoData.admID, () => {
- uni.navigateTo({ url: '../patMainPage/patMainPage' });
- });
- };
- const gotoPage = (e) => {
- const flag = e.currentTarget.dataset.flag;
- if (flag === 'Pat') {
- uni.navigateTo({ url: '../wardPatList/wardPatList' });
- } else if (flag === 'template') {
- const patInfo = uni.getStorageSync('patInfo');
- if (!patInfo) {
- uni.showModal({
- title: '提示',
- content: '无患者信息,请先扫描患者腕带或选择患者!!!',
- showCancel: false,
- confirmText: '知道了'
- });
- return;
- }
- const itemdata = e.currentTarget.dataset.itemdata;
- uni.navigateTo({
- url: `../nurseRecordList/nurseRecordList?templateID=${itemdata.id}&title=${itemdata.IEMRTemplateDesc}列表`
- });
- }
- };
- const scan = () => {
- uni.scanCode({
- success: (res) => {
- const scValue = res.result;
- if (scValue.length > 20) {
- uni.navigateTo({ url: scValue });
- } else {
- Util.getPatInfoNew(res.result, () => {
- uni.navigateTo({ url: '../patMainPage/patMainPage' });
- });
- }
- }
- });
- };
- const getPatInfo = (admID) => {
- $http.post('urlDeault',this, {
- code: '03030002',
- data: { params: [{ admID }] },
- success: (res) => {
- if (+res.errorCode === 0) {
- patInfo.value = res.result;
- uni.setStorage({ key: 'patInfo', data: res.result });
- }
- }
- });
- };
- const getAuthorityApply = () => {
- const storedUserData = uni.getStorageSync('userData');
- if (storedUserData) {
- userData.value = storedUserData;
- getWardPatList();
- } else {
- gotoAuthority();
- }
- };
- const gotoAuthority = () => {
- uni.reLaunch({ url: '../authentication/authentication' });
- };
- const getPatInfoColumns = () => {
- const data = {
- params: [{ compontName: 'MobileNursePatInfo', type: 'C', reactCode: [] }]
- };
-
- $http.post('urlDeault',this, {
- code: '01040073',
- data,
- success: (res) => {
- if (+res.errorCode === 0) {
- if (res.result.C) {
- patColums.value = res.result.C;
- } else {
- uni.showToast({ title: '未获取到病人信息维护,请联系信息中心', icon: 'none' });
- }
- } else {
- uni.showToast({ title: res.errorMessage, icon: 'none' });
- }
- }
- });
- };
- const getTemplateList = () => {
- const patInfo = uni.getStorageSync('patInfo');
- const userData = uni.getStorageSync('userData');
- const data = {
- params: [{
- hospID: userData.hospID,
- admID: patInfo.admInfo ? patInfo.admInfo.admID : '',
- useFlag: 'N'
- }]
- };
-
- $http.post('urlDeault',this, {
- code: '10020001',
- data,
- success: (res) => {
- templateList.value = res.result.TemplateList;
- }
- });
- };
- const getWardPatList = () => {
- const userData = uni.getStorageSync('userData');
- uni.showLoading({ title: '数据加载中...' });
-
- $http.post('urlDeault',this, {
- code: '04020025',
- data: {
- params: [{ wardID: userData.locID, patMessage: searchData.value || '' }]
- },
- success: (res) => {
- uni.hideLoading();
- if (+res.errorCode === 0) {
- wardPatList.value = res.result.patList;
- showchangeLoc.value = false;
- } else if (['01040053', '01040054', '01040055'].includes(res.errorCode)) {
- getWardPatList();
- }
- }
- });
- };
- const changeloc = () => {
- getLocList();
- };
- const userOutFun = () => {
- uni.showModal({
- title: '退出登录',
- content: '您确定要退出当前登录工号吗?',
- success: (res) => {
- if (res.confirm) {
- uni.removeStorageSync('userData');
- gotoAuthority();
- }
- }
- });
- };
- const onClose = () => {
- showchangeLoc.value = false;
- };
- const showTime = () => {
- const showDay = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
-
- timer.value = setInterval(() => {
- const time = new Date();
- const year = time.getFullYear();
- const month = time.getMonth() + 1;
- const date = time.getDate();
- const day = time.getDay();
- const hour = time.getHours().toString().padStart(2, '0');
- const minutes = time.getMinutes().toString().padStart(2, '0');
- const second = time.getSeconds().toString().padStart(2, '0');
-
- dateStr.value = `${year}年${month}月${date}日 ${hour}:${minutes}:${second} ${showDay[day]}`;
- }, 1000);
- };
- const handleInput = (val) => {
- let inputvalue = val.detail.value.replace(/\s+/g, '');
- if (inputvalue.length === 10) {
- searchData.value = '';
- Util.getPatInfoNew(inputvalue, () => {
- uni.navigateTo({ url: '../patMainPage/patMainPage' });
- });
- } else {
- searchData.value = inputvalue;
- if (!searchWaiting.value) {
- searchTimer();
- }
- }
- };
- const searchTimer = () => {
- searchWaiting.value = true;
-
- const setTimer = setInterval(() => {
- countTime.value -= 500;
- if (countTime.value <= 0) {
- countTime.value = 1500;
- searchWaiting.value = false;
- clearInterval(setTimer);
- getWardPatList();
- }
- }, 500);
- };
- const getLocList = () => {
- const userData = uni.getStorageSync('userData');
- const data = {
- params: [{
- currentLocFlag: 'Y',
- language: 'CN',
- userCode: userData.userCode
- }]
- };
-
- $http.post('urlDeault',this, {
- code: '01040043',
- data,
- success: (res) => {
- if (+res.errorCode === 0) {
- let currentIndex = -1;
- const logonLocAry = res.result.logonLocAry;
-
- logonLocAry.forEach((locInfo, index) => {
- if (
- locInfo.logonLocID === userData.locID &&
- locInfo.logonHospID === userData.hospID &&
- locInfo.logonGroupID === userData.groupID
- ) {
- currentIndex = index;
- }
- });
-
- locList.value = logonLocAry;
- curLoc.value = currentIndex;
- showchangeLoc.value = true;
- }
- }
- });
- };
- const changeToLoc = (loc) => {
- const updatedUserData = { ...userData.value };
- updatedUserData.locID = loc.logonLocID;
- updatedUserData.locDesc = loc.logonLocDesc;
- updatedUserData.groupID = loc.logonGroupID;
- updatedUserData.groupDesc = loc.logonGroupDesc;
- updatedUserData.hospID = loc.logonHospID;
- updatedUserData.hospDesc = loc.logonHospDesc;
- updatedUserData.hospCode = loc.logonHospCode;
-
- userData.value = updatedUserData;
- uni.setStorage({
- key: 'userData',
- data: updatedUserData,
- success: () => {
- uni.removeStorage({ key: 'patInfo' });
- getWardPatList();
- }
- });
- };
- </script>
- <style>
- /* 保持原样式不变 */
- .pat {
- font-size: 30rpx;
- padding: 0 20rpx;
- }
- .patInfo {
- font-size: 26rpx;
- font-weight: 400;
- }
- .userbg {
- width: 100%;
- height: 340rpx;
- background-size: 100% auto;
- background-repeat: no-repeat;
- }
- .search {
- height: 100rpx;
- padding: 20rpx 30rpx 0;
- }
- .searchcontent {
- width: calc(100% - 120rpx);
- float: left;
- }
- .search-input {
- margin-top: 18rpx;
- height: 70rpx;
- border-radius: 40rpx;
- background-color: #ffffff;
- border: #007aff 1px solid;
- padding: 0rpx 10rpx;
- }
- .searchcontent .van-cell__title {
- max-width: 0 !important;
- min-width: 0 !important;
- -webkit-flex: 0;
- flex: 0;
- }
- .scan {
- width: 100rpx;
- padding-left: 16rpx;
- float: left;
- color: #fff;
- text-align: center;
- }
- .user {
- width: calc(100% - 30rpx);
- height: 200rpx;
- background-size: 100% auto;
- background-repeat: no-repeat;
- padding: 0 18rpx 20rpx;
- margin-top: -8rpx !important;
- }
- .usericon {
- border-radius: 50%;
- margin-left: 12rpx;
- background: #e3e4fc;
- height: 120rpx;
- width: 120rpx;
- text-align: center;
- line-height: 120rpx;
- float: left;
- margin: 40rpx 20rpx;
- }
- .userinfo {
- float: left;
- width: calc(100% - 190rpx);
- height: 120rpx;
- margin: 40rpx 0;
- line-height: 60rpx;
- padding-right: 30rpx;
- }
- .date {
- font-size: 15px;
- font-weight: 400;
- color: #333333;
- }
- .icon {
- height: 120rpx;
- width: 120rpx;
- border-radius: 50%;
- }
- .wardtitle {
- width: calc(100% - 56px);
- margin: 0 28rpx;
- height: 42rpx;
- font-size: 15px;
- border-left: 8rpx solid #007aff;
- font-weight: 400;
- color: #333333;
- line-height: 42rpx;
- margin-bottom: 10rpx;
- }
- .username {
- font-size: 14px;
- font-weight: 400;
- color: #666666;
- display: flex;
- justify-content: space-between;
- }
- .unwrite {
- color: red !important;
- font-size: 10px !important;
- }
- .but-span {
- display: flex;
- flex-direction: row;
- }
- .changeloc {
- width: 140rpx;
- height: 50rpx;
- background: #007aff;
- border-radius: 4px;
- font-size: 25rpx;
- color: #fff;
- line-height: 50rpx;
- border-radius: 8rpx;
- text-align: center;
- }
- .userout {
- width: 120rpx;
- height: 46rpx;
- border-radius: 4px;
- border: 1px solid;
- color: #007aff;
- font-size: 25rpx;
- line-height: 46rpx;
- border-radius: 8rpx;
- text-align: center;
- margin-right: 20rpx;
- }
- .write {
- color: #809aff !important;
- font-size: 10px !important;
- }
- .patcontent {
- overflow: auto;
- height: calc(100% - 330rpx - 42rpx);
- }
- .patlist .van-cell,
- .patlist .van-cell__left-icon-wrap {
- height: 120rpx !important;
- padding: 0 8px !important;
- }
- .patlist .van-cell__left-icon-wrap {
- line-height: 120rpx !important;
- }
- .patlist .van-icon--image,
- .patlist .van-icon__image {
- height: 90rpx !important;
- width: 90rpx !important;
- bottom: 20rpx !important;
- }
- .patlist .van-col {
- white-space: nowrap;
- min-height: 1px;
- }
- .patlist .van-cell__value {
- width: 0 !important;
- }
- .patlist .van-cell__title {
- padding-left: 10rpx;
- }
- .patlist .van-cell__right-icon-wrap {
- height: 100%;
- }
- .topinfo {
- font-size: 32rpx;
- font-weight: 400;
- color: #666666;
- height: 45rpx;
- line-height: 40rpx;
- padding-top: 8px;
- }
- .topinfo .van-col {
- text-align: left;
- }
- .paticon {
- display: flex;
- flex-direction: row;
- }
- .bottominfo {
- font-weight: 400;
- color: #999999;
- height: 40rpx;
- line-height: 40rpx;
- }
- /* 让row下的所有col内容左对齐 */
- .bottominfo .van-col {
- text-align: left;
- }
- .nurse-lv-css-red {
- background-color: red;
- color: #fff;
- border-radius: 4rpx;
- padding: 0rpx 18rpx;
- font-size: 20rpx;
- width: 50rpx;
- }
- .nurse-lv-css-pink {
- background-color: pink;
- color: #fff;
- border-radius: 4rpx;
- padding: 0rpx 18rpx;
- font-size: 20rpx;
- width: 50rpx;
- }
- .nurse-lv-css-greenyellow {
- background-color: rgb(93, 187, 93);
- color: #fff;
- border-radius: 4rpx;
- padding: 0rpx 18rpx;
- font-size: 20rpx;
- width: 50rpx;
- }
- .nurse-lv-css-blue {
- background-color: #007aff;
- color: #fff;
- border-radius: 4rpx;
- padding: 0rpx 18rpx;
- font-size: 20rpx;
- width: 50rpx;
- }
- .custom-icon {
- margin-top: 24rpx;
- width: 60rpx;
- height: 60rpx;
- }
- .locclass {
- font-size: 34rpx;
- font-weight: 500;
- color: #000 !important;
- }
- .locitem .van-cell {
- background: #fff;
- }
- .locitemcur .van-cell {
- background: #bfe6f8 !important;
- }
- .label {
- font-size: 32rpx !important;
- font-weight: 500;
- }
- .title {
- font-size: 34rpx;
- font-weight: 500;
- color: #000;
- }
- </style>
|