From adff8d4e040a96e018e69683ece6e4c2aa8b749c Mon Sep 17 00:00:00 2001 From: ndbs Date: Thu, 27 Oct 2022 11:59:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=80=BC=E7=8F=AD=E5=AE=89=E6=8E=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PersonnelManagement/DutySchedule/list.vue | 56 ++++++++++++++----- .../DutySchedule/single.vue | 36 ++++++++---- 2 files changed, 67 insertions(+), 25 deletions(-) diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/DutySchedule/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/DutySchedule/list.vue index 28aae3ee9..00970a14d 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/DutySchedule/list.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/DutySchedule/list.vue @@ -2,7 +2,7 @@ - + {{ tips }} @@ -13,12 +13,14 @@ 时间: - {{ displayListItem(item, 'Date') }} + + {{ displayListItem(item, 'StartTime') }} - {{ displayListItem(item, 'EndTime') }} 值班人: - {{ displayListItem(item, 'Person') }} + + {{ displayListItem(item, 'F_RealName') }} @@ -41,8 +43,20 @@ - - + + + 重置查询条件 @@ -50,7 +64,7 @@ - + @@ -84,9 +98,12 @@ export default { return { // 数据项的数据类型、结构 scheme: { - Date: { type: 'datetime', dateformat: '0' }, - Person: { type: 'text' }, + // Date: { type: 'datetime', dateformat: '0' }, + // Person: { type: 'text' }, Remark: { type: 'textarea' }, + StartTime: { type: 'datetime', dateformat: '1' }, + EndTime: { type: 'datetime', dateformat: '1' }, + F_RealName: { type: 'text' }, }, // 查询条件 @@ -108,7 +125,9 @@ export default { // 列表与分页信息 page: 1, total: 2, - list: [] + list: [] , + + dateRange:null } }, @@ -137,7 +156,7 @@ export default { }, // 拉取列表 - async fetchList() { + async fetchList(isConcat=true) { if (this.page > this.total) { return } const result = await this.HTTP_GET( @@ -155,19 +174,19 @@ export default { this.total = result.total this.page = result.page + 1 - this.list = this.list.concat(result.rows) + this.list = isConcat?this.list.concat(result.rows):result.rows this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' }, // 刷新清空列表 - async refreshList() { + async refreshList(isConcat=true) { this.page = 1 this.total = 2 this.list = [] - await this.fetchList() + await this.fetchList(isConcat) }, // 列表下拉 @@ -180,19 +199,26 @@ export default { // 设置搜索条件 async searchChange() { const result = {} + + // 时间查询相关参数 + if (this.dateRange) { + result.StartTime = this.dateRange.start + result.EndTime = this.dateRange.end + } // 将其他查询项添加到查询 JSON 中 const queryObj = pickBy(this.queryData, t => (Array.isArray(t) ? t.length > 0 : t)) Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) this.searchData = result - await this.refreshList() + await this.refreshList(false) }, // 点击「清空查询条件」按钮 reset() { this.queryData = this.COPY(this.defaultQueryData) - this.searchChange() + this.$refs.datefilter.changeDateRange('all') + // this.searchChange() }, // 点击「编辑」、「查看」、「添加」、「删除」按钮 diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/DutySchedule/single.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/DutySchedule/single.vue index 718a3a09e..09d4dde16 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/DutySchedule/single.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/DutySchedule/single.vue @@ -1,18 +1,31 @@