diff --git a/api/list.js b/api/list.js new file mode 100644 index 0000000..f83bc41 --- /dev/null +++ b/api/list.js @@ -0,0 +1,23 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; +import useNetWork from '@/common/useNetWork.js'; + +const List = BASE_URL + '/visitor/apply/list' +const MessageInfo = BASE_URL + '/visitor/getMessageInfo' +/** + * 获取访客提交记录列表 + * @param {*} + */ +export function getList(data) { + useNetWork(); + return fetch.post(List,data).then(res => res); +} + +/** + * 获取消息详情 + * @param {*} + */ +export function getMessageInfo(params) { + useNetWork(); + return fetch.get(MessageInfo,params).then(res => res); +} \ No newline at end of file diff --git a/api/list.js b/api/list.js new file mode 100644 index 0000000..f83bc41 --- /dev/null +++ b/api/list.js @@ -0,0 +1,23 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; +import useNetWork from '@/common/useNetWork.js'; + +const List = BASE_URL + '/visitor/apply/list' +const MessageInfo = BASE_URL + '/visitor/getMessageInfo' +/** + * 获取访客提交记录列表 + * @param {*} + */ +export function getList(data) { + useNetWork(); + return fetch.post(List,data).then(res => res); +} + +/** + * 获取消息详情 + * @param {*} + */ +export function getMessageInfo(params) { + useNetWork(); + return fetch.get(MessageInfo,params).then(res => res); +} \ No newline at end of file diff --git a/common/formatTime.js b/common/formatTime.js index e5d158e..6129cc2 100644 --- a/common/formatTime.js +++ b/common/formatTime.js @@ -3,4 +3,13 @@ var timestr = new Date(parseInt(unixtime) * 1000); var datetime = timestr.toLocaleString().replace(/年|月/g,"-").replace(/日/g," "); return datetime; +} + +/* + 获取前几个月,默认前一个月的今天 +*/ +export function getLastMonth(monthNum = 1){ + let today = new Date() //当天 + today.setMonth(today.getMonth()-monthNum) + return today; } \ No newline at end of file diff --git a/api/list.js b/api/list.js new file mode 100644 index 0000000..f83bc41 --- /dev/null +++ b/api/list.js @@ -0,0 +1,23 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; +import useNetWork from '@/common/useNetWork.js'; + +const List = BASE_URL + '/visitor/apply/list' +const MessageInfo = BASE_URL + '/visitor/getMessageInfo' +/** + * 获取访客提交记录列表 + * @param {*} + */ +export function getList(data) { + useNetWork(); + return fetch.post(List,data).then(res => res); +} + +/** + * 获取消息详情 + * @param {*} + */ +export function getMessageInfo(params) { + useNetWork(); + return fetch.get(MessageInfo,params).then(res => res); +} \ No newline at end of file diff --git a/common/formatTime.js b/common/formatTime.js index e5d158e..6129cc2 100644 --- a/common/formatTime.js +++ b/common/formatTime.js @@ -3,4 +3,13 @@ var timestr = new Date(parseInt(unixtime) * 1000); var datetime = timestr.toLocaleString().replace(/年|月/g,"-").replace(/日/g," "); return datetime; +} + +/* + 获取前几个月,默认前一个月的今天 +*/ +export function getLastMonth(monthNum = 1){ + let today = new Date() //当天 + today.setMonth(today.getMonth()-monthNum) + return today; } \ No newline at end of file diff --git a/pages.json b/pages.json index b4cf49b..ab349c6 100644 --- a/pages.json +++ b/pages.json @@ -51,7 +51,7 @@ "style" : { "navigationBarTitleText": "列表", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/api/list.js b/api/list.js new file mode 100644 index 0000000..f83bc41 --- /dev/null +++ b/api/list.js @@ -0,0 +1,23 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; +import useNetWork from '@/common/useNetWork.js'; + +const List = BASE_URL + '/visitor/apply/list' +const MessageInfo = BASE_URL + '/visitor/getMessageInfo' +/** + * 获取访客提交记录列表 + * @param {*} + */ +export function getList(data) { + useNetWork(); + return fetch.post(List,data).then(res => res); +} + +/** + * 获取消息详情 + * @param {*} + */ +export function getMessageInfo(params) { + useNetWork(); + return fetch.get(MessageInfo,params).then(res => res); +} \ No newline at end of file diff --git a/common/formatTime.js b/common/formatTime.js index e5d158e..6129cc2 100644 --- a/common/formatTime.js +++ b/common/formatTime.js @@ -3,4 +3,13 @@ var timestr = new Date(parseInt(unixtime) * 1000); var datetime = timestr.toLocaleString().replace(/年|月/g,"-").replace(/日/g," "); return datetime; +} + +/* + 获取前几个月,默认前一个月的今天 +*/ +export function getLastMonth(monthNum = 1){ + let today = new Date() //当天 + today.setMonth(today.getMonth()-monthNum) + return today; } \ No newline at end of file diff --git a/pages.json b/pages.json index b4cf49b..ab349c6 100644 --- a/pages.json +++ b/pages.json @@ -51,7 +51,7 @@ "style" : { "navigationBarTitleText": "列表", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/info/info.vue b/pages/info/info.vue index e9e9c6a..c5c9234 100644 --- a/pages/info/info.vue +++ b/pages/info/info.vue @@ -1,59 +1,99 @@ @@ -62,16 +102,26 @@ .check-message-detail { padding: 18rpx; height: 100%; - .detail-content{ + + .detail-content { padding: 22rpx; background-color: #fff; border-radius: 10rpx; } - .detail-item{ + + .detail-item { display: flex; justify-content: space-between; margin-top: 44rpx; } } - + .green{ + color: #04ef0e; + } + .blue{ + color: #04a4ef; + } + .red{ + color: #ff0019; + } diff --git a/api/list.js b/api/list.js new file mode 100644 index 0000000..f83bc41 --- /dev/null +++ b/api/list.js @@ -0,0 +1,23 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; +import useNetWork from '@/common/useNetWork.js'; + +const List = BASE_URL + '/visitor/apply/list' +const MessageInfo = BASE_URL + '/visitor/getMessageInfo' +/** + * 获取访客提交记录列表 + * @param {*} + */ +export function getList(data) { + useNetWork(); + return fetch.post(List,data).then(res => res); +} + +/** + * 获取消息详情 + * @param {*} + */ +export function getMessageInfo(params) { + useNetWork(); + return fetch.get(MessageInfo,params).then(res => res); +} \ No newline at end of file diff --git a/common/formatTime.js b/common/formatTime.js index e5d158e..6129cc2 100644 --- a/common/formatTime.js +++ b/common/formatTime.js @@ -3,4 +3,13 @@ var timestr = new Date(parseInt(unixtime) * 1000); var datetime = timestr.toLocaleString().replace(/年|月/g,"-").replace(/日/g," "); return datetime; +} + +/* + 获取前几个月,默认前一个月的今天 +*/ +export function getLastMonth(monthNum = 1){ + let today = new Date() //当天 + today.setMonth(today.getMonth()-monthNum) + return today; } \ No newline at end of file diff --git a/pages.json b/pages.json index b4cf49b..ab349c6 100644 --- a/pages.json +++ b/pages.json @@ -51,7 +51,7 @@ "style" : { "navigationBarTitleText": "列表", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/info/info.vue b/pages/info/info.vue index e9e9c6a..c5c9234 100644 --- a/pages/info/info.vue +++ b/pages/info/info.vue @@ -1,59 +1,99 @@ @@ -62,16 +102,26 @@ .check-message-detail { padding: 18rpx; height: 100%; - .detail-content{ + + .detail-content { padding: 22rpx; background-color: #fff; border-radius: 10rpx; } - .detail-item{ + + .detail-item { display: flex; justify-content: space-between; margin-top: 44rpx; } } - + .green{ + color: #04ef0e; + } + .blue{ + color: #04a4ef; + } + .red{ + color: #ff0019; + } diff --git a/pages/information/information.vue b/pages/information/information.vue index fac0620..7c2fb84 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -53,7 +53,6 @@ - {{isForm ? '提交' : '完成'}} @@ -123,6 +122,7 @@ change(e) {}, //点击提交访客记录 async submit() { + console.log(JSON.stringify(this.callerInfo)) if (this.callerInfo.visitorName.trim() == '' || this.callerInfo.visitorIdCard.trim() == '' || this.callerInfo .visitorPhone.trim() == '' || this.callerInfo.visitReason.trim() == '' || this.callerInfo.visitPosition.trim() == '' || this.callerInfo.staffCode.trim() == ''){ return uni.showToast({ @@ -130,7 +130,7 @@ icon: 'none', duration: 2000, }) - }else if(this.callerInfo.inTime === this.callerInfo.outTime){ + }else if(this.callerInfo.inTime >= this.callerInfo.outTime){ return uni.showToast({ title: `访客结束时间未选择`, icon: 'none', diff --git a/api/list.js b/api/list.js new file mode 100644 index 0000000..f83bc41 --- /dev/null +++ b/api/list.js @@ -0,0 +1,23 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; +import useNetWork from '@/common/useNetWork.js'; + +const List = BASE_URL + '/visitor/apply/list' +const MessageInfo = BASE_URL + '/visitor/getMessageInfo' +/** + * 获取访客提交记录列表 + * @param {*} + */ +export function getList(data) { + useNetWork(); + return fetch.post(List,data).then(res => res); +} + +/** + * 获取消息详情 + * @param {*} + */ +export function getMessageInfo(params) { + useNetWork(); + return fetch.get(MessageInfo,params).then(res => res); +} \ No newline at end of file diff --git a/common/formatTime.js b/common/formatTime.js index e5d158e..6129cc2 100644 --- a/common/formatTime.js +++ b/common/formatTime.js @@ -3,4 +3,13 @@ var timestr = new Date(parseInt(unixtime) * 1000); var datetime = timestr.toLocaleString().replace(/年|月/g,"-").replace(/日/g," "); return datetime; +} + +/* + 获取前几个月,默认前一个月的今天 +*/ +export function getLastMonth(monthNum = 1){ + let today = new Date() //当天 + today.setMonth(today.getMonth()-monthNum) + return today; } \ No newline at end of file diff --git a/pages.json b/pages.json index b4cf49b..ab349c6 100644 --- a/pages.json +++ b/pages.json @@ -51,7 +51,7 @@ "style" : { "navigationBarTitleText": "列表", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/info/info.vue b/pages/info/info.vue index e9e9c6a..c5c9234 100644 --- a/pages/info/info.vue +++ b/pages/info/info.vue @@ -1,59 +1,99 @@ @@ -62,16 +102,26 @@ .check-message-detail { padding: 18rpx; height: 100%; - .detail-content{ + + .detail-content { padding: 22rpx; background-color: #fff; border-radius: 10rpx; } - .detail-item{ + + .detail-item { display: flex; justify-content: space-between; margin-top: 44rpx; } } - + .green{ + color: #04ef0e; + } + .blue{ + color: #04a4ef; + } + .red{ + color: #ff0019; + } diff --git a/pages/information/information.vue b/pages/information/information.vue index fac0620..7c2fb84 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -53,7 +53,6 @@ - {{isForm ? '提交' : '完成'}} @@ -123,6 +122,7 @@ change(e) {}, //点击提交访客记录 async submit() { + console.log(JSON.stringify(this.callerInfo)) if (this.callerInfo.visitorName.trim() == '' || this.callerInfo.visitorIdCard.trim() == '' || this.callerInfo .visitorPhone.trim() == '' || this.callerInfo.visitReason.trim() == '' || this.callerInfo.visitPosition.trim() == '' || this.callerInfo.staffCode.trim() == ''){ return uni.showToast({ @@ -130,7 +130,7 @@ icon: 'none', duration: 2000, }) - }else if(this.callerInfo.inTime === this.callerInfo.outTime){ + }else if(this.callerInfo.inTime >= this.callerInfo.outTime){ return uni.showToast({ title: `访客结束时间未选择`, icon: 'none', diff --git a/pages/list/list.vue b/pages/list/list.vue index 0e5bbca..a6f9635 100644 --- a/pages/list/list.vue +++ b/pages/list/list.vue @@ -5,18 +5,21 @@ - 筛选时间 + {{time}} - 筛选状态 + {{statusInfo}} - + - {{item.time}} - {{item.number}} - {{item.name}} + {{item.inTime}} + {{item.remarks}} + {{item.visitorName}} + {{item.status }} - - - + @@ -61,7 +63,7 @@ - 单号{{number}}访客申请{{text}} + 确定要将{{text}}的{{leixin}} @@ -73,56 +75,101 @@ + + + + + + @@ -179,40 +311,46 @@ font-size: 28rpx; border: 0.5rpx #000 solid; .table-checkbox { - width: 50rpx; + width: 30rpx; height: 100rpx; - border: 0.5rpx #000 solid; - padding-top: 50rpx; - padding-left: 16rpx; + border-right: 0.5rpx #000 solid; + padding: 50rpx 5rpx 3rpx 3rpx; } .table-time { width: 200rpx; height: 110rpx; padding-top: 40rpx; text-align: center; - border: 0.5rpx #000 solid; + border-right: 0.5rpx #000 solid; } .table-number { - width: 200rpx; + width: 160rpx; height: 150rpx; line-height: 150rpx; text-align: center; - border: 0.5rpx #000 solid; + border-right: 0.5rpx #000 solid; } .table-name { - width: 100rpx; + width: 140rpx; height: 150rpx; line-height: 150rpx; text-align: center; - border: 0.5rpx #000 solid; + border-right: 0.5rpx #000 solid; } + .table-status{ + width: 140rpx; + font-size: 24rpx; + text-align: center; + line-height: 150rpx; + border-right: 0.5rpx #000 solid; + } .table-icon { display: flex; - justify-content: space-between; + justify-content: center; padding-right: 10rpx; height: 150rpx; - width: 150rpx; - border: 0.5rpx #000 solid; + width: 50rpx; + border-right: 0.5rpx #000 solid; } } } @@ -255,4 +393,13 @@ border: 1px #000 solid; } } + .green{ + color: #04ef0e; + } + .blue{ + color: #04a4ef; + } + .red{ + color: #ff0019; + }