diff --git a/src/views/examProject.vue b/src/views/examProject.vue index df813fd..9f312ad 100644 --- a/src/views/examProject.vue +++ b/src/views/examProject.vue @@ -79,12 +79,13 @@ export default { project:item.name, cuAddr:item.posi, period:item.time.substr(0,2), - timeFrame:item.time.slice(-9), + timeFrame:item.time.substr(2), cupName:this.userInfo.name, cupPhone:this.userInfo.mobile, cupCardNo:this.userInfo.papersnumber }) }) + console.log("proArr",this.proArr) }, methods: { cancelButton(val){ diff --git a/src/views/examination.vue b/src/views/examination.vue index c2818d3..fb10934 100644 --- a/src/views/examination.vue +++ b/src/views/examination.vue @@ -6,10 +6,11 @@
{{item}}
-
+
{{item}}
+
@@ -21,7 +22,7 @@ ref="calendar" first-day-of-week="1" v-model="show" - @confirm="onConfirm" + @confirm="onConfirm" :poppable="false" :show-mark="false" :show-title="false" @@ -30,6 +31,7 @@ :min-date="minDate" :max-date="maxDate" :formatter="formatter" + :default-date="new Date(selectDate)" /> @@ -46,6 +48,8 @@ :show-confirm="false" :min-date="minDate1" :max-date="maxDate1" + :formatter="formatter1" + :default-date="new Date(selectDate)" /> @@ -59,19 +63,19 @@
-
{{item.name}}
+
{{item.project}}
-
{{item.position}}
+
{{item.cuAddr}}
-
{{item.residue}}
/{{item.total}}
+
{{item.totalApmNum}}
/{{item.totalNum}}
-
-
{{item1.moment}} {{item1.time}}
-
剩余:{{item1.num}}
+
+
{{item1.period}} {{item1.timeFrame}}
+
剩余:{{item1.residueNum}}
@@ -98,27 +102,26 @@ export default { maxDate: new Date(new Date().getFullYear(), new Date().getMonth(), new Date(new Date().getFullYear(),new Date().getMonth() + 1,0).getDate()), minDate1: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 1), maxDate1: new Date(new Date().getFullYear(), new Date().getMonth() + 1, new Date(new Date().getFullYear(),new Date().getMonth() + 2,0).getDate()), - numData:[{date:'2023-02-09',isNum:1},{date:'2023-02-11',isNum:0}, - {date:'2023-02-15',isNum:1},{date:'2023-02-17',isNum:1},{date:'2023-02-20',isNum:0}], + numData:[], examData:[ - {name:'单眼视力',position:'门诊楼3楼眼科门诊',total:20,residue:15,examArr:[ - {moment:'上午',time:'8:00-8:30',num:2}, - {moment:'上午',time:'8:30-9:00',num:0}, - {moment:'上午',time:'9:00-9:30',num:1}, - {moment:'上午',time:'9:30-10:00',num:1}, - ]}, - {name:'肢体',position:'门诊楼3楼',total:20,residue:15,examArr:[ - {moment:'上午',time:'8:00-8:30',num:2}, - {moment:'上午',time:'8:30-9:00',num:0}, - {moment:'上午',time:'9:00-9:30',num:1}, - {moment:'上午',time:'9:30-10:00',num:1}, - ]}, - {name:'听力',position:'门诊楼3楼听力门诊',total:20,residue:15,examArr:[ - {moment:'上午',time:'8:00-8:30',num:2}, - {moment:'上午',time:'8:30-9:00',num:0}, - {moment:'上午',time:'9:00-9:30',num:1}, - {moment:'上午',time:'9:30-10:00',num:1}, - ]} + // {name:'单眼视力',position:'门诊楼3楼眼科门诊',total:20,residue:15,examArr:[ + // {moment:'上午',time:'8:00-8:30',num:2}, + // {moment:'上午',time:'8:30-9:00',num:0}, + // {moment:'上午',time:'9:00-9:30',num:1}, + // {moment:'上午',time:'9:30-10:00',num:1}, + // ]}, + // {name:'肢体',position:'门诊楼3楼',total:20,residue:15,examArr:[ + // {moment:'上午',time:'8:00-8:30',num:2}, + // {moment:'上午',time:'8:30-9:00',num:0}, + // {moment:'上午',time:'9:00-9:30',num:1}, + // {moment:'上午',time:'9:30-10:00',num:1}, + // ]}, + // {name:'听力',position:'门诊楼3楼听力门诊',total:20,residue:15,examArr:[ + // {moment:'上午',time:'8:00-8:30',num:2}, + // {moment:'上午',time:'8:30-9:00',num:0}, + // {moment:'上午',time:'9:00-9:30',num:1}, + // {moment:'上午',time:'9:30-10:00',num:1}, + // ]} ], selectArr:[], selectDate:'', @@ -127,7 +130,8 @@ export default { hospitalId:'', startTime:'', endTime:'', - cupCardNo:'' + cupCardNo:'', + dayArr:[] } }, created() { @@ -153,7 +157,7 @@ export default { }) this.startTime = year + '-' + month + '-' + this.today; this.endTime = year + '-' + month1 + '-' + lastDay; - // this.getDays() + this.getDays() this.cupCardNo = JSON.parse(sessionStorage.getItem('userInfo')).papersnumber; this.getList() }, @@ -166,25 +170,136 @@ export default { endTime:this.endTime } ).then(res =>{ - console.log(res) + this.numData = [] + if(JSON.stringify(res.data) === '{}'){ + this.dayArr = []; + this.numData = this.dayArr + }else{ + this.dayArr = res.data; + for(let key in this.dayArr){ + console.log(key) + console.log(this.dayArr[key]) + this.dayArr[key].map(item =>{ + this.numData.push({ + date:item, + isNum:0 + }) + }) + } + } }) }, getList(){ queryList( { createDept:this.hospitalId, - apmDay:this.selectDate, + apmDay: this.selectDate, cupCardNo:this.cupCardNo } ).then(res =>{ - console.log('列表===>',res ) - }) - this.examData.map(item =>{ - item.examArr.map(item1 =>{ - item1.isSelect = false + if(res.data.length == 0){ + this.examData = [ + { + project:'单眼视力',cuAddr:'三楼眼科',apmDay: "2023-03-12", + totalNum : 10, totalApmNum: 0, + detailList: [ + { + period:"上午", + timeFrame: "9:00-9:30", + numberNum: 5, + apmNum: 0, + residueNum: 0, + enableApm: 0 + }, + { + period:"上午", + timeFrame: "9:30-10:00", + numberNum: 5, + apmNum: 0, + residueNum: 0, // 剩余号数 + enableApm: 0 // 是否可预约 + }, + { + period:"上午", + timeFrame: "10:30-11:00", + numberNum: 5, + apmNum: 0, + residueNum: 0, // 剩余号数 + enableApm: 0 // 是否可预约 + } + ] + }, + { + project:'听力',cuAddr:'三楼眼科',apmDay: "2023-03-12", + totalNum : 10, totalApmNum: 0, + detailList: [ + { + period:"上午", + timeFrame: "9:00-9:30", + numberNum: 5, + apmNum: 0, + residueNum: 0, + enableApm: 0 + }, + { + period:"上午", + timeFrame: "9:30-10:00", + numberNum: 5, + apmNum: 0, + residueNum: 0, // 剩余号数 + enableApm: 0 // 是否可预约 + }, + { + period:"上午", + timeFrame: "10:30-11:00", + numberNum: 5, + apmNum: 0, + residueNum: 0, // 剩余号数 + enableApm: 0 // 是否可预约 + } + ] + }, + { + project:'四肢',cuAddr:'三楼眼科',apmDay: "2023-03-12", + totalNum : 10, totalApmNum: 0, + detailList: [ + { + period:"上午", + timeFrame: "9:00-9:30", + numberNum: 5, + apmNum: 0, + residueNum: 0, + enableApm: 0 + }, + { + period:"上午", + timeFrame: "9:30-10:00", + numberNum: 5, + apmNum: 0, + residueNum: 0, // 剩余号数 + enableApm: 0 // 是否可预约 + }, + { + period:"上午", + timeFrame: "10:30-11:00", + numberNum: 5, + apmNum: 0, + residueNum: 0, // 剩余号数 + enableApm: 0 // 是否可预约 + } + ] + } + ]; + }else{ + this.examData = res.data; + + } + this.examData.map(item =>{ + item.detailList.map(item1 =>{ + item1.isSelect = false + }) }) }) - console.log(this.examData) }, formatter(day){ /* @@ -196,15 +311,19 @@ export default { 我们只需要修改type值为 disabled 即可 */ + if(day.date.getDate() < new Date().getDate()){ day.type = 'disabled' }else{ + let month = day.date.getMonth() < 10 ? '0' + parseInt(day.date.getMonth() + 1) : day.date.getMonth() + 1; this.numData.forEach(item =>{ - if(day.date.getDate() == item.date.slice(-2)){ - item.isNum == 0 ? day.bottomInfo = '有号' : day.bottomInfo = '无号' - item.isNum == 0 ? day.className = 'num1' : day.className = 'num2' - + if(month == item.date.substr(5,2)){ + if(day.date.getDate() == item.date.slice(-2)){ + item.isNum == 0 ? day.bottomInfo = '有号' : day.bottomInfo = '无号' + item.isNum == 0 ? day.className = 'num1' : day.className = 'num2' + } } + }) } // if(day.date.getDate() == new Date().getDate()){ @@ -214,22 +333,42 @@ export default { // } return day }, + formatter1(day){ + let month = day.date.getMonth() < 10 ? '0' + parseInt(day.date.getMonth() + 1) : day.date.getMonth() + 1; + this.numData.forEach(item =>{ + if(month == item.date.substr(5,2)){ + if(day.date.getDate() == item.date.slice(-2)){ + item.isNum == 0 ? day.bottomInfo = '有号' : day.bottomInfo = '无号' + item.isNum == 0 ? day.className = 'num1' : day.className = 'num2' + + } + } + + }) + day.topInfo = ` ` + return day + }, changeDate(item){ - console.log(item) + let year = new Date().getFullYear() + let month = new Date().getMonth() < 10 ? '0' + parseInt(new Date().getMonth() + 1) : new Date().getMonth() + 1 + this.selectDate = year + '-' + month + '-' + item; + this.getList() this.isToday = item }, isShow(){ - console.log(111) - this.isCal = !this.isCal + this.isCal = !this.isCal + console.log(this.selectDate) }, clickExam(val,val1){ + console.log(val,val1) this.selectArr = [] let arr = JSON.parse(JSON.stringify(this.examData)) + console.log(arr) arr.find(item =>{ - if(item.name == val.name){ - console.log(item) - item.examArr.find(item1 =>{ - if(item1.time == val1.time){ + console.log('item ===>',item) + if(item.project == val.project){ + item.detailList.find(item1 =>{ + if(item1.timeFrame == val1.timeFrame){ item1.isSelect = true }else{ item1.isSelect = false @@ -239,12 +378,12 @@ export default { }) this.examData = arr this.examData.map(item =>{ - item.examArr.map(item1 =>{ + item.detailList.map(item1 =>{ if(item1.isSelect){ this.selectArr.push({ - name:item.name, - posi:item.position, - time:item1.moment + ' ' + item1.time, + name:item.project, + posi:item.cuAddr, + time:item1.period + ' ' + item1.timeFrame, }) } }) @@ -255,15 +394,20 @@ export default { 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 val = this.numData.find(item => item.date == text) - console.log(val) - if(val){ - this.selectDate = val.date - }else{ - // this.$toast('异常') - } + console.log(text) + this.selectDate = text; + this.getList() + }, + onConfirm1(date){ + 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 + console.log(text) + this.selectDate = text; + this.getList() + }, - onConfirm1(){}, handleExam(){ console.log(this.selectArr,this.selectDate) this.$router.push({ @@ -439,12 +583,12 @@ export default { .exam_bottom{ width: 93%; display: flex; - justify-content: space-between; + justify-content: flex-start; margin: 0 auto; flex-wrap: wrap; .exam_txt{ - width: 2.2rem; + width: 32%; height: 1rem; background: #F6F6F6; border: 1px solid #1677FF; @@ -454,7 +598,8 @@ export default { justify-content: space-around; align-items: center; font-size: 0.22rem; - margin-bottom: 0.2rem; + margin: 0 0.025rem 0.2rem; + } .isAct{ diff --git a/vue.config.js b/vue.config.js index bc10ee8..9bcdc1e 100644 --- a/vue.config.js +++ b/vue.config.js @@ -6,16 +6,16 @@ module.exports = defineConfig({ devServer: { port: 8080, proxy: { - '/api': { + "/api": { //本地服务接口地址 - target: 'http://192.168.1.106', + target: "http://192.168.1.3", //远程演示服务地址,可用于直接启动项目 // target: 'https://saber.bladex.vip/api', ws: true, pathRewrite: { - '^/api': '/' - } - } - } - } + "^/api": "/", + }, + }, + }, + }, });