修改体检项目页面

main
jinna 3 years ago
parent 1475ce4e60
commit 3e3a8b72ac
  1. 76
      src/views/examination.vue

@ -6,10 +6,10 @@
<div class="week_num" v-for="item in weekData" :key="item">{{item}}</div> <div class="week_num" v-for="item in weekData" :key="item">{{item}}</div>
</div> </div>
<div class="week_text"> <div class="week_text">
<div class="week_txt" v-for="item in weekArr" :key="item" @click="changeDate(item)" :class="[(item < today ? 'week_none' : ''),item == selectDate.slice(-2) ? 'today_week' : '',numData.find(item1 => item1.date.slice(-2) == (item < 0 ? '0' + item : item)) ? numData.find(item1 => item1.date.slice(-2) == (item < 0 ? '0' + item : item)).isNum == 1 ? 'isnum' : 'none' : '']"> <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' : '']">
<div class="top_info"></div> <div class="top_info"></div>
{{item}} {{item.slice(-2)}}
<div class="bottom_info" v-text="numData.find(item1 => item1.date.slice(-2) == (item < 0 ? '0' + item : item)) ? numData.find(item1 => item1.date.slice(-2) == (item < 0 ? '0' + item : item)).isNum == 1 ? '有号' :'无号' : ''"></div> <div class="bottom_info" v-text="numData.find(item1 => item1.date == item) ? numData.find(item1 => item1.date == item).isNum == 1 ? '有号' :'无号' : ''"></div>
</div> </div>
</div> </div>
@ -137,7 +137,8 @@ export default {
startTime:'', startTime:'',
endTime:'', endTime:'',
cupCardNo:'', cupCardNo:'',
dayArr:[] dayArr:[],
yesterDay:''
} }
}, },
created() { created() {
@ -151,12 +152,15 @@ export default {
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 = new Date().getMonth() + 2 < 10 ? '0' + (new Date().getMonth() + 2) : new Date().getMonth() + 2;
let day = new Date().getDate() < 10 ? '0' + parseInt(new Date().getDate() - 1) : new Date().getDate() - 1
let lastDay = new Date(new Date().getFullYear(),new Date().getMonth() + 2,0).getDate(); let lastDay = new Date(new Date().getFullYear(),new Date().getMonth() + 2,0).getDate();
this.yesterDay = year + '-' + month + '-' + day
console.log(this.yesterDay)
this.selectDate = year + '-' + month + '-' + (this.today < 10 ? '0' + this.today : this.today); this.selectDate = year + '-' + month + '-' + (this.today < 10 ? '0' + this.today : this.today);
for(var i = WeekFirstDay.getDate();i<= parseInt(WeekFirstDay.getDate()) + 6;i++){ for(var i = WeekFirstDay.getDate();i<= parseInt(WeekFirstDay.getDate()) + 6;i++){
this.weekArr.push(i) i = i < 10 ? '0' + i : i
this.weekArr.push(year + '-' + month + '-' + i)
} }
console.log(this.weekArr)
var todayWeek = new Date().getDay(); var todayWeek = new Date().getDay();
this.weekData.map((item,index) =>{ this.weekData.map((item,index) =>{
if(index + 1 == todayWeek){ if(index + 1 == todayWeek){
@ -259,17 +263,19 @@ export default {
console.log(retData.data) console.log(retData.data)
if(retData.data.length == 0){ if(retData.data.length == 0){
this.examData = retData.data this.examData = retData.data
lightAppJssdk.notification.alert({ this.$toast.clear();
message: "当前时间无体检项目", // lightAppJssdk.notification.alert({
title: "提示",// // message: "",
buttonName: "收到", // title: "",//
success: (data) => { // buttonName: "",
this.$toast.clear(); // success: (data) => {
// console.log(this.examData)
}, // // console.log(this.examData)
fail: function (data) { // // },
} // fail: data => { //
}) // // this.$toast.clear();
// }
// })
}else{ }else{
this.examData = retData.data; this.examData = retData.data;
this.$toast.clear(); this.$toast.clear();
@ -293,18 +299,20 @@ export default {
} }
).then(res =>{ ).then(res =>{
if(res.data.length == 0){ if(res.data.length == 0){
this.examData = res.data this.examData = res.data;
lightAppJssdk.notification.alert({ this.$toast.clear();
message: "当前时间无体检项目", // lightAppJssdk.notification.alert({
title: "提示",// // message: "",
buttonName: "收到", // title: "",//
success: (data) => { // buttonName: "",
this.$toast.clear(); // success: (data) => {
// console.log(this.examData) // this.$toast.clear();
}, // // console.log(this.examData)
fail: function (data) { // // },
} // fail: function (data) { //
}) // console.log('data')
// }
// })
}else{ }else{
this.examData = res.data; this.examData = res.data;
this.examData.map(item =>{ this.examData.map(item =>{
@ -367,9 +375,9 @@ export default {
return day return day
}, },
changeDate(item){ changeDate(item){
let year = new Date().getFullYear() // let year = new Date().getFullYear()
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.selectDate = year + '-' + month + '-' + item; this.selectDate = item;
console.log(this.selectDate) console.log(this.selectDate)
this.getList() this.getList()
this.isToday = item this.isToday = item
@ -448,9 +456,9 @@ export default {
let m = date.getMonth() + 1 let m = date.getMonth() + 1
m < 10 ? m = '0' + m : m m < 10 ? m = '0' + m : m
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 = d let datetime = y + '-' + m + '-' + d
dates.push(datetime) dates.push(datetime)
} }
return dates return dates

Loading…
Cancel
Save