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

【增加】app2.0,增加毕业信息统计;

长阳分支推送专用
dyy 2 лет назад
Родитель
Сommit
dae8163438
9 измененных файлов: 839 добавлений и 192 удалений
  1. +1
    -60
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuGraduateStatistic/Form.js
  2. +2
    -105
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuGraduateStatistic/Index.js
  3. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj
  4. +127
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EducationalAdministration/StuGraduateStatisticApi.cs
  5. +3
    -23
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuGraduateStatistic/StuGraduateStatisticService.cs
  6. +4
    -4
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js
  7. +13
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json
  8. +404
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/StuGraduateStatistic/list.vue
  9. +284
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/StuGraduateStatistic/single.vue

+ 1
- 60
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuGraduateStatistic/Form.js Просмотреть файл

@@ -1,63 +1,4 @@
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2022-08-29 16:34


+ 2
- 105
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuGraduateStatistic/Index.js Просмотреть файл

@@ -1,107 +1,4 @@
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2022-08-29 16:34
@@ -243,7 +140,7 @@ var bootstrap = function ($, learun) {
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'UniversityLevel',
code: 'GraduateLevel',
callback: function (_data) {
callback(_data.text);
}


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj Просмотреть файл

@@ -195,6 +195,7 @@
<Compile Include="Modules\ArrangeLessonTermAttemperApi.cs" />
<Compile Include="Modules\DataSourceNoLoginApi.cs" />
<Compile Include="Modules\AskApi.cs" />
<Compile Include="Modules\EducationalAdministration\StuGraduateStatisticApi.cs" />
<Compile Include="Modules\EducationalAdministration\Sys_ReceiveComplaintApi.cs" />
<Compile Include="Modules\EducationalAdministration\Sys_SendComplaintApi.cs" />
<Compile Include="Modules\EducationalAdministration\LoginUserBindApi.cs" />


+ 127
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EducationalAdministration/StuGraduateStatisticApi.cs Просмотреть файл

@@ -0,0 +1,127 @@
using Nancy;
using Learun.Util;
using System.Collections.Generic;
using Learun.Application.TwoDevelopment.EducationalAdministration;
namespace Learun.Application.WebApi
{
/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2022-09-23 15:31
/// 描 述:毕业信息统计
/// </summary>
public class StuGraduateStatisticApi : BaseApi
{
private StuGraduateStatisticIBLL stuGraduateStatisticIBLL = new StuGraduateStatisticBLL();
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL();

/// <summary>
/// 注册接口
/// <summary>
public StuGraduateStatisticApi()
: base("/Learun/adms/EducationalAdministration/StuGraduateStatistic")
{
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 = stuGraduateStatisticIBLL.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 StuGraduateStatisticData = stuGraduateStatisticIBLL.GetStuGraduateStatisticEntity( keyValue );
var jsonData = new {
StuGraduateStatistic = StuGraduateStatisticData,
};
return Success(jsonData);
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// <param name="_"></param>
/// <summary>
/// <returns></returns>
public Response DeleteForm(dynamic _)
{
string keyValue = this.GetReqData();
stuGraduateStatisticIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="_"></param>
/// <summary>
/// <returns></returns>
public Response SaveForm(dynamic _)
{
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
StuGraduateStatisticEntity entity = parameter.strEntity.ToObject<StuGraduateStatisticEntity>();
if (string.IsNullOrEmpty(parameter.keyValue))
{
var loginUserInfo = LoginUserInfo.Get();
var stuInfoEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(loginUserInfo.account);
if (stuInfoEntity != null)
{
entity.StuNo = stuInfoEntity.StuNo;
entity.StuName = stuInfoEntity.StuName;
entity.GenderNo = stuInfoEntity.GenderNo;
entity.IdentityCardNo = stuInfoEntity.IdentityCardNo;
entity.StuCode = stuInfoEntity.StuCode;
entity.ProvinceCode = stuInfoEntity.ProvinceCode;
entity.MajorNo = stuInfoEntity.MajorNo;
entity.EduSystem = stuInfoEntity.EduSystem;
entity.ClassNo = stuInfoEntity.ClassNo;
entity.mobile = stuInfoEntity.mobile;
}
else
{
return Fail("登录用户学籍信息不存在!");
}
}
stuGraduateStatisticIBLL.SaveEntity(parameter.keyValue,entity);
return Success("保存成功!");
}
#endregion

#region 私有类

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

}
}

+ 3
- 23
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuGraduateStatistic/StuGraduateStatisticService.cs Просмотреть файл

@@ -30,27 +30,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(@"
t.Id,
t.StuNo,
t.StuName,
t.GenderNo,
t.IdentityCardNo,
t.StuCode,
t.ProvinceCode,
t.MajorNo,
t.EduSystem,
t.ClassNo,
t.mobile,
t.GraduateGo,
t.EnterUniversityName,
t.UniversityLevel,
t.EmployerName,
t.EmployerProvince,
t.EmployerCity,
t.EmployerCountry
");
strSql.Append("SELECT t.* ");
strSql.Append(" FROM StuGraduateStatistic t ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
@@ -63,8 +43,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
if (!queryParam["StuNo"].IsEmpty())
{
dp.Add("StuNo", "%" + queryParam["StuNo"].ToString() + "%", DbType.String);
strSql.Append(" AND t.StuNo Like @StuNo ");
dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String);
strSql.Append(" AND t.StuNo = @StuNo ");
}
if (!queryParam["MajorNo"].IsEmpty())
{


+ 4
- 4
Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js Просмотреть файл

@@ -21,13 +21,13 @@ export default {
// "http://192.168.2.98:8088/"
// ],
"apiHost": [
"http://cyzjzx.gnway.cc:30626/"//测试地址
// "http://cyzjzx.gnway.cc:30626/"//测试地址
// "http://cyzjzx.gnway.cc:29615/"//正式地址
// "http://192.168.10.31:8088/"
"http://192.168.10.31:8088/"
],
"webHost":"http://cyzjzx.gnway.cc:29618/",//测试地址
// "webHost":"http://cyzjzx.gnway.cc:29618/",//测试地址
//"webHost":"http://wxd3f.cyzjzx.com/",//正式地址
// "webHost":"http://192.168.10.31:8087/",
"webHost":"http://192.168.10.31:8087/",
// 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示
"devAccount": [
// 20201130230 21364200000400266 老师 420528196310072253 学生 420528200606205026 420528200507261428


+ 13
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json Просмотреть файл

@@ -1077,6 +1077,19 @@
"style": {
"navigationBarTitleText": "详情"
}
},
//毕业信息统计
{
"path": "pages/EducationalAdministration/StuGraduateStatistic/list",
"style": {
"navigationBarTitleText": "毕业信息统计"
}
},
{
"path": "pages/EducationalAdministration/StuGraduateStatistic/single",
"style": {
"navigationBarTitleText": "详情"
}
}


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

@@ -0,0 +1,404 @@
<template>
<view class="page">
<!-- 主列表页 -->
<view class="mainpage" style="padding-top: 80rpx;">
<!-- 顶部条目/分页信息栏 -->
<view class="customlist-banner-header">
<view class="customlist-banner-content">
<slot>{{tips}}</slot>
</view>
</view>
<!-- 滚动列表,跨端支持上拉/下拉 -->
<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, 'StuNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">姓名:</text>
{{ displayListItem(item, 'StuName') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">性别:</text>
{{ displayListItem(item, 'GenderNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">身份证号:</text>
{{ displayListItem(item, 'IdentityCardNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">学籍号:</text>
{{ displayListItem(item, 'StuCode') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">学号:</text>
{{ displayListItem(item, 'ProvinceCode') }}
</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, 'EduSystem') }}
</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, 'mobile') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">毕业去向:</text>
{{ displayListItem(item, 'GraduateGo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">升入高校名称:</text>
{{ displayListItem(item, 'EnterUniversityName') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">大学层次:</text>
{{ displayListItem(item, 'UniversityLevel') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">就业单位名称:</text>
{{ displayListItem(item, 'EmployerName') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">就业单位所属省:</text>
{{ displayListItem(item, 'EmployerProvince') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">就业单位所属市:</text>
{{ displayListItem(item, 'EmployerCity') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">就业单位所属县(区):</text>
{{ displayListItem(item, 'EmployerCountry') }}
</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>
<l-customlist-add @click="action('add')" />
</view>
</template>
<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2022-09-23 15:16
* 描 述:毕业信息统计
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/EducationalAdministration/StuGraduateStatistic/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: {
StuNo: { type: 'text', title: '学生编码' },
StuName: { type: 'text', title: '姓名' },
GenderNo: { type: 'select', title: '性别' },
IdentityCardNo: { type: 'text' , title: '身份证号'},
StuCode: { type: 'text', title: '学籍号' },
ProvinceCode: { type: 'text', title: '学号' },
MajorNo: { type: 'select', title: '专业', dataSource: '1', dataSourceId: 'CdMajorInfo,majorname,majorno' },
EduSystem: { type: 'select', title: '学制', itemCode: 'EduSystem', dataSource: '0' },
ClassNo: { type: 'select', title: '班级', dataSource: '1', dataSourceId: 'bjsj,classname,classno' },
mobile: { type: 'text', title: '联系电话' },
GraduateGo: { type: 'select', title: '毕业去向', itemCode: 'GraduateGo', dataSource: '0' },
EnterUniversityName: { type: 'text', title: '升入高校名称' },
UniversityLevel: { type: 'select', title: '大学层次', itemCode: 'UniversityLevel', dataSource: '0' },
EmployerName: { type: 'text', title: '就业单位名称' },
EmployerProvince: { type: 'select', title: '就业单位所属省', dataSource: '1', dataSourceId: 'DIC_PROVINCE,pname,pcode' },
EmployerCity: { type: 'select', title: '就业单位所属市', dataSource: '1', dataSourceId: 'DIC_CITY,cname,ccode' },
EmployerCountry: { type: 'select', title: '就业单位所属县(区)', dataSource: '1', dataSourceId: 'DIC_AREA,aname,acode' },
Remark: { type: 'textarea' , title: '备注'},
},
// 查询条件
searchData: {},
defaultQueryData: {},
queryData: {
},
// 数据源
dataSource: {
GenderNo: [
{ text: '男', value: 'true' },
{ text: '女', value: 'false' }
],
MajorNo: [],
EduSystem: Object.values(this.GET_GLOBAL('dataDictionary').EduSystem).map(t => ({ value: t.value, text: t.text })),
ClassNo: [],
GraduateGo: Object.values(this.GET_GLOBAL('dataDictionary').GraduateGo).map(t => ({ value: t.value, text: t.text })),
UniversityLevel: Object.values(this.GET_GLOBAL('dataDictionary').GraduateLevel).map(t => ({ value: t.value, text: t.text })),
EmployerProvince: [],
EmployerCity: [],
EmployerCountry: [],
},
// 页面相关参数
ready: false,
tips: '加载中...',
loadState: '向下翻以加载更多',
sideOpen: false,
// 列表与分页信息
page: 1,
total: 2,
list: []
}
},
async onLoad() {
await this.init()
},
onUnload() {
this.OFF('EducationalAdministrationStuGraduateStatistic-list-change')
},
methods: {
// 页面初始化
async init() {
this.ON('EducationalAdministrationStuGraduateStatistic-list-change', this.refreshList)
// 拉取加载列表和数据源
await Promise.all([
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('DIC_PROVINCE').then(result => {
this.dataSource.EmployerProvince = result.data.map(t => ({ text: t.pname, value: t.pcode }))
}),
this.FETCH_DATASOURCE('DIC_CITY').then(result => {
this.dataSource.EmployerCity = result.data.map(t => ({ text: t.cname, value: t.ccode }))
}),
this.FETCH_DATASOURCE('DIC_AREA').then(result => {
this.dataSource.EmployerCountry = result.data.map(t => ({ text: t.aname, value: t.acode }))
}),
() => {}
])
await this.fetchList()
// 初始化查询条件
this.defaultQueryData = this.COPY(this.queryData)
this.ready = true
},
// 拉取列表
async fetchList() {
if (this.page > this.total) { return }
const sobj = {
StuNo:this.GET_GLOBAL('loginUser').account,
};
Object.assign(this.searchData,sobj);
const result = await this.HTTP_GET(
'learun/adms/EducationalAdministration/StuGraduateStatistic/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 = 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/StuGraduateStatistic/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>
<style lang="less" scoped>
.customlist-banner-header {
position: fixed;
top: var(--window-top);
z-index: 1024;
border-bottom: 1rpx solid #ddd;
height: 80rpx;
width: 100%;
box-shadow: 0 0.5px 3px rgba(0, 0, 0, 0.1);
background: #f1f1f1;

.customlist-banner-content {
color: #8f8f94;
background: #ffffff;
padding: 20rpx 25rpx;
width: 100%;
vertical-align: middle;
border-bottom: 1rpx solid #ddd;

.customlist-banner-action {
position: absolute;
right: 20rpx;
top: 20rpx;
}
}
}
</style>

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

@@ -0,0 +1,284 @@
<template>
<view class="page">
<view v-if="ready">
<l-select
@input="setValue('StuGraduateStatistic.GraduateGo', $event)"
:value="getValue('StuGraduateStatistic.GraduateGo')"
:disabled="!edit"
:range="dataSource.StuGraduateStatistic.GraduateGo"
title="毕业去向"
required
/>
<l-input
@input="setValue('StuGraduateStatistic.EnterUniversityName', $event)"
:value="getValue('StuGraduateStatistic.EnterUniversityName')"
:disabled="!edit"
title="升入高校名称"
/>
<l-select
@input="setValue('StuGraduateStatistic.UniversityLevel', $event)"
:value="getValue('StuGraduateStatistic.UniversityLevel')"
:disabled="!edit"
:range="dataSource.StuGraduateStatistic.UniversityLevel"
title="大学层次"
/>
<l-input
@input="setValue('StuGraduateStatistic.EmployerName', $event)"
:value="getValue('StuGraduateStatistic.EmployerName')"
:disabled="!edit"
title="就业单位名称"
/>
<l-select
@input="setValue('StuGraduateStatistic.EmployerProvince', $event)"
:value="getValue('StuGraduateStatistic.EmployerProvince')"
:disabled="!edit"
:range="dataSource.StuGraduateStatistic.EmployerProvince"
@change="EmployerProvinceChange"
title="就业单位所属省"
/>
<l-select
@input="setValue('StuGraduateStatistic.EmployerCity', $event)"
:value="getValue('StuGraduateStatistic.EmployerCity')"
:disabled="!edit"
:range="dataSource.StuGraduateStatistic.EmployerCity"
@change="EmployerCityChange"
title="就业单位所属市"
/>
<l-select
@input="setValue('StuGraduateStatistic.EmployerCountry', $event)"
:value="getValue('StuGraduateStatistic.EmployerCountry')"
:disabled="!edit"
:range="dataSource.StuGraduateStatistic.EmployerCountry"
title="就业单位所属县"
/>
<l-textarea
@input="setValue('StuGraduateStatistic.Remark', $event)"
:value="getValue('StuGraduateStatistic.Remark')"
:disabled="!edit"
title="备注"
>
</l-textarea>
</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-23 15:16
* 描 述:毕业信息统计
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/EducationalAdministration/StuGraduateStatistic/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'
export default {
mixins: [customPageMixins],
data() {
return {
// 页面相关参数
id: null,
mode: null,
edit: null,
ready: false,
// 表单数据
current: {},
origin: {},
// 表单项数据结构
scheme: {
StuGraduateStatistic: {
GraduateGo: { type: 'select', title: '毕业去向', itemCode: 'GraduateGo', dataSource: '0', verify: 'NotNull' },
EnterUniversityName: { type: 'text', title: '升入高校名称' },
UniversityLevel: { type: 'select', title: '大学层次', itemCode: 'UniversityLevel', dataSource: '0' },
EmployerName: { type: 'text', title: '就业单位名称' },
EmployerProvince: { type: 'select', title: '就业单位所属省', dataSource: '1', dataSourceId: 'DIC_PROVINCE,pname,pcode' },
EmployerCity: { type: 'select', title: '就业单位所属市', dataSource: '1', dataSourceId: 'DIC_CITY,cname,ccode' },
EmployerCountry: { type: 'select', title: '就业单位所属县(区)', dataSource: '1', dataSourceId: 'DIC_AREA,aname,acode' },
Remark: { type: 'textarea' , title: '备注'},
},
},
// 数据源
dataSource: {
StuGraduateStatistic: {
GraduateGo: Object.values(this.GET_GLOBAL('dataDictionary').GraduateGo).map(t => ({ value: t.value, text: t.text })),
UniversityLevel: Object.values(this.GET_GLOBAL('dataDictionary').GraduateLevel).map(t => ({ value: t.value, text: t.text })),
EmployerProvince: [],
EmployerCity: [],
EmployerCountry: [],
},
}
}
},
async onLoad({ type, id }) {
await this.init(type, id)
},
methods: {
// 页面初始化
async init(type, id) {
this.LOADING('加载数据中...')
this.id = id
this.mode = type
this.edit = ['create', 'edit'].includes(this.mode)
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('DIC_PROVINCE').then(result => {
this.dataSource.StuGraduateStatistic.EmployerProvince = result.data.map(t => ({ text: t.pname, value: t.pcode }))
}),
this.FETCH_DATASOURCE('DIC_CITY').then(result => {
this.dataSource.StuGraduateStatistic.EmployerCity = result.data.map(t => ({ text: t.cname, value: t.ccode }))
}),
this.FETCH_DATASOURCE('DIC_AREA').then(result => {
this.dataSource.StuGraduateStatistic.EmployerCountry = result.data.map(t => ({ text: t.aname, value: t.acode }))
}),
() => {}
])
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/EducationalAdministration/StuGraduateStatistic/form', this.id)
this.origin = await this.formatFormData(result)
}
this.current = this.COPY(this.origin)
},
// 点击 「编辑」、「重置」、「保存」、「删除」 按钮
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)
this.HTTP_POST('learun/adms/EducationalAdministration/StuGraduateStatistic/save', postData, '表单提交保存失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.EMIT('EducationalAdministrationStuGraduateStatistic-list-change')
this.NAV_BACK()
this.TOAST('提交保存成功')
})
break
case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) {
return
}
this.LOADING('提交删除中...')
this.HTTP_POST('learun/adms/EducationalAdministration/StuGraduateStatistic/delete', this.id, '删除失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.EMIT('EducationalAdministrationStuGraduateStatistic-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 EmployerProvinceChange(){
if (this.getValue('StuGraduateStatistic.EmployerProvince') != null && this.getValue('StuGraduateStatistic.EmployerProvince') !=undefined && this.getValue('StuGraduateStatistic.EmployerProvince') != "") {
this.FETCH_DATASOURCE('DIC_CITY').then(result => {
this.dataSource.StuGraduateStatistic.EmployerCity = result.data.filter(t=>t.cparent===this.getValue('StuGraduateStatistic.EmployerProvince') ).map(t => ({ text: t.cname, value: t.ccode }))
})
}else{
this.FETCH_DATASOURCE('DIC_CITY').then(result => {
this.dataSource.StuGraduateStatistic.EmployerCity = result.data.map(t => ({ text: t.cname, value: t.ccode }))
})
}
},
//多条件查询:市改变事件
async EmployerCityChange(){
if (this.getValue('StuGraduateStatistic.EmployerCity') != null && this.getValue('StuGraduateStatistic.EmployerCity')!=undefined && this.getValue('StuGraduateStatistic.EmployerCity')!= "") {
this.FETCH_DATASOURCE('DIC_AREA').then(result => {
this.dataSource.StuGraduateStatistic.EmployerCountry = result.data.filter(t=>t.aparent===this.getValue('StuGraduateStatistic.EmployerCity')).map(t => ({ text: t.aname, value: t.acode }))
})
}else{
this.FETCH_DATASOURCE('DIC_AREA').then(result => {
this.dataSource.StuGraduateStatistic.EmployerCountry = result.data.map(t => ({ text: t.aname, value: t.acode }))
})
}
},
}
}
</script>

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