|
@@ -14,7 +14,7 @@ Page({
|
|
|
itemData: {},
|
|
|
appointmentList: [],
|
|
|
form: {
|
|
|
- meetingNum: 0,
|
|
|
+ meetingNum: 1,
|
|
|
appointmentDate: null,
|
|
|
aircondition: false,
|
|
|
projection: false,
|
|
@@ -46,9 +46,9 @@ Page({
|
|
|
let rightList = []
|
|
|
for (let i = 0; i < seatNum; i++) {
|
|
|
let data = {
|
|
|
- monogram: null,
|
|
|
+ monogram: '',
|
|
|
snack: false,
|
|
|
- teaWater: null,
|
|
|
+ teaWater: '',
|
|
|
}
|
|
|
if (i % 2 == 0) {
|
|
|
leftList.push(data)
|
|
@@ -77,6 +77,22 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ // 清除茶水
|
|
|
+ getCleaeTea(e) {
|
|
|
+ let dataset = e.detail.currentTarget.dataset
|
|
|
+ let name = "leftList[" + dataset.index + "].teaWater"
|
|
|
+ let name1 = "rightList[" + dataset.index + "].teaWater"
|
|
|
+ if (dataset.type === 'left') {
|
|
|
+ this.setData({
|
|
|
+ [name]: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (dataset.type === 'right') {
|
|
|
+ this.setData({
|
|
|
+ [name1]: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
// 点心
|
|
|
getSnack(e) {
|
|
|
let dataset = e.detail.currentTarget.dataset
|
|
@@ -117,9 +133,6 @@ Page({
|
|
|
if (type == "appointmentDate") {
|
|
|
this.appointmentDateRecordList(e.detail)
|
|
|
}
|
|
|
- // if (type == "meetingNum") {
|
|
|
- // this.getSeat()
|
|
|
- // }
|
|
|
},
|
|
|
getValue1(e) {
|
|
|
this.setData({
|
|
@@ -147,9 +160,10 @@ Page({
|
|
|
rightList,
|
|
|
type
|
|
|
} = this.data
|
|
|
+ let that = this
|
|
|
if (!form.appointmentStartTime || !form.appointmentEndTime) {
|
|
|
wx.showToast({
|
|
|
- title: '请填写完整',
|
|
|
+ title: '会议时间不能为空',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
@@ -167,43 +181,38 @@ Page({
|
|
|
}
|
|
|
wx.requestSubscribeMessage({
|
|
|
tmplIds: ['mJs6TXjIFuwgPu2JOEIpu3lO9ym9rnai-schUPuLuok'],
|
|
|
- success(res) {
|
|
|
- if (type == 'transfer-audit') {
|
|
|
- checkTurnMeeting(form).then(res => {
|
|
|
- wx.showToast({
|
|
|
- title: '提交成功',
|
|
|
- icon: 'none',
|
|
|
- duration: 800,
|
|
|
- mask: true,
|
|
|
- success: function () {
|
|
|
- setTimeout(function () {
|
|
|
- wx.switchTab({
|
|
|
- url: '/pages/home/home',
|
|
|
- })
|
|
|
- }, 800)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- } else {
|
|
|
- insertMeetingRecord(form).then(res => {
|
|
|
- wx.showToast({
|
|
|
- title: '提交成功',
|
|
|
- icon: 'none',
|
|
|
- duration: 800,
|
|
|
- mask: true,
|
|
|
- success: function () {
|
|
|
- setTimeout(function () {
|
|
|
- wx.switchTab({
|
|
|
- url: '/pages/home/home',
|
|
|
- })
|
|
|
- }, 800)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
+ success() {
|
|
|
+ that.check()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ async check() {
|
|
|
+ let {
|
|
|
+ form,
|
|
|
+ type
|
|
|
+ } = this.data
|
|
|
+ let res
|
|
|
+ if (type == 'transfer-audit') {
|
|
|
+ res = await checkTurnMeeting(form)
|
|
|
+ } else {
|
|
|
+ res = await insertMeetingRecord(form)
|
|
|
+ }
|
|
|
+ if (res.code == 200) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '提交成功',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 800,
|
|
|
+ mask: true,
|
|
|
+ success: function () {
|
|
|
+ setTimeout(function () {
|
|
|
+ wx.switchTab({
|
|
|
+ url: '/pages/home/home',
|
|
|
+ })
|
|
|
+ }, 800)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
// 获取预约日期
|
|
|
getStartDate() {
|
|
|
let {
|
|
@@ -263,9 +272,8 @@ Page({
|
|
|
let timeStart = Date.parse(form.appointmentDate + ' ' + item.appointmentStartTime + ':00')
|
|
|
let timeEnd = Date.parse(form.appointmentDate + ' ' + appointmentList[(index == 0 ? index : index - 1)].appointmentEndTime + ':00')
|
|
|
let timeEnd1 = Date.parse(form.appointmentDate + ' ' + appointmentList[(index == 0 ? index : index - 1)].appointmentEndTime + ':00')
|
|
|
-
|
|
|
timePeriodList.push({
|
|
|
- startTime: appointmentList.length == 0 ? itemData.canAppointmentStartTime : this.convertTime(timeEnd + ttt),
|
|
|
+ startTime: index==0 ? itemData.canAppointmentStartTime : this.convertTime(timeEnd + ttt),
|
|
|
endTime: this.convertTime(timeStart - ttt),
|
|
|
type: 1, //1:可点击;2:禁用
|
|
|
id: index + 'q'
|