diff --git a/api/list.js b/api/list.js index 62e818a..f83bc41 100644 --- a/api/list.js +++ b/api/list.js @@ -3,12 +3,21 @@ 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 index 62e818a..f83bc41 100644 --- a/api/list.js +++ b/api/list.js @@ -3,12 +3,21 @@ 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/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 index 62e818a..f83bc41 100644 --- a/api/list.js +++ b/api/list.js @@ -3,12 +3,21 @@ 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/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 index 62e818a..f83bc41 100644 --- a/api/list.js +++ b/api/list.js @@ -3,12 +3,21 @@ 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/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 b01bece..7c2fb84 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -122,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({ diff --git a/api/list.js b/api/list.js index 62e818a..f83bc41 100644 --- a/api/list.js +++ b/api/list.js @@ -3,12 +3,21 @@ 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/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 b01bece..7c2fb84 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -122,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({ diff --git a/pages/list/list.vue b/pages/list/list.vue index c4fb2bb..a6f9635 100644 --- a/pages/list/list.vue +++ b/pages/list/list.vue @@ -10,15 +10,16 @@ prefixIconStyle="font-size: 22px;color: #909399" > - 筛选时间 + {{time}} - 筛选状态 + {{statusInfo}} - + {{item.inTime}} {{item.remarks}} {{item.visitorName}} + {{item.status }} - - - + @@ -63,7 +63,7 @@ - 单号{{number}}访客申请{{text}} + 确定要将{{text}}的{{leixin}} @@ -113,7 +113,7 @@ list: [], isExportShow:false, ispassShow:false, - number:'', + leixin:'', text:'已通过', checkboxList:[], checkExport:'所有', @@ -122,7 +122,11 @@ endTimeShow:false, TimeNextShow:false, statusShow:false, - statusList:[{name:'已通过',id:1},{name:'未通过',id:2}] + statusList:[{name:'已通过',id:1},{name:'未通过',id:2}], + time:'筛选时间', + isTimeQ:'', + isTimeZ:'', + statusInfo:'筛选状态' } }, async onShow() { @@ -137,7 +141,35 @@ status:'' } const res = await getList({}) - this.list = res.data + this.list = res.map(item=>{ + if(item.visitorApplyStatus == '1'){ + item.status = '申请通过' + item.color = 'green' + }else if(item.visitorApplyStatus == '2'){ + item.status = '申请中' + item.color = 'blue' + }else { + item.status = '申请未通过' + item.color = 'red' + } + return item + }) + + }, + //下拉刷新 + onPullDownRefresh(){ + this.queryList = { + keywords:'' , + startTime:'', + endTime:'', + status:'' + } + this.statusInfo = '筛选状态' + this.time ='筛选时间' + this.searchList() + setTimeout(()=>{ + uni.stopPullDownRefresh() + },1000) }, methods: { //选中的数据 @@ -157,7 +189,7 @@ async change(e){ if(e.trim() === '') { const res = await getList({}) - return this.list = res.data + return this.list = res } setTimeout(()=>{ this.searchList() @@ -166,21 +198,35 @@ //根据条件搜索 async searchList(){ const res = await getList(this.queryList) - if(res === []){ + if(res.length == 0){ this.list = [] }else{ - this.list = res.data + this.list = res.map(item=>{ + if(item.visitorApplyStatus == '1'){ + item.status = '申请通过' + item.color = 'green' + }else if(item.visitorApplyStatus == '2'){ + item.status = '申请中' + item.color = 'blue' + }else { + item.status = '申请未通过' + item.color = 'red' + } + return item + }) } }, //选中状态 statusSelect(e){ - console.log(e) + this.statusInfo = e.name + this.queryList.status = e.id + this.searchList() }, //打开导出提示框 - pass(number,text){ - this.number = number - this.text = text - this.ispassShow = true + pass(leixin){ + this.leixin = leixin + this.checkboxList.length !== 0 ? this.text = '选中的' : this.text = '全部' + this.ispassShow = true }, possQr(){ this.ispassShow = false @@ -188,9 +234,9 @@ exportQr(){ this.isExportShow = false }, - eyeLoock(){ + eyeLoock(messageId){ wx.navigateTo({ - url: `/pages/info/info`, + url: `/pages/info/info?messageId=${messageId}`, }); }, //取消选择时间 @@ -200,12 +246,15 @@ //确定选择结束时间 async confirmEndTime(e){ this.queryList.endTime = await this.shijianc(e.value) + this.isTimeZ = await this.yueFen(e.value) + this.time = `${this.isTimeQ}${this.isTimeZ}` this.endTimeShow = false this.searchList() }, //确定选择开始时间 async confirmTime(e) { this.queryList.startTime = await this.shijianc(e.value) + this.isTimeQ = await this.yueFen(e.value) this.startTimeShow = false this.endTimeShow = true }, @@ -219,6 +268,12 @@ let s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()) return Y + M + D + h + m + s }, + yueFen(time) { + let date = new Date(time) + let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-' + let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ' + return M + D + }, //格式化时间 formatter(type, value) { if (type === 'year') { @@ -256,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; } } } @@ -332,4 +393,13 @@ border: 1px #000 solid; } } + .green{ + color: #04ef0e; + } + .blue{ + color: #04a4ef; + } + .red{ + color: #ff0019; + }