Просмотр исходного кода

修改第一批bug(不需要联调问题)

新疆警官学校中职
lb01 2 лет назад
Родитель
Сommit
3d785c6811
6 измененных файлов: 755 добавлений и 600 удалений
  1. +397
    -292
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AssetManagementSystem/FundsApply/list.vue
  2. +310
    -273
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/JournalSend/list.vue
  3. +9
    -7
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/JournalSend/single.vue
  4. +6
    -2
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/StuAttendanceLeave/IndexInStudent/list.vue
  5. +28
    -24
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/StuAttendanceLeave/single.vue
  6. +5
    -2
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/StuLeaveManagement/single.vue

+ 397
- 292
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AssetManagementSystem/FundsApply/list.vue Просмотреть файл

@@ -1,292 +1,397 @@
<template>
<view class="page">
<!-- 主列表页 -->
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;">
<!-- 顶部条目/分页信息栏 -->
<l-customlist-banner @buttonClick="sideOpen = true">{{ tips }}</l-customlist-banner>
<!-- 滚动列表,跨端支持上拉/下拉 -->
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="list">
<l-customlist :tips="loadState" showTips>
<!-- 单条记录 -->
<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, '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, 'F_RealName') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">备注:</text>
{{ displayListItem(item, 'Remark') }}
</view>
<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>
</view>
<!-- 关闭侧边抽屉按钮 -->
<view @click="sideOpen = false" :class="sideOpen ? 'show' : ''" class="sideclose">
<l-icon type="pullright" color="blue" />
</view>
<!-- 侧边栏,用于设置查询条件 -->
<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>
</view>
</view>
</scroll-view>
<l-customlist-add v-if="!sideOpen" @click="action('add')" />
</view>
</template>
<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2020-10-20 09:55
* 描 述:值班安排
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/PersonnelManagement/DutySchedule/list", "style": { "navigationBarTitleText": "表单列表页" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
*/
import moment from 'moment'
import get from 'lodash/get'
import set from 'lodash/set'
import pickBy from 'lodash/pickBy'
import mapValues from 'lodash/mapValues'
export default {
data() {
return {
// 数据项的数据类型、结构
scheme: {
// 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' },
},
// 查询条件
searchData: {},
defaultQueryData: {},
queryData: {
},
// 数据源
dataSource: {
},
// 页面相关参数
ready: false,
tips: '加载中...',
loadState: '向下翻以加载更多',
sideOpen: false,
// 列表与分页信息
page: 1,
total: 2,
list: [] ,
dateRange:null
}
},
async onLoad() {
await this.init()
},
onUnload() {
this.OFF('PersonnelManagementDutySchedule-list-change')
},
methods: {
// 页面初始化
async init() {
this.ON('PersonnelManagementDutySchedule-list-change', this.refreshList)
// 拉取加载列表和数据源
await Promise.all([
() => {}
])
await this.fetchList()
// 初始化查询条件
this.defaultQueryData = this.COPY(this.queryData)
this.ready = true
},
// 拉取列表
async fetchList(isConcat=true) {
if (this.page > this.total) { return }
const result = await this.HTTP_GET(
'learun/adms/PersonnelManagement/DutySchedule/pagelist',
{
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序)
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序
pagination: { rows: 10, page: this.page, sidx: 'ID', sord: 'DESC' },
queryJson: JSON.stringify(this.searchData)
},
'加载数据时出错'
)
if (!result) { return }
this.total = result.total
this.page = result.page + 1
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(isConcat=true) {
this.page = 1
this.total = 2
this.list = []
await this.fetchList(isConcat)
},
// 列表下拉
pullDown() {
this.refreshList().then(() => {
this.$refs.list.stopPullDown()
})
},
// 设置搜索条件
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(false)
},
// 点击「清空查询条件」按钮
reset() {
this.queryData = this.COPY(this.defaultQueryData)
this.$refs.datefilter.changeDateRange('all')
// this.searchChange()
},
// 点击「编辑」、「查看」、「添加」、「删除」按钮
async action(type, id = '') {
switch (type) {
case 'view':
this.NAV_TO(`./single?type=view&id=${id}`)
return
case 'add':
this.NAV_TO('./single?type=create')
return
case 'edit':
this.NAV_TO(`./single?type=edit&id=${id}`)
return
case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) {
return
}
this.HTTP_POST('learun/adms/PersonnelManagement/DutySchedule/delete', id, '删除失败').then(success => {
if(!success) { return }
this.TOAST('删除成功', 'success')
this.refreshList()
})
return
default:
return
}
},
// 显示列表中的标题项
displayListItem(item, field) {
const fieldItem = this.scheme[field]
const value = item[field]
switch (fieldItem.type) {
case 'currentInfo':
case 'organize':
return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), `${value}.name`, '')
case 'radio':
case 'select':
const selectItem = this.dataSource[field].find(t => t.value === String(value))
return get(selectItem, 'text', '')
case 'checkbox':
if (!value || value.split(',').length <= 0) { return '' }
const checkboxItems = value.split(',')
return this.dataSource[field].filter(t => checkboxItems.includes(t.value)).map(t => t.text).join(',')
case 'datetime':
if (!value) { return '' }
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm')
default: return value === null || value === undefined ? '' : value
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@/common/css/sidepage.less';
@import '~@/common/css/customlist.less';
</style>
<template>
<view class="page">
<!-- 主列表页 -->
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;">
<!-- 顶部条目/分页信息栏 -->
<l-customlist-banner @buttonClick="sideOpen = true">{{ tips }}</l-customlist-banner>

