|
|
@@ -3,7 +3,7 @@ |
|
|
|
<!-- 主列表页 --> |
|
|
|
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;"> |
|
|
|
<!-- 顶部条目/分页信息栏 --> |
|
|
|
<l-customlist-banner @buttonClick="sideOpen = true">{{ tips }}</l-customlist-banner> |
|
|
|
<l-customlist-banner >{{ tips }}</l-customlist-banner> |
|
|
|
|
|
|
|
<!-- 滚动列表,跨端支持上拉/下拉 --> |
|
|
|
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="list"> |
|
|
@@ -12,22 +12,22 @@ |
|
|
|
<view class="customlist-item" v-for="item of list" :key="item.ID"> |
|
|
|
|
|
|
|
<view class="customlist-item-field"> |
|
|
|
<text class="customlist-item-field-title">文本框:</text> |
|
|
|
{{ displayListItem(item, 'ADDate') }} |
|
|
|
<text class="customlist-item-field-title">打卡时间:</text> |
|
|
|
{{ displayListItem(item, 'ClockTime') }} |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="customlist-item-field"> |
|
|
|
<text class="customlist-item-field-title">下拉框:</text> |
|
|
|
{{ displayListItem(item, 'ClockStatus') }} |
|
|
|
<text class="customlist-item-field-title">考勤类型:</text> |
|
|
|
{{ showADTypeFormat(item, 'ADType') }} |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="customlist-item-field"> |
|
|
|
<text class="customlist-item-field-title">日期框:</text> |
|
|
|
{{ displayListItem(item, 'ADTime') }} |
|
|
|
<text class="customlist-item-field-title">打卡结果:</text> |
|
|
|
{{ displayListItem(item, 'ClockStatus') }} |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<l-customlist-action showEdit @edit="action('edit', item.ID)" showDelete @delete="action('delete', item.ID)" @view="action('view', item.ID)" /> |
|
|
|
<!-- <l-customlist-action showEdit @edit="action('edit', item.ID)" showDelete @delete="action('delete', item.ID)" @view="action('view', item.ID)" /> --> |
|
|
|
</view> |
|
|
|
</l-customlist> |
|
|
|
</l-scroll-list> |
|
|
@@ -71,7 +71,7 @@ |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
<l-customlist-add v-if="!sideOpen" @click="action('add')" /> |
|
|
|
<!-- <l-customlist-add v-if="!sideOpen" @click="action('add')" /> --> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
@@ -105,22 +105,22 @@ export default { |
|
|
|
return { |
|
|
|
// 数据项的数据类型、结构 |
|
|
|
scheme: { |
|
|
|
ADDate: { type: 'text' }, |
|
|
|
ClockStatus: { type: 'select', itemCode: 'DbFieldType', dataSource: '0' }, |
|
|
|
ADTime: { type: 'datetime', dateformat: '0' }, |
|
|
|
ClockTime: { type: 'datetime' }, |
|
|
|
ADType: { type: 'text' }, |
|
|
|
ClockStatus: { type: 'select', itemCode: 'ADStatus', dataSource: '0' }, |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询条件 |
|
|
|
searchData: {}, |
|
|
|
defaultQueryData: {}, |
|
|
|
queryData: { |
|
|
|
ADDate: '', |
|
|
|
ClockTime: '', |
|
|
|
ClockStatus: '', |
|
|
|
}, |
|
|
|
|
|
|
|
// 数据源 |
|
|
|
dataSource: { |
|
|
|
ClockStatus: Object.values(this.GET_GLOBAL('dataDictionary').DbFieldType).map(t => ({ value: t.value, text: t.text })), |
|
|
|
ClockStatus: Object.values(this.GET_GLOBAL('dataDictionary').ADStatus).map(t => ({ value: t.value, text: t.text })), |
|
|
|
}, |
|
|
|
|
|
|
|
// 时间查询参数 |
|
|
@@ -143,13 +143,13 @@ export default { |
|
|
|
await this.init() |
|
|
|
}, |
|
|
|
onUnload() { |
|
|
|
this.OFF('LogisticsManagementADR_Record-list-change') |
|
|
|
this.OFF('ADRRecord-list-change') |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
// 页面初始化 |
|
|
|
async init() { |
|
|
|
this.ON('LogisticsManagementADR_Record-list-change', this.refreshList) |
|
|
|
this.ON('ADRRecord-list-change', this.refreshList) |
|
|
|
|
|
|
|
// 拉取加载列表和数据源 |
|
|
|
await Promise.all([ |
|
|
@@ -166,13 +166,16 @@ export default { |
|
|
|
// 拉取列表 |
|
|
|
async fetchList() { |
|
|
|
if (this.page > this.total) { return } |
|
|
|
|
|
|
|
let userInfo = this.GET_GLOBAL('loginUser'); |
|
|
|
this.searchData.UserNo=userInfo.account; |
|
|
|
|
|
|
|
const result = await this.HTTP_GET( |
|
|
|
'learun/adms/LogisticsManagement/ADR_Record/pagelist', |
|
|
|
'learun/adms/attendance/getrecordpagelist', |
|
|
|
{ |
|
|
|
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序) |
|
|
|
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序 |
|
|
|
pagination: { rows: 10, page: this.page, sidx: 'ID', sord: 'DESC' }, |
|
|
|
pagination: { rows: 10, page: this.page, sidx: 'ClockTime', sord: 'DESC' }, |
|
|
|
queryJson: JSON.stringify(this.searchData) |
|
|
|
}, |
|
|
|
'加载数据时出错' |
|
|
@@ -283,11 +286,46 @@ export default { |
|
|
|
|
|
|
|
case 'datetime': |
|
|
|
if (!value) { return '' } |
|
|
|
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm') |
|
|
|
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
|
|
default: return value === null || value === undefined ? '' : value |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//显示考勤类型格式化 |
|
|
|
showADTypeFormat(item,field){ |
|
|
|
const ADType = item[field] |
|
|
|
var type = ''; |
|
|
|
if(ADType=='0'){ |
|
|
|
type='未定义'; |
|
|
|
}else if(ADType=='1') |
|
|
|
{ |
|
|
|
type='上班'; |
|
|
|
}else if(ADType=='2') |
|
|
|
{ |
|
|
|
type='下班'; |
|
|
|
}else if(ADType=='3') |
|
|
|
{ |
|
|
|
type='开始休息'; |
|
|
|
}else if(ADType=='4') |
|
|
|
{ |
|
|
|
type='结束休息'; |
|
|
|
}else if(ADType=='5') |
|
|
|
{ |
|
|
|
type='开始加班'; |
|
|
|
}else if(ADType=='6') |
|
|
|
{ |
|
|
|
type='结束加班'; |
|
|
|
}else if(ADType=='7') |
|
|
|
{ |
|
|
|
type='中午上班'; |
|
|
|
}else if(ADType=='8') |
|
|
|
{ |
|
|
|
type='中午下班'; |
|
|
|
} |
|
|
|
return type; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |