修改体检项目日期显示

main
jinna 3 years ago
parent 5cc4d19cd5
commit 1c334c5165
  1. 64
      src/views/examination.vue

@ -7,7 +7,7 @@
</div> </div>
<div class="week_text"> <div class="week_text">
<div class="week_txt" v-for="item in weekArr" :key="item" @click="changeDate(item)" <div class="week_txt" v-for="item in weekArr" :key="item" @click="changeDate(item)"
:class="[(new Date(item).getTime() <= new Date(yesterDay).getTime() ? 'week_none' : ''), item == selectDate ? 'today_week' : '', numData.find(item1 => item1.date == item) ? numData.find(item1 => item1.date == item).isNum == 1 ? 'isnum' : 'none' : '']"> :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' : '']">
<div class="top_info"></div> <div class="top_info"></div>
{{ item.slice(-2) }} {{ item.slice(-2) }}
<div class="bottom_info" <div class="bottom_info"
@ -115,21 +115,17 @@ export default {
mounted() { mounted() {
this.hospitalId = this.$route.query.id; this.hospitalId = this.$route.query.id;
var WeekFirstDay = new Date(new Date() - (new Date().getDay() - 1) * 86400000); var WeekFirstDay = new Date(new Date() - (new Date().getDay() - 1) * 86400000);
this.today = new Date().getDate(); this.today = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate();
this.isToday = this.today; this.isToday = this.today;
let year = new Date().getFullYear(); let year = new Date().getFullYear();
let month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1 let month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1; //
let month1 = new Date().getMonth() + 2 < 10 ? '0' + (new Date().getMonth() + 2) : new Date().getMonth() + 2; let month1 = parseInt(month) + 1 < 10 ? '0' + (parseInt(month) + 1) : parseInt(month) + 1; //
let day = new Date().getDate() < 10 ? '0' + parseInt(new Date().getDate() - 1) : new Date().getDate() - 1 console.log(month1)
let lastDay = new Date(new Date().getFullYear(), new Date().getMonth() + 2, 0).getDate(); let now = new Date();
this.yesterDay = year + '-' + month + '-' + day this.yesterDay = dateFormat(new Date(now.setDate(now.getDate() - 1)),'yyyy/MM/dd') ;
let day1 = year + '-' + month + '-' + this.today
// console.log(this.yesterDay) let day1 = year + '-' + month + '-' + this.today;
this.selectDate = year + '-' + month + '-' + (this.today < 10 ? '0' + this.today : this.today); this.selectDate = year + '/' + month + '/' + this.today;
// for (var i = WeekFirstDay.getDate(); i <= parseInt(WeekFirstDay.getDate()) + 6; i++) {
// i = i < 10 ? '0' + i : i
// this.weekArr.push(year + '-' + month + '-' + i)
// }
this.weekArr = this.getWeekTime(day1) this.weekArr = this.getWeekTime(day1)
var todayWeek = new Date().getDay(); var todayWeek = new Date().getDay();
this.weekData.map((item, index) => { this.weekData.map((item, index) => {
@ -138,7 +134,7 @@ export default {
} }
}) })
this.startTime = year + '-' + month + '-' + this.today; this.startTime = year + '-' + month + '-' + this.today;
this.endTime = year + '-' + month1 + '-' + lastDay; this.endTime = this.getLastDay(year,month1);
this.getDays() this.getDays()
this.querySystemTime(); this.querySystemTime();
@ -180,7 +176,7 @@ export default {
for (let key in this.dayArr) { for (let key in this.dayArr) {
this.dayArr[key].map(item => { this.dayArr[key].map(item => {
this.numData.push({ this.numData.push({
date: item.date, date: item.date.replace(/-/g, '/'),
isNum: item.enableApm isNum: item.enableApm
}) })
}) })
@ -206,7 +202,7 @@ export default {
for (let key in this.dayArr) { for (let key in this.dayArr) {
this.dayArr[key].map(item => { this.dayArr[key].map(item => {
this.numData.push({ this.numData.push({
date: item.date, date: item.date.replace(/-/g, '/'),
isNum: item.enableApm isNum: item.enableApm
}) })
}) })
@ -233,6 +229,7 @@ export default {
apmDay: this.selectDate, apmDay: this.selectDate,
cupCardNo: this.Base64.encode(this.cupCardNo) 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) vaildInterfacefn("cgstjyyxuwxt", "qdsgajjtjczdhqfhlb", JSON.stringify(val), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway)
.then((value) => { .then((value) => {
this.$toast.clear(); this.$toast.clear();
@ -251,12 +248,14 @@ export default {
this.$toast.clear(); this.$toast.clear();
}) })
} else { } else {
let val = {
createDept: this.hospitalId,
apmDay: this.selectDate,
cupCardNo: this.Base64.encode(this.cupCardNo)
}
val.apmDay = val.apmDay.replace(/\//g, '-')
queryList( queryList(
{ val
createDept: this.hospitalId,
apmDay: this.selectDate,
cupCardNo: this.Base64.encode(this.cupCardNo)
}
).then(res => { ).then(res => {
this.$toast.clear(); this.$toast.clear();
if (res.code == 200) { 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) { formatter(day) {
/* /*
这里的参数包含以下属性 这里的参数包含以下属性
@ -325,7 +337,7 @@ export default {
// let month = new Date().getMonth() < 10 ? '0' + parseInt(new Date().getMonth() + 1) : new Date().getMonth() + 1 // let month = new Date().getMonth() < 10 ? '0' + parseInt(new Date().getMonth() + 1) : new Date().getMonth() + 1
this.examData = []; this.examData = [];
this.selectDate = item; this.selectDate = item;
// console.log(this.selectDate) console.log(this.selectDate)
this.getList() this.getList()
this.isToday = item this.isToday = item
}, },
@ -367,7 +379,7 @@ export default {
let year = date.getFullYear(); let year = date.getFullYear();
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
let text = year + '-' + month + '-' + day let text = year + '/' + month + '/' + day
this.selectDate = text; this.selectDate = text;
this.getList() this.getList()
}, },
@ -375,7 +387,7 @@ export default {
let year = date.getFullYear(); let year = date.getFullYear();
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
let text = year + '-' + month + '-' + day let text = year + '/' + month + '/' + day
this.selectDate = text; this.selectDate = text;
this.getList() this.getList()
@ -406,7 +418,7 @@ export default {
let d = date.getDate() let d = date.getDate()
d < 10 ? d = "0" + d : d d < 10 ? d = "0" + d : d
// let datetime = y + '-' + m + '-' + d // let datetime = y + '-' + m + '-' + d
let datetime = y + '-' + m + '-' + d let datetime = y + '/' + m + '/' + d
dates.push(datetime) dates.push(datetime)
} }
return dates return dates

Loading…
Cancel
Save