From ec62e93bf5570acc20eaa71b11b7c33e5d162f89 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期四, 27 十月 2022 16:14:27 +0800
Subject: [PATCH] 45
---
src/views/paiban/index.vue | 36 ++++++++++++++++++++++++------------
1 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/src/views/paiban/index.vue b/src/views/paiban/index.vue
index 0463a2f..959efba 100644
--- a/src/views/paiban/index.vue
+++ b/src/views/paiban/index.vue
@@ -67,7 +67,7 @@
const day=new Date()
const Year = day.getFullYear()
const minDate=ref( new Date(Date.parse(Year+'-01-01'.replace(/-/g, '/'))))
- const selectDate=ref([{y:2000,m:1,d:1,type:'',code:'',deviceGroupName:'',deviceName:'',timeSlot:1}])
+ const selectDate=ref([{y:2000,m:1,d:1,type:'',code:'',id:0,deviceGroupName:'',deviceName:'',timeSlot:1}])
const fanhui=()=>{
router.go(-1)
}
@@ -84,22 +84,34 @@
year:y,
month:m,
}
+ const lisd = selectDate.value.filter(el=>{
+ return el.y!==pagedata.year&&el.m!==pagedata.month
+ })
+ selectDate.value=lisd
ajaxPost('/hemo/med/schedule/listMonthSchedulesByPat',pagedata).then((re:any)=>{
console.log(re)
re.forEach((element:any) => {
const dey=element.scheduleDay.split('-')
- // console.log(dey,'444')
- selectDate.value.push({
- y:Number(dey[0]),
- m:Number(dey[1]),
- d:Number(dey[2].substring(0,2)),
- type:element.patientVsHemoMedSchemeName,
- deviceGroupName:element.deviceGroupName,
- deviceName:element.deviceName,
- timeSlot:element.timeSlot,
- code:element.code
+ // 不能添加重复的
+ const x=selectDate.value.findIndex(e=>{return e.code===element.code})
+ if (x===-1){
+ selectDate.value.push({
+ y:Number(dey[0]),
+ m:Number(dey[1]),
+ d:Number(dey[2].substring(0,2)),
+ type:element.patientVsHemoMedSchemeName,
+ deviceGroupName:element.deviceGroupName,
+ deviceName:element.deviceName,
+ timeSlot:element.timeSlot,
+ code:element.code,
+ id:element.id
- })
+ })
+ }
+
+ })
+ selectDate.value= selectDate.value.sort((a,b)=>{
+ return a.id-b.id
})
console.log(selectDate.value)
})
--
Gitblit v1.8.0