diff --git a/src/components/ebiz/nbs/InternalList.vue b/src/components/ebiz/nbs/InternalList.vue index 430aa9a86..d4f7fd0ee 100644 --- a/src/components/ebiz/nbs/InternalList.vue +++ b/src/components/ebiz/nbs/InternalList.vue @@ -45,6 +45,10 @@ export default { if (this.level === '3') return if (this.level === '1') window.localStorage.setItem('nbsSecondManageCode', code) else if (this.level === '2') window.localStorage.setItem('nbsThirdManageCode', code) + // 生产环境路径中不包含井号, 开发环境包含井号无需再次拼接 + if (process.env.NODE_ENV === 'production') { + this.url = '/#' + this.url + } this.$jump({ flag: 'h5', extra: { diff --git a/src/views/ebiz/nbs/InternalService.vue b/src/views/ebiz/nbs/InternalService.vue index f6570bb97..8e0cb1c4f 100644 --- a/src/views/ebiz/nbs/InternalService.vue +++ b/src/views/ebiz/nbs/InternalService.vue @@ -6,14 +6,34 @@ 今日 当月 -
- 选择日期 - +
+
+ {{ startTimeStr ? startTimeStr : '开始日期' }} + +
+
+ {{ endTimeStr ? endTimeStr : '结束日期' }} + +
+ 搜索
- + + + + + + @@ -44,7 +64,6 @@ export default { [InternalNav.name]: InternalNav, [InternalList.name]: InternalList }, - data() { return { params: { @@ -54,15 +73,39 @@ export default { minDate: new Date('1999/01/01'), maxDate: new Date(`${new Date().getFullYear() + 5}/12/31`), currentDate: new Date().getFullYear() + '-' + Number(new Date().getMonth() + 1) + '-' + new Date().getDate(), + showStartTime: false, showTime: false, + startTime: null, tableData: { list: [], total: 0 }, - checkType: '' + checkType: '', + startTimeStr: '', + endTimeStr: '' } }, methods: { + setStartTime(date) { + this.startTime = date + this.showStartTime = false + this.startTimeStr = utils.formatDate(date, 'yyyy-MM-dd') + }, + setEndTime(date) { + this.currentDate = date + this.checkType = date + this.showTime = false + this.endTimeStr = utils.formatDate(date, 'yyyy-MM-dd') + }, + searchData() { + if (!this.startTimeStr || !this.endTimeStr) { + return this.$toast('请选择查询范围') + } + if (this.startTime.getTime() > this.currentDate.getTime()) { + return this.$toast('开始时间不能大于结束时间') + } + this.setDateType() + }, setDateType(type) { this.checkType = type this.showTime = false @@ -70,31 +113,37 @@ export default { let endTime = null if (type === 1) { //今日 - - this.params.dateType = utils.formatDate(date, 'yyyy-MM-dd') + this.startTime = utils.formatDate(date, 'yyyy-MM-dd') + this.startTimeStr = '' + this.endTimeStr = '' } else if (type === 2) { //当月 - this.params.dateType = utils.formatDate(date, 'yyyy-MM-01') + this.startTime = utils.formatDate(date, 'yyyy-MM-01') endTime = utils.formatDate(date, 'yyyy-MM-dd') + this.startTimeStr = '' + this.endTimeStr = '' } else { - this.params.dateType = type - endTime = type + this.startTime = this.startTimeStr + console.log(this.startTime) + endTime = utils.formatDate(this.currentDate, 'yyyy-MM-dd') } this.getDataList(endTime) }, + showStartTimeSelector() { + this.showStartTime = !this.showStartTime + }, showTimeSelector() { this.showTime = !this.showTime }, async getDataList(endTime = null) { this.tableData = { total: 0, list: false } const rs = await getTableList({ - startTime: this.params.dateType, + startTime: this.startTime, endTime, pageSize: 0, pageNum: 0 }) - console.log(rs) if (rs.result === '1') { this.tableData.list = [] return this.$toast(rs.resultMessage) @@ -134,9 +183,6 @@ export default { border-right: 0; padding: 0 10px; .left { - /deep/ button:nth-child(1) { - margin-right: 10px; - } .default { background: transparent; color: #999; @@ -149,12 +195,16 @@ export default { } } .right { - font-size: 14px; + font-size: 12px; display: flex; align-items: center; span { padding-right: 5px; } + .time { + display: flex; + align-items: center; + } } }