hldy_app_mini/pages/NursingNew/index.vue

463 lines
12 KiB
Vue
Raw Normal View History

2025-11-05 15:59:48 +08:00
<template>
2026-01-26 13:19:11 +08:00
<view class="backgroundContainer" @touchmove.stop="getxy" @touchend.stop="cleanall">
<!-- 手指拖动 -->
<view class="box" :style="boxStyle">
<view class="title-time-blue">
<image class="blue-img" lazy-load src="/static/index/target.png" />
</view>
<image class="card-icon" :src="movelook.url" mode="aspectFill"></image>
<view class="card-text" style="margin-top: 0;">
{{ movelook.title }}
</view>
</view>
2025-12-30 08:40:09 +08:00
<!-- 左侧菜单 -->
2026-01-09 16:25:02 +08:00
<leftcontent :list="arrlist" @navurl="navurl" :userInfo="userInfo"></leftcontent>
2025-11-05 15:59:48 +08:00
<!-- 主页 -->
2026-01-16 14:28:12 +08:00
<!-- <index :isShow="menuIndex==0" v-if="swipedex==0&&!specialPage" @swip="swip" @gospecial="gospecial" /> -->
2026-01-09 16:23:18 +08:00
<index :isShow="menuIndex==0" v-if="swipedex==0&&!specialPage" @swip="swip" @gospecial="gospecial" />
2026-01-16 14:28:12 +08:00
<!-- 新主页 -->
2026-01-26 13:19:11 +08:00
<bignurse :isshow="menuIndex==0"
v-if="swipedex==0&&specialPage==1&&uni.getStorageSync('elderId')&&uni.getStorageSync('nuId')" />
2025-11-05 15:59:48 +08:00
<!-- 户嘱页 -->
2026-01-26 13:19:11 +08:00
<newnurse :isshow="menuIndex==1" v-if="swipedex==1" :canmove="startmoveit"
:sendxy="sendxy" :isblue='isblue' @handmove="handmove" @handsend="handsend" />
2025-12-16 16:54:29 +08:00
<!-- 医嘱 -->
2026-01-05 15:32:51 +08:00
<doctorask v-if="swipedex==2&&uni.getStorageSync('elderId')&&uni.getStorageSync('nuId')" />
2026-01-26 13:19:11 +08:00
<logistics :isshow="menuIndex==3"
v-if="swipedex==3&&uni.getStorageSync('elderId')&&uni.getStorageSync('nuId')" />
<invoicing :isshow="menuIndex==6"
v-if="swipedex==6&&uni.getStorageSync('elderId')&&uni.getStorageSync('nuId')" />
2026-01-05 09:29:43 +08:00
<!-- 医嘱页 -->
<!-- <logistics :isShow="menuIndexshowfourth" v-if="menuIndex==3" /> -->
2026-01-05 15:32:51 +08:00
<requestform :isShow="menuIndex==4" v-if="swipedex==4" />
2026-01-07 11:23:47 +08:00
<!-- 设备页 -->
<equipment :isShow="menuIndex==5" v-if="swipedex==5" />
2025-12-30 08:40:09 +08:00
<!-- 没有数据 -->
<view class="nomessageclass" :style="messageopit?{opacity: `1`}:{opacity: `0`}"
v-if="(menuIndex == 1 || menuIndex == 2) && (!uni.getStorageSync('elderId') ||!uni.getStorageSync('nuId'))">
<defaultr cont="暂无老人入住"></defaultr>
</view>
2025-11-05 15:59:48 +08:00
</view>
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, nextTick } from 'vue';
2026-01-26 13:19:11 +08:00
import { queryPadPageList, getPermissionList } from '@/pages/watch/api/lunpan.js'
2025-11-05 15:59:48 +08:00
import index from "./component/index.vue"
2026-01-16 14:28:12 +08:00
import newnurse from "./component/nurse/newindex.vue"
2025-11-05 15:59:48 +08:00
import equipment from "./component/equipment.vue"
2026-01-07 16:06:12 +08:00
import logistics from "./component/logistics/index.vue"
import invoicing from "./component/invoicing/index.vue"
2026-01-26 13:19:11 +08:00
2025-11-27 14:47:04 +08:00
import requestform from "./component/pleasetake/takehome.vue"
2025-12-16 16:54:29 +08:00
import doctorask from "./component/doctorask/doctorask.vue"
2026-01-16 14:28:12 +08:00
// import nurse from "./component/nurse/index.vue"
2026-01-09 16:23:18 +08:00
import bignurse from "./component/nurse/bigindex.vue"
2026-01-26 13:19:11 +08:00
import { onBackPress, onShow } from '@dcloudio/uni-app';
import { getNcPackagelist } from './component/nurse/api.js'
2025-12-25 13:27:31 +08:00
import leftcontent from "./component/leftcontent/leftcontent.vue"
2025-12-30 08:40:09 +08:00
import defaultr from '@/pages/procurement/components/default.vue';
2026-01-09 16:23:18 +08:00
onBackPress(() => {
2026-01-26 13:19:11 +08:00
if (specialPage.value) {
specialPage.value--
2026-01-09 16:23:18 +08:00
return true; // 禁止返回手势返回
2026-01-26 13:19:11 +08:00
} else {
2026-01-09 16:23:18 +08:00
return false; // 禁止返回手势返回
}
2026-01-26 13:19:11 +08:00
2026-01-09 16:23:18 +08:00
})
2026-01-26 13:19:11 +08:00
2026-01-05 09:29:43 +08:00
const listarr = ref([]);
2025-11-05 15:59:48 +08:00
onMounted(() => {
2026-01-06 14:15:35 +08:00
menuIndex.value = 0;
2026-01-26 13:19:11 +08:00
swipedex.value = 0;
2026-01-26 17:28:01 +08:00
getNcPackagelist().then((res : any) => {
//缓存指令包
console.log("缓存指令包",res)
uni.setStorageSync("Packagelist", res.result)
})
2026-01-26 13:19:11 +08:00
getPermissionList({ employessId: uni.getStorageSync('userInfo').employessId }).then(res => {
listarr.value = res.result;
console.log("这个是啥",listarr.value)
2026-01-05 09:29:43 +08:00
})
2025-11-05 15:59:48 +08:00
})
2026-01-26 13:19:11 +08:00
const gospecial = (index : number) => {
2026-01-09 16:23:18 +08:00
specialPage.value = index
}
2025-11-05 15:59:48 +08:00
// 通用的生成函数
function genPaths(base, prefix, count, ext = 'png', startIndex = 0, pad = false) {
return Array.from({ length: count }, (_, i) => {
const idx = pad
? String(i + startIndex).padStart(2, '0')
: i + startIndex
return `${base}/${prefix}${idx}.${ext}`
})
}
2025-12-25 13:27:31 +08:00
const tabbrarr = ref([
2026-01-26 13:19:11 +08:00
{ name: '护理', url: '/static/shouye/sy/n0.png', urls: '/static/shouye/sy/n1.png', type: 'kzgn_hljz' },
{ name: '医疗', url: '/static/shouye/sy/y0.png', urls: '/static/shouye/sy/y1.png', type: 'kzgn_yljz' },
{ name: '后勤', url: '/static/shouye/sy/l0.png', urls: '/static/shouye/sy/l1.png', type: 'kzgn_hqjz' },
{ name: '库房', url: '/static/shouye/sy/l0.png', urls: '/static/shouye/sy/l1.png', type: 'kzgn_kfjz' },
2025-12-25 13:27:31 +08:00
])
2026-01-09 16:23:18 +08:00
const specialPage = ref(0)
2026-01-26 13:19:11 +08:00
const navurl = (e, v) => {
2026-01-05 15:32:51 +08:00
swipedex.value = -1;
2026-01-09 16:23:18 +08:00
specialPage.value = 0
2026-01-26 13:19:11 +08:00
switch (v.type) {
2026-01-05 09:29:43 +08:00
case 'hldy':
2026-01-26 13:19:11 +08:00
swipedex.value = 0;
setTimeout(() => {
menuIndex.value = 0;
}, 100)
// console.log('护理单元')
2026-01-05 09:29:43 +08:00
break;
2026-01-07 11:23:47 +08:00
case 'kzgn_hljz':
2026-01-26 13:19:11 +08:00
swipedex.value = 1;
setTimeout(() => {
menuIndex.value = 1;
}, 100)
// console.log('护理矩阵')
2026-01-05 09:29:43 +08:00
break;
2026-01-07 11:23:47 +08:00
case 'kzgn_yljz':
2026-01-26 13:19:11 +08:00
swipedex.value = 2;
setTimeout(() => {
menuIndex.value = 2;
}, 100)
// console.log('医疗矩阵')
2026-01-05 09:29:43 +08:00
break;
2026-01-07 11:23:47 +08:00
case 'kzgn_hqjz':
2026-01-26 13:19:11 +08:00
swipedex.value = 3;
setTimeout(() => {
menuIndex.value = 3;
}, 100)
// console.log('后勤矩阵')
2026-01-05 09:29:43 +08:00
break;
2026-01-07 11:23:47 +08:00
case 'kzgn_kfjz':
2026-01-26 13:19:11 +08:00
swipedex.value = 6;
setTimeout(() => {
menuIndex.value = 6;
}, 100)
//console.log('库房')
2026-01-05 09:29:43 +08:00
break;
case 'kf_cg':
2026-01-26 13:19:11 +08:00
//console.log('采购')
2026-01-05 09:29:43 +08:00
break;
case 'kf_jh':
2026-01-26 13:19:11 +08:00
//console.log('拣货')
2026-01-05 09:29:43 +08:00
break;
case 'kf_wj':
2026-01-26 13:19:11 +08:00
//console.log('完结')
2026-01-05 09:29:43 +08:00
break;
2026-01-05 15:32:51 +08:00
case 'hldy_ql':
2026-01-26 13:19:11 +08:00
swipedex.value = 4;
setTimeout(() => {
menuIndex.value = 4;
}, 100)
//console.log('请领')
2026-01-05 09:29:43 +08:00
break;
case 'kf_th':
2026-01-26 13:19:11 +08:00
//console.log('退货')
2026-01-05 09:29:43 +08:00
break;
case 'kf_pd':
2026-01-26 13:19:11 +08:00
//console.log('盘点')
2026-01-05 09:29:43 +08:00
break;
case 'wl':
2026-01-26 13:19:11 +08:00
swipedex.value = 5;
setTimeout(() => {
menuIndex.value = 5;
}, 100)
//console.log('物联')
2026-01-05 09:29:43 +08:00
break;
case 'back':
2026-01-26 13:19:11 +08:00
uni.navigateBack()
//console.log('物联')
2026-01-05 09:29:43 +08:00
break;
2026-01-26 13:19:11 +08:00
2026-01-05 09:29:43 +08:00
default:
break;
}
//
2026-01-26 13:19:11 +08:00
2026-01-05 09:29:43 +08:00
}
2026-01-05 11:01:11 +08:00
const arrlist = ref([
2026-01-26 13:19:11 +08:00
{ name: '首页', url: '/static/shouye/sy/h0.png', urls: '/static/shouye/sy/h1.png', type: 'hldy' }
2026-01-05 11:01:11 +08:00
])
2026-01-26 13:19:11 +08:00
const swip = () => {
2026-01-07 11:23:47 +08:00
let nuId = uni.getStorageSync('nuId');
let arrs = [];
2026-01-26 13:19:11 +08:00
listarr.value.forEach(item => {
if (item.nuId == nuId) {
2026-01-07 11:23:47 +08:00
arrs = item.dataList
}
})
2026-01-05 09:29:43 +08:00
let nuName = uni.getStorageSync('nuName')
2026-01-26 13:19:11 +08:00
queryPadPageList({ 'pageNo': -1, 'nuName': nuName }).then((res => {
2026-01-05 09:29:43 +08:00
let arr = res.result.records[0].permissionList;
2026-01-26 13:19:11 +08:00
arrlist.value = [{ name: '首页', url: '/static/shouye/sy/h0.png', urls: '/static/shouye/sy/h1.png', type: 'hldy' }];
2026-01-05 09:29:43 +08:00
let tbr = [];
2026-01-26 13:19:11 +08:00
// console.log("xxxx",arr)
if (arr) {
arr.forEach((v, i) => {
let obj = arrs.find(item =>
2026-01-05 11:01:11 +08:00
item.menuCode == v.menuCode
);
2026-01-26 13:19:11 +08:00
if (obj) {
2026-01-05 11:01:11 +08:00
tbr.push(v);
}
})
2026-01-26 13:19:11 +08:00
tbr.forEach(item => {
let obj = tabbrarr.value.find(r =>
2026-01-05 11:01:11 +08:00
r.type == item.menuCode
);
2026-01-26 13:19:11 +08:00
if (obj) {
2026-01-05 11:01:11 +08:00
arrlist.value.push(obj);
}
2026-01-26 13:19:11 +08:00
})
2026-01-05 11:01:11 +08:00
}
2026-01-26 13:19:11 +08:00
let back = [
{ name: '请领', url: '/static/shouye/sy/l0.png', urls: '/static/shouye/sy/l1.png', type: 'hldy_ql' },
{ name: '智慧物联', url: '/static/shouye/sy/g0.png', urls: '/static/shouye/sy/g1.png', type: 'wl' },
{ name: '返回', url: '/static/shouye/sy/f0.png', urls: '/static/shouye/sy/f1.png', type: 'back' }
2026-01-05 09:29:43 +08:00
]
arrlist.value.push(...back);
2026-01-06 16:37:04 +08:00
// navurl(0,arrlist.value[0])
2026-01-05 09:29:43 +08:00
}))
2025-12-25 13:27:31 +08:00
}
2025-11-05 15:59:48 +08:00
// 当前选中的菜单索引
const menuIndex = ref<number>(-1);
2026-01-05 15:32:51 +08:00
const swipedex = ref<number>(-1);
2025-11-05 15:59:48 +08:00
const menuIndexshow = ref<boolean>(false);
const menuIndexshowsecond = ref<boolean>(false);
2025-11-26 13:26:22 +08:00
const menuIndexshowfourth = ref<boolean>(false);
2025-11-05 15:59:48 +08:00
const menuIndexshowfifth = ref<boolean>(false);
2025-12-30 08:40:09 +08:00
const messageopit = ref<boolean>(false);
2025-11-05 15:59:48 +08:00
// 变更菜单
const changeMenu = (index : number) => {
2025-12-30 08:40:09 +08:00
if (index === menuIndex.value) {
return
}
2025-11-05 15:59:48 +08:00
menuIndex.value = index;
menuIndexshow.value = false
menuIndexshowsecond.value = false
2025-11-26 13:26:22 +08:00
menuIndexshowfourth.value = false;
2025-11-05 15:59:48 +08:00
menuIndexshowfifth.value = false
2026-01-26 13:19:11 +08:00
if (index === arrlist.value.length - 1) {
2025-11-05 15:59:48 +08:00
uni.navigateBack()
return
}
setTimeout(() => {
switch (index) {
case 0:
menuIndexshow.value = true
break;
case 1:
menuIndexshowsecond.value = true
2025-12-30 08:40:09 +08:00
nomesssageshow()
break;
case 2:
2025-11-05 15:59:48 +08:00
2025-12-30 08:40:09 +08:00
nomesssageshow()
2025-11-26 13:26:22 +08:00
break;
case 3:
menuIndexshowfourth.value = true
2025-11-05 15:59:48 +08:00
break;
case 4:
menuIndexshowfifth.value = true;
break;
2026-01-05 09:29:43 +08:00
case 5:
menuIndexshowfourth.value = true
break;
2026-01-26 13:19:11 +08:00
2025-11-05 15:59:48 +08:00
default:
}
}, 50)
};
const clientX = ref(0);
const clientY = ref(0);
const savename = ref("")
2026-01-26 13:19:11 +08:00
2025-11-05 15:59:48 +08:00
// 生命周期钩子
onMounted(() => {
//首次加载和跳转回来需要重新做个动画
setTimeout(() => {
changeMenu(menuIndex.value)
}, 50)
menuIndexshow.value = false
setTimeout(() => {
menuIndexshow.value = true
}, 50)
});
2025-12-30 08:40:09 +08:00
const nomesssageshow = () => {
messageopit.value = false;
setTimeout(() => {
messageopit.value = true;
}, 200)
}
2026-01-09 16:25:02 +08:00
const userInfo = ref({})
2026-01-26 13:19:11 +08:00
onShow(() => {
2026-01-09 16:25:02 +08:00
userInfo.value = uni.getStorageSync('userInfo');
})
2026-01-26 13:19:11 +08:00
const box = ref(null);
const boxStyle = ref({
transform: 'translate3d(-500px, -500px, 0px)',
});
function handmove(wh : number[]) {
// 直接更新 transform父组件可频繁调用
const nx = Number(wh[0]) || 0;
const ny = Number(wh[1]) || 0;
// console.log("----", nx, ny)
boxStyle.value = {
transform: `translate3d(${nx - 100}px, ${ny - 70}px, 0)`
};
}
const movelook = ref({
url: "",
title: ""
})
const startmoveit = ref(true)
function handsend(look : any) {
movelook.value.url = uni.getStorageSync('imagebase') + look.immediateFileFocus;
if (!movelook.value.url) {
movelook.value.url = `/static/index/sharelogo.png`
}
movelook.value.title = look.title;
startmoveit.value = false
}
//节流函数
function throttle(fn, delay) {
let lastExecutionTime = 0;
return function (...args) {
const now = Date.now();
if (now - lastExecutionTime >= delay) {
lastExecutionTime = now;
fn.apply(this, args);
}
};
}
const canTrigger = ref(true);
//全局获得x轴和y轴
const animation = uni.createAnimation({
duration: 0,
timingFunction: 'linear',
delay: 0
});
const animationData = ref({});
let ticking = false;
let handle = null;
const sendxy = ref([0,0])
const isblue = ref(false)
const getxyrel = (event) => {
event.preventDefault()
if(!startmoveit.value){
const touch = event.touches[0];
const a = touch.clientX.toFixed(2);
const b = touch.clientY.toFixed(2);
isblue.value = inArea(a,b)
handmove([a,b])
}
}
function inArea(x, y) {
return (
x >= 790 &&
x <= 1062 &&
y >= 147 &&
y <= 255
)
}
const getxy = throttle(getxyrel, 40);
const cleanall = (event) => {
// console.log("zzzz",event)
const touch = event.changedTouches[0];
const a = touch.clientX.toFixed(2);
const b = touch.clientY.toFixed(2);
sendxy.value = [a,b]
handmove([-200,-200])
startmoveit.value = true;
isblue.value = false
}
2025-11-05 15:59:48 +08:00
</script>
<style lang="less" scoped>
.backgroundContainer {
display: flex;
position: relative;
2026-01-26 13:19:11 +08:00
width: 100vw;
2025-11-05 15:59:48 +08:00
height: 100vh;
overflow: hidden;
2026-01-26 13:19:11 +08:00
z-index: 99;
2026-01-26 13:22:39 +08:00
background-color: #F2F3F8;
2025-11-05 15:59:48 +08:00
}
2025-12-30 08:40:09 +08:00
.nomessageclass {
width: 100vw;
transition: opacity 1s ease;
}
2026-01-26 13:19:11 +08:00
.box {
// pointer-events: none;
position: fixed;
left: 0;
top: 0;
width: 190rpx;
height: 140rpx;
border-radius: 20rpx;
background: #fff;
will-change: transform;
pointer-events: none;
z-index: 200;
border: 2rpx dashed #0089FE;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.card-icon {
width: 55rpx;
height: 55rpx;
/* margin-bottom: 10rpx; */
}
.card-text {
margin-top: -10rpx;
color: #0089FE;
font-size: 26rpx;
}
.title-time-blue {
/* 你的定位与尺寸保持不变 */
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 107%;
height: 105%;
z-index: 10;
.blue-img {
width: 100%;
height: 100%;
}
}
}
2025-11-05 15:59:48 +08:00
</style>