xuechunyuan 3 years ago
commit 9421b5b6b1
  1. 26
      src/views/examination.vue

@ -18,7 +18,7 @@
</div> </div>
</div> </div>
<div v-if="isCal"> <div v-if="isCal">
<van-swipe class="my-swipe" :stop-propagation="false" :show-indicators="false"> <van-swipe class="my-swipe" :stop-propagation="false" :show-indicators="false" :initial-swipe="currentIndex">
<van-swipe-item> <van-swipe-item>
<van-calendar class="can_box" ref="calendar" first-day-of-week="1" v-model="show" <van-calendar class="can_box" ref="calendar" first-day-of-week="1" v-model="show"
@confirm="onConfirm" :poppable="false" :show-mark="false" :show-title="false" @confirm="onConfirm" :poppable="false" :show-mark="false" :show-title="false"
@ -106,7 +106,9 @@ export default {
cupCardNo: '', cupCardNo: '',
dayArr: [], dayArr: [],
yesterDay: '', yesterDay: '',
systemTime: dateFormat(new Date(), 'yyyy-MM-dd') systemTime: dateFormat(new Date(), 'yyyy-MM-dd'),
currentIndex:'0',
currentMonth:''
} }
}, },
created() { created() {
@ -119,6 +121,7 @@ export default {
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; //
this.currentMonth = month
let month1 = parseInt(month) + 1 < 10 ? '0' + (parseInt(month) + 1) : parseInt(month) + 1; // let month1 = parseInt(month) + 1 < 10 ? '0' + (parseInt(month) + 1) : parseInt(month) + 1; //
let now = new Date(); let now = new Date();
this.yesterDay = dateFormat(new Date(now.setDate(now.getDate() - 1)),'yyyy/MM/dd'); this.yesterDay = dateFormat(new Date(now.setDate(now.getDate() - 1)),'yyyy/MM/dd');
@ -235,6 +238,7 @@ export default {
// console.log(retData.data) // console.log(retData.data)
if(retData.code == 200) { if(retData.code == 200) {
this.examData = retData.data; this.examData = retData.data;
this.selectArr = []
this.examData.map(item => { this.examData.map(item => {
item.detailList.map(item1 => { item.detailList.map(item1 => {
item1.isSelect = false item1.isSelect = false
@ -257,6 +261,7 @@ export default {
).then(res => { ).then(res => {
this.$toast.clear(); this.$toast.clear();
if (res.code == 200) { if (res.code == 200) {
this.selectArr = []
this.examData = res.data; this.examData = res.data;
this.examData.map(item => { this.examData.map(item => {
item.detailList.map(item1 => { item.detailList.map(item1 => {
@ -335,7 +340,12 @@ 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) let month = parseInt(new Date(this.selectDate).getMonth()) < 10 ? '0' + (parseInt(new Date(this.selectDate).getMonth()) + 1) : (parseInt(new Date(this.selectDate).getMonth()) + 1);
if(month == this.currentMonth){
this.currentIndex = '0'
}else{
this.currentIndex = '1'
}
this.getList() this.getList()
this.isToday = item this.isToday = item
}, },
@ -371,13 +381,17 @@ export default {
} }
}) })
}) })
console.log(this.selectArr) console.log('sele ===>',this.selectArr)
}, },
onConfirm(date) { onConfirm(date) {
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;
console.log('current ===>',month);
// if(this.currentMonth == month){
this.currentIndex = '0'
// }
this.selectDate = text; this.selectDate = text;
this.getList() this.getList()
}, },
@ -386,7 +400,9 @@ export default {
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
console.log('next===>',month)
this.selectDate = text; this.selectDate = text;
this.currentIndex = '1'
this.getList() this.getList()
}, },

Loading…
Cancel
Save