<!-- 滚动列表,跨端支持上拉/下拉 -->
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="list">
<l-customlist :tips="loadState" showTips>
<!-- 单条记录 -->
<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, 'EnCode') }}
</view>

<view class="customlist-item-field">
<text class="customlist-item-field-title">申报部门:</text>
{{ displayListItem(item, 'ApplyDept') }}
</view>

<view class="customlist-item-field">
<text class="customlist-item-field-title">填报时间:</text>
{{ displayListItem(item, 'ApplyTime') }}
</view>

<view class="customlist-item-field">
<text class="customlist-item-field-title">填报人:</text>
{{ displayListItem(item, 'ApplyUser') }}
</view>

<view class="customlist-item-field">
<text class="customlist-item-field-title">备注:</text>
{{ displayListItem(item, 'Remark') }}
</view>

<view class="customlist-item-field">
<text class="customlist-item-field-title">总金额:</text>
{{ displayListItem(item, 'SumAmount') }}
</view>

<view class="customlist-item-field">
<text class="customlist-item-field-title">人民币(大写):</text>
{{ displayListItem(item, 'UpperAmount') }}
</view>

<view class="customlist-item-field">
<text class="customlist-item-field-title">审批状态:</text>
{{ Statusitem(displayListItem(item, 'Status')) }}
</view>

<l-customlist-action :showButton="item.Status==0" buttonText="提交"
@join="action('check', item.Id)" :showEdit="item.Status==0" @edit="action('edit', item.Id)"
:showDelete="item.Status==0" @delete="action('delete', item.Id)"
@view="action('view', item.Id)" />
</view>
</l-customlist>
</l-scroll-list>
</view>

<!-- 关闭侧边抽屉按钮 -->
<view @click="sideOpen = false" :class="sideOpen ? 'show' : ''" class="sideclose">
<l-icon type="pullright" color="blue" />
</view>

<!-- 侧边栏,用于设置查询条件 -->
<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-select v-model="queryData.ApplyUser" @change="searchChange" :range="dataSource.ApplyUser" title="申请人"
placeholder="按申请人查询" />

<!-- 重置查询条件按钮 -->
<view class="padding-tb">
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button>
</view>
</view>
</scroll-view>

<l-customlist-add v-if="!sideOpen" @click="action('add')" />

</view>
</template>


<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2020-10-20 15:22
* 描 述:aaa
*/

/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/EducationalAdministration/StuAttendanceLeave/list", "style": { "navigationBarTitleText": "表单列表页" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
*/
import moment from 'moment'
import get from 'lodash/get'
import set from 'lodash/set'
import pickBy from 'lodash/pickBy'
import mapValues from 'lodash/mapValues'
import {
result
} from 'lodash'

