调用预约接口

main
jinna 3 years ago
parent 51bce6fbc8
commit 0deac82a1b
  1. 28
      src/api/examination.js
  2. 43
      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="" /> <img src="~@/assets/image/time.png" alt="" />
</div> </div>
<div class="time_box"> <div class="time_box">
<div class="time_text">{{item.day}}</div> <div class="time_text">{{item.apmDay}}</div>
<div class="date_txt">{{item.monmet}}</div> <div class="date_txt">{{item.period}} {{item.timeFrame}}</div>
</div> </div>
</div> </div>
<div class="pro_bottom"> <div class="pro_bottom">
@ -15,8 +15,8 @@
<div class="img_box"> <div class="img_box">
<img src="~@/assets/image/pro.png" alt="" /> <img src="~@/assets/image/pro.png" alt="" />
</div> </div>
<div class="pro_name">{{item.name}}</div> <div class="pro_name">{{item.project}}</div>
<div class="pro_pos">{{item.posi}}</div> <div class="pro_pos">{{item.cuAddr}}</div>
</div> </div>
<div class="pro_right"> <div class="pro_right">
<div class="cancel" @click="cancelButton(item)">取消预约</div> <div class="cancel" @click="cancelButton(item)">取消预约</div>
@ -55,24 +55,33 @@
</template> </template>
<script> <script>
import {postExam} from "@/api/examination";
export default { export default {
data() { data() {
return { return {
proData:{}, proData:{},
proArr:[], proArr:[],
isShow:false, isShow:false,
isSuccess:false isSuccess:false,
userInfo:{}
}; };
}, },
mounted() { mounted() {
console.log(this.$route.params); console.log(this.$route.params);
this.userInfo = JSON.parse(sessionStorage.getItem('userInfo'))
console.log(this.userInfo)
this.proData = this.$route.params; this.proData = this.$route.params;
this.proData.selectArr.map(item =>{ this.proData.selectArr.map(item =>{
this.proArr.push({ this.proArr.push({
day:this.proData.time, apmDay:this.proData.time,
name:item.name, createDept:this.proData.createDept,
monmet:item.time, project:item.name,
posi:item.posi 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(){ confirm(){
console.log(this.proArr) console.log(this.proArr)
if(this.proArr.length != 0){ postExam(JSON.stringify(this.proArr)).then(res =>{
console.log(res)
if(res.code == 200){
this.isShow = true; this.isShow = true;
this.isSuccess = true this.isSuccess = true
}else{
this.isShow = true;
this.isSuccess = false
} }
})
// if(this.proArr.length != 0){
//
// }
}, },
clickFail(){ clickFail(){
@ -113,7 +131,10 @@ export default {
}, },
clickSucc(){ clickSucc(){
this.$router.replace({ this.$router.replace({
name:'MyExam' name:'MyExam',
query:{
id:this.proData.createDept
}
}) })
}, },
clickClose(){ clickClose(){

@ -84,6 +84,7 @@
</template> </template>
<script> <script>
import {queryDays,queryList} from "@/api/examination";
export default { export default {
data() { data() {
return { return {
@ -122,18 +123,24 @@ export default {
selectArr:[], selectArr:[],
selectDate:'', selectDate:'',
today:'', today:'',
isToday:'' isToday:'',
hospitalId:'',
startTime:'',
endTime:'',
cupCardNo:''
} }
}, },
created() { created() {
this.getList()
}, },
mounted() { mounted() {
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();
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 lastDay = new Date(new Date().getFullYear(),new Date().getMonth() + 2,0).getDate();
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) this.weekArr.push(i)
@ -141,13 +148,37 @@ export default {
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){
// item = ''
this.weekData[index] = '今日' 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: { methods: {
getDays(){
queryDays(
{
createDept:this.hospitalId,
startTime:this.startTime,
endTime:this.endTime
}
).then(res =>{
console.log(res)
})
},
getList(){ getList(){
queryList(
{
createDept:this.hospitalId,
apmDay:this.selectDate,
cupCardNo:this.cupCardNo
}
).then(res =>{
console.log('列表===>',res )
})
this.examData.map(item =>{ this.examData.map(item =>{
item.examArr.map(item1 =>{ item.examArr.map(item1 =>{
item1.isSelect = false item1.isSelect = false
@ -239,6 +270,7 @@ export default {
name:'ExamProject', name:'ExamProject',
params:{ params:{
time:this.selectDate, time:this.selectDate,
createDept:this.hospitalId,
selectArr:this.selectArr selectArr:this.selectArr
} }
}) })

Loading…
Cancel
Save