Browse Source

版本1.0.6 2023-11-30 ljd

1、优化了添加人员的时间选择,现在某个人员的凭证录入时间只能在该人员入住该房间的时间内
master
xiaohei 1 year ago
parent
commit
64a58f223e
2 changed files with 21 additions and 6 deletions
  1. +5
    -2
      pages/addperson/addperson.js
  2. +16
    -4
      pages/personManger/personManger.js

+ 5
- 2
pages/addperson/addperson.js View File

@ -239,8 +239,11 @@ Page({
var cgInfo = wx.getStorageSync('cgInfo') var cgInfo = wx.getStorageSync('cgInfo')
var deviceinfo = wx.getStorageSync('deviceinfo') var deviceinfo = wx.getStorageSync('deviceinfo')
var personLi = wx.getStorageSync('personLi') var personLi = wx.getStorageSync('personLi')
let minDate = wx.getStorageSync('minDate')
let minDate1 = wx.getStorageSync('minDate1')
console.log("242",personLi);
let minDate = moment(personLi.startTime).format('YYYY-MM-DD HH:mm:ss')
let minDate1 = moment(personLi.endTime).format('YYYY-MM-DD HH:mm:ss')
// let minDate = wx.getStorageSync('minDate')
// let minDate1 = wx.getStorageSync('minDate1')
this.setData({ this.setData({
cgInfo: cgInfo, cgInfo: cgInfo,
minDate, minDate,


+ 16
- 4
pages/personManger/personManger.js View File

@ -110,13 +110,19 @@ Page({
console.log(moment().format("x")) console.log(moment().format("x"))
var deviceinfo = wx.getStorageSync('deviceinfo') var deviceinfo = wx.getStorageSync('deviceinfo')
var cgInfo = wx.getStorageSync('cgInfo') var cgInfo = wx.getStorageSync('cgInfo')
let starttime = moment().format('YYYY-MM-DD HH:mm:ss')
let endtime = moment().add(30,'days').format('YYYY-MM-DD HH:mm:ss')
if(deviceinfo.roomId){ if(deviceinfo.roomId){
this.getSiteTenant(deviceinfo.roomId) this.getSiteTenant(deviceinfo.roomId)
} }
this.setData({ this.setData({
deviceinfo: deviceinfo, deviceinfo: deviceinfo,
roomId: deviceinfo.roomId, roomId: deviceinfo.roomId,
cgInfo: cgInfo
cgInfo: cgInfo,
starttime,
endtime,
minDate: starttime,
minDate1: endtime
}) })
}, },
onChange1(event) { onChange1(event) {
@ -295,6 +301,8 @@ Page({
mask:true, mask:true,
duration: 2000 duration: 2000
}) })
// wx.setStorageSync('minDate', data.startTime)
// wx.setStorageSync('minDate1', data.endTime)
WXAPI.sendCommand(data3).then(res6 => { WXAPI.sendCommand(data3).then(res6 => {
if(res6.success){ if(res6.success){
var data4 = { var data4 = {
@ -426,6 +434,8 @@ Page({
mask:true, mask:true,
duration: 2000 duration: 2000
}) })
// wx.setStorageSync('minDate', data.startTime)
// wx.setStorageSync('minDate1', data.endTime)
} else { } else {
wx.hideLoading() wx.hideLoading()
wx.showToast({ wx.showToast({
@ -525,6 +535,8 @@ Page({
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
// wx.setStorageSync('minDate', data.startTime)
// wx.setStorageSync('minDate1', data.endTime)
_this.getSiteTenant(_this.data.roomId) _this.getSiteTenant(_this.data.roomId)
}else{ }else{
wx.hideLoading() wx.hideLoading()
@ -609,13 +621,13 @@ Page({
let minDate1 = res1.data.list[0].endTime let minDate1 = res1.data.list[0].endTime
let starttime = moment(minDate).format('YYYY-MM-DD HH:mm:ss') let starttime = moment(minDate).format('YYYY-MM-DD HH:mm:ss')
let endtime = moment(minDate1).format('YYYY-MM-DD HH:mm:ss') let endtime = moment(minDate1).format('YYYY-MM-DD HH:mm:ss')
wx.setStorageSync('minDate',starttime)
wx.setStorageSync('minDate1',endtime)
// wx.setStorageSync('minDate',starttime)
// wx.setStorageSync('minDate1',endtime)
this.setData({ this.setData({
personList: res1.data.list, personList: res1.data.list,
starttime, starttime,
endtime, endtime,
minDate,minDate1
// minDate,minDate1
}) })
} else { } else {
wx.showToast({ wx.showToast({


Loading…
Cancel
Save