export default {
data() {
return {
// 数据项的数据类型、结构
scheme: {
EnCode: {
type: 'text'
},
ApplyDept: {
type: "select",
dataSource: '1',
dataSourceId: 'ApplyDept'
},
ApplyTime: {
type: 'text'
},
ApplyUser: {
type: "select",
dataSource: '1',
dataSourceId: 'ApplyUser'
},
Remark: {
type: 'text'
},
SumAmount: {
type: 'text'
},
UpperAmount: {
type: 'text'
},
Status: {
type: 'text'
}
},

// 查询条件
searchData: {},
defaultQueryData: {},
queryData: {
ApplyUser: [],
},

// 数据源
dataSource: {
ApplyUser: [],
ApplyDept: []
},
// 时间查询参数
dateRange: null,
// 页面相关参数
ready: false,
tips: '加载中...',
loadState: '向下翻以加载更多',
sideOpen: false,

// 列表与分页信息
page: 1,
total: 2,
list: [],
user: null
}
},

async onLoad() {
await this.init()
},
onUnload() {
this.OFF('AssetManagementSystemFundsApply-list-change')
},

methods: {
// 页面初始化
async init() {
this.ON('AssetManagementSystemFundsApply-list-change', this.refreshList)

// 拉取加载列表和数据源
await Promise.all([
this.FETCH_DATASOURCE('teacheruserdata').then(result => {
// console.log(result.data)
this.dataSource.ApplyUser = result.data.map(t => ({
text: t.f_realname,
value: t.f_userid
}));
}),
this.FETCH_DATASOURCE('classdata').then(result => {
// console.log(result.data)
this.dataSource.ApplyDept = result.data.map(t => ({
text: t.name,
value: t.id
}));
}),
() => {}
])
await this.fetchList()
// 初始化查询条件
this.defaultQueryData = this.COPY(this.queryData)
this.ready = true
},

// 拉取列表
async fetchList() {
if (this.page > this.total) {
return
}

const result = await this.HTTP_GET(
'learun/adms/FundsApply/pagelist', {
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序)
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序
pagination: {
rows: 10,
page: this.page,
sidx: 'ApplyTime',
sord: 'DESC'
},
queryJson: JSON.stringify(this.searchData)
},
'加载数据时出错'
)

if (!result) {
return
}

this.total = result.total
this.page = result.page + 1
this.list = this.list.concat(result.rows)

this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项`
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多'
},

// 刷新清空列表
async refreshList() {
this.page = 1
this.total = 2
this.list = []

await this.fetchList()
},

// 列表下拉
pullDown() {
this.refreshList().then(() => {
this.$refs.list.stopPullDown()
})
},

// 设置搜索条件
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()
},

// 点击「清空查询条件」按钮
reset() {

this.queryData = this.COPY(this.defaultQueryData)
this.$refs.datefilter.changeDateRange('all')
// this.searchChange()
},

// 点击「编辑」、「查看」、「添加」、「删除」按钮
async action(type, id = '') {
switch (type) {
case 'view':
this.NAV_TO(`./single?type=view&id=${id}`)
return

case 'add':
this.NAV_TO('./single?type=create')
return

case 'edit':
this.NAV_TO(`./single?type=edit&id=${id}`)
return

case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) {
return
}

this.HTTP_POST('/learun/adms/FundsApply/delete', id, '删除失败')
.then(success => {
if (!success) {
return
}
this.TOAST('删除成功', 'success')
this.refreshList()
})
return

case 'check':
if (!(await this.CONFIRM('提交项目', '确定要提交该项吗?', true))) {
return
}
this.HTTP_POST('/learun/adms/FundsApply/submit', id, '提交失败')
.then(success => {
if (!success) {
return
}
this.TOAST('提交成功', 'success')
this.refreshList()
})
return

default:
return
}
},

// 显示列表中的标题项
displayListItem(item, field) {
const fieldItem = this.scheme[field]
const value = item[field]

switch (fieldItem.type) {
case 'currentInfo':
case 'organize':
return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType),
`${value}.name`, '')

case 'radio':
case 'select':
const selectItem = this.dataSource[field].find(t => t.value === String(value))
return get(selectItem, 'text', '')

case 'checkbox':
if (!value || value.split(',').length <= 0) {
return ''
}
const checkboxItems = value.split(',')
return this.dataSource[field].filter(t => checkboxItems.includes(t.value)).map(t => t.text).join(
',')

case 'datetime':
if (!value) {
return ''
}
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' :
'YYYY-MM-DD HH:mm')

default:
return value === null || value === undefined ? '' : value
}
},
Statusitem(data) {
if (data == '0') {
return '草稿'
} else if (data == '1') {
return '审批中'
} else if (data == '2') {
return '审批通过'
} else {
return data;
}
}

},
created() {
this.user = this.GET_GLOBAL('loginUser');
}
}
</script>


<style lang="less" scoped>
@import '~@/common/css/sidepage.less';
@import '~@/common/css/customlist.less';
</style>

+ 310
- 273
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/JournalSend/list.vue Просмотреть файл

@@ -1,273 +1,310 @@
<template>
<view class="page">
<!-- 主列表页 -->
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;">
<!-- 顶部条目/分页信息栏 -->
<l-customlist-banner :buttonShow="false" @buttonClick="sideOpen = true">{{ tips }}</l-customlist-banner>
<!-- 滚动列表,跨端支持上拉/下拉 -->
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="list">
<l-customlist :tips="loadState" showTips>
<!-- 单条记录 -->
<view class="customlist-item" v-for="item of list" :key="item.JournalSendId">
<view class="customlist-item-field">
<text class="customlist-item-field-title">日志主题:</text>
{{ displayListItem(item, 'JTitle') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">日志类型:</text>
{{ displayListItem(item, 'JTypeId') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">接收人:</text>
{{ displayListItem(item, 'JReceiveId') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">日志内容:</text>
{{ displayListItem(item, 'JContent') }}
</view>
<l-customlist-action showEdit @edit="action('edit', item.JournalSendId)" showDelete @delete="action('delete', item.JournalSendId)" @view="action('view', item.JournalSendId)" />
</view>
</l-customlist>
</l-scroll-list>
</view>
<!-- 关闭侧边抽屉按钮 -->
<view @click="sideOpen = false" :class="sideOpen ? 'show' : ''" class="sideclose">
<l-icon type="pullright" color="blue" />
</view>
<!-- 侧边栏,用于设置查询条件 -->
<scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y>
<view v-if="ready" class="padding">
<!-- 重置查询条件按钮 -->
<view class="padding-tb">
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button>
</view>
</view>
</scroll-view>
<l-customlist-add v-if="!sideOpen" @click="action('add')" />
</view>
</template>
<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2020-10-16 15:39
* 描 述:工作日志
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/EducationalAdministration/Journal/list", "style": { "navigationBarTitleText": "表单列表页" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
*/
import moment from 'moment'
import get from 'lodash/get'
import set from 'lodash/set'
import pickBy from 'lodash/pickBy'
import mapValues from 'lodash/mapValues'
export default {
data() {
return {
// 数据项的数据类型、结构
scheme: {
JTitle: { type: 'text' },
JTypeId: { type: 'select', dataSource: '0' },
JReceiveId: { type: 'organize', dataType: 'user' },
JContent: { type: 'textarea' },
},
// 查询条件
searchData: {},
defaultQueryData: {},
queryData: {
},
// 数据源
dataSource: {
JTypeId: [],
},
// 页面相关参数
ready: false,
tips: '加载中...',
loadState: '向下翻以加载更多',
sideOpen: false,
// 列表与分页信息
page: 1,
total: 2,
list: []
}
},
async onLoad() {
await this.init()
},
onUnload() {
this.OFF('EducationalAdministrationJournalSend-list-change')
},
methods: {
// 页面初始化
async init() {
this.ON('EducationalAdministrationJournalSend-list-change', this.refreshList)
// 拉取加载列表和数据源
await Promise.all([
() => {}
])
await this.fetchList()
// 初始化查询条件
this.defaultQueryData = this.COPY(this.queryData)
this.ready = true
},
// 拉取列表
async fetchList() {
if (this.page > this.total) { return }
const result = await this.HTTP_GET(
'learun/adms/EducationalAdministration/Journal/pagelist',
{
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序)
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序
pagination: { rows: 10, page: this.page, sidx: 'JournalSendId', sord: 'DESC' },
queryJson: JSON.stringify(this.searchData)
},
'加载数据时出错'
)
if (!result) { return }
this.total = result.total
this.page = result.page + 1
this.list = this.list.concat(result.rows)
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项`
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多'
},
// 刷新清空列表
async refreshList() {
this.page = 1
this.total = 2
this.list = []
await this.fetchList()
},
// 列表下拉
pullDown() {
this.refreshList().then(() => {
this.$refs.list.stopPullDown()
})
},
// 设置搜索条件
async searchChange() {
const result = {}
// 将其他查询项添加到查询 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()
},
// 点击「清空查询条件」按钮
reset() {
this.queryData = this.COPY(this.defaultQueryData)
this.searchChange()
},
// 点击「编辑」、「查看」、「添加」、「删除」按钮
async action(type, id = '') {
switch (type) {
case 'view':
this.NAV_TO(`./single?type=view&id=${id}`)
return
case 'add':
this.NAV_TO('./single?type=create')
return
case 'edit':
this.NAV_TO(`./single?type=edit&id=${id}`)
return
case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) {
return
}
this.HTTP_POST('learun/adms/EducationalAdministration/Journal/delete', id, '删除失败').then(success => {
if(!success) { return }
this.TOAST('删除成功', 'success')
this.refreshList()
})
return
default:
return
}
},
// 显示列表中的标题项
displayListItem(item, field) {
const fieldItem = this.scheme[field]
const value = item[field]
switch (fieldItem.type) {
case 'currentInfo':
case 'organize':
return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), `${value}.name`, '')
case 'radio':
case 'select':
const selectItem = this.dataSource[field].find(t => t.value === String(value))
return get(selectItem, 'text', '')
case 'checkbox':
if (!value || value.split(',').length <= 0) { return '' }
const checkboxItems = value.split(',')
return this.dataSource[field].filter(t => checkboxItems.includes(t.value)).map(t => t.text).join(',')
case 'datetime':
if (!value) { return '' }
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm')
default: return value === null || value === undefined ? '' : value
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@/common/css/sidepage.less';
@import '~@/common/css/customlist.less';
</style>
<template>
<view class="page">
<!-- 主列表页 -->
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;">
<!-- 顶部条目/分页信息栏 -->
<l-customlist-banner :buttonShow="false" @buttonClick="sideOpen = true">{{ tips }}</l-customlist-banner>

