@@ -224,6 +224,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 资助变更列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult IndexHelpChange() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 新生学费管理 | |||
/// </summary> | |||
/// <returns></returns> | |||
@@ -573,7 +582,21 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return Success(data); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormDataByProcessId(string processId) | |||
{ | |||
StuEnrollEntity data = stuEnrollIBLL.GetEntityByProcessId(processId); | |||
var jsonData = new | |||
{ | |||
StuEnroll = data, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -18,13 +18,13 @@ var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
// $('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
//idcardreader.objectcheck("btnread"); | |||
}, | |||
bind: function () { | |||
$('#ClassNo').lrselect({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', | |||
@@ -32,7 +32,7 @@ var bootstrap = function ($, learun) { | |||
value: "classno", | |||
text: "classname" | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
@@ -51,6 +51,28 @@ var bootstrap = function ($, learun) { | |||
} | |||
} | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
if (id == 'StuEnroll' && data[id]) { | |||
keyValue = data[id].StuId; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
//setTimeout(function () { | |||
// ue.setContent(data[id].F_NewsContent); | |||
//}, 100); | |||
} | |||
} | |||
}); | |||
} | |||
callback && callback(); | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
if (!$('body').lrValidform()) { | |||
@@ -65,13 +87,24 @@ var bootstrap = function ($, learun) { | |||
} | |||
var postData = {}; | |||
var strEntity = $('body').lrGetFormData(); | |||
strEntity.SupportProcessId = processId; | |||
if (!!processId) { | |||
strEntity.SupportProcessId = processId; | |||
} | |||
postData.strEntity = JSON.stringify(strEntity); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/SupportChange?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, strEntity, i); | |||
if (!!processId) { | |||
var res = {}; | |||
res.code = 200; | |||
if (!!callBack) { | |||
callBack(res, i); | |||
} | |||
} else { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, strEntity, i); | |||
} | |||
} | |||
}); | |||
}; | |||
@@ -58,6 +58,7 @@ | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 查看</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i> 提交</a> | |||
</div> | |||
</div> | |||
@@ -19,7 +19,7 @@ var bootstrap = function ($, learun) { | |||
page.search(queryJson); | |||
//page.refreshMoney(); | |||
}, 380, 400); | |||
$('#ClassNo').lrselect({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', | |||
@@ -35,6 +35,7 @@ var bootstrap = function ($, learun) { | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
//查看 | |||
$('#lr_view').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('StuId'); | |||
if (learun.checkrow(keyValue)) { | |||
@@ -48,13 +49,34 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}); | |||
//编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('StuId'); | |||
var status = $('#gridtable').jfGridValue('SupportStatus'); | |||
if (status != 0) { | |||
learun.alert.warning("选中记录中已提交,不可编辑!"); | |||
return; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/HelpChange?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
top[id].save(); | |||
return refreshGirdData('', ''); | |||
} | |||
}); | |||
} | |||
}); | |||
// 提交 | |||
$('#lr_submit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('StuId'); | |||
if (learun.checkrow(keyValue)) { | |||
var AAStatus = $('#gridtable').jfGridValue('SupportStatus'); | |||
if (AAStatus !== 0) { | |||
var status = $('#gridtable').jfGridValue('SupportStatus'); | |||
if (status != 0) { | |||
learun.alert.warning("当前项目已提交,请耐心等待审批!"); | |||
return; | |||
} | |||
@@ -88,55 +110,22 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}, | |||
{ label: "开户银行", name: "SupportBank", width: 100, align: "left" }, | |||
{ label: "银行卡号", name: "SupportBankCard", width: 100, align: "left" }, | |||
{ label: "金额", name: "SupportAmount", width: 100, align: "left" }, | |||
{ label: "备注信息", name: "SupportChangeRemark", width: 200, align: "left" }, | |||
{ | |||
label: "户别", name: "ResidenceType", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'HouseholdCategory', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
label: "审批状态", name: "SupportStatus", width: 100, align: "left", | |||
formatter: function (cellvalue, row) { | |||
if (cellvalue === 1) { | |||
return '<span class=\"label label-warning\">审批中</span>'; | |||
} else if (cellvalue === 2) { | |||
return '<span class=\"label label-success\">审批通过</span>'; | |||
} else { | |||
return '<span class=\"label label-default\" >草稿</span>'; | |||
} | |||
} | |||
}, | |||
{ | |||
label: "享受等级", name: "SupportGrade", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
console.log('享受等级',value); | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'SupportGrade', | |||
callback: function (_data) { | |||
console.log('dataItem', _data); | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, { | |||
label: "资助种类", name: "SupportType", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'SupportType1', | |||
callback: function (_data) { | |||
if (_data.text) { | |||
callback(_data.text); | |||
} else { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'SupportType2', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "符合资助条件", name: "SupportCondition", width: 200, align: "left" }, | |||
{ label: "备注信息", name: "SupportRemarks", width: 200, align: "left" } | |||
} | |||
], | |||
isMultiselect: true, | |||
mainId: 'StuId', | |||
@@ -172,9 +161,8 @@ var bootstrap = function ($, learun) { | |||
refreshGirdData = function (res, postData) { | |||
if (res && res.code && res.code == 200) { | |||
// 发起流程 | |||
var postData = { | |||
schemeCode: 'Ass_PurchaseApply',// 填写流程对应模板编号 | |||
schemeCode: 'HelpChange',// 填写流程对应模板编号 | |||
processId: processId, | |||
level: '1', | |||
}; | |||
@@ -185,5 +173,6 @@ var bootstrap = function ($, learun) { | |||
} | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -119,28 +119,35 @@ var bootstrap = function ($, learun) { | |||
//资助变更 | |||
$("#lr_change").on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('StuId'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '资助变更', | |||
url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/HelpChange?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
var isSupportChange = $('#gridtable').jfGridValue('IsSupportChange'); | |||
//如果已变更,将不能重复变更 | |||
if (isSupportChange) { | |||
learun.alert.warning("选中记录中已变更,不可重复变更!"); | |||
return; | |||
} else { | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '资助变更', | |||
url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/HelpChange?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
} | |||
return res; | |||
} | |||
return res; | |||
} | |||
}); | |||
} | |||
}); | |||
} | |||
} | |||
}); | |||
}, | |||
@@ -159,7 +159,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
/// <summary> | |||
/// 获取StuEnroll表实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public StuEnrollEntity GetEntityByProcessId(string processId) | |||
{ | |||
try | |||
{ | |||
return stuEnrollService.GetEntityByProcessId(processId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public object GetStuInfo(string stuId) | |||
{ | |||
@@ -40,6 +40,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <summary> | |||
/// <returns></returns> | |||
StuEnrollEntity GetStuEnrollEntity(string keyValue); | |||
/// <summary> | |||
/// 获取数据 | |||
/// </summary> | |||
/// <param name="processId"></param> | |||
/// <returns></returns> | |||
StuEnrollEntity GetEntityByProcessId(string processId); | |||
#endregion | |||
#region 提交数据 | |||
@@ -99,7 +99,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
t.Grade, | |||
t.THROUGHPROJECT, | |||
t.Status, | |||
t.IsSupport,t.SupportGrade,t.SupportType,t.SupportCondition,t.SupportRemarks | |||
t.IsSupport,t.SupportGrade,t.SupportType,t.SupportCondition,t.SupportRemarks, | |||
t.IsSupportChange,t.SupportBank,t.SupportBankCard,t.SupportAmount,t.SupportStatus,t.SupportChangeRemark,t.SupportProcessId | |||
"); | |||
strSql.Append(" FROM StuEnroll t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
@@ -2202,6 +2203,40 @@ t.IsSupport,t.SupportGrade,t.SupportType,t.SupportCondition,t.SupportRemarks | |||
} | |||
} | |||
/// <summary> | |||
/// 获取StuEnroll表实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public StuEnrollEntity GetEntityByProcessId(string processId) | |||
{ | |||
try | |||
{ | |||
var entity = this.BaseRepository("CollegeMIS").FindEntity<StuEnrollEntity>(x=>x.SupportProcessId== processId); | |||
//if (!string.IsNullOrEmpty(entity.Photo)) | |||
//{ | |||
// var path = this.BaseRepository().FindEntity<AnnexesFileEntity>(a => a.F_Id == entity.Photo)?.F_FilePath; | |||
// if (!string.IsNullOrEmpty(path)) | |||
// { | |||
// path = "/" + path.Substring(path.IndexOf("Resource")); | |||
// entity.PhotoUrl = path; | |||
// } | |||
//} | |||
return entity; | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion 获取数据 | |||
#region 提交数据 | |||
@@ -2602,7 +2637,9 @@ where StuId='{keyValue}'"; | |||
string sql = $@"update StuEnroll set SupportBank='{entity.SupportBank}', | |||
SupportBankCard='{entity.SupportBankCard}', | |||
SupportAmount='{entity.SupportAmount}', | |||
SupportProcessId='{entity.SupportProcessId}',SupportStatus=0,IsSupportChange=1 | |||
SupportProcessId='{entity.SupportProcessId}', | |||
SupportChangeRemark='{entity.SupportChangeRemark}', | |||
SupportStatus=0,IsSupportChange=1 | |||
where StuId='{keyValue}'"; | |||
this.BaseRepository("CollegeMis").ExecuteBySql(sql); | |||
} | |||