@@ -53,7 +53,7 @@ | |||
if (param.begin && param.end) { | |||
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end }); | |||
} | |||
learun.httpget(config.webapi + 'learun/EducationalAdministration/ArrangeLessonTermAttemper/pagelist', _postParam, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/EducationalAdministration/ArrangeLessonTermAttemper/pagelist', _postParam, (data) => { | |||
$page.find('.lr-badge').text('0'); | |||
if (data) { | |||
$page.find('.lr-badge').text(data.records); |
@@ -61,7 +61,7 @@ | |||
var baseUser = JSON.parse(localStorage.userinfo); | |||
_postParam.queryJson = JSON.stringify({ userId: baseUser.baseinfo.userId }); | |||
console.log(_postParam); | |||
learun.httpget(config.webapi + 'learun/EducationalAdministration/SYS_ReceiveMessage/pagelist', _postParam, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/EducationalAdministration/SYS_ReceiveMessage/pagelist', _postParam, (data) => { | |||
$page.find('.lr-badge').text('0'); | |||
if (data) { | |||
$page.find('.lr-badge').text(data.records); | |||
@@ -91,7 +91,7 @@ | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/EducationalAdministration/SYS_ReceiveMessage/delete', item.MESSAGEID, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/EducationalAdministration/SYS_ReceiveMessage/delete', item.MESSAGEID, (data) => { | |||
if (data) {// 删除数据成功 | |||
page.grid.reload(); | |||
} | |||
@@ -53,7 +53,7 @@ | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/EducationalAdministration/SYS_ReceiveMessage/delete', keyValue, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/EducationalAdministration/SYS_ReceiveMessage/delete', keyValue, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 删除数据成功 | |||
learun.nav.closeCurrent(); | |||
@@ -80,7 +80,7 @@ | |||
_postData.keyValue = keyValue; | |||
_postData.strEntity = JSON.stringify($page.find('.lr-form-container').lrformGet()); | |||
learun.layer.loading(true, '正在提交数据'); | |||
learun.httppost(config.webapi + 'learun/EducationalAdministration/SYS_ReceiveMessage/save', _postData, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/EducationalAdministration/SYS_ReceiveMessage/save', _postData, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 表单数据保存成功 | |||
if (keyValue) { | |||
@@ -107,7 +107,7 @@ | |||
$header.find('.lr-form-header-btnlist').show(); | |||
// 获取表单数据 | |||
learun.layer.loading(true, '获取表单数据'); | |||
learun.httpget(config.webapi + 'learun/EducationalAdministration/SYS_ReceiveMessage/form', keyValue, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/EducationalAdministration/SYS_ReceiveMessage/form', keyValue, (data) => { | |||
console.log(data); | |||
console.log(data.SYS_ReceiveMessage.URL); | |||
$("#URL").attr("href", config.web + data.SYS_ReceiveMessage.URL); | |||
@@ -55,7 +55,7 @@ | |||
if (param.begin && param.end) { | |||
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end }); | |||
} | |||
learun.httpget(config.webapi + 'learun/EducationalAdministration/StuAttendanceLeave/pagelist', _postParam, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/EducationalAdministration/StuAttendanceLeave/pagelist', _postParam, (data) => { | |||
$page.find('.lr-badge').text('0'); | |||
if (data) { | |||
$page.find('.lr-badge').text(data.records); | |||
@@ -95,7 +95,7 @@ | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/EducationalAdministration/StuAttendanceLeave/delete', item.ID, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/EducationalAdministration/StuAttendanceLeave/delete', item.ID, (data) => { | |||
if (data) {// 删除数据成功 | |||
page.grid.reload(); | |||
} | |||
@@ -61,7 +61,7 @@ | |||
// learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
// if (_index === '1') { | |||
// learun.layer.loading(true, '正在删除该笔数据'); | |||
// learun.httppost(config.webapi + 'learun/EducationalAdministration/StuAttendanceLeave/delete', keyValue, (data) => { | |||
// learun.httppost(config.webapi + 'learun/adms/EducationalAdministration/StuAttendanceLeave/delete', keyValue, (data) => { | |||
// learun.layer.loading(false); | |||
// if (data) {// 删除数据成功 | |||
// learun.nav.closeCurrent(); | |||
@@ -88,7 +88,7 @@ | |||
_postData.keyValue = keyValue; | |||
_postData.strEntity = JSON.stringify($page.find('.lr-form-container').lrformGet()); | |||
learun.layer.loading(true, '正在提交数据'); | |||
learun.httppost(config.webapi + 'learun/EducationalAdministration/StuAttendanceLeave/save', _postData, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/EducationalAdministration/StuAttendanceLeave/save', _postData, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 表单数据保存成功 | |||
if (keyValue) { | |||
@@ -116,7 +116,7 @@ | |||
$header.find('.lr-form-header-btnlist').show(); | |||
// 获取表单数据 | |||
learun.layer.loading(true, '获取表单数据'); | |||
learun.httpget(config.webapi + 'learun/EducationalAdministration/StuAttendanceLeave/form', keyValue, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/EducationalAdministration/StuAttendanceLeave/form', keyValue, (data) => { | |||
if (data) { | |||
for (var id in data) { | |||
if (data[id].length) { | |||
@@ -63,7 +63,7 @@ | |||
if (param.begin && param.end) { | |||
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end }); | |||
} | |||
learun.httpget(config.webapi + 'learun/PersonnelManagement/ActivitySchedule/pagelist', _postParam, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/PersonnelManagement/ActivitySchedule/pagelist', _postParam, (data) => { | |||
$page.find('.lr-badge').text('0'); | |||
if (data) { | |||
$page.find('.lr-badge').text(data.records); | |||
@@ -93,7 +93,7 @@ | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/PersonnelManagement/ActivitySchedule/delete', item.Id , (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/PersonnelManagement/ActivitySchedule/delete', item.Id , (data) => { | |||
if (data) {// 删除数据成功 | |||
page.grid.reload(); | |||
} | |||
@@ -61,7 +61,7 @@ | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/PersonnelManagement/ActivitySchedule/delete', keyValue, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/PersonnelManagement/ActivitySchedule/delete', keyValue, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 删除数据成功 | |||
learun.nav.closeCurrent(); | |||
@@ -88,7 +88,7 @@ | |||
_postData.keyValue = keyValue; | |||
_postData.strEntity = JSON.stringify($page.find('.lr-form-container').lrformGet()); | |||
learun.layer.loading(true, '正在提交数据'); | |||
learun.httppost(config.webapi + 'learun/PersonnelManagement/ActivitySchedule/save', _postData, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/PersonnelManagement/ActivitySchedule/save', _postData, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 表单数据保存成功 | |||
if (keyValue) { | |||
@@ -115,7 +115,7 @@ | |||
$header.find('.lr-form-header-btnlist').show(); | |||
// 获取表单数据 | |||
learun.layer.loading(true, '获取表单数据'); | |||
learun.httpget(config.webapi + 'learun/PersonnelManagement/ActivitySchedule/form', keyValue, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/PersonnelManagement/ActivitySchedule/form', keyValue, (data) => { | |||
if (data) { | |||
for (var id in data) { | |||
if (data[id].length) { | |||
@@ -68,7 +68,7 @@ | |||
if (param.begin && param.end) { | |||
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end }); | |||
} | |||
learun.httpget(config.webapi + 'learun/PersonnelManagement/ClassWork/pagelist', _postParam, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/PersonnelManagement/ClassWork/pagelist', _postParam, (data) => { | |||
$page.find('.lr-badge').text('0'); | |||
if (data) { | |||
$page.find('.lr-badge').text(data.records); | |||
@@ -102,7 +102,7 @@ | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/PersonnelManagement/ClassWork/delete', item.Id , (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/PersonnelManagement/ClassWork/delete', item.Id , (data) => { | |||
if (data) {// 删除数据成功 | |||
page.grid.reload(); | |||
} | |||
@@ -61,7 +61,7 @@ | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/PersonnelManagement/ClassWork/delete', keyValue, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/PersonnelManagement/ClassWork/delete', keyValue, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 删除数据成功 | |||
learun.nav.closeCurrent(); | |||
@@ -88,7 +88,7 @@ | |||
_postData.keyValue = keyValue; | |||
_postData.strEntity = JSON.stringify($page.find('.lr-form-container').lrformGet()); | |||
learun.layer.loading(true, '正在提交数据'); | |||
learun.httppost(config.webapi + 'learun/PersonnelManagement/ClassWork/save', _postData, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/PersonnelManagement/ClassWork/save', _postData, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 表单数据保存成功 | |||
if (keyValue) { | |||
@@ -115,7 +115,7 @@ | |||
$header.find('.lr-form-header-btnlist').show(); | |||
// 获取表单数据 | |||
learun.layer.loading(true, '获取表单数据'); | |||
learun.httpget(config.webapi + 'learun/PersonnelManagement/ClassWork/form', keyValue, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/PersonnelManagement/ClassWork/form', keyValue, (data) => { | |||
if (data) { | |||
for (var id in data) { | |||
if (data[id].length) { | |||
@@ -61,7 +61,7 @@ | |||
if (param.begin && param.end) { | |||
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end }); | |||
} | |||
learun.httpget(config.webapi + 'learun/EducationalAdministration/DutySchedule/pagelist', _postParam, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/PersonnelManagement/DutySchedule/pagelist', _postParam, (data) => { | |||
$page.find('.lr-badge').text('0'); | |||
if (data) { | |||
$page.find('.lr-badge').text(data.records); |
@@ -63,7 +63,7 @@ | |||
if (param.begin && param.end) { | |||
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end }); | |||
} | |||
learun.httpget(config.webapi + 'learun/PersonnelManagement/EmpRepair/pagelist', _postParam, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/PersonnelManagement/EmpRepair/pagelist', _postParam, (data) => { | |||
$page.find('.lr-badge').text('0'); | |||
if (data) { | |||
$page.find('.lr-badge').text(data.records); | |||
@@ -95,7 +95,7 @@ | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/PersonnelManagement/EmpRepair/delete', item.Id , (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/PersonnelManagement/EmpRepair/delete', item.Id , (data) => { | |||
if (data) {// 删除数据成功 | |||
page.grid.reload(); | |||
} | |||
@@ -61,7 +61,7 @@ | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/PersonnelManagement/EmpRepair/delete', keyValue, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/PersonnelManagement/EmpRepair/delete', keyValue, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 删除数据成功 | |||
learun.nav.closeCurrent(); | |||
@@ -88,7 +88,7 @@ | |||
_postData.keyValue = keyValue; | |||
_postData.strEntity = JSON.stringify($page.find('.lr-form-container').lrformGet()); | |||
learun.layer.loading(true, '正在提交数据'); | |||
learun.httppost(config.webapi + 'learun/PersonnelManagement/EmpRepair/save', _postData, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/PersonnelManagement/EmpRepair/save', _postData, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 表单数据保存成功 | |||
if (keyValue) { | |||
@@ -115,7 +115,7 @@ | |||
$header.find('.lr-form-header-btnlist').show(); | |||
// 获取表单数据 | |||
learun.layer.loading(true, '获取表单数据'); | |||
learun.httpget(config.webapi + 'learun/PersonnelManagement/EmpRepair/form', keyValue, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/PersonnelManagement/EmpRepair/form', keyValue, (data) => { | |||
if (data) { | |||
for (var id in data) { | |||
if (data[id].length) { | |||
@@ -64,7 +64,7 @@ | |||
if (param.begin && param.end) { | |||
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end }); | |||
} | |||
learun.httpget(config.webapi + 'learun/PersonnelManagement/Schedule/pagelist', _postParam, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/PersonnelManagement/Schedule/pagelist', _postParam, (data) => { | |||
$page.find('.lr-badge').text('0'); | |||
if (data) { | |||
$page.find('.lr-badge').text(data.records); | |||
@@ -98,7 +98,7 @@ | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/PersonnelManagement/Schedule/delete', item.F_ScheduleId, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/PersonnelManagement/Schedule/delete', item.F_ScheduleId, (data) => { | |||
if (data) {// 删除数据成功 | |||
page.grid.reload(); | |||
} | |||
@@ -61,7 +61,7 @@ | |||
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { | |||
if (_index === '1') { | |||
learun.layer.loading(true, '正在删除该笔数据'); | |||
learun.httppost(config.webapi + 'learun/PersonnelManagement/Schedule/delete', keyValue, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/PersonnelManagement/Schedule/delete', keyValue, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 删除数据成功 | |||
learun.nav.closeCurrent(); | |||
@@ -88,7 +88,7 @@ | |||
_postData.keyValue = keyValue; | |||
_postData.strEntity = JSON.stringify($page.find('.lr-form-container').lrformGet()); | |||
learun.layer.loading(true, '正在提交数据'); | |||
learun.httppost(config.webapi + 'learun/PersonnelManagement/Schedule/save', _postData, (data) => { | |||
learun.httppost(config.webapi + 'learun/adms/PersonnelManagement/Schedule/save', _postData, (data) => { | |||
learun.layer.loading(false); | |||
if (data) {// 表单数据保存成功 | |||
if (keyValue) { | |||
@@ -115,7 +115,7 @@ | |||
$header.find('.lr-form-header-btnlist').show(); | |||
// 获取表单数据 | |||
learun.layer.loading(true, '获取表单数据'); | |||
learun.httpget(config.webapi + 'learun/PersonnelManagement/Schedule/form', keyValue, (data) => { | |||
learun.httpget(config.webapi + 'learun/adms/PersonnelManagement/Schedule/form', keyValue, (data) => { | |||
if (data) { | |||
for (var id in data) { | |||
if (data[id].length) { | |||
@@ -209,7 +209,7 @@ | |||
<Compile Include="Modules\StatisticsApi.cs" /> | |||
<Compile Include="Modules\TaiGang\TUserApi.cs" /> | |||
<Compile Include="Modules\TeacherWorkloadApi.cs" /> | |||
<Compile Include="Modules\DutyScheduleApi.cs" /> | |||
<Compile Include="Modules\PersonnelManagement\DutyScheduleApi.cs" /> | |||
<Compile Include="Modules\PersonnelManagement\ScheduleApi.cs" /> | |||
<Compile Include="Modules\StuMailApi.cs" /> | |||
<Compile Include="Modules\EmpInfoApi.cs" /> | |||
@@ -20,7 +20,7 @@ namespace Learun.Application.WebApi.Modules | |||
/// 注册接口 | |||
/// <summary> | |||
public ArrangeLessonTermAttemperApi() | |||
: base("/Learun/EducationalAdministration/ArrangeLessonTermAttemper") | |||
: base("/Learun/adms/EducationalAdministration/ArrangeLessonTermAttemper") | |||
{ | |||
Get["/pagelist"] = GetPageList; | |||
} | |||
@@ -19,7 +19,7 @@ namespace Learun.Application.WebApi | |||
/// 注册接口 | |||
/// <summary> | |||
public ActivityScheduleApi() | |||
: base("/Learun/PersonnelManagement/ActivitySchedule") | |||
: base("/Learun/adms/PersonnelManagement/ActivitySchedule") | |||
{ | |||
Get["/pagelist"] = GetPageList; | |||
Get["/list"] = GetList; | |||
@@ -21,7 +21,7 @@ namespace Learun.Application.WebApi | |||
/// 注册接口 | |||
/// <summary> | |||
public ClassWorkApi() | |||
: base("/Learun/PersonnelManagement/ClassWork") | |||
: base("/Learun/adms/PersonnelManagement/ClassWork") | |||
{ | |||
Get["/pagelist"] = GetPageList; | |||
Get["/list"] = GetList; | |||
@@ -21,7 +21,7 @@ namespace Learun.Application.WebApi.Modules | |||
/// 注册接口 | |||
/// <summary> | |||
public DutyScheduleApi() | |||
: base("/Learun/EducationalAdministration/DutySchedule") | |||
: base("/Learun/adms/PersonnelManagement/DutySchedule") | |||
{ | |||
Get["/pagelist"] = GetPageList; | |||
} |
@@ -21,7 +21,7 @@ namespace Learun.Application.WebApi | |||
/// 注册接口 | |||
/// <summary> | |||
public EmpRepairApi() | |||
: base("/Learun/PersonnelManagement/EmpRepair") | |||
: base("/Learun/adms/PersonnelManagement/EmpRepair") | |||
{ | |||
Get["/pagelist"] = GetPageList; | |||
Get["/list"] = GetList; | |||
@@ -22,7 +22,7 @@ namespace Learun.Application.WebApi | |||
/// 注册接口 | |||
/// <summary> | |||
public ScheduleApi() | |||
: base("/Learun/PersonnelManagement/Schedule") | |||
: base("/Learun/adms/PersonnelManagement/Schedule") | |||
{ | |||
Get["/pagelist"] = GetPageList; | |||
Get["/list"] = GetList; | |||
@@ -19,7 +19,7 @@ namespace Learun.Application.WebApi | |||
/// 注册接口 | |||
/// <summary> | |||
public SYS_ReceiveMessageApi() | |||
: base("/Learun/EducationalAdministration/SYS_ReceiveMessage") | |||
: base("/Learun/adms/EducationalAdministration/SYS_ReceiveMessage") | |||
{ | |||
Get["/pagelist"] = GetPageList; | |||
Get["/list"] = GetList; | |||
@@ -23,7 +23,7 @@ namespace Learun.Application.WebApi | |||
/// 注册接口 | |||
/// <summary> | |||
public StuAttendanceLeaveApi() | |||
: base("/Learun/EducationalAdministration/StuAttendanceLeave") | |||
: base("/Learun/adms/EducationalAdministration/StuAttendanceLeave") | |||
{ | |||
Get["/pagelist"] = GetPageList; | |||
Get["/list"] = GetList; | |||
@@ -52,7 +52,7 @@ export default { | |||
autoHeight: {}, | |||
simpleMode: {}, | |||
required: {}, | |||
title: {} | |||
title: {}, | |||
}, | |||
data() { | |||
@@ -157,7 +157,30 @@ | |||
{ "path": "pages/EducationalAdministration/Sys_ReceiveFile/list", "style": { "navigationBarTitleText": "公文查看" } }, | |||
{ "path": "pages/EducationalAdministration/Sys_ReceiveFile/single", "style": { "navigationBarTitleText": "公文详情" } }, | |||
//教师个人信息 | |||
{ "path": "pages/EducationalAdministration/EmpInfo/list", "style": { "navigationBarTitleText": "个人信息" } } | |||
{ "path": "pages/EducationalAdministration/EmpInfo/list", "style": { "navigationBarTitleText": "个人信息" } }, | |||
//收件箱 | |||
{ "path": "pages/EducationalAdministration/SYS_ReceiveMessage/list", "style": { "navigationBarTitleText": "收件箱" } }, | |||
{ "path": "pages/EducationalAdministration/SYS_ReceiveMessage/single", "style": { "navigationBarTitleText": "邮件详情" } }, | |||
//活动安排 | |||
{ "path": "pages/PersonnelManagement/ActivitySchedule/list", "style": { "navigationBarTitleText": "活动安排" } }, | |||
{ "path": "pages/PersonnelManagement/ActivitySchedule/single", "style": { "navigationBarTitleText": "活动详情" } }, | |||
//班级活动记事 | |||
{ "path": "pages/PersonnelManagement/ClassWork/list", "style": { "navigationBarTitleText": "班级工作记事" } }, | |||
{ "path": "pages/PersonnelManagement/ClassWork/single", "style": { "navigationBarTitleText": "详情" } }, | |||
//值班安排 | |||
{ "path": "pages/PersonnelManagement/DutySchedule/list", "style": { "navigationBarTitleText": "值班安排" } }, | |||
{ "path": "pages/PersonnelManagement/DutySchedule/single", "style": { "navigationBarTitleText": "详情" } }, | |||
//掌上报修 | |||
{ "path": "pages/PersonnelManagement/EmpRepair/list", "style": { "navigationBarTitleText": "掌上报修" } }, | |||
{ "path": "pages/PersonnelManagement/EmpRepair/single", "style": { "navigationBarTitleText": "详情" } }, | |||
//日程安排 | |||
{ "path": "pages/PersonnelManagement/Schedule/list", "style": { "navigationBarTitleText": "日程安排" } }, | |||
{ "path": "pages/PersonnelManagement/Schedule/single", "style": { "navigationBarTitleText": "详情" } }, | |||
//调度信息 | |||
{ "path": "pages/EducationalAdministration/ArrangeLessonTermAttemper/list", "style": { "navigationBarTitleText": "调度信息" } }, | |||
//请假管理 | |||
{ "path": "pages/EducationalAdministration/StuAttendanceLeave/list", "style": { "navigationBarTitleText": "请假管理" } }, | |||
{ "path": "pages/EducationalAdministration/StuAttendanceLeave/single", "style": { "navigationBarTitleText": "审核" } } | |||
], | |||
@@ -0,0 +1,475 @@ | |||
<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, 'AttemperType') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">调度时限:</text> | |||
{{ displayListItem(item, 'AttemperTimeType') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">调度时间:</text> | |||
{{ showField(item, 'AttemperStartTime') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">学年学期:</text> | |||
{{ showField(item, 'AcademicYearNo') }} | |||
</view> | |||
<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, 'LessonNo') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">班级信息:</text> | |||
{{ displayListItem(item, 'TeachClassNo') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">教师:</text> | |||
{{ displayListItem(item, 'EmpNo') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">教室:</text> | |||
{{ displayListItem(item, 'ClassroomNo') }} | |||
</view> | |||
<view v-show="item.AttemperType!= '02'"> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">新系部:</text> | |||
{{ displayListItem(item, 'NewDeptNo') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">新专业:</text> | |||
{{ displayListItem(item, 'NewMajorNo') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">新课程:</text> | |||
{{ displayListItem(item, 'NewLessonNo') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">新班级:</text> | |||
{{ displayListItem(item, 'NewTeachClassNo') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">新教师:</text> | |||
{{ displayListItem(item, 'NewEmpNo') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">新教室:</text> | |||
{{ displayListItem(item, 'NewClassroomNo') }} | |||
</view> | |||
</view> | |||
</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.AttemperType" | |||
@change="searchChange" | |||
:range="dataSource.AttemperType" | |||
title ="调度类型" | |||
placeholder="按调度类型查询" | |||
/> | |||
<l-input | |||
v-model="queryData.AcademicYearNo" | |||
@change="searchChange" | |||
title ="学年学期" | |||
placeholder="按学年学期查询" | |||
/> | |||
<l-select | |||
v-model="queryData.DeptNo" | |||
@change="searchChange" | |||
:range="dataSource.DeptNo" | |||
title ="系部" | |||
placeholder="按系部查询" | |||
/> | |||
<l-select | |||
v-model="queryData.MajorNo" | |||
@change="searchChange" | |||
:range="dataSource.MajorNo" | |||
title ="专业" | |||
placeholder="按专业查询" | |||
/> | |||
<l-select | |||
v-model="queryData.LessonNo" | |||
@change="searchChange" | |||
:range="dataSource.LessonNo" | |||
title ="课程" | |||
placeholder="按课程查询" | |||
/> | |||
<l-select | |||
v-model="queryData.TeachClassNo" | |||
@change="searchChange" | |||
:range="dataSource.TeachClassNo" | |||
title ="班级信息" | |||
placeholder="按班级信息查询" | |||
/> | |||
<l-select | |||
v-model="queryData.EmpNo" | |||
@change="searchChange" | |||
:range="dataSource.EmpNo" | |||
title ="教师" | |||
placeholder="按教师查询" | |||
/> | |||
<!-- 重置查询条件按钮 --> | |||
<view class="padding-tb"> | |||
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button> | |||
</view> | |||
</view> | |||
</scroll-view> | |||
</view> | |||
</template> | |||
<script> | |||
/* | |||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-20 14:32 | |||
* 描 述:调度信息 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/EducationalAdministration/ArrangeLessonTermAttemper/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: { | |||
AttemperType: { type: 'select', itemCode: 'AttemperType', dataSource: '0' }, | |||
AttemperTimeType: { type: 'select', itemCode: 'AttemperTimeType', dataSource: '0' }, | |||
AttemperStartTime: { type: 'text' }, | |||
AcademicYearNo: { type: 'text' }, | |||
DeptNo: { type: 'select', dataSource: '1', dataSourceId: 'CdDeptInfo,deptname,deptno' }, | |||
MajorNo: { type: 'select', dataSource: '1', dataSourceId: 'CdMajorInfo,majorname,majorno' }, | |||
LessonNo: { type: 'select', dataSource: '1', dataSourceId: 'LessonInfo,lessonname,lessonno' }, | |||
TeachClassNo: { type: 'select', dataSource: '1', dataSourceId: 'bjsj,classname,classno' }, | |||
EmpNo: { type: 'select', dataSource: '1', dataSourceId: 'EmpInfo,empname,empno' }, | |||
ClassroomNo: { type: 'select', dataSource: '1', dataSourceId: 'ClassRoomInfo,classroomname,classroomno' }, | |||
NewDeptNo: { type: 'select', dataSource: '1', dataSourceId: 'CdDeptInfo,deptname,deptno' }, | |||
NewMajorNo: { type: 'select', dataSource: '1', dataSourceId: 'CdMajorInfo,majorname,majorno' }, | |||
NewLessonNo: { type: 'select', dataSource: '1', dataSourceId: 'LessonInfo,lessonname,lessonno' }, | |||
NewTeachClassNo: { type: 'select', dataSource: '1', dataSourceId: 'bjsj,classname,classno' }, | |||
NewEmpNo: { type: 'select', dataSource: '1', dataSourceId: 'EmpInfo,empname,empno' }, | |||
NewClassroomNo: { type: 'select', dataSource: '1', dataSourceId: 'ClassRoomInfo,classroomname,classroomno' }, | |||
}, | |||
// 查询条件 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: { | |||
AttemperType: '', | |||
AcademicYearNo: '', | |||
DeptNo: '', | |||
MajorNo: '', | |||
LessonNo: '', | |||
TeachClassNo: '', | |||
EmpNo: '', | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
AttemperType: Object.values(this.GET_GLOBAL('dataDictionary').AttemperType).map(t => ({ value: t.value, text: t.text })), | |||
AttemperTimeType: Object.values(this.GET_GLOBAL('dataDictionary').AttemperTimeType).map(t => ({ value: t.value, text: t.text })), | |||
DeptNo: [], | |||
MajorNo: [], | |||
LessonNo: [], | |||
TeachClassNo: [], | |||
EmpNo: [], | |||
ClassroomNo: [], | |||
NewDeptNo: [], | |||
NewMajorNo: [], | |||
NewLessonNo: [], | |||
NewTeachClassNo: [], | |||
NewEmpNo: [], | |||
NewClassroomNo: [], | |||
}, | |||
// 时间查询参数 | |||
dateRange: null, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中...', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad() { | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('EducationalAdministrationArrangeLessonTermAttemper-list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
this.ON('EducationalAdministrationArrangeLessonTermAttemper-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('LessonInfo').then(result => { | |||
this.dataSource.LessonNo = result.data.map(t => ({ text: t.lessonname, value: t.lessonno })) | |||
}), | |||
this.FETCH_DATASOURCE('bjsj').then(result => { | |||
this.dataSource.TeachClassNo = result.data.map(t => ({ text: t.classname, value: t.classno })) | |||
}), | |||
this.FETCH_DATASOURCE('EmpInfo').then(result => { | |||
this.dataSource.EmpNo = result.data.map(t => ({ text: t.empname, value: t.empno })) | |||
}), | |||
this.FETCH_DATASOURCE('ClassRoomInfo').then(result => { | |||
this.dataSource.ClassroomNo = result.data.map(t => ({ text: t.classroomname, value: t.classroomno })) | |||
}), | |||
this.FETCH_DATASOURCE('CdDeptInfo').then(result => { | |||
this.dataSource.NewDeptNo = result.data.map(t => ({ text: t.deptname, value: t.deptno })) | |||
}), | |||
this.FETCH_DATASOURCE('CdMajorInfo').then(result => { | |||
this.dataSource.NewMajorNo = result.data.map(t => ({ text: t.majorname, value: t.majorno })) | |||
}), | |||
this.FETCH_DATASOURCE('LessonInfo').then(result => { | |||
this.dataSource.NewLessonNo = result.data.map(t => ({ text: t.lessonname, value: t.lessonno })) | |||
}), | |||
this.FETCH_DATASOURCE('bjsj').then(result => { | |||
this.dataSource.NewTeachClassNo = result.data.map(t => ({ text: t.classname, value: t.classno })) | |||
}), | |||
this.FETCH_DATASOURCE('EmpInfo').then(result => { | |||
this.dataSource.NewEmpNo = result.data.map(t => ({ text: t.empname, value: t.empno })) | |||
}), | |||
this.FETCH_DATASOURCE('ClassRoomInfo').then(result => { | |||
this.dataSource.NewClassroomNo = result.data.map(t => ({ text: t.classroomname, value: t.classroomno })) | |||
}), | |||
() => {} | |||
]) | |||
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( | |||
'/EducationalAdministration/ArrangeLessonTermAttemper/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 = {} | |||
// 时间查询相关参数 | |||
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('/EducationalAdministration/ArrangeLessonTermAttemper/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 | |||
} | |||
}, | |||
showField(item,field){ | |||
switch(field){ | |||
case 'AttemperStartTime': | |||
return (item.AttemperStartTime == null ? "-" : item.AttemperStartTime) + "到" + (item.AttemperEndTime == null ? "-" : item.AttemperEndTime) | |||
case 'AcademicYearNo': | |||
return item.AcademicYearNo + "学年第" + item.Semester + "学期" | |||
} | |||
} | |||
} | |||
} | |||
</script> | |||
<style lang="less" scoped> | |||
@import '~@/common/css/sidepage.less'; | |||
@import '~@/common/css/customlist.less'; | |||
</style> |
@@ -25,8 +25,8 @@ | |||
@input="setValue('EmpInfo.Photo', $event)" | |||
:value="getValue('EmpInfo.Photo')" | |||
:readonly="!edit" | |||
:number="9" | |||
title="附件上传" | |||
:number="1" | |||
title="照片上传" | |||
/> | |||
<l-input | |||
@input="setValue('EmpInfo.mobile', $event)" | |||
@@ -79,16 +79,6 @@ | |||
> | |||
取消编辑 </l-button | |||
> | |||
<l-button | |||
v-if="!edit && mode !== 'create'" | |||
@click="action('delete')" | |||
size="lg" | |||
line="red" | |||
class="block margin-top" | |||
block | |||
> | |||
删除 </l-button | |||
> | |||
</view | |||
> | |||
</view | |||
@@ -147,11 +137,11 @@ export default { | |||
}, | |||
async onLoad({ type, id }) { | |||
let userInfo = this.GET_GLOBAL("loginUser"); | |||
if(userInfo.Description=="学生"){ | |||
if(userInfo.Description!="教师"){ | |||
this.TOAST('请使用教师账号登录!'); | |||
return; | |||
} | |||
await this.init("edit", userInfo.account); | |||
await this.init("", userInfo.account); | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
@@ -170,9 +160,11 @@ export default { | |||
this.origin = await this.getDefaultForm(); | |||
} else { | |||
const result = await this.HTTP_GET( | |||
"/EducationalAdministration/EmpRegister/form", | |||
"/EducationalAdministration/EmpRegister/formForNo", | |||
this.id | |||
); | |||
this.id=result.EmpInfo.EmpId; | |||
console.log(result); | |||
this.origin = await this.formatFormData(result); | |||
} | |||
this.current = this.COPY(this.origin); | |||
@@ -0,0 +1,305 @@ | |||
<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.MESSAGEID"> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">发件人:</text> | |||
{{ displayListItem(item, 'SENDER') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">主题:</text> | |||
{{ displayListItem(item, 'TITLE') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">状态:</text> | |||
{{ showStatus(item) }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">收件时间:</text> | |||
{{ displayListItem(item, 'SENDTIME') }} | |||
</view> | |||
<l-customlist-action @view="action('view', item.MESSAGEID)" /> | |||
</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.SENDER" | |||
@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-19 17:58 | |||
* 描 述:收件箱 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/EducationalAdministration/SYS_ReceiveMessage/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: { | |||
SENDER: { type: 'text' }, | |||
TITLE: { type: 'text' }, | |||
READFLAG: { type: 'select', dataSource: '0' }, | |||
SENDTIME: { type: 'datetime', dateformat: '0' }, | |||
URL: { type: 'upload' }, | |||
CONTENTS: { type: 'textarea' }, | |||
}, | |||
// 查询条件 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: { | |||
SENDER: '', | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
READFLAG: [], | |||
}, | |||
// 时间查询参数 | |||
dateRange: null, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中...', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad() { | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('EducationalAdministrationSYS_ReceiveMessage-list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
this.ON('EducationalAdministrationSYS_ReceiveMessage-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 } | |||
this.searchData.userId=this.GET_GLOBAL('loginUser').userId; | |||
const result = await this.HTTP_GET( | |||
'/EducationalAdministration/SYS_ReceiveMessage/pagelist', | |||
{ | |||
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序) | |||
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序 | |||
pagination: { rows: 10, page: this.page, sidx: 'MESSAGEID', 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('/EducationalAdministration/SYS_ReceiveMessage/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 | |||
} | |||
}, | |||
showStatus(item){ | |||
return item.READFLAG==1?'已读':'未读'; | |||
} | |||
} | |||
} | |||
</script> | |||
<style lang="less" scoped> | |||
@import '~@/common/css/sidepage.less'; | |||
@import '~@/common/css/customlist.less'; | |||
</style> |
@@ -0,0 +1,216 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<l-input | |||
@input="setValue('SYS_ReceiveMessage.SENDER', $event)" | |||
:value="getValue('SYS_ReceiveMessage.SENDER')" | |||
:disabled="!edit" | |||
title="发件人" | |||
/> | |||
<l-input | |||
@input="setValue('SYS_ReceiveMessage.TITLE', $event)" | |||
:value="getValue('SYS_ReceiveMessage.TITLE')" | |||
:disabled="!edit" | |||
title="主题" | |||
/> | |||
<l-select | |||
@input="setValue('SYS_ReceiveMessage.READFLAG', $event)" | |||
:value="getValue('SYS_ReceiveMessage.READFLAG')" | |||
:disabled="!edit" | |||
:range="dataSource.SYS_ReceiveMessage.READFLAG" | |||
title="状态" | |||
/> | |||
<l-date-picker | |||
@input="setValue('SYS_ReceiveMessage.SENDTIME', $event)" | |||
:value="getValue('SYS_ReceiveMessage.SENDTIME')" | |||
:disabled="!edit" | |||
title="收件时间" | |||
/> | |||
<l-upload-file | |||
@input="setValue('SYS_ReceiveMessage.URL', $event)" | |||
:value="getValue('SYS_ReceiveMessage.URL')" | |||
:readonly="!edit" | |||
:number="9" | |||
title="附件上传" | |||
/> | |||
<l-textarea | |||
@input="setValue('SYS_ReceiveMessage.CONTENTS', $event)" | |||
:value="getValue('SYS_ReceiveMessage.CONTENTS')" | |||
:readonly="!edit" | |||
title="邮件内容" | |||
/> | |||
</view> | |||
</view> | |||
</template> | |||
<script> | |||
/* | |||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-19 17:58 | |||
* 描 述:收件箱 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/EducationalAdministration/SYS_ReceiveMessage/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: { | |||
SYS_ReceiveMessage: { | |||
SENDER: { type: 'text', title: '发件人' }, | |||
TITLE: { type: 'text', title: '主题' }, | |||
READFLAG: { type: 'select', title: '状态', dataSource: '0' }, | |||
SENDTIME: { type: 'datetime', title: '收件时间', dateformat: '0' }, | |||
URL: { type: 'upload', title: '附件上传' }, | |||
CONTENTS: { type: 'textarea', title: '邮件内容' }, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
SYS_ReceiveMessage: { | |||
READFLAG: [], | |||
}, | |||
} | |||
} | |||
}, | |||
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([ | |||
() => {} | |||
]) | |||
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('/EducationalAdministration/SYS_ReceiveMessage/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('/EducationalAdministration/SYS_ReceiveMessage/save', postData, '表单提交保存失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministrationSYS_ReceiveMessage-list-change') | |||
this.NAV_BACK() | |||
this.TOAST('提交保存成功') | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('/EducationalAdministration/SYS_ReceiveMessage/delete', this.id, '删除失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministrationSYS_ReceiveMessage-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) | |||
} | |||
} | |||
} | |||
</script> |
@@ -0,0 +1,322 @@ | |||
<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, 'AcademicYearNo') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">学期:</text> | |||
{{ displayListItem(item, 'Semester') }} | |||
</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, 'StuName') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">年级:</text> | |||
{{ displayListItem(item, 'Grade') }} | |||
</view> | |||
<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, 'DeptName') }} | |||
</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, 'MajorName') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">所在行政班号:</text> | |||
{{ displayListItem(item, 'ClassNo') }} | |||
</view> | |||
<l-customlist-action showButton buttonText="审核" @join="action('check',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-input | |||
v-model="queryData.StuNo" | |||
@change="searchChange" | |||
title ="学号" | |||
placeholder="按学号查询" | |||
/> | |||
<l-input | |||
v-model="queryData.StuName" | |||
@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 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' | |||
export default { | |||
data() { | |||
return { | |||
// 数据项的数据类型、结构 | |||
scheme: { | |||
AcademicYearNo: { type: 'text' }, | |||
Semester: { type: 'text' }, | |||
StuNo: { type: 'text' }, | |||
StuName: { type: 'text' }, | |||
Grade: { type: 'text' }, | |||
DeptNo: { type: 'text' }, | |||
DeptName: { type: 'text' }, | |||
MajorNo: { type: 'text' }, | |||
MajorName: { type: 'text' }, | |||
ClassNo: { type: 'text' }, | |||
}, | |||
// 查询条件 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: { | |||
StuNo: '', | |||
StuName: '', | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
}, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中...', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad() { | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('EducationalAdministrationStuAttendanceLeave-list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
this.ON('EducationalAdministrationStuAttendanceLeave-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( | |||
'/EducationalAdministration/StuAttendanceLeave/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('/EducationalAdministration/StuAttendanceLeave/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> |
@@ -0,0 +1,350 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.AcademicYearNo', $event)" | |||
:value="getValue('StuAttendanceLeave.AcademicYearNo')" | |||
:disabled="!edit" | |||
title="学年度" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.Semester', $event)" | |||
:value="getValue('StuAttendanceLeave.Semester')" | |||
:disabled="!edit" | |||
title="学期" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.StuNo', $event)" | |||
:value="getValue('StuAttendanceLeave.StuNo')" | |||
:disabled="!edit" | |||
title="学号" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.StuName', $event)" | |||
:value="getValue('StuAttendanceLeave.StuName')" | |||
:disabled="!edit" | |||
title="姓名" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.Grade', $event)" | |||
:value="getValue('StuAttendanceLeave.Grade')" | |||
:disabled="!edit" | |||
title="年级" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.EmpNo', $event)" | |||
:value="getValue('StuAttendanceLeave.EmpNo')" | |||
:disabled="!edit" | |||
title="教师号" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.DeptNo', $event)" | |||
:value="getValue('StuAttendanceLeave.DeptNo')" | |||
:disabled="!edit" | |||
title="系所码" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.DeptName', $event)" | |||
:value="getValue('StuAttendanceLeave.DeptName')" | |||
:disabled="!edit" | |||
title="系名" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.MajorNo', $event)" | |||
:value="getValue('StuAttendanceLeave.MajorNo')" | |||
:disabled="!edit" | |||
title="专业码" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.MajorName', $event)" | |||
:value="getValue('StuAttendanceLeave.MajorName')" | |||
:disabled="!edit" | |||
title="专业名" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.ClassNo', $event)" | |||
:value="getValue('StuAttendanceLeave.ClassNo')" | |||
:disabled="!edit" | |||
title="所在行政班号" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.ClassName', $event)" | |||
:value="getValue('StuAttendanceLeave.ClassName')" | |||
:disabled="!edit" | |||
title="班级名称" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.LessonNo', $event)" | |||
:value="getValue('StuAttendanceLeave.LessonNo')" | |||
:disabled="!edit" | |||
title="课程号" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.LessonName', $event)" | |||
:value="getValue('StuAttendanceLeave.LessonName')" | |||
:disabled="!edit" | |||
title="课程名称" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.LessonSortNo', $event)" | |||
:value="getValue('StuAttendanceLeave.LessonSortNo')" | |||
:disabled="!edit" | |||
title="课程类别码" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.LessonSortName', $event)" | |||
:value="getValue('StuAttendanceLeave.LessonSortName')" | |||
:disabled="!edit" | |||
title="课程类别" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.LessonDate', $event)" | |||
:value="getValue('StuAttendanceLeave.LessonDate')" | |||
:disabled="!edit" | |||
title="原上课日期" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.LessonTime', $event)" | |||
:value="getValue('StuAttendanceLeave.LessonTime')" | |||
:disabled="!edit" | |||
title="上课时间" | |||
/> | |||
<l-input | |||
@input="setValue('StuAttendanceLeave.PlanWeek', $event)" | |||
:value="getValue('StuAttendanceLeave.PlanWeek')" | |||
:disabled="!edit" | |||
title="教学周次" | |||
/> | |||
<l-select | |||
@input="setValue('StuAttendanceLeave.LeaveType', $event)" | |||
:value="getValue('StuAttendanceLeave.LeaveType')" | |||
:disabled="!edit" | |||
:range="dataSource.StuAttendanceLeave.LeaveType" | |||
title="请假类型" | |||
/> | |||
<l-textarea | |||
@input="setValue('StuAttendanceLeave.Remark', $event)" | |||
:value="getValue('StuAttendanceLeave.Remark')" | |||
:readonly="!edit" | |||
title="备注" | |||
/> | |||
<l-select | |||
@input="setValue('StuAttendanceLeave.IsCheck', $event)" | |||
:value="getValue('StuAttendanceLeave.IsCheck')" | |||
:disabled="!edit" | |||
:range="dataSource.StuAttendanceLeave.IsCheck" | |||
title="下拉框" | |||
/> | |||
<l-textarea | |||
@input="setValue('StuAttendanceLeave.TecRemark', $event)" | |||
:value="getValue('StuAttendanceLeave.TecRemark')" | |||
:readonly="!edit" | |||
title="备注" | |||
/> | |||
</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('edit')" size="lg" line="orange" 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> | |||
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" 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 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-20 15:34 | |||
* 描 述:aaa | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/EducationalAdministration/StuAttendanceLeave/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: { | |||
StuAttendanceLeave: { | |||
AcademicYearNo: { type: 'text', title: '学年度' }, | |||
Semester: { type: 'text', title: '学期' }, | |||
StuNo: { type: 'text', title: '学号' }, | |||
StuName: { type: 'text', title: '姓名' }, | |||
Grade: { type: 'text', title: '年级' }, | |||
EmpNo: { type: 'text', title: '教师号' }, | |||
DeptNo: { type: 'text', title: '系所码' }, | |||
DeptName: { type: 'text', title: '系名' }, | |||
MajorNo: { type: 'text', title: '专业码' }, | |||
MajorName: { type: 'text', title: '专业名' }, | |||
ClassNo: { type: 'text', title: '所在行政班号' }, | |||
ClassName: { type: 'text', title: '班级名称' }, | |||
LessonNo: { type: 'text', title: '课程号' }, | |||
LessonName: { type: 'text', title: '课程名称' }, | |||
LessonSortNo: { type: 'text', title: '课程类别码' }, | |||
LessonSortName: { type: 'text', title: '课程类别' }, | |||
LessonDate: { type: 'text', title: '原上课日期' }, | |||
LessonTime: { type: 'text', title: '上课时间' }, | |||
PlanWeek: { type: 'text', title: '教学周次' }, | |||
LeaveType: { type: 'select', title: '请假类型', itemCode: 'LeaveType', dataSource: '0' }, | |||
Remark: { type: 'textarea', title: '备注' }, | |||
IsCheck: { type: 'select', title: '下拉框', itemCode: 'LeaveCheck', dataSource: '0' }, | |||
TecRemark: { type: 'textarea', title: '备注' }, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
StuAttendanceLeave: { | |||
LeaveType: Object.values(this.GET_GLOBAL('dataDictionary').LeaveType).map(t => ({ value: t.value, text: t.text })), | |||
IsCheck: Object.values(this.GET_GLOBAL('dataDictionary').LeaveCheck).map(t => ({ value: t.value, text: t.text })), | |||
}, | |||
} | |||
} | |||
}, | |||
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([ | |||
() => {} | |||
]) | |||
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('/EducationalAdministration/StuAttendanceLeave/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('/EducationalAdministration/StuAttendanceLeave/save', postData, '表单提交保存失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministrationStuAttendanceLeave-list-change') | |||
this.NAV_BACK() | |||
this.TOAST('提交保存成功') | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('/EducationalAdministration/StuAttendanceLeave/delete', this.id, '删除失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministrationStuAttendanceLeave-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) | |||
} | |||
} | |||
} | |||
</script> |
@@ -0,0 +1,303 @@ | |||
<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') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">地点:</text> | |||
{{ displayListItem(item, 'Address') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">主题:</text> | |||
{{ displayListItem(item, 'Title') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">内容:</text> | |||
{{ displayListItem(item, 'Content') }} | |||
</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.Title" | |||
@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:25 | |||
* 描 述:活动安排 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/PersonnelManagement/ActivitySchedule/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' }, | |||
Address: { type: 'text' }, | |||
Title: { type: 'text' }, | |||
Content: { type: 'textarea' }, | |||
Remark: { type: 'textarea' }, | |||
}, | |||
// 查询条件 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: { | |||
Title: '', | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
}, | |||
// 时间查询参数 | |||
dateRange: null, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中...', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad() { | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('PersonnelManagementActivitySchedule-list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
this.ON('PersonnelManagementActivitySchedule-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( | |||
'/PersonnelManagement/ActivitySchedule/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 = {} | |||
// 时间查询相关参数 | |||
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('/PersonnelManagement/ActivitySchedule/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> |
@@ -0,0 +1,220 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<l-date-picker | |||
@input="setValue('ActivitySchedule.Date', $event)" | |||
:value="getValue('ActivitySchedule.Date')" | |||
:disabled="!edit" | |||
title="时间" | |||
/> | |||
<l-input | |||
@input="setValue('ActivitySchedule.Address', $event)" | |||
:value="getValue('ActivitySchedule.Address')" | |||
:disabled="!edit" | |||
title="地点" | |||
/> | |||
<l-input | |||
@input="setValue('ActivitySchedule.Title', $event)" | |||
:value="getValue('ActivitySchedule.Title')" | |||
:disabled="!edit" | |||
title="主题" | |||
/> | |||
<l-textarea | |||
@input="setValue('ActivitySchedule.Content', $event)" | |||
:value="getValue('ActivitySchedule.Content')" | |||
:readonly="!edit" | |||
title="内容" | |||
/> | |||
<l-textarea | |||
@input="setValue('ActivitySchedule.Remark', $event)" | |||
:value="getValue('ActivitySchedule.Remark')" | |||
:readonly="!edit" | |||
title="备注" | |||
/> | |||
</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('edit')" size="lg" line="orange" 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> | |||
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" 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 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-20 09:25 | |||
* 描 述:活动安排 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/PersonnelManagement/ActivitySchedule/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: { | |||
ActivitySchedule: { | |||
Date: { type: 'datetime', title: '时间', dateformat: '0' }, | |||
Address: { type: 'text', title: '地点' }, | |||
Title: { type: 'text', title: '主题' }, | |||
Content: { type: 'textarea', title: '内容' }, | |||
Remark: { type: 'textarea', title: '备注' }, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
ActivitySchedule: { | |||
}, | |||
} | |||
} | |||
}, | |||
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([ | |||
() => {} | |||
]) | |||
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('/PersonnelManagement/ActivitySchedule/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('/PersonnelManagement/ActivitySchedule/save', postData, '表单提交保存失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('PersonnelManagementActivitySchedule-list-change') | |||
this.NAV_BACK() | |||
this.TOAST('提交保存成功') | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('/PersonnelManagement/ActivitySchedule/delete', this.id, '删除失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('PersonnelManagementActivitySchedule-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) | |||
} | |||
} | |||
} | |||
</script> |
@@ -0,0 +1,302 @@ | |||
<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, 'ClassNo') }} | |||
</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, 'Title') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">工作内容:</text> | |||
{{ displayListItem(item, 'Content') }} | |||
</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.ClassNo" | |||
@change="searchChange" | |||
:range="dataSource.ClassNo" | |||
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:37 | |||
* 描 述:班级工作记事 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/PersonnelManagement/ClassWork/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: { | |||
ClassNo: { type: 'select', dataSource: '1', dataSourceId: 'bjsj,classname,classno' }, | |||
Date: { type: 'datetime', dateformat: '0' }, | |||
Title: { type: 'text' }, | |||
Content: { type: 'textarea' }, | |||
}, | |||
// 查询条件 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: { | |||
ClassNo: '', | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
ClassNo: [], | |||
}, | |||
// 时间查询参数 | |||
dateRange: null, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中...', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad() { | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('PersonnelManagementClassWork-list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
this.ON('PersonnelManagementClassWork-list-change', this.refreshList) | |||
// 拉取加载列表和数据源 | |||
await Promise.all([ | |||
this.FETCH_DATASOURCE('bjsj').then(result => { | |||
this.dataSource.ClassNo = result.data.map(t => ({ text: t.classname, value: t.classno })) | |||
}), | |||
() => {} | |||
]) | |||
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( | |||
'/PersonnelManagement/ClassWork/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 = {} | |||
// 时间查询相关参数 | |||
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('/PersonnelManagement/ClassWork/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> |
@@ -0,0 +1,218 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<l-select | |||
@input="setValue('ClassWork.ClassNo', $event)" | |||
:value="getValue('ClassWork.ClassNo')" | |||
:disabled="!edit" | |||
:range="dataSource.ClassWork.ClassNo" | |||
title="班级" | |||
/> | |||
<l-date-picker | |||
@input="setValue('ClassWork.Date', $event)" | |||
:value="getValue('ClassWork.Date')" | |||
:disabled="!edit" | |||
title="日期" | |||
/> | |||
<l-input | |||
@input="setValue('ClassWork.Title', $event)" | |||
:value="getValue('ClassWork.Title')" | |||
:disabled="!edit" | |||
title="标题" | |||
/> | |||
<l-textarea | |||
@input="setValue('ClassWork.Content', $event)" | |||
:value="getValue('ClassWork.Content')" | |||
:readonly="!edit" | |||
title="工作内容" | |||
/> | |||
</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('edit')" size="lg" line="orange" 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> | |||
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" 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 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-20 09:37 | |||
* 描 述:班级工作记事 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/PersonnelManagement/ClassWork/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: { | |||
ClassWork: { | |||
ClassNo: { type: 'select', title: '班级', dataSource: '1', dataSourceId: 'bjsj,classname,classno' }, | |||
Date: { type: 'datetime', title: '日期', dateformat: '0' }, | |||
Title: { type: 'text', title: '标题' }, | |||
Content: { type: 'textarea', title: '工作内容' }, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
ClassWork: { | |||
ClassNo: [], | |||
}, | |||
} | |||
} | |||
}, | |||
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('bjsj').then(result => { | |||
this.dataSource.ClassWork.ClassNo = result.data.map(t => ({ text: t.classname, value: t.classno })) | |||
}), | |||
() => {} | |||
]) | |||
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('/PersonnelManagement/ClassWork/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('/PersonnelManagement/ClassWork/save', postData, '表单提交保存失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('PersonnelManagementClassWork-list-change') | |||
this.NAV_BACK() | |||
this.TOAST('提交保存成功') | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('/PersonnelManagement/ClassWork/delete', this.id, '删除失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('PersonnelManagementClassWork-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) | |||
} | |||
} | |||
} | |||
</script> |
@@ -0,0 +1,266 @@ | |||
<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') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">值班人:</text> | |||
{{ displayListItem(item, 'Person') }} | |||
</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"> | |||
<!-- 重置查询条件按钮 --> | |||
<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' }, | |||
}, | |||
// 查询条件 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: { | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
}, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中...', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
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() { | |||
if (this.page > this.total) { return } | |||
const result = await this.HTTP_GET( | |||
'/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 = 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('/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> |
@@ -0,0 +1,206 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<l-date-picker | |||
@input="setValue('DutySchedule.Date', $event)" | |||
:value="getValue('DutySchedule.Date')" | |||
:disabled="!edit" | |||
title="时间" | |||
/> | |||
<l-input | |||
@input="setValue('DutySchedule.Person', $event)" | |||
:value="getValue('DutySchedule.Person')" | |||
:disabled="!edit" | |||
title="值班人" | |||
/> | |||
<l-textarea | |||
@input="setValue('DutySchedule.Remark', $event)" | |||
:value="getValue('DutySchedule.Remark')" | |||
:readonly="!edit" | |||
title="备注" | |||
/> | |||
</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('edit')" size="lg" line="orange" 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> | |||
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" 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 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-20 09:55 | |||
* 描 述:值班安排 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/PersonnelManagement/DutySchedule/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: { | |||
DutySchedule: { | |||
Date: { type: 'datetime', title: '时间', dateformat: '0' }, | |||
Person: { type: 'text', title: '值班人' }, | |||
Remark: { type: 'textarea', title: '备注' }, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
DutySchedule: { | |||
}, | |||
} | |||
} | |||
}, | |||
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([ | |||
() => {} | |||
]) | |||
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('/PersonnelManagement/DutySchedule/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('/PersonnelManagement/DutySchedule/save', postData, '表单提交保存失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('PersonnelManagementDutySchedule-list-change') | |||
this.NAV_BACK() | |||
this.TOAST('提交保存成功') | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('/PersonnelManagement/DutySchedule/delete', this.id, '删除失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('PersonnelManagementDutySchedule-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) | |||
} | |||
} | |||
} | |||
</script> |
@@ -0,0 +1,290 @@ | |||
<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, 'ApplyCode') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">报修人:</text> | |||
{{ displayListItem(item, 'ApplyUserId') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">报修内容:</text> | |||
{{ displayListItem(item, 'ApplyContent') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">报修时间:</text> | |||
{{ displayListItem(item, 'ApplyTime') }} | |||
</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" | |||
/> | |||
<!-- 重置查询条件按钮 --> | |||
<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 11:11 | |||
* 描 述:掌上报修 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/PersonnelManagement/EmpRepair/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: { | |||
ApplyCode: { type: 'text' }, | |||
ApplyUserId: { type: 'organize', dataType: 'user' }, | |||
ApplyContent: { type: 'textarea' }, | |||
ApplyTime: { type: 'datetime', dateformat: '0' }, | |||
}, | |||
// 查询条件 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: { | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
}, | |||
// 时间查询参数 | |||
dateRange: null, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中...', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad() { | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('PersonnelManagementEmpRepair-list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
this.ON('PersonnelManagementEmpRepair-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( | |||
'/PersonnelManagement/EmpRepair/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 = {} | |||
// 时间查询相关参数 | |||
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('/PersonnelManagement/EmpRepair/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> |
@@ -0,0 +1,214 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<l-input | |||
@input="setValue('EmpRepair.ApplyCode', $event)" | |||
:value="getValue('EmpRepair.ApplyCode')" | |||
:disabled="!edit" | |||
title="报修编号" | |||
/> | |||
<l-organize-picker | |||
@input="setValue('EmpRepair.ApplyUserId', $event)" | |||
:value="getValue('EmpRepair.ApplyUserId')" | |||
:readonly="!edit" | |||
type="user" | |||
title="报修人" | |||
/> | |||
<l-textarea | |||
@input="setValue('EmpRepair.ApplyContent', $event)" | |||
:value="getValue('EmpRepair.ApplyContent')" | |||
:readonly="!edit" | |||
title="报修内容" | |||
/> | |||
<l-date-picker | |||
@input="setValue('EmpRepair.ApplyTime', $event)" | |||
:value="getValue('EmpRepair.ApplyTime')" | |||
:disabled="!edit" | |||
title="报修时间" | |||
/> | |||
</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('edit')" size="lg" line="orange" 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> | |||
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" 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 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-20 11:11 | |||
* 描 述:掌上报修 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/PersonnelManagement/EmpRepair/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: { | |||
EmpRepair: { | |||
ApplyCode: { type: 'text', title: '报修编号' }, | |||
ApplyUserId: { type: 'organize', title: '报修人', dataType: 'user' }, | |||
ApplyContent: { type: 'textarea', title: '报修内容' }, | |||
ApplyTime: { type: 'datetime', title: '报修时间', dateformat: '0' }, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
EmpRepair: { | |||
}, | |||
} | |||
} | |||
}, | |||
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([ | |||
() => {} | |||
]) | |||
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('/PersonnelManagement/EmpRepair/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('/PersonnelManagement/EmpRepair/save', postData, '表单提交保存失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('PersonnelManagementEmpRepair-list-change') | |||
this.NAV_BACK() | |||
this.TOAST('提交保存成功') | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('/PersonnelManagement/EmpRepair/delete', this.id, '删除失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('PersonnelManagementEmpRepair-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) | |||
} | |||
} | |||
} | |||
</script> |
@@ -0,0 +1,290 @@ | |||
<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.F_ScheduleId"> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">开始时间:</text> | |||
{{ displayListItem(item, 'F_StartDate') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">结束时间:</text> | |||
{{ displayListItem(item, 'F_EndDate') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">提前提醒:</text> | |||
{{ displayListItem(item, 'F_Early') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">日程内容:</text> | |||
{{ displayListItem(item, 'F_ScheduleContent') }} | |||
</view> | |||
<l-customlist-action showEdit @edit="action('edit', item.F_ScheduleId)" showDelete @delete="action('delete', item.F_ScheduleId)" @view="action('view', item.F_ScheduleId)" /> | |||
</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" | |||
/> | |||
<!-- 重置查询条件按钮 --> | |||
<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 11:22 | |||
* 描 述:日程安排 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/PersonnelManagement/Schedule/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: { | |||
F_StartDate: { type: 'datetime', dateformat: '1' }, | |||
F_EndDate: { type: 'datetime', dateformat: '1' }, | |||
F_Early: { type: 'text' }, | |||
F_ScheduleContent: { type: 'textarea' }, | |||
}, | |||
// 查询条件 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: { | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
}, | |||
// 时间查询参数 | |||
dateRange: null, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中...', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad() { | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('PersonnelManagementSchedule-list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
this.ON('PersonnelManagementSchedule-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( | |||
'/PersonnelManagement/Schedule/pagelist', | |||
{ | |||
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序) | |||
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序 | |||
pagination: { rows: 10, page: this.page, sidx: 'F_ScheduleId', 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('/PersonnelManagement/Schedule/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> |
@@ -0,0 +1,214 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<l-datetime-picker | |||
@input="setValue('LR_OA_Schedule.F_StartDate', $event)" | |||
:value="getValue('LR_OA_Schedule.F_StartDate')" | |||
:disabled="!edit" | |||
title="开始时间" | |||
/> | |||
<l-datetime-picker | |||
@input="setValue('LR_OA_Schedule.F_EndDate', $event)" | |||
:value="getValue('LR_OA_Schedule.F_EndDate')" | |||
:disabled="!edit" | |||
title="结束时间" | |||
/> | |||
<l-input | |||
@input="setValue('LR_OA_Schedule.F_Early', $event)" | |||
:value="getValue('LR_OA_Schedule.F_Early')" | |||
:disabled="!edit" | |||
title="提前提醒" | |||
required | |||
/> | |||
<l-textarea | |||
@input="setValue('LR_OA_Schedule.F_ScheduleContent', $event)" | |||
:value="getValue('LR_OA_Schedule.F_ScheduleContent')" | |||
:readonly="!edit" | |||
title="日程内容" | |||
/> | |||
</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('edit')" size="lg" line="orange" 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> | |||
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" 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 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-20 11:22 | |||
* 描 述:日程安排 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/PersonnelManagement/Schedule/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: { | |||
LR_OA_Schedule: { | |||
F_StartDate: { type: 'datetime', title: '开始时间', dateformat: '1' }, | |||
F_EndDate: { type: 'datetime', title: '结束时间', dateformat: '1' }, | |||
F_Early: { type: 'text', title: '提前提醒', verify: 'NumOrNull' }, | |||
F_ScheduleContent: { type: 'textarea', title: '日程内容' }, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
LR_OA_Schedule: { | |||
}, | |||
} | |||
} | |||
}, | |||
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([ | |||
() => {} | |||
]) | |||
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('/PersonnelManagement/Schedule/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('/PersonnelManagement/Schedule/save', postData, '表单提交保存失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('PersonnelManagementSchedule-list-change') | |||
this.NAV_BACK() | |||
this.TOAST('提交保存成功') | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('/PersonnelManagement/Schedule/delete', this.id, '删除失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('PersonnelManagementSchedule-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) | |||
} | |||
} | |||
} | |||
</script> |