<!-- 滚动列表,跨端支持上拉/下拉 -->
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="list">
<l-customlist :tips="loadState" showTips>
<!-- 单条记录 -->
<view class="customlist-item" v-for="item of list" :key="item.JournalSendId">

<view class="customlist-item-field">
<text class="customlist-item-field-title">日志主题:</text>
{{ displayListItem(item, 'JTitle') }}
</view>

<view class="customlist-item-field">
<text class="customlist-item-field-title">日志类型:</text>
{{ displayListItem(item, 'JTypeId') }}
</view>

<view class="customlist-item-field">
<text class="customlist-item-field-title">接收人:</text>
{{ displayListItem(item, 'JReceiveId') }}
</view>

<view class="customlist-item-field">
<text class="customlist-item-field-title">日志内容:</text>
{{ displayListItem(item, 'JContent') }}
</view>


<l-customlist-action :showEdit="user.userId != item.JReceiveId" @edit="action('edit', item.JournalSendId)" :showDelete="user.userId != item.JReceiveId"
@delete="action('delete', item.JournalSendId)" @view="action('view', item.JournalSendId)" />
</view>
</l-customlist>
</l-scroll-list>
</view>

<!-- 关闭侧边抽屉按钮 -->
<view @click="sideOpen = false" :class="sideOpen ? 'show' : ''" class="sideclose">
<l-icon type="pullright" color="blue" />
</view>

