...
|
...
|
@@ -16,9 +16,9 @@ Page({ |
|
|
"门诊服务"
|
|
|
],
|
|
|
time_arr: [
|
|
|
"上午", "下午"
|
|
|
"上午", "下午","全天"
|
|
|
],
|
|
|
|
|
|
|
|
|
t_arr: [{ //选择日期数组
|
|
|
data: '',
|
|
|
time: ''
|
...
|
...
|
@@ -31,7 +31,7 @@ Page({ |
|
|
e_arr: [ //申请用餐数组
|
|
|
{
|
|
|
time: '',
|
|
|
night:''
|
|
|
night: ''
|
|
|
}
|
|
|
],
|
|
|
|
...
|
...
|
@@ -42,54 +42,67 @@ Page({ |
|
|
zhiyuan: '',
|
|
|
show: false,
|
|
|
shows: false,
|
|
|
shownight:false,
|
|
|
showdate:false,
|
|
|
arr:[],
|
|
|
},
|
|
|
|
|
|
//日历
|
|
|
// 参加日期
|
|
|
onDisplaydate() {
|
|
|
this.setData({
|
|
|
showdate: true
|
|
|
});
|
|
|
},
|
|
|
|
|
|
onClosedate() {
|
|
|
this.setData({
|
|
|
showdate: false
|
|
|
});
|
|
|
},
|
|
|
|
|
|
onConfirmdate(event) {
|
|
|
|
|
|
console.log(event)
|
|
|
var that = this;
|
|
|
var dates = event.detail
|
|
|
console.log(dates);
|
|
|
var list = [];
|
|
|
event.detail.forEach(item => {
|
|
|
var date = new Date(item);
|
|
|
console.log(date)
|
|
|
|
|
|
var year = date.getFullYear();
|
|
|
var m = date.getMonth() + 1;
|
|
|
var d = date.getDate();
|
|
|
|
|
|
var Data = year + "/" + m + "/" + d
|
|
|
list.push(Data);
|
|
|
});
|
|
|
|
|
|
|
|
|
console.log('1111111111111111', list)
|
|
|
this.setData({
|
|
|
shownight: false,
|
|
|
showdate: false,
|
|
|
data: list.join(',')
|
|
|
});
|
|
|
selectdata:[],
|
|
|
arr: [],
|
|
|
lunch: [],
|
|
|
dinner: [],
|
|
|
},
|
|
|
|
|
|
//日历
|
|
|
// 参加日期
|
|
|
onDisplaydate() {
|
|
|
this.setData({
|
|
|
showdate: true
|
|
|
});
|
|
|
},
|
|
|
|
|
|
onClosedate() {
|
|
|
this.setData({
|
|
|
showdate: false
|
|
|
});
|
|
|
},
|
|
|
|
|
|
onConfirmdate(event) {
|
|
|
|
|
|
console.log(event)
|
|
|
var that = this;
|
|
|
var dates = event.detail
|
|
|
console.log(dates);
|
|
|
var list = [];
|
|
|
event.detail.forEach(item => {
|
|
|
var date = new Date(item);
|
|
|
console.log(date)
|
|
|
|
|
|
var year = date.getFullYear();
|
|
|
var m = date.getMonth() + 1;
|
|
|
var d = date.getDate();
|
|
|
|
|
|
var Data = year + "/" + m + "/" + d
|
|
|
list.push(Data);
|
|
|
});
|
|
|
let data = [];
|
|
|
console.log('1111111111111111', list)
|
|
|
list.forEach(item => {
|
|
|
console.log("item-", item);
|
|
|
data.push({
|
|
|
date: item
|
|
|
})
|
|
|
})
|
|
|
console.log("---", data);
|
|
|
|
|
|
console.log('1111111111111111', list)
|
|
|
this.setData({
|
|
|
showdate: false,
|
|
|
data: list.join(','),
|
|
|
selectdata: data
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
// 入住日期
|
|
|
|
|
|
},
|
|
|
// 入住日期
|
|
|
onDisplay() {
|
|
|
this.setData({
|
|
|
show: true
|
...
|
...
|
@@ -119,23 +132,23 @@ onConfirmdate(event) { |
|
|
list.push(Data);
|
|
|
});
|
|
|
|
|
|
let data=[];
|
|
|
let data = [];
|
|
|
console.log('1111111111111111', list)
|
|
|
list.forEach(item => {
|
|
|
console.log("item-",item);
|
|
|
console.log("item-", item);
|
|
|
data.push({
|
|
|
date:item
|
|
|
date: item
|
|
|
})
|
|
|
})
|
|
|
console.log("---",data);
|
|
|
console.log("---", data);
|
|
|
this.setData({
|
|
|
show: false,
|
|
|
date: list.join(','),
|
|
|
arr:data,
|
|
|
arr: data,
|
|
|
});
|
|
|
},
|
|
|
|
|
|
//午餐
|
|
|
//午餐
|
|
|
onDisplays() {
|
|
|
this.setData({
|
|
|
shows: true
|
...
|
...
|
@@ -167,16 +180,27 @@ onConfirmdate(event) { |
|
|
list.push(Data);
|
|
|
});
|
|
|
|
|
|
let data = [];
|
|
|
console.log('1111111111111111', list)
|
|
|
list.forEach(item => {
|
|
|
console.log("item-", item);
|
|
|
data.push({
|
|
|
date: item
|
|
|
})
|
|
|
})
|
|
|
console.log("---", data);
|
|
|
|
|
|
console.log('1111111111111111', list)
|
|
|
this.setData({
|
|
|
shows: false,
|
|
|
time: list.join(',')
|
|
|
time: list.join(','),
|
|
|
lunch: data,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
},
|
|
|
// 晚餐
|
|
|
// 晚餐
|
|
|
onDisplaynight() {
|
|
|
this.setData({
|
|
|
shownight: true
|
...
|
...
|
@@ -208,27 +232,26 @@ onConfirmdate(event) { |
|
|
list.push(Data);
|
|
|
});
|
|
|
|
|
|
|
|
|
let data = [];
|
|
|
console.log('1111111111111111', list)
|
|
|
list.forEach(item => {
|
|
|
console.log("item-", item);
|
|
|
data.push({
|
|
|
date: item
|
|
|
})
|
|
|
})
|
|
|
console.log("---", data);
|
|
|
console.log('1111111111111111', list)
|
|
|
this.setData({
|
|
|
shownight: false,
|
|
|
night: list.join(',')
|
|
|
night: list.join(','),
|
|
|
dinner: data
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
// 获取到焦点
|
|
|
focus: function (e) {
|
|
|
this.setData({
|
...
|
...
|
@@ -345,10 +368,10 @@ onConfirmdate(event) { |
|
|
let index = e.currentTarget.dataset.index
|
|
|
// let id = e.currentTarget.dataset.id
|
|
|
let zindex = Number(e.detail.value)
|
|
|
|
|
|
that.setData({
|
|
|
[`t_arr[${index}].date`]: that.data.date_arr[zindex]
|
|
|
})
|
|
|
|
|
|
that.setData({
|
|
|
[`t_arr[${index}].date`]: that.data.date_arr[zindex]
|
|
|
})
|
|
|
|
|
|
|
|
|
// else if (id == 2) {
|
...
|
...
|
@@ -576,21 +599,21 @@ onConfirmdate(event) { |
|
|
})
|
|
|
return
|
|
|
}
|
|
|
if (that.data.t_type == false) {
|
|
|
if (that.data.selectdata == '') {
|
|
|
wx.showToast({
|
|
|
title: '请先完善选择日期信息',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
if (that.data.z_type == false) {
|
|
|
if (that.data.arr == '') {
|
|
|
wx.showToast({
|
|
|
title: '请先完善申请入住信息',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
if (that.data.e_type == false) {
|
|
|
if (that.data.lunch =='' ) {
|
|
|
wx.showToast({
|
|
|
title: '请先完善申请用餐信息',
|
|
|
icon: 'none'
|
...
|
...
|
@@ -654,10 +677,16 @@ onConfirmdate(event) { |
|
|
form_id: form_id,
|
|
|
type: that.data.type_id,
|
|
|
work_content: that.data.check_id,
|
|
|
select_time: JSON.stringify(that.data.t_arr),
|
|
|
// select_time: JSON.stringify(that.data.t_arr),
|
|
|
select_time: JSON.stringify(that.data.selectdata),
|
|
|
// apply_stay: JSON.stringify(that.data.z_arr),
|
|
|
apply_stay: JSON.stringify(that.data.arr),
|
|
|
apply_food: JSON.stringify(that.data.e_arr)
|
|
|
// apply_food: JSON.stringify(that.data.e_arr)
|
|
|
apply_lunch_food: JSON.stringify(that.data.lunch),
|
|
|
apply_dinner_food: JSON.stringify(that.data.dinner)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
let header = {
|
|
|
'XX-Token': wx.getStorageSync('token')
|
...
|
...
|
|