diff --git a/pages/list/list.vue b/pages/list/list.vue index 63846da..0e67c11 100644 --- a/pages/list/list.vue +++ b/pages/list/list.vue @@ -6,9 +6,10 @@ {{time}} @@ -36,7 +37,7 @@ {{item.visitorName}} - {{item.staffCode}} + {{item.applyNo}} {{item.inTime}} @@ -102,6 +103,7 @@ import {debounce} from '@/common/utils.js' import {getLastMonth} from '@/common/formatTime.js' import {solveStatus} from '@/api/message.js' +import BASE_URL from '@/api/base.js'; export default { components: { TabBar, @@ -185,11 +187,7 @@ }else { this.checkboxList.splice(this.checkboxList.indexOf(item),1) } - if(this.checkboxList.length > 0){ - this.checkExport = '选中的' - }else { - this.checkExport = '所有' - } + this.checkExport = this.checkboxList.length > 0 ? '选中的' : '所有' }, //搜索框发生改变 async change(e){ @@ -211,8 +209,21 @@ } debounce(this.searchList(),10000) }, - exportClick() { - + async exportClick() { + let ids + this.checkboxList.length === 0 ? ids = this.list.map(item=>item.id).join() : ids = this.checkboxList.map(item=> item.id).join() + wx.downloadFile({ + url: BASE_URL + `/visitor/exportMessage?ids=${ids}`, + success: function (res) { + const filePath = res.tempFilePath + wx.openDocument({ + filePath: filePath, + success: function (res) { + console.log('打开文档成功') + } + }) + } + }) }, //根据条件搜索 async searchList(){ @@ -244,30 +255,19 @@ //打开导出提示框 pass(leixin){ this.leixin = leixin - this.checkboxList.length !== 0 ? this.text = '选中的' : this.text = '全部' - this.ispassShow = true + this.text = this.checkboxList.length !== 0 ? '选中的' : '所有' + this.ispassShow = true }, async possQr(){ - if(this.checkboxList.length === 0){ - let ids = await this.list.map(item=>{ - return item.id - }) - ids = ids.join() - let res = await solveStatus(this.leixin == '通过' ? '2' : '3',ids) - }else { - let ids = await this.checkboxList.map(item=>{ - return item.id - }) - ids = ids.join() - let res = await solveStatus(this.leixin == '通过' ? '2' : '3',ids) - } + let ids = this.checkboxList.length === 0 ? this.list.map(item=> item.id).join() : this.checkboxList.map(item=>item.id).join() + let res = await solveStatus(this.leixin == '通过' ? '2' : '3',ids) this.searchList() this.ispassShow = false this.checkboxList = [] }, exportQr(){ - this.isExportShow = false this.exportClick() + this.isExportShow = false }, eyeLoock(messageId){ wx.navigateTo({ @@ -450,8 +450,10 @@ } } } - /deep/.u-input--radius{ - background-color: #F0F0F0 !important; + /deep/.u-input__content{ + background-color: #F0F0F0 ; + border-radius: 10rpx ; + height: 80rpx; } .popup { width: 700rpx; diff --git a/pages/list/list.vue b/pages/list/list.vue index 63846da..0e67c11 100644 --- a/pages/list/list.vue +++ b/pages/list/list.vue @@ -6,9 +6,10 @@ {{time}} @@ -36,7 +37,7 @@ {{item.visitorName}} - {{item.staffCode}} + {{item.applyNo}} {{item.inTime}} @@ -102,6 +103,7 @@ import {debounce} from '@/common/utils.js' import {getLastMonth} from '@/common/formatTime.js' import {solveStatus} from '@/api/message.js' +import BASE_URL from '@/api/base.js'; export default { components: { TabBar, @@ -185,11 +187,7 @@ }else { this.checkboxList.splice(this.checkboxList.indexOf(item),1) } - if(this.checkboxList.length > 0){ - this.checkExport = '选中的' - }else { - this.checkExport = '所有' - } + this.checkExport = this.checkboxList.length > 0 ? '选中的' : '所有' }, //搜索框发生改变 async change(e){ @@ -211,8 +209,21 @@ } debounce(this.searchList(),10000) }, - exportClick() { - + async exportClick() { + let ids + this.checkboxList.length === 0 ? ids = this.list.map(item=>item.id).join() : ids = this.checkboxList.map(item=> item.id).join() + wx.downloadFile({ + url: BASE_URL + `/visitor/exportMessage?ids=${ids}`, + success: function (res) { + const filePath = res.tempFilePath + wx.openDocument({ + filePath: filePath, + success: function (res) { + console.log('打开文档成功') + } + }) + } + }) }, //根据条件搜索 async searchList(){ @@ -244,30 +255,19 @@ //打开导出提示框 pass(leixin){ this.leixin = leixin - this.checkboxList.length !== 0 ? this.text = '选中的' : this.text = '全部' - this.ispassShow = true + this.text = this.checkboxList.length !== 0 ? '选中的' : '所有' + this.ispassShow = true }, async possQr(){ - if(this.checkboxList.length === 0){ - let ids = await this.list.map(item=>{ - return item.id - }) - ids = ids.join() - let res = await solveStatus(this.leixin == '通过' ? '2' : '3',ids) - }else { - let ids = await this.checkboxList.map(item=>{ - return item.id - }) - ids = ids.join() - let res = await solveStatus(this.leixin == '通过' ? '2' : '3',ids) - } + let ids = this.checkboxList.length === 0 ? this.list.map(item=> item.id).join() : this.checkboxList.map(item=>item.id).join() + let res = await solveStatus(this.leixin == '通过' ? '2' : '3',ids) this.searchList() this.ispassShow = false this.checkboxList = [] }, exportQr(){ - this.isExportShow = false this.exportClick() + this.isExportShow = false }, eyeLoock(messageId){ wx.navigateTo({ @@ -450,8 +450,10 @@ } } } - /deep/.u-input--radius{ - background-color: #F0F0F0 !important; + /deep/.u-input__content{ + background-color: #F0F0F0 ; + border-radius: 10rpx ; + height: 80rpx; } .popup { width: 700rpx; diff --git a/pages/message/message.vue b/pages/message/message.vue index 91c953a..37a680b 100644 --- a/pages/message/message.vue +++ b/pages/message/message.vue @@ -69,7 +69,6 @@ }, mounted() { const userInfo = JSON.parse(uni.getStorageSync('userInfo')); - console.log('----------', userInfo); if(userInfo.salt === '物业人员') { this.isManager = true; } else {