<!-- 侧边栏,用于设置查询条件 -->
<scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y>
<view v-if="ready" class="padding">


<!-- 重置查询条件按钮 -->
<view class="padding-tb">
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button>
</view>
</view>
</scroll-view>

<l-customlist-add v-if="!sideOpen" @click="action('add')" />

</view>
</template>


<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2020-10-16 15:39
* 描 述:工作日志
*/

/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/EducationalAdministration/Journal/list", "style": { "navigationBarTitleText": "表单列表页" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
*/
import moment from 'moment'
import get from 'lodash/get'
import set from 'lodash/set'
import pickBy from 'lodash/pickBy'
import mapValues from 'lodash/mapValues'

export default {
data() {
return {
// 数据项的数据类型、结构
scheme: {
JTitle: {
type: 'text'
},
JTypeId: {
type: 'select',
dataSource: '0'
},
JReceiveId: {
type: 'organize',
dataType: 'user'
},
JContent: {
type: 'textarea'
},
},

// 查询条件
searchData: {},
defaultQueryData: {},
queryData: {},

// 数据源
dataSource: {
JTypeId: Object.values(this.GET_GLOBAL('dataDictionary').JournalType).map(t => ({
value: t.value,
text: t.text
})),
},

// 页面相关参数
ready: false,
tips: '加载中...',
loadState: '向下翻以加载更多',
sideOpen: false,

// 列表与分页信息
page: 1,
total: 2,
list: [],
user: null,
}
},

async onLoad() {
await this.init()
},
onUnload() {
this.OFF('EducationalAdministrationJournalSend-list-change')
},

methods: {
// 页面初始化
async init() {
this.ON('EducationalAdministrationJournalSend-list-change', this.refreshList)

// 拉取加载列表和数据源
await Promise.all([


() => {}
])
await this.fetchList()
// 初始化查询条件
this.defaultQueryData = this.COPY(this.queryData)
this.ready = true
},

// 拉取列表
async fetchList() {
if (this.page > this.total) {
return
}

const result = await this.HTTP_GET(
'learun/adms/EducationalAdministration/Journal/pagelist', {
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序)
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序
pagination: {
rows: 10,
page: this.page,
sidx: 'JournalSendId',
sord: 'DESC'
},
queryJson: JSON.stringify(this.searchData)
},
'加载数据时出错'
)

if (!result) {
return
}

this.total = result.total
this.page = result.page + 1
this.list = this.list.concat(result.rows)

this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项`
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多'
},

// 刷新清空列表
async refreshList() {
this.page = 1
this.total = 2
this.list = []

await this.fetchList()
},

// 列表下拉
pullDown() {
this.refreshList().then(() => {
this.$refs.list.stopPullDown()
})
},

// 设置搜索条件
async searchChange() {
const result = {}

// 将其他查询项添加到查询 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()
},

// 点击「清空查询条件」按钮
reset() {
this.queryData = this.COPY(this.defaultQueryData)
this.searchChange()
},

// 点击「编辑」、「查看」、「添加」、「删除」按钮
async action(type, id = '') {
switch (type) {
case 'view':
this.NAV_TO(`./single?type=view&id=${id}`)
return

case 'add':
this.NAV_TO('./single?type=create')
return

case 'edit':
this.NAV_TO(`./single?type=edit&id=${id}`)
return

case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) {
return
}

this.HTTP_POST('learun/adms/EducationalAdministration/Journal/delete', id, '删除失败').then(
success => {
if (!success) {
return
}
this.TOAST('删除成功', 'success')
this.refreshList()
})
return

default:
return
}
},

// 显示列表中的标题项
displayListItem(item, field) {
const fieldItem = this.scheme[field]
const value = item[field]

switch (fieldItem.type) {
case 'currentInfo':
case 'organize':
return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType),
`${value}.name`, '')

case 'radio':
case 'select':
const selectItem = this.dataSource[field].find(t => t.value === String(value))
return get(selectItem, 'text', '')

case 'checkbox':
if (!value || value.split(',').length <= 0) {
return ''
}
const checkboxItems = value.split(',')
return this.dataSource[field].filter(t => checkboxItems.includes(t.value)).map(t => t.text).join(
',')

case 'datetime':
if (!value) {
return ''
}
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' :
'YYYY-MM-DD HH:mm')

default:
return value === null || value === undefined ? '' : value
}
}

},
created() {
this.user = this.GET_GLOBAL('loginUser');
console.log(this.user)
}
}
</script>


<style lang="less" scoped>
@import '~@/common/css/sidepage.less';
@import '~@/common/css/customlist.less';
</style>

+ 9
- 7
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/JournalSend/single.vue Просмотреть файл

@@ -29,19 +29,19 @@
/>
</view>
<view v-if="ready" class="bg-white margin-tb padding" style="padding-top: 0; overflow: hidden;">
<view v-if="ready && edit" class="bg-white margin-tb padding" style="padding-top: 0; overflow: hidden;">
<l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block>
提交保存
</l-button>
<l-button v-if="!edit && mode !== 'create'" @click="action('edit')" size="lg" line="orange" class="block margin-top" block>
<!-- <l-button v-if="!edit && mode !== 'create'" @click="action('edit')" size="lg" line="orange" class="block margin-top" block>
编辑本页
</l-button>
</l-button> -->
<l-button v-if="edit && mode !== 'create'" @click="action('reset')" size="lg" line="red" class="block margin-top" block>
取消编辑
</l-button>
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" size="lg" line="red" class="block margin-top" block>
<!-- <l-button v-if="!edit && mode !== 'create'" @click="action('delete')" size="lg" line="red" class="block margin-top" block>
删除
</l-button>
</l-button> -->
</view>
</view>
</template>
@@ -150,8 +150,10 @@ export default {
break
case 'reset':
this.current = this.COPY(this.origin)
this.edit = false
// this.current = this.COPY(this.origin)
// this.edit = false
this.EMIT('EducationalAdministrationJournalSend-list-change')
this.NAV_BACK()
break
case 'save':


+ 6
- 2
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/StuAttendanceLeave/IndexInStudent/list.vue Просмотреть файл

@@ -108,7 +108,7 @@

<view class="customlist-item-field">
<text class="customlist-item-field-title">原上课日期:</text>
{{ displayListItem(item, 'LessonDate') }}
{{itmeDel(displayListItem(item, 'LessonDate')) }}
</view>

<view class="customlist-item-field">
@@ -129,7 +129,7 @@

<!-- <l-customlist-action showDelete @delete="action('delete', item.ID)" />
-->
<view class="customlist-banner-action">
<view class="customlist-banner-action" v-if="!item.IsCheck">
<view @click="delaction(item)" class="customlist-banner-action-btn line-red text-sm"
style="border: currentColor 1px solid">
<l-icon type="delete" />
@@ -490,6 +490,10 @@
default:
return '申请中'
}
},
itmeDel(data){
var newDate = /\d{4}-\d{1,2}-\d{1,2}/g.exec(data)
return newDate[0]
}

},


+ 28
- 24
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/StuAttendanceLeave/single.vue Просмотреть файл

@@ -4,128 +4,128 @@
<l-input
@input="setValue('StuAttendanceLeave.AcademicYearNo', $event)"
:value="getValue('StuAttendanceLeave.AcademicYearNo')"
:disabled="!edit"
disabled
title="学年度"
/>
<l-input
@input="setValue('StuAttendanceLeave.Semester', $event)"
:value="getValue('StuAttendanceLeave.Semester')"
:disabled="!edit"
disabled
title="学期"
/>
<l-input
@input="setValue('StuAttendanceLeave.StuNo', $event)"
:value="getValue('StuAttendanceLeave.StuNo')"
:disabled="!edit"
disabled
title="学号"
/>
<l-input
@input="setValue('StuAttendanceLeave.StuName', $event)"
:value="getValue('StuAttendanceLeave.StuName')"
:disabled="!edit"
disabled
title="姓名"
/>
<l-input
@input="setValue('StuAttendanceLeave.Grade', $event)"
:value="getValue('StuAttendanceLeave.Grade')"
:disabled="!edit"
disabled
title="年级"
/>
<l-input
@input="setValue('StuAttendanceLeave.EmpNo', $event)"
:value="getValue('StuAttendanceLeave.EmpNo')"
:disabled="!edit"
disabled
title="教师号"
/>
<l-input
@input="setValue('StuAttendanceLeave.DeptNo', $event)"
:value="getValue('StuAttendanceLeave.DeptNo')"
:disabled="!edit"
disabled
title="系所码"
/>
<l-input
@input="setValue('StuAttendanceLeave.DeptName', $event)"
:value="getValue('StuAttendanceLeave.DeptName')"
:disabled="!edit"
disabled
title="系名"
/>
<l-input
@input="setValue('StuAttendanceLeave.MajorNo', $event)"
:value="getValue('StuAttendanceLeave.MajorNo')"
:disabled="!edit"
disabled
title="专业码"
/>
<l-input
@input="setValue('StuAttendanceLeave.MajorName', $event)"
:value="getValue('StuAttendanceLeave.MajorName')"
:disabled="!edit"
disabled
title="专业名"
/>
<l-input
@input="setValue('StuAttendanceLeave.ClassNo', $event)"
:value="getValue('StuAttendanceLeave.ClassNo')"
:disabled="!edit"
disabled
title="所在行政班号"
/>
<l-input
@input="setValue('StuAttendanceLeave.ClassName', $event)"
:value="getValue('StuAttendanceLeave.ClassName')"
:disabled="!edit"
disabled
title="班级名称"
/>
<l-input
@input="setValue('StuAttendanceLeave.LessonNo', $event)"
:value="getValue('StuAttendanceLeave.LessonNo')"
:disabled="!edit"
disabled
title="课程号"
/>
<l-input
@input="setValue('StuAttendanceLeave.LessonName', $event)"
:value="getValue('StuAttendanceLeave.LessonName')"
:disabled="!edit"
disabled
title="课程名称"
/>
<l-input
@input="setValue('StuAttendanceLeave.LessonSortNo', $event)"
:value="getValue('StuAttendanceLeave.LessonSortNo')"
:disabled="!edit"
disabled
title="课程类别码"
/>
<l-input
@input="setValue('StuAttendanceLeave.LessonSortName', $event)"
:value="getValue('StuAttendanceLeave.LessonSortName')"
:disabled="!edit"
disabled
title="课程类别"
/>
<l-input
@input="setValue('StuAttendanceLeave.LessonDate', $event)"
:value="getValue('StuAttendanceLeave.LessonDate')"
:disabled="!edit"
:value="itmeDel(getValue('StuAttendanceLeave.LessonDate'))"
disabled
title="原上课日期"
/>
<l-input
@input="setValue('StuAttendanceLeave.LessonTime', $event)"
:value="getValue('StuAttendanceLeave.LessonTime')"
:disabled="!edit"
disabled
title="上课时间"
/>
<l-input
@input="setValue('StuAttendanceLeave.PlanWeek', $event)"
:value="getValue('StuAttendanceLeave.PlanWeek')"
:disabled="!edit"
disabled
title="教学周次"
/>
<l-select
@input="setValue('StuAttendanceLeave.LeaveType', $event)"
:value="getValue('StuAttendanceLeave.LeaveType')"
:disabled="!edit"
disabled
:range="dataSource.StuAttendanceLeave.LeaveType"
title="请假类型"
/>
<l-textarea
@input="setValue('StuAttendanceLeave.Remark', $event)"
:value="getValue('StuAttendanceLeave.Remark')"
:readonly="!edit"
readonly
title="备注"
/>
<l-select
@@ -133,7 +133,7 @@
:value="getValue('StuAttendanceLeave.IsCheck')"
:disabled="!edit"
:range="dataSource.StuAttendanceLeave.IsCheck"
title="下拉框"
title="审核意见"
/>
<l-textarea
@input="setValue('StuAttendanceLeave.TecRemark', $event)"
@@ -344,7 +344,11 @@ export default {
// 设置表单值
setValue(path, val) {
set(this.current, path, val)
}
},
itmeDel(data){
var newDate = /\d{4}-\d{1,2}-\d{1,2}/g.exec(data)
return newDate[0]
}
}
}
</script>

+ 5
- 2
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/StuLeaveManagement/single.vue Просмотреть файл

@@ -252,8 +252,11 @@ export default {
break

case 'reset':
this.current = this.COPY(this.origin)
this.edit = false
// this.current = this.COPY(this.origin)
// this.edit = false
this.EMIT('EducationalAdministrationStuLeaveManagement-list-change')
// this.NAV_BACK()
uni.navigateBack({})
break

case 'save':


Загрузка…
Отмена
Сохранить