From 1c334c5165d19a72f192ac237d08e5dcabb7e717 Mon Sep 17 00:00:00 2001 From: jinna Date: Wed, 1 Mar 2023 11:14:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=93=E6=A3=80=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=97=A5=E6=9C=9F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/examination.vue | 64 +++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/src/views/examination.vue b/src/views/examination.vue index e8f6a1d..61788f3 100644 --- a/src/views/examination.vue +++ b/src/views/examination.vue @@ -7,7 +7,7 @@
+ :class="[(Date.parse(new Date(item)) <= Date.parse(new Date(yesterDay)) ? 'week_none' : ''), item == selectDate ? 'today_week' : '', numData.find(item1 => item1.date == item) ? numData.find(item1 => item1.date == item).isNum == 1 ? 'isnum' : 'none' : '']">
{{ item.slice(-2) }}
{ @@ -138,7 +134,7 @@ export default { } }) this.startTime = year + '-' + month + '-' + this.today; - this.endTime = year + '-' + month1 + '-' + lastDay; + this.endTime = this.getLastDay(year,month1); this.getDays() this.querySystemTime(); @@ -180,7 +176,7 @@ export default { for (let key in this.dayArr) { this.dayArr[key].map(item => { this.numData.push({ - date: item.date, + date: item.date.replace(/-/g, '/'), isNum: item.enableApm }) }) @@ -206,7 +202,7 @@ export default { for (let key in this.dayArr) { this.dayArr[key].map(item => { this.numData.push({ - date: item.date, + date: item.date.replace(/-/g, '/'), isNum: item.enableApm }) }) @@ -233,6 +229,7 @@ export default { apmDay: this.selectDate, cupCardNo: this.Base64.encode(this.cupCardNo) } + val.apmDay = val.apmDay.replace(/\//g, '-') vaildInterfacefn("cgstjyyxuwxt", "qdsgajjtjczdhqfhlb", JSON.stringify(val), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway) .then((value) => { this.$toast.clear(); @@ -251,12 +248,14 @@ export default { this.$toast.clear(); }) } else { + let val = { + createDept: this.hospitalId, + apmDay: this.selectDate, + cupCardNo: this.Base64.encode(this.cupCardNo) + } + val.apmDay = val.apmDay.replace(/\//g, '-') queryList( - { - createDept: this.hospitalId, - apmDay: this.selectDate, - cupCardNo: this.Base64.encode(this.cupCardNo) - } + val ).then(res => { this.$toast.clear(); if (res.code == 200) { @@ -274,6 +273,19 @@ export default { }) } }, + // 获得某月的最后一天 + getLastDay(year,month) { + var new_year = year; //取当前的年份 + var new_month = month ;//取下一个月的第一天,方便计算(最后一天不固定) + new_month = new_month++ + if(month>12) { + new_month -=12; //月份减 + new_year++; //年份增 + } + new_month = new_month < 10 ? '0' + new_month : new_month + var new_date = new Date(new_year,new_month,1); //取当年当月中的第一天 + return new_year + '-' + new_month + '-' + (new Date(new_date.getTime()-1000*60*60*24)).getDate();//获取当月最后一天日期 + }, formatter(day) { /* 这里的参数包含以下属性 @@ -325,7 +337,7 @@ export default { // let month = new Date().getMonth() < 10 ? '0' + parseInt(new Date().getMonth() + 1) : new Date().getMonth() + 1 this.examData = []; this.selectDate = item; - // console.log(this.selectDate) + console.log(this.selectDate) this.getList() this.isToday = item }, @@ -367,7 +379,7 @@ export default { let year = date.getFullYear(); let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() - let text = year + '-' + month + '-' + day + let text = year + '/' + month + '/' + day this.selectDate = text; this.getList() }, @@ -375,7 +387,7 @@ export default { let year = date.getFullYear(); let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() - let text = year + '-' + month + '-' + day + let text = year + '/' + month + '/' + day this.selectDate = text; this.getList() @@ -406,7 +418,7 @@ export default { let d = date.getDate() d < 10 ? d = "0" + d : d // let datetime = y + '-' + m + '-' + d - let datetime = y + '-' + m + '-' + d + let datetime = y + '/' + m + '/' + d dates.push(datetime) } return dates