Ver código fonte

Merge branch '长阳分支中职' of 123.57.209.16:bjquanjiang/DigitalScholl into 长阳分支中职

临城职教中职
liangkun 2 anos atrás
pai
commit
33023fa09a
7 arquivos alterados com 949 adições e 3 exclusões
  1. +1
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Acc_GoodsDemageController.cs
  2. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj
  3. +109
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/LogisticsManagement/Acc_GoodsDemageApi.cs
  4. +108
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/LogisticsManagement/Acc_StuDayRoutineApi.cs
  5. +13
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json
  6. +385
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Acc_StuDayRoutine/list.vue
  7. +331
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Acc_StuDayRoutine/single.vue

+ 1
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Acc_GoodsDemageController.cs Ver arquivo

@@ -104,9 +104,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
{
Acc_GoodsDemageEntity entity = strEntity.ToObject<Acc_GoodsDemageEntity>();
var loginUserInfo = LoginUserInfo.Get();
entity.F_CreateAccount = loginUserInfo.account;
entity.F_CreateUserId = loginUserInfo.userId;
entity.F_CreateDate = DateTime.Now;
entity.F_CreateAccount = loginUserInfo.account;//上报学生学号
acc_GoodsDemageIBLL.SaveEntity(keyValue,entity);
return Success("保存成功!");
}


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj Ver arquivo

@@ -198,6 +198,8 @@
<Compile Include="Modules\EducationalAdministration\Sys_ReceiveComplaintApi.cs" />
<Compile Include="Modules\EducationalAdministration\Sys_SendComplaintApi.cs" />
<Compile Include="Modules\EducationalAdministration\LoginUserBindApi.cs" />
<Compile Include="Modules\LogisticsManagement\Acc_GoodsDemageApi.cs" />
<Compile Include="Modules\LogisticsManagement\Acc_StuDayRoutineApi.cs" />
<Compile Include="Modules\LogisticsManagement\Acc_PublicAreaHealthApi.cs" />
<Compile Include="Modules\LogisticsManagement\Acc_DailyAssessApi.cs" />
<Compile Include="Modules\PushMessageApi.cs" />


+ 109
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/LogisticsManagement/Acc_GoodsDemageApi.cs Ver arquivo

@@ -0,0 +1,109 @@
using Nancy;
using Learun.Util;
using System.Collections.Generic;
using System;
using Learun.Application.TwoDevelopment.LogisticsManagement;

