Browse Source

值班安排

娄底高职分支
ndbs 2 years ago
parent
commit
adff8d4e04
2 changed files with 67 additions and 25 deletions
  1. +41
    -15
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/DutySchedule/list.vue
  2. +26
    -10
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/DutySchedule/single.vue

+ 41
- 15
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/DutySchedule/list.vue View File

@@ -2,7 +2,7 @@
<view class="page">
<!-- 主列表页 -->
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;">
<!-- 顶部条目/分页信息栏 -->
<!-- 顶部条目/分页信息栏 -->
<l-customlist-banner @buttonClick="sideOpen = true">{{ tips }}</l-customlist-banner>
<!-- 滚动列表,跨端支持上拉/下拉 -->
@@ -13,12 +13,14 @@
<view class="customlist-item-field">
<text class="customlist-item-field-title">时间:</text>
{{ displayListItem(item, 'Date') }}
<!-- {{ displayListItem(item, 'Date') }} -->
{{ displayListItem(item, 'StartTime') }}&nbsp;-&nbsp;{{ displayListItem(item, 'EndTime') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">值班人:</text>
{{ displayListItem(item, 'Person') }}
<!-- {{ displayListItem(item, 'Person') }} -->
{{ displayListItem(item, 'F_RealName') }}
</view>
<view class="customlist-item-field">
@@ -41,8 +43,20 @@
<!-- 侧边栏,用于设置查询条件 -->
<scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y>
<view v-if="ready" class="padding">
<l-customlist-sidepage-datefilter
v-model="dateRange"
@change="searchChange"
title="按时间日期查询: "
ref="datefilter"
class="margin-bottom"
/>
<l-input
v-model="queryData.keyword"
@change="searchChange"
title ="值班人"
placeholder="按值班人查询"
/>
<!-- 重置查询条件按钮 -->
<view class="padding-tb">
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button>
@@ -50,7 +64,7 @@
</view>
</scroll-view>
<!-- <l-customlist-add v-if="!sideOpen" @click="action('add')" /> -->
<l-customlist-add v-if="!sideOpen" @click="action('add')" />
</view>
</template>
@@ -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()
},
// 点击「编辑」、「查看」、「添加」、「删除」按钮


+ 26
- 10
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/DutySchedule/single.vue View File

@@ -1,18 +1,31 @@
<template>
<view class="page">
<view v-if="ready">
<l-date-picker
@input="setValue('DutySchedule.Date', $event)"
:value="getValue('DutySchedule.Date')"
<l-datetime-picker
@input="setValue('DutySchedule.StartTime', $event)"
:value="getValue('DutySchedule.StartTime')"
:disabled="!edit"
title="时间"
title="开始时间"
/>
<l-input
<l-datetime-picker
@input="setValue('DutySchedule.EndTime', $event)"
:value="getValue('DutySchedule.EndTime')"
:disabled="!edit"
title="结束时间"
/>
<!-- <l-input
@input="setValue('DutySchedule.Person', $event)"
:value="getValue('DutySchedule.Person')"
:disabled="!edit"
title="值班人"
/>
/> -->
<l-organize-picker
@input="setValue('DutySchedule.Person', $event)"
:value="getValue('DutySchedule.Person')"
:readonly="!edit"
type="user"
title="值班人"
/>
<l-textarea
@input="setValue('DutySchedule.Remark', $event)"
:value="getValue('DutySchedule.Remark')"
@@ -80,8 +93,10 @@ export default {
// 表单项数据结构
scheme: {
DutySchedule: {
Date: { type: 'datetime', title: '时间', dateformat: '0' },
Person: { type: 'text', title: '值班人' },
// Date: { type: 'datetime', title: '时间', dateformat: '0' },
StartTime: { type: 'datetime', dateformat: '1' },
EndTime: { type: 'datetime', dateformat: '1' },
Person: { type: 'text', title: '值班人',verify: 'NotNull' },
Remark: { type: 'textarea', title: '备注' },
},
@@ -127,7 +142,8 @@ export default {
this.origin = await this.getDefaultForm()
} else {
const result = await this.HTTP_GET('learun/adms/PersonnelManagement/DutySchedule/form', this.id)
this.origin = await this.formatFormData(result)
let res = {DutySchedule:result.Schedule}
this.origin = await this.formatFormData(res)
}
this.current = this.COPY(this.origin)
},
@@ -184,7 +200,7 @@ export default {
this.EMIT('PersonnelManagementDutySchedule-list-change')
this.NAV_BACK()
this.this.TOAST('删除成功', 'success')
this.TOAST('删除成功', 'success')
})
break


Loading…
Cancel
Save