调用预约接口

main
jinna 3 years ago
parent 51bce6fbc8
commit 0deac82a1b
  1. 28
      src/api/examination.js
  2. 49
      src/views/examProject.vue
  3. 38
      src/views/examination.vue

@ -0,0 +1,28 @@
import request from "../utils/axios";
//放号天数
export const queryDays = (query) => {
return request({
url: "/api/blade-business/apm-config/already-config-day",
method: "get",
params: query,
});
};
// 获取放号列表
export const queryList = (query) => {
return request({
url: "/api/blade-business/apm-config/detail-for-apm",
method: "get",
params: query,
});
};
// 新增预约记录
export const postExam = (data) => {
return request({
url: "/api/blade-business/apm-record/save",
method: "post",
data,
});
};

@ -6,8 +6,8 @@
<img src="~@/assets/image/time.png" alt="" />
</div>
<div class="time_box">
<div class="time_text">{{item.day}}</div>
<div class="date_txt">{{item.monmet}}</div>
<div class="time_text">{{item.apmDay}}</div>
<div class="date_txt">{{item.period}} {{item.timeFrame}}</div>
</div>
</div>
<div class="pro_bottom">
@ -15,8 +15,8 @@
<div class="img_box">
<img src="~@/assets/image/pro.png" alt="" />
</div>
<div class="pro_name">{{item.name}}</div>
<div class="pro_pos">{{item.posi}}</div>
<div class="pro_name">{{item.project}}</div>
<div class="pro_pos">{{item.cuAddr}}</div>
</div>
<div class="pro_right">
<div class="cancel" @click="cancelButton(item)">取消预约</div>
@ -55,24 +55,33 @@
</template>
<script>
import {postExam} from "@/api/examination";
export default {
data() {
return {
proData:{},
proArr:[],
isShow:false,
isSuccess:false
isSuccess:false,
userInfo:{}
};
},
mounted() {
console.log(this.$route.params);
this.userInfo = JSON.parse(sessionStorage.getItem('userInfo'))
console.log(this.userInfo)
this.proData = this.$route.params;
this.proData.selectArr.map(item =>{
this.proArr.push({
day:this.proData.time,
name:item.name,
monmet:item.time,
posi:item.posi
apmDay:this.proData.time,
createDept:this.proData.createDept,
project:item.name,
cuAddr:item.posi,
period:item.time.substr(0,2),
timeFrame:item.time.slice(-9),
cupName:this.userInfo.name,
cupPhone:this.userInfo.mobile,
cupCardNo:this.userInfo.papersnumber
})
})
},
@ -100,10 +109,19 @@ export default {
confirm(){
console.log(this.proArr)
if(this.proArr.length != 0){
this.isShow = true;
this.isSuccess = true
}
postExam(JSON.stringify(this.proArr)).then(res =>{
console.log(res)
if(res.code == 200){
this.isShow = true;
this.isSuccess = true
}else{
this.isShow = true;
this.isSuccess = false
}
})
// if(this.proArr.length != 0){
//
// }
},
clickFail(){
@ -113,7 +131,10 @@ export default {
},
clickSucc(){
this.$router.replace({
name:'MyExam'
name:'MyExam',
query:{
id:this.proData.createDept
}
})
},
clickClose(){

@ -84,6 +84,7 @@
</template>
<script>
import {queryDays,queryList} from "@/api/examination";
export default {
data() {
return {
@ -122,18 +123,24 @@ export default {
selectArr:[],
selectDate:'',
today:'',
isToday:''
isToday:'',
hospitalId:'',
startTime:'',
endTime:'',
cupCardNo:''
}
},
created() {
this.getList()
},
mounted() {
this.hospitalId = this.$route.query.id;
var WeekFirstDay=new Date(new Date()-(new Date().getDay()-1)*86400000);
this.today = new Date().getDate();
this.isToday = this.today;
let year = new Date().getFullYear();
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 lastDay = new Date(new Date().getFullYear(),new Date().getMonth() + 2,0).getDate();
this.selectDate = year + '-' + month + '-' + (this.today < 10 ? '0' + this.today : this.today);
for(var i = WeekFirstDay.getDate();i<= parseInt(WeekFirstDay.getDate()) + 6;i++){
this.weekArr.push(i)
@ -141,13 +148,37 @@ export default {
var todayWeek = new Date().getDay();
this.weekData.map((item,index) =>{
if(index + 1 == todayWeek){
// item = ''
this.weekData[index] = '今日'
}
})
this.startTime = year + '-' + month + '-' + this.today;
this.endTime = year + '-' + month1 + '-' + lastDay;
// this.getDays()
this.cupCardNo = JSON.parse(sessionStorage.getItem('userInfo')).papersnumber;
this.getList()
},
methods: {
getDays(){
queryDays(
{
createDept:this.hospitalId,
startTime:this.startTime,
endTime:this.endTime
}
).then(res =>{
console.log(res)
})
},
getList(){
queryList(
{
createDept:this.hospitalId,
apmDay:this.selectDate,
cupCardNo:this.cupCardNo
}
).then(res =>{
console.log('列表===>',res )
})
this.examData.map(item =>{
item.examArr.map(item1 =>{
item1.isSelect = false
@ -239,6 +270,7 @@ export default {
name:'ExamProject',
params:{
time:this.selectDate,
createDept:this.hospitalId,
selectArr:this.selectArr
}
})

Loading…
Cancel
Save