namespace Learun.Application.WebApi
{
/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2022-09-16 14:43
/// 描 述:宿舍物品损坏上报
/// </summary>
public class Acc_GoodsDemageApi : BaseApi
{
private Acc_GoodsDemageIBLL acc_GoodsDemageIBLL = new Acc_GoodsDemageBLL();

/// <summary>
/// 注册接口
/// <summary>
public Acc_GoodsDemageApi()
: base("/Learun/adms/LogisticsManagement/Acc_GoodsDemage")
{
Get["/pagelist"] = GetPageList;
Get["/form"] = GetForm;
Post["/delete"] = DeleteForm;
Post["/save"] = SaveForm;
}
#region 获取数据

/// <summary>
/// 获取页面显示列表分页数据
/// <summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetPageList(dynamic _)
{
ReqPageParam parameter = this.GetReqData<ReqPageParam>();
var data = acc_GoodsDemageIBLL.GetPageList(parameter.pagination, parameter.queryJson);
var jsonData = new
{
rows = data,
total = parameter.pagination.total,
page = parameter.pagination.page,
records = parameter.pagination.records
};
return Success(jsonData);
}
/// <summary>
/// 获取表单数据
/// <summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetForm(dynamic _)
{
string keyValue = this.GetReqData();
var Acc_GoodsDemageData = acc_GoodsDemageIBLL.GetAcc_GoodsDemageEntity(keyValue);
var jsonData = new
{
Acc_GoodsDemage = Acc_GoodsDemageData,
};
return Success(jsonData);
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// <param name="_"></param>
/// <summary>
/// <returns></returns>
public Response DeleteForm(dynamic _)
{
string keyValue = this.GetReqData();
acc_GoodsDemageIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="_"></param>
/// <summary>
/// <returns></returns>
public Response SaveForm(dynamic _)
{
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
Acc_GoodsDemageEntity entity = parameter.strEntity.ToObject<Acc_GoodsDemageEntity>();
entity.F_CreateAccount = LoginUserInfo.Get().account;
acc_GoodsDemageIBLL.SaveEntity(parameter.keyValue, entity);
return Success("保存成功!");
}
#endregion

#region 私有类

/// <summary>
/// 表单实体类
/// <summary>
private class ReqFormEntity
{
public string keyValue { get; set; }
public string strEntity { get; set; }
}
#endregion

}
}

+ 108
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/LogisticsManagement/Acc_StuDayRoutineApi.cs Ver arquivo

@@ -0,0 +1,108 @@
using Nancy;
using Learun.Util;
using System.Collections.Generic;
using System;
using Learun.Application.TwoDevelopment.LogisticsManagement;

namespace Learun.Application.WebApi
{
/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2022-09-16 14:43
/// 描 述:学生日常规管理
/// </summary>
public class Acc_StuDayRoutineApi : BaseApi
{
private Acc_StuDayRoutineIBLL acc_StuDayRoutineIBLL = new Acc_StuDayRoutineBLL();

/// <summary>
/// 注册接口
/// <summary>
public Acc_StuDayRoutineApi()
: base("/Learun/adms/LogisticsManagement/Acc_StuDayRoutine")
{
Get["/pagelist"] = GetPageList;
Get["/form"] = GetForm;
Post["/delete"] = DeleteForm;
Post["/save"] = SaveForm;
}
#region 获取数据

/// <summary>
/// 获取页面显示列表分页数据
/// <summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetPageList(dynamic _)
{
ReqPageParam parameter = this.GetReqData<ReqPageParam>();
var data = acc_StuDayRoutineIBLL.GetPageList(parameter.pagination, parameter.queryJson);
var jsonData = new
{
rows = data,
total = parameter.pagination.total,
page = parameter.pagination.page,
records = parameter.pagination.records
};
return Success(jsonData);
}
/// <summary>
/// 获取表单数据
/// <summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetForm(dynamic _)
{
string keyValue = this.GetReqData();
var Acc_StuDayRoutineData = acc_StuDayRoutineIBLL.GetAcc_StuDayRoutineEntity(keyValue);
var jsonData = new
{
Acc_StuDayRoutine = Acc_StuDayRoutineData,
};
return Success(jsonData);
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// <param name="_"></param>
/// <summary>
/// <returns></returns>
public Response DeleteForm(dynamic _)
{
string keyValue = this.GetReqData();
acc_StuDayRoutineIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="_"></param>
/// <summary>
/// <returns></returns>
public Response SaveForm(dynamic _)
{
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
Acc_StuDayRoutineEntity entity = parameter.strEntity.ToObject<Acc_StuDayRoutineEntity>();
acc_StuDayRoutineIBLL.SaveEntity(parameter.keyValue, entity);
return Success("保存成功!");
}
#endregion

#region 私有类

/// <summary>
/// 表单实体类
/// <summary>
private class ReqFormEntity
{
public string keyValue { get; set; }
public string strEntity { get; set; }
}
#endregion

}
}

+ 13
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json Ver arquivo

@@ -1045,6 +1045,19 @@
"style": {
"navigationBarTitleText": "详情"
}
},
//学生日常规管理
{
"path": "pages/LogisticsManagement/Acc_StuDayRoutine/list",
"style": {
"navigationBarTitleText": "学生日常规管理"
}
},
{
"path": "pages/LogisticsManagement/Acc_StuDayRoutine/single",
"style": {
"navigationBarTitleText": "详情"
}
}


+ 385
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Acc_StuDayRoutine/list.vue Ver arquivo

@@ -0,0 +1,385 @@
<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, 'DeptNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">专业:</text>
{{ displayListItem(item, 'MajorNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">班级:</text>
{{ displayListItem(item, 'ClassNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">学生姓名:</text>
{{ displayListItem(item, 'StuNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">日期:</text>
{{ displayListItem(item, 'Date') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">奖分:</text>
{{ displayListItem(item, 'AddScore') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">扣分:</text>
{{ displayListItem(item, 'MinusScore') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">奖扣分原因:</text>
{{ displayListItem(item, 'Reason') }}
</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-select
v-model="queryData.DeptNo"
@change="DeptNoChange"
:range="dataSource.DeptNo"
title ="专业部"
placeholder="按专业部查询"
/>
<l-select
v-model="queryData.MajorNo"
@change="MajorNoChange"
:range="dataSource.MajorNo"
title ="专业"
placeholder="按专业查询"
/>
<l-select
v-model="queryData.ClassNo"
@change="searchChange"
:range="dataSource.ClassNo"
title ="班级"
placeholder="按班级查询"
/>
<l-input
v-model="queryData.StuName"
@change="searchChange"
title ="学生姓名"
/>
<!-- 重置查询条件按钮 -->
<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 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2022-09-16 09:37
* 描 述:学生日常规管理
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/LogisticsManagement/Acc_StuDayRoutine/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: {
DeptNo: { type: 'select', dataSource: '1', dataSourceId: 'CdDeptInfo,deptname,deptno' },
MajorNo: { type: 'select', dataSource: '1', dataSourceId: 'CdMajorInfo,majorname,majorno' },
ClassNo: { type: 'select', dataSource: '1', dataSourceId: 'bjsj,classname,classno' },
StuNo: { type: 'select', dataSource: '1', dataSourceId: 'StuInfoBasic,stuname,stuno' },
Date: { type: 'datetime', dateformat: '0' },
AddScore: { type: 'text' },
MinusScore: { type: 'text' },
Reason: { type: 'textarea' },
},
// 查询条件
searchData: {},
defaultQueryData: {},
queryData: {
DeptNo: '',
MajorNo: '',
ClassNo: '',
StuName: '',
},
// 数据源
dataSource: {
DeptNo: [],
MajorNo: [],
ClassNo: [],
StuNo:[],
},
// 时间查询参数
dateRange: null,
// 页面相关参数
ready: false,
tips: '加载中...',
loadState: '向下翻以加载更多',
sideOpen: false,
// 列表与分页信息
page: 1,
total: 2,
list: []
}
},
async onLoad() {
await this.init()
},
onUnload() {
this.OFF('LogisticsManagementAcc_StuDayRoutine-list-change')
},
methods: {
// 页面初始化
async init() {
this.ON('LogisticsManagementAcc_StuDayRoutine-list-change', this.refreshList)
// 拉取加载列表和数据源
await Promise.all([
this.FETCH_DATASOURCE('CdDeptInfo').then(result => {
this.dataSource.DeptNo = result.data.map(t => ({ text: t.deptname, value: t.deptno }))
}),
this.FETCH_DATASOURCE('CdMajorInfo').then(result => {
this.dataSource.MajorNo = result.data.map(t => ({ text: t.majorname, value: t.majorno }))
}),
this.FETCH_DATASOURCE('bjsj').then(result => {
this.dataSource.ClassNo = result.data.map(t => ({ text: t.classname, value: t.classno }))
}),
this.FETCH_DATASOURCE('StuInfoBasic').then(result => {
this.dataSource.StuNo = result.data.map(t => ({ text: t.stuname, value: t.stuno }))
}),
() => {}
])
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/LogisticsManagement/Acc_StuDayRoutine/pagelist',
{
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序)
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序
pagination: { rows: 10, page: this.page, sidx: 'Date', 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.$refs.datefilter.changeDateRange('all')
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/LogisticsManagement/Acc_StuDayRoutine/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:ss')
default: return value === null || value === undefined ? '' : value
}
},
//多条件查询:专业部改变事件
async DeptNoChange(){
if (this.queryData.DeptNo != null && this.queryData.DeptNo!=undefined && this.queryData.DeptNo != "") {
this.FETCH_DATASOURCE('CdMajorInfo').then(result => {
this.dataSource.MajorNo = result.data.filter(t=>t.deptno===this.queryData.DeptNo).map(t => ({ text: t.majorname, value: t.majorno }))
})
}else{
this.FETCH_DATASOURCE('CdMajorInfo').then(result => {
this.dataSource.MajorNo = result.data.map(t => ({ text: t.majorname, value: t.majorno }))
})
}
this.searchChange()
},
//多条件查询:专业改变事件
async MajorNoChange(){
if (this.queryData.MajorNo != null && this.queryData.MajorNo!=undefined && this.queryData.MajorNo != "") {
this.FETCH_DATASOURCE('bjsj').then(result => {
this.dataSource.ClassNo = result.data.filter(t=>t.majorno===this.queryData.MajorNo).map(t => ({ text: t.classname, value: t.classno }))
})
}else{
this.FETCH_DATASOURCE('bjsj').then(result => {
this.dataSource.ClassNo = result.data.map(t => ({ text: t.classname, value: t.classno }))
})
}
this.searchChange()
},
}
}
</script>
<style lang="less" scoped>
@import '~@/common/css/sidepage.less';
@import '~@/common/css/customlist.less';
</style>

+ 331
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Acc_StuDayRoutine/single.vue Ver arquivo

@@ -0,0 +1,331 @@
<template>
<view class="page">
<view v-if="ready">
<l-select
@input="setValue('Acc_StuDayRoutine.DeptNo', $event)"
:value="getValue('Acc_StuDayRoutine.DeptNo')"
:disabled="!edit"
:range="dataSource.Acc_StuDayRoutine.DeptNo"
@change="DeptNoChange"
title="专业部"
required
/>
<l-select
@input="setValue('Acc_StuDayRoutine.MajorNo', $event)"
:value="getValue('Acc_StuDayRoutine.MajorNo')"
:disabled="!edit"
:range="dataSource.Acc_StuDayRoutine.MajorNo"
@change="MajorNoChange"
title="专业"
required
/>
<l-select
@input="setValue('Acc_StuDayRoutine.ClassNo', $event)"
:value="getValue('Acc_StuDayRoutine.ClassNo')"
:disabled="!edit"
:range="dataSource.Acc_StuDayRoutine.ClassNo"
title="班级"
required
/>
<l-select
@input="setValue('Acc_StuDayRoutine.StuNo', $event)"
:value="getValue('Acc_StuDayRoutine.StuNo')"
:disabled="!edit"
:range="dataSource.Acc_StuDayRoutine.StuNo"
title="学生"
required
/>
<l-date-picker
@input="setValue('Acc_StuDayRoutine.Date', $event)"
:value="getValue('Acc_StuDayRoutine.Date')"
:disabled="!edit"
title="日期"
required
/>
<l-input
@input="setValue('Acc_StuDayRoutine.AddScore', $event)"
:value="getValue('Acc_StuDayRoutine.AddScore')"
:disabled="!edit"
title="奖分"
/>
<l-input
@input="setValue('Acc_StuDayRoutine.MinusScore', $event)"
:value="getValue('Acc_StuDayRoutine.MinusScore')"
:disabled="!edit"
title="扣分"
/>
<l-textarea
@input="setValue('Acc_StuDayRoutine.Reason', $event)"
:value="getValue('Acc_StuDayRoutine.Reason')"
:readonly="!edit"
title="奖扣分原因"
required
/>
<!-- 附件上传 -->
<l-input
@input="setValue('Acc_StuDayRoutine.Files', $event)"
:value="getValue('Acc_StuDayRoutine.Files')"
disabled="disabled"
v-show="false"
title="附件值"
/>
<uploadFile :number="5" :folderId="folderId" :value="fileList" :readonly="!edit" :title="fileTitle" :required="false"></uploadFile>
</view>
<view v-if="ready" 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('reset')" size="lg" line="red" class="block margin-top" block>
取消编辑
</l-button>
</view>
</view>
</template>
<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2022-09-16 09:37
* 描 述:学生日常规管理
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/LogisticsManagement/Acc_StuDayRoutine/single", "style": { "navigationBarTitleText": "表单详情页" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
*/
import get from 'lodash/get'
import set from 'lodash/set'
import moment from 'moment'
import customPageMixins from '@/common/custompage.js'
import uploadFile from '@/components/upload-file2.vue'
export default {
mixins: [customPageMixins],
components:{
uploadFile,
},
data() {
return {
// 页面相关参数
id: null,
mode: null,
edit: null,
ready: false,
fileList:[],//附件列表
folderId:null,//附件随机文件夹id
fileTitle:'附件上传',//附件label值
// 表单数据
current: {},
origin: {},
// 表单项数据结构
scheme: {
Acc_StuDayRoutine: {
DeptNo: { type: 'select', title: '专业部', dataSource: '1', dataSourceId: 'CdDeptInfo,deptname,deptno', verify: 'NotNull' },
MajorNo: { type: 'select', title: '专业', dataSource: '1', dataSourceId: 'CdMajorInfo,majorname,majorno', verify: 'NotNull' },
ClassNo: { type: 'select', title: '班级', dataSource: '1', dataSourceId: 'bjsj,classname,classno', verify: 'NotNull' },
StuNo: { type: 'select', title: '学生', dataSource: '1', dataSourceId: 'StuInfoBasic,stuname,stuno', verify: 'NotNull' },
Date: { type: 'datetime', title: '日期', dateformat: '0' , verify: 'NotNull'},
AddScore: { type: 'text', title: '奖分' },
MinusScore: { type: 'text', title: '扣分' },
Reason: { type: 'textarea', title: '奖扣分原因' , verify: 'NotNull'},
Files: { type: "text", title: "附件上传" },
},
},
// 数据源
dataSource: {
Acc_StuDayRoutine: {
DeptNo: [],
MajorNo: [],
ClassNo: [],
StuNo:[],
},
}
}
},
async onLoad({ type, id }) {
await this.init(type, id)
},
methods: {
// 页面初始化
async init(type, id) {
this.folderId=this.GUID();
// console.log('附件随机文件夹id:'+this.folderId);
this.LOADING('加载数据中...')
this.id = id
this.mode = type
this.edit = ['create', 'edit'].includes(this.mode)
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('CdDeptInfo').then(result => {
this.dataSource.Acc_StuDayRoutine.DeptNo = result.data.map(t => ({ text: t.deptname, value: t.deptno }))
}),
this.FETCH_DATASOURCE('CdMajorInfo').then(result => {
this.dataSource.Acc_StuDayRoutine.MajorNo = result.data.map(t => ({ text: t.majorname, value: t.majorno }))
}),
this.FETCH_DATASOURCE('bjsj').then(result => {
this.dataSource.Acc_StuDayRoutine.ClassNo = result.data.map(t => ({ text: t.classname, value: t.classno }))
}),
this.FETCH_DATASOURCE('StuInfoBasic').then(result => {
this.dataSource.Acc_StuDayRoutine.StuNo = result.data.map(t => ({ text: t.stuname, value: t.stuno }))
}),
() => {}
])
await this.fetchForm()
this.ready = true
this.HIDE_LOADING()
},
// 加载表单数据
async fetchForm() {
if (this.mode === 'create') {
this.origin = await this.getDefaultForm()
} else {
const result = await this.HTTP_GET('learun/adms/LogisticsManagement/Acc_StuDayRoutine/form', this.id)
this.origin = await this.formatFormData(result)
}
this.current = this.COPY(this.origin)
//加载附件值数据
// console.log('附件值赋值前:'+this.getValue('Acc_StuDayRoutine.Files'));
if (this.getValue('Acc_StuDayRoutine.Files') == ""||this.getValue('Acc_StuDayRoutine.Files') == undefined ||this.getValue('Acc_StuDayRoutine.Files') == null) {
this.setValue('Acc_StuDayRoutine.Files',this.folderId);
// console.log('附件值赋值后:'+this.getValue('Acc_StuDayRoutine.Files'));
}else{
this.folderId=this.getValue('Acc_StuDayRoutine.Files');
// console.log('文件夹id赋值后:'+this.folderId);
//请求‘获取附件列表’接口
this.fileList = await this.FETCH_FILEList(this.getValue('Acc_StuDayRoutine.Files'));
}
// console.log('origin:'+JSON.stringify(this.origin) )
// console.log('current:'+JSON.stringify(this.current))
},
// 点击 「编辑」、「重置」、「保存」、「删除」 按钮
async action(type) {
switch (type) {
case 'edit':
this.edit = true
break
case 'reset':
this.current = this.COPY(this.origin)
this.edit = false
break
case 'save':
const verifyResult = this.verifyForm()
if (verifyResult.length > 0) {
this.CONFIRM('表单验证失败', verifyResult.join('\n'))
return
}
if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) {
return
}
this.LOADING('正在提交...')
const postData = await this.getPostData(this.id)
// console.log('页面提交数据:'+JSON.stringify(postData));
this.HTTP_POST('learun/adms/LogisticsManagement/Acc_StuDayRoutine/save', postData, '表单提交保存失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.EMIT('LogisticsManagementAcc_StuDayRoutine-list-change')
this.NAV_BACK()
this.TOAST('提交保存成功')
})
break
case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) {
return
}
this.LOADING('提交删除中...')
this.HTTP_POST('learun/adms/LogisticsManagement/Acc_StuDayRoutine/delete', this.id, '删除失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.EMIT('LogisticsManagementAcc_StuDayRoutine-list-change')
this.NAV_BACK()
this.this.TOAST('删除成功', 'success')
})
break
default: break
}
},
// 获取表单值
getValue(path) {
return get(this.current, path)
},
// 设置表单值
setValue(path, val) {
set(this.current, path, val)
},
//多条件查询:专业部改变事件
async DeptNoChange(){
if (this.getValue('Acc_StuDayRoutine.DeptNo') != null && this.getValue('Acc_StuDayRoutine.DeptNo')!=undefined && this.getValue('Acc_StuDayRoutine.DeptNo') != "") {
this.FETCH_DATASOURCE('CdMajorInfo').then(result => {
this.dataSource.Acc_StuDayRoutine.MajorNo = result.data.filter(t=>t.deptno===this.getValue('Acc_StuDayRoutine.DeptNo')).map(t => ({ text: t.majorname, value: t.majorno }))
})
}else{
this.FETCH_DATASOURCE('CdMajorInfo').then(result => {
this.dataSource.Acc_StuDayRoutine.MajorNo = result.data.map(t => ({ text: t.majorname, value: t.majorno }))
})
}
},
//多条件查询:专业改变事件
async MajorNoChange(){
if (this.getValue('Acc_StuDayRoutine.MajorNo') != null && this.getValue('Acc_StuDayRoutine.MajorNo')!=undefined && this.getValue('Acc_StuDayRoutine.MajorNo') != "") {
this.FETCH_DATASOURCE('bjsj').then(result => {
this.dataSource.Acc_StuDayRoutine.ClassNo = result.data.filter(t=>t.majorno===this.getValue('Acc_StuDayRoutine.MajorNo')).map(t => ({ text: t.classname, value: t.classno }))
})
}else{
this.FETCH_DATASOURCE('bjsj').then(result => {
this.dataSource.Acc_StuDayRoutine.ClassNo = result.data.map(t => ({ text: t.classname, value: t.classno }))
})
}
},
}
}
</script>

Carregando…
Cancelar
Salvar