@@ -17,6 +17,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
public class FundsApplyController : MvcControllerBase | |||
{ | |||
private FundsApplyIBLL fundsApplyIBLL = new FundsApplyBLL(); | |||
private FundsApplyDetailIBLL fundsApplyDetailIBLL = new FundsApplyDetailBLL(); | |||
#region 视图功能 | |||
@@ -27,7 +28,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -39,6 +40,12 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
ViewBag.EnCode = "JFKZ_" + CommonHelper.CreateNo(); | |||
return View(); | |||
} | |||
[HttpGet] | |||
public ActionResult FormView() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
@@ -73,9 +80,12 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var FundsApplyData = fundsApplyIBLL.GetFundsApplyEntity( keyValue ); | |||
var jsonData = new { | |||
var FundsApplyData = fundsApplyIBLL.GetFundsApplyEntity(keyValue); | |||
var FundsApplyDetailData = fundsApplyDetailIBLL.GetListByApplyId(keyValue); | |||
var jsonData = new | |||
{ | |||
FundsApply = FundsApplyData, | |||
FundsApplyDetail = FundsApplyDetailData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
@@ -88,8 +98,9 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[AjaxOnly] | |||
public ActionResult GetFormDataByProcessId(string processId) | |||
{ | |||
var FundsApplyData = fundsApplyIBLL.GetEntityByProcessId( processId ); | |||
var jsonData = new { | |||
var FundsApplyData = fundsApplyIBLL.GetEntityByProcessId(processId); | |||
var jsonData = new | |||
{ | |||
FundsApply = FundsApplyData, | |||
}; | |||
return Success(jsonData); | |||
@@ -119,15 +130,30 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
public ActionResult SaveForm(string keyValue, string strEntity, string fundsApplyDetailList) | |||
{ | |||
FundsApplyEntity entity = strEntity.ToObject<FundsApplyEntity>(); | |||
fundsApplyIBLL.SaveEntity(keyValue,entity); | |||
List<FundsApplyDetailEntity> detailList = fundsApplyDetailList.ToObject<List<FundsApplyDetailEntity>>(); | |||
fundsApplyIBLL.SaveEntity(keyValue, entity, detailList); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 提交 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult ChangeStatusById(string keyValue, string processId) | |||
{ | |||
fundsApplyIBLL.ChangeStatusById(keyValue, 1, processId); | |||
return Success("操作成功!"); | |||
} | |||
#endregion | |||
} | |||
@@ -7,7 +7,7 @@ | |||
</script> | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="FundsApply"> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
<div class="lr-form-item-title">申报单号</div> | |||
<input id="EnCode" type="text" readonly class="form-control" readonly="readonly" /> | |||
</div> | |||
@@ -19,12 +19,16 @@ | |||
<div class="lr-form-item-title">填报时间</div> | |||
<input id="ApplyTime" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
<div class="lr-form-item-title">是否固定资产</div> | |||
<div id="IsFixedAssets"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
<div class="lr-form-item-title">填报人</div> | |||
<input id="ApplyUser" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
@*<div class="lr-form-item-title">备注</div>*@ | |||
<div class="lr-form-item-title">备注</div> | |||
<input id="Remark" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
@@ -78,11 +78,12 @@ var bootstrap = function ($, learun) { | |||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||
if (res) { | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].Id === keyValue) { | |||
if (tempdatra[key] && tempdatra[key].Id === keyValue) { | |||
pricecount -= tempdatra[key].Amount; | |||
tempdatra.splice(key, 1); | |||
} | |||
}); | |||
pricecount = pricecount.toFixed(2); | |||
$("#SumAmount").val(pricecount); | |||
$("#UpperAmount").val(smalltoBIG(pricecount)); | |||
$('#FundsApplyDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | |||
@@ -96,6 +97,7 @@ var bootstrap = function ($, learun) { | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#IsFixedAssets').lrDataItemSelect({ code: 'YesOrNoInt' }); | |||
$('#ApplyDept').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); | |||
$('#ApplyDept').lrselectSet(learun.clientdata.get(['userinfo']).departmentId); | |||
$('#ApplyTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | |||
@@ -127,9 +129,13 @@ var bootstrap = function ($, learun) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
tempdatra = data[id]; | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
if (data[id].SumAmount) { | |||
pricecount = data[id].SumAmount; | |||
} | |||
} | |||
} | |||
}); | |||
@@ -154,7 +160,7 @@ var bootstrap = function ($, learun) { | |||
for (var i = 0; i < tempdatra.length; i++) { | |||
pricecount += parseFloat(tempdatra[i].Amount); | |||
} | |||
$("#SumAmount").val(pricecount); | |||
$("#SumAmount").val(pricecount.toFixed(2)); | |||
$("#UpperAmount").val(smalltoBIG(pricecount)); | |||
$('#FundsApplyDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | |||
}; | |||
@@ -195,7 +201,7 @@ var bootstrap = function ($, learun) { | |||
formData.ProcessId = processId; | |||
} | |||
postData.strEntity = JSON.stringify(formData); | |||
postData.FundsApplyDetailList = JSON.stringify($('#FundsApplyDetail').jfGridGet('rowdatas')); | |||
postData.fundsApplyDetailList = JSON.stringify($('#FundsApplyDetail').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/FundsApply/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
@@ -0,0 +1,52 @@ | |||
@{ | |||
ViewBag.Title = "经费开支申报"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<script> | |||
var NewEnCode = "@ViewBag.EnCode"; | |||
</script> | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
<div class="lr-form-item-title">申报单号</div> | |||
<input id="EnCode" type="text" readonly class="form-control" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
<div class="lr-form-item-title">申报部门</div> | |||
<div id="ApplyDept" readonly></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
<div class="lr-form-item-title">填报时间</div> | |||
<input id="ApplyTime" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
<div class="lr-form-item-title">是否固定资产</div> | |||
<div id="IsFixedAssets"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
<div class="lr-form-item-title">填报人</div> | |||
<input id="ApplyUser" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
<div class="lr-form-item-title">备注</div> | |||
<input id="Remark" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
<div class="lr-form-item-title">总金额</div> | |||
<input id="SumAmount" type="text" class="form-control" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="FundsApply"> | |||
<div class="lr-form-item-title">人民币(大写)</div> | |||
<input id="UpperAmount" type="text" class="form-control" readonly="readonly" /> | |||
</div> | |||
@*<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">明细操作</div> | |||
<input id="detailadd" type="button" class="btn btn-success" value="新增明细" /> | |||
<input id="detailedit" type="button" class="btn btn-warning" value="编辑明细" /> | |||
<input id="detaildel" type="button" class="btn btn-danger" value="移除明细" /> | |||
</div>*@ | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="FundsApplyDetail"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/FundsApply/FormView.js") |
@@ -0,0 +1,242 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-11-07 14:25 | |||
* 描 述:经费开支申报 | |||
*/ | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var refreshGirdData; | |||
var acceptClick; | |||
var selectedRow; | |||
var tempdatra = new Array(); | |||
//总价计算 | |||
var pricecount = 0; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
setAuthorize = function (data) { | |||
if (!!data) { | |||
for (var field in data) { | |||
if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 | |||
$('#' + data[field].fieldId).parent().remove(); | |||
} | |||
else { | |||
if (data[field].isEdit != 1) { | |||
$('#' + data[field].fieldId).attr('disabled', 'disabled'); | |||
if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { | |||
$('#' + data[field].fieldId).css({ 'padding-right': '58px' }); | |||
$('#' + data[field].fieldId).find('.btn-success').remove(); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
}; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
$("#detailadd").on('click', function () { | |||
selectedRow = null; | |||
learun.layerForm({ | |||
id: 'formdetail', | |||
title: '新增明细', | |||
url: top.$.rootUrl + '/AssetManagementSystem/FundsApplyDetail/Form', | |||
width: 500, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
$("#detailedit").on('click', function () { | |||
var keyValue = $('#FundsApplyDetail').jfGridValue('Id'); | |||
selectedRow = $('#FundsApplyDetail').jfGridGet('rowdata'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formdetail', | |||
title: '编辑明细', | |||
url: top.$.rootUrl + '/AssetManagementSystem/FundsApplyDetail/Form?keyValue=' + keyValue, | |||
width: 500, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
$("#detaildel").on('click', function () { | |||
var keyValue = $('#FundsApplyDetail').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||
if (res) { | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key] && tempdatra[key].Id === keyValue) { | |||
pricecount -= tempdatra[key].Amount; | |||
tempdatra.splice(key, 1); | |||
} | |||
}); | |||
pricecount = pricecount.toFixed(2); | |||
$("#SumAmount").val(pricecount); | |||
$("#UpperAmount").val(smalltoBIG(pricecount)); | |||
$('#FundsApplyDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | |||
top.layer.close(index); | |||
} | |||
}); | |||
} | |||
}); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#IsFixedAssets').lrDataItemSelect({ code: 'YesOrNoInt' }); | |||
$('#ApplyDept').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); | |||
$('#ApplyDept').lrselectSet(learun.clientdata.get(['userinfo']).departmentId); | |||
$('#ApplyTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | |||
$('#ApplyUser')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||
$('#ApplyUser').val(learun.clientdata.get(['userinfo']).realName); | |||
$('#FundsApplyDetail').jfGrid({ | |||
headData: [ | |||
{ | |||
label: '项目内容', name: 'ProjectContent', width: 150, align: 'left' | |||
}, | |||
{ | |||
label: '数量', name: 'Number', width: 150, align: 'left' | |||
}, | |||
{ | |||
label: '单价(元)', name: 'Price', width: 150, align: 'left' | |||
}, | |||
{ | |||
label: '金额(元)', name: 'Amount', width: 150, align: 'left' | |||
}, | |||
], | |||
height: 400, | |||
mainId: 'AAIId', | |||
reloadSelected: false, | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/FundsApply/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
tempdatra = data[id]; | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
if (data[id].SumAmount) { | |||
pricecount = data[id].SumAmount; | |||
} | |||
} | |||
} | |||
}); | |||
} else { | |||
$("#EnCode").val(NewEnCode); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
var ifnewrow = true; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].Id === temprow.Id) { | |||
tempdatra[key] = temprow; | |||
ifnewrow = false; | |||
} | |||
}); | |||
if (ifnewrow) { | |||
tempdatra.push(temprow); | |||
} | |||
//总价计算 | |||
pricecount = 0; | |||
for (var i = 0; i < tempdatra.length; i++) { | |||
pricecount += parseFloat(tempdatra[i].Amount); | |||
} | |||
$("#SumAmount").val(pricecount.toFixed(2)); | |||
$("#UpperAmount").val(smalltoBIG(pricecount)); | |||
$('#FundsApplyDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | |||
}; | |||
function sortNumber(a, b) { | |||
return a.AAIOrder - b.AAIOrder; | |||
} | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/FundsApply/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 == 'FundsApply' && data[id]) { | |||
keyValue = data[id].Id; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
callback && callback(); | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (processId, callBack, i) { | |||
var postData = {}; | |||
var formData = $('[data-table="FundsApply"]').lrGetFormData(); | |||
if (!!processId) { | |||
formData.ProcessId = processId; | |||
} | |||
postData.strEntity = JSON.stringify(formData); | |||
postData.fundsApplyDetailList = JSON.stringify($('#FundsApplyDetail').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/FundsApply/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, i); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
function smalltoBIG(n) { | |||
var fraction = ['角', '分']; | |||
var digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']; | |||
var unit = [ | |||
['元', '万', '亿'], | |||
['', '拾', '佰', '仟'] | |||
]; | |||
var head = n < 0 ? '欠' : ''; | |||
n = Math.abs(n); | |||
var s = ''; | |||
for (var i = 0; i < fraction.length; i++) { | |||
s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, ''); | |||
} | |||
s = s || '整'; | |||
n = Math.floor(n); | |||
for (var i = 0; i < unit[0].length && n > 0; i++) { | |||
var p = ''; | |||
for (var j = 0; j < unit[1].length && n > 0; j++) { | |||
p = digit[n % 10] + unit[1][j] + p; | |||
n = Math.floor(n / 10); | |||
} | |||
s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s; | |||
} | |||
return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整'); | |||
} | |||
} |
@@ -16,6 +16,7 @@ | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 申请</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-trash-o"></i> 提交</a> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
@@ -32,8 +32,11 @@ var bootstrap = function ($, learun) { | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
processId = learun.newGuid(); | |||
res = top[id].save(processId, refreshGirdData); | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
//processId = learun.newGuid(); | |||
//res = top[id].save(processId, refreshGirdData); | |||
} | |||
return res; | |||
} | |||
@@ -81,13 +84,33 @@ var bootstrap = function ($, learun) { | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
// 提交 | |||
$('#lr_submit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var Status = $('#gridtable').jfGridValue('Status'); | |||
if (Status !== 0) { | |||
learun.alert.warning("当前项目已提交,请耐心等待审批!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认提交该项!', function (res) { | |||
if (res) { | |||
processId = learun.newGuid(); | |||
learun.postForm(top.$.rootUrl + '/AssetManagementSystem/FundsApply/ChangeStatusById', { keyValue: keyValue, processId: processId }, function (res) { | |||
refreshGirdData(res, {}); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/AssetManagementSystem/FundsApply/GetPageList', | |||
headData: [ | |||
{ label: "申报单号", name: "EnCode", width: 100, align: "left" }, | |||
{ label: "申报单号", name: "EnCode", width: 200, align: "left" }, | |||
{ label: "申报部门", name: "ApplyDept", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op,$cell) { | |||
learun.clientdata.getAsync('department', { | |||
@@ -109,7 +132,20 @@ var bootstrap = function ($, learun) { | |||
}}, | |||
{ label: "备注", name: "Remark", width: 100, align: "left"}, | |||
{ label: "总金额", name: "SumAmount", width: 100, align: "left"}, | |||
{ label: "人民币(大写)", name: "UpperAmount", width: 100, align: "left"}, | |||
{ label: "人民币(大写)", name: "UpperAmount", width: 100, align: "left" }, | |||
{ | |||
label: "审批状态", name: "Status", 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>'; | |||
} | |||
} | |||
} | |||
], | |||
mainId:'Id', | |||
isPage: true | |||
@@ -128,7 +164,7 @@ var bootstrap = function ($, learun) { | |||
{ | |||
// 发起流程 | |||
var postData = { | |||
schemeCode:'',// 填写流程对应模板编号 | |||
schemeCode:'LC_FundsApply',// 填写流程对应模板编号 | |||
processId:processId, | |||
level:'1', | |||
}; | |||
@@ -21,7 +21,7 @@ var bootstrap = function ($, learun) { | |||
var num = $('#Number').val(); | |||
var Price = $('#Price').val(); | |||
if (!!num && !!Price) { | |||
$('#Amount').val(parseInt(num) * parseFloat(Price)); | |||
$('#Amount').val((parseInt(num) * parseFloat(Price)).toFixed(2)); | |||
} | |||
}); | |||
}, | |||
@@ -0,0 +1,175 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Web.Mvc; | |||
using Learun.Application.TwoDevelopment.LR_CodeDemo; | |||
using System.Collections.Generic; | |||
using Learun.Application.Base.SystemModule; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-11-09 11:05 | |||
/// 描 述:学生文章发表 | |||
/// </summary> | |||
public class StudentArticlePublicController : MvcControllerBase | |||
{ | |||
private StudentArticlePublicIBLL studentArticlePublicIBLL = new StudentArticlePublicBLL(); | |||
private CodeRuleIBLL codeRuleIBLL = new CodeRuleBLL(); | |||
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 修改分值 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult FormScore() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = studentArticlePublicIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var StudentArticlePublicData = studentArticlePublicIBLL.GetStudentArticlePublicEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
StudentArticlePublic = StudentArticlePublicData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetStuData(string stuno, string stuname) | |||
{ | |||
var stuData = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNoOrStuName(stuno, stuname); | |||
return Success(stuData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="processId">流程实例主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormDataByProcessId(string processId) | |||
{ | |||
var StudentArticlePublicData = studentArticlePublicIBLL.GetEntityByProcessId(processId); | |||
var jsonData = new | |||
{ | |||
StudentArticlePublic = StudentArticlePublicData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
studentArticlePublicIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
StudentArticlePublicEntity entity = strEntity.ToObject<StudentArticlePublicEntity>(); | |||
studentArticlePublicIBLL.SaveEntity(keyValue, entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 提交 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult ChangeStatusById(string keyValue, string processId) | |||
{ | |||
studentArticlePublicIBLL.ChangeStatusById(keyValue, 1, processId); | |||
return Success("操作成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,63 @@ | |||
@{ | |||
ViewBag.Title = "学生文章发表"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | |||
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||
<div id="Semester"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">学生学号<font face="宋体">*</font></div> | |||
<input id="StuNo" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">学生姓名<font face="宋体">*</font></div> | |||
<input id="StuName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">专业部<font face="宋体">*</font></div> | |||
<div id="DeptNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">专业<font face="宋体">*</font></div> | |||
<div id="MajorNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">班级<font face="宋体">*</font></div> | |||
<div id="ClassNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">刊登期刊名称<font face="宋体">*</font></div> | |||
<input id="APName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">刊登期刊级别<font face="宋体">*</font></div> | |||
<div id="APLevel" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">指导老师<font face="宋体">*</font></div> | |||
<input id="Instructor" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">出版单位<font face="宋体">*</font></div> | |||
<input id="Unit" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">分值<font face="宋体">*</font></div> | |||
<input id="Score" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">刊登时间<font face="宋体">*</font></div> | |||
<input id="APTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#APTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic"> | |||
<div class="lr-form-item-title">附件上传</div> | |||
<div id="Url"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StudentArticlePublic/Form.js") |
@@ -0,0 +1,174 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-11-09 11:05 | |||
* 描 述:学生文章发表 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var type = request('type'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
setAuthorize = function (data) { | |||
if (!!data) { | |||
for (var field in data) { | |||
if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 | |||
$('#' + data[field].fieldId).parent().remove(); | |||
} | |||
else { | |||
if (data[field].isEdit != 1) { | |||
$('#' + data[field].fieldId).attr('disabled', 'disabled'); | |||
if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { | |||
$('#' + data[field].fieldId).css({ 'padding-right': '58px' }); | |||
$('#' + data[field].fieldId).find('.btn-success').remove(); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
}; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
//学年 | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); | |||
$('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); | |||
$('#Url').lrUploader(); | |||
$('#APLevel').lrDataItemSelect({ code: 'Level' }); | |||
$('#StuNo').blur(function () { | |||
learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/GetStuData?stuno=' + $('#StuNo').val(), function (res) { | |||
learun.loading(false); | |||
if (res.code == learun.httpCode.success) { | |||
var data = res.data; | |||
if (!!data) { | |||
$('#StuName').val(data.StuName); | |||
$('#DeptNo').lrselectSet(data.DeptNo); | |||
$('#MajorNo').lrselectSet(data.MajorNo); | |||
$('#ClassNo').lrselectSet(data.ClassNo); | |||
} else { | |||
$('#StuName').val(); | |||
$('#DeptNo').lrselectSet(); | |||
$('#MajorNo').lrselectSet(); | |||
$('#ClassNo').lrselectSet(); | |||
} | |||
} | |||
else { | |||
learun.alert.error(res.info); | |||
} | |||
}); | |||
}); | |||
$('#StuName').blur(function () { | |||
learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/GetStuData?stuname=' + $('#StuName').val(), function (res) { | |||
learun.loading(false); | |||
if (res.code == learun.httpCode.success) { | |||
var data = res.data; | |||
if (!!data) { | |||
$('#StuNo').val(data.StuNo); | |||
$('#DeptNo').lrselectSet(data.DeptNo); | |||
$('#MajorNo').lrselectSet(data.MajorNo); | |||
$('#ClassNo').lrselectSet(data.ClassNo); | |||
} else { | |||
$('#StuName').val(); | |||
$('#DeptNo').lrselectSet(); | |||
$('#MajorNo').lrselectSet(); | |||
$('#ClassNo').lrselectSet(); | |||
} | |||
} | |||
else { | |||
learun.alert.error(res.info); | |||
} | |||
}); | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/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 == 'StudentArticlePublic' && data[id]) { | |||
keyValue = data[id].Id; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
callback && callback(); | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (processId, callBack, i) { | |||
var formData = $('body').lrGetFormData(); | |||
if (!!processId) { | |||
formData.processId = processId; | |||
} | |||
if (type == 'copy') { | |||
keyValue = ''; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify(formData) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, i); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,23 @@ | |||
@{ | |||
ViewBag.Title = "学生文章发表"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic" > | |||
<div class="lr-form-item-title">学生学号<font face="宋体">*</font></div> | |||
<input id="StuNo" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic" > | |||
<div class="lr-form-item-title">学生姓名<font face="宋体">*</font></div> | |||
<input id="StuName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic" > | |||
<div class="lr-form-item-title">刊登期刊名称<font face="宋体">*</font></div> | |||
<input id="APName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StudentArticlePublic" > | |||
<div class="lr-form-item-title">分值<font face="宋体">*</font></div> | |||
<input id="Score" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StudentArticlePublic/FormScore.js") |
@@ -0,0 +1,94 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-11-09 11:05 | |||
* 描 述:学生文章发表 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var type = request('type'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); | |||
$('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/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 == 'StudentArticlePublic' && data[id]) { | |||
keyValue = data[id].Id; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
callback && callback(); | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (processId, callBack, i) { | |||
var formData = $('body').lrGetFormData(); | |||
if (!!processId) { | |||
formData.processId = processId; | |||
} | |||
if (type == 'copy') { | |||
keyValue = ''; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify(formData) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, i); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,85 @@ | |||
@{ | |||
ViewBag.Title = "学生文章发表"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<style> | |||
.lr-form-item-title{ | |||
width:90px; | |||
} | |||
.lr-form-item{ | |||
padding-left:90px; | |||
} | |||
</style> | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学年</div> | |||
<div id="AcademicYearNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学期</div> | |||
<div id="Semester"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学生学号</div> | |||
<input id="StuNo" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学生姓名</div> | |||
<input id="StuName" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">专业部</div> | |||
<div id="DeptNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="MajorNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">班级</div> | |||
<div id="ClassNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">刊登期刊名称</div> | |||
<input id="APName" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">刊登期刊级别</div> | |||
<div id="APLevel"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">指导老师</div> | |||
<input id="Instructor" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_copy" class="btn btn-default"><i class="fa fa-plus"></i> 复制</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_updscore" class="btn btn-default"><i class="fa fa-plus"></i> 修改分值</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i> 提交</a> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StudentArticlePublic/Index.js") |
@@ -0,0 +1,317 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-11-09 11:05 | |||
* 描 述:学生文章发表 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var processId = ''; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 240, 400); | |||
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); | |||
$('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); | |||
$('#APLevel').lrDataItemSelect({ code: 'Level' }); | |||
//学年 | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "请选择学期", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/Form', | |||
width: 1000, | |||
height: 800, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
processId = learun.newGuid(); | |||
res = top[id].save(processId, refreshGirdData); | |||
} | |||
return res; | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var Status = $('#gridtable').jfGridValue('Status'); | |||
if (Status == '2') { | |||
learun.alert.warning("当前项目已审批通过!"); | |||
return; | |||
} | |||
if (Status != '0') { | |||
learun.alert.warning("当前项目已提交,请耐心等待审批!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/Form?keyValue=' + keyValue, | |||
width: 1000, | |||
height: 800, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
} | |||
return res; | |||
} | |||
}); | |||
} | |||
}); | |||
//修改分值 | |||
$('#lr_updscore').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var Status = $('#gridtable').jfGridValue('Status'); | |||
if (Status == '2') { | |||
learun.alert.warning("当前项目已审批通过!"); | |||
return; | |||
} | |||
if (Status != '0') { | |||
learun.alert.warning("当前项目已提交,请耐心等待审批!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'form_updscore', | |||
title: '修改分值', | |||
url: top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/FormScore?keyValue=' + keyValue, | |||
width: 500, | |||
height: 350, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
} | |||
return res; | |||
} | |||
}); | |||
} | |||
}); | |||
//复制 | |||
$('#lr_copy').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/Form?keyValue=' + keyValue + '&type=copy', | |||
width: 1000, | |||
height: 800, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
} | |||
return res; | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var Status = $('#gridtable').jfGridValue('Status'); | |||
if (Status == '2') { | |||
learun.alert.warning("当前项目已审批通过!"); | |||
return; | |||
} | |||
if (Status != '0') { | |||
learun.alert.warning("当前项目已提交,请耐心等待审批!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 提交 | |||
$('#lr_submit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var Status = $('#gridtable').jfGridValue('Status'); | |||
if (Status == '2') { | |||
learun.alert.warning("当前项目已审批通过!"); | |||
return; | |||
} | |||
if (Status != '0') { | |||
learun.alert.warning("当前项目已提交,请耐心等待审批!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认提交该项!', function (res) { | |||
if (res) { | |||
processId = learun.newGuid(); | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/ChangeStatusById', { keyValue: keyValue, processId: processId }, function (res) { | |||
refreshGirdData(res, {}); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/StudentArticlePublic/GetPageList', | |||
headData: [ | |||
{ label: "学年", name: "AcademicYearNo", width: 80, align: "left" }, | |||
{ label: "学期", name: "Semester", width: 80, align: "left" }, | |||
{ label: "学生学号", name: "StuNo", width: 150, align: "left" }, | |||
{ label: "学生姓名", name: "StuName", width: 100, align: "left" }, | |||
{ | |||
label: "专业部", name: "DeptNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', | |||
key: value, | |||
keyId: 'deptno', | |||
callback: function (_data) { | |||
callback(_data['deptname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "专业", name: "MajorNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
key: value, | |||
keyId: 'majorno', | |||
callback: function (_data) { | |||
callback(_data['majorname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "班级", name: "ClassNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||
key: value, | |||
keyId: 'classno', | |||
callback: function (_data) { | |||
callback(_data['classname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "刊登期刊名称", name: "APName", width: 100, align: "left" }, | |||
{ | |||
label: "刊登期刊级别", name: "APLevel", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'Level', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "指导老师", name: "Instructor", width: 100, align: "left" }, | |||
{ label: "出版单位", name: "Unit", width: 100, align: "left" }, | |||
{ label: "分值", name: "Score", width: 100, align: "left" }, | |||
{ | |||
label: "刊登时间", name: "APTime", width: 100, align: "left", | |||
formatter: function (cellvalue, row) { | |||
return learun.formatDate(cellvalue, 'yyyy-MM-dd'); | |||
} | |||
}, | |||
{ | |||
label: "状态", name: "Status", 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>'; | |||
} | |||
} | |||
}, | |||
], | |||
mainId: 'Id', | |||
isPage: true | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function (res, postData) { | |||
if (res && res.code && res.code == 200) { | |||
var postData = { | |||
schemeCode: 'StudentArticlePublic',// 填写流程对应模板编号 | |||
processId: processId, | |||
level: '1', | |||
}; | |||
learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { | |||
learun.loading(false); | |||
}); | |||
} | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -351,6 +351,7 @@ | |||
<Compile Include="Areas\EducationalAdministration\Controllers\ScholarshipxjController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\ScoreStatisticsController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuAttendanceController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StudentArticlePublicController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StudentCompetitionController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StudentHonorController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuDisciplineManagementController.cs" /> | |||
@@ -1006,6 +1007,7 @@ | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_UserChangeInfo\Index.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Form.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Index.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\FundsApply\FormView.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\Index.cshtml" /> | |||
@@ -1174,6 +1176,9 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\StuCancelLeaveManagement\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuConsumption\IndexForStudent.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuConsumption\IndexForTeacher.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StudentArticlePublic\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StudentArticlePublic\FormScore.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StudentArticlePublic\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StudentCompetition\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StudentCompetition\FormScore.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StudentCompetition\Index.js" /> | |||
@@ -1297,6 +1302,10 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\StudentCompetition\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StudentCompetition\FormScore.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StudentCompetition\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StudentArticlePublic\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StudentArticlePublic\FormScore.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StudentArticlePublic\Index.cshtml" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\FundsApply\FormView.cshtml" /> | |||
<None Include="Areas\EducationalAdministration\Views\StuInfoBasic\Printxjk.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuInfoFresh\AllocationClassDC.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuInfoFresh\StatisticClassIndex.js" /> | |||
@@ -35,7 +35,9 @@ | |||
<typeAlias alias="StuDisciplineManagementMethod" type="Learun.Application.WorkFlow.StuDisciplineManagementMethod,Learun.Application.WorkFlow" /> | |||
<typeAlias alias="StudentCertificateMethod" type="Learun.Application.WorkFlow.StudentCertificateMethod,Learun.Application.WorkFlow" /> | |||
<typeAlias alias="StudentHonorMethod" type="Learun.Application.WorkFlow.StudentHonorMethod,Learun.Application.WorkFlow" /> | |||
<typeAlias alias="FundsApplyMethod" type="Learun.Application.WorkFlow.StudentHonorMethod,Learun.Application.WorkFlow" /> | |||
<typeAlias alias="StudentCompetitionMethod" type="Learun.Application.WorkFlow.StudentCompetitionMethod,Learun.Application.WorkFlow" /> | |||
<typeAlias alias="StudentArticlePublicMethod" type="Learun.Application.WorkFlow.StudentArticlePublicMethod,Learun.Application.WorkFlow" /> | |||
<!--任务调度器--> | |||
<typeAlias alias="ITSMethod" type="Learun.Application.Extention.TaskScheduling.ITsMethod,Learun.Application.Extention" /> | |||
@@ -81,7 +83,9 @@ | |||
<type type="IWorkFlowMethod" mapTo="StuDisciplineManagementMethod" name="StuDisciplineManagementMethod"></type> | |||
<type type="IWorkFlowMethod" mapTo="StudentCertificateMethod" name="StudentCertificateMethod"></type> | |||
<type type="IWorkFlowMethod" mapTo="StudentHonorMethod" name="StudentHonorMethod"></type> | |||
<type type="IWorkFlowMethod" mapTo="FundsApplyMethod" name="FundsApplyMethod"></type> | |||
<type type="IWorkFlowMethod" mapTo="StudentCompetitionMethod" name="StudentCompetitionMethod"></type> | |||
<type type="IWorkFlowMethod" mapTo="StudentArticlePublicMethod" name="StudentArticlePublicMethod"></type> | |||
</container> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-11-09 11:05 | |||
/// 描 述:学生文章发表 | |||
/// </summary> | |||
public class StudentArticlePublicMap : EntityTypeConfiguration<StudentArticlePublicEntity> | |||
{ | |||
public StudentArticlePublicMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("STUDENTARTICLEPUBLIC"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -110,6 +110,7 @@ | |||
<Compile Include="EducationalAdministration\ScoreStatisticsMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuCancelLeaveManagementMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuCancleDisciplineManagementMap.cs" /> | |||
<Compile Include="EducationalAdministration\StudentArticlePublicMap.cs" /> | |||
<Compile Include="EducationalAdministration\StudentCompetitionMap.cs" /> | |||
<Compile Include="EducationalAdministration\StudentHonorMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuDisciplineManagementMap.cs" /> | |||
@@ -123,11 +123,11 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, FundsApplyEntity entity) | |||
public void SaveEntity(string keyValue, FundsApplyEntity entity, List<FundsApplyDetailEntity> detailList) | |||
{ | |||
try | |||
{ | |||
fundsApplyService.SaveEntity(keyValue, entity); | |||
fundsApplyService.SaveEntity(keyValue, entity, detailList); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -142,6 +142,43 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
} | |||
} | |||
public void ChangeStatusById(string keyValue,int status, string processId) | |||
{ | |||
try | |||
{ | |||
fundsApplyService.ChangeStatusById(keyValue, status, processId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public void ChangeStatusByProcessId(string processId, int status) | |||
{ | |||
try | |||
{ | |||
fundsApplyService.ChangeStatusByProcessId(processId, status); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -35,6 +35,11 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
[Column("APPLYDEPT")] | |||
public string ApplyDept { get; set; } | |||
/// <summary> | |||
/// 是否固定资产 | |||
/// </summary> | |||
[Column("ISFIXEDASSETS")] | |||
public int? IsFixedAssets { get; set; } | |||
/// <summary> | |||
/// ApplyUser | |||
/// </summary> | |||
[Column("APPLYUSER")] | |||
@@ -73,6 +78,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
this.Status = 0; | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
@@ -48,7 +48,14 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, FundsApplyEntity entity); | |||
void SaveEntity(string keyValue, FundsApplyEntity entity, List<FundsApplyDetailEntity> detailList); | |||
/// <summary> | |||
/// 提交 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <param name="processId"></param> | |||
void ChangeStatusById(string keyValue,int status, string processId); | |||
void ChangeStatusByProcessId(string processId, int status); | |||
#endregion | |||
} | |||
@@ -135,20 +135,76 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, FundsApplyEntity entity) | |||
public void SaveEntity(string keyValue, FundsApplyEntity entity, List<FundsApplyDetailEntity> detailList) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS"); | |||
try | |||
{ | |||
db.BeginTrans(); | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository("CollegeMIS").Update(entity); | |||
db.Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
db.Insert(entity); | |||
} | |||
//子表 | |||
db.ExecuteBySql($"delete FundsApplyDetail where ApplyId='{entity.Id}'"); | |||
foreach (var detail in detailList) | |||
{ | |||
detail.Create(); | |||
detail.ApplyId = entity.Id; | |||
db.Insert(detail); | |||
} | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <param name="status"></param> | |||
/// <param name="processId"></param> | |||
public void ChangeStatusById(string keyValue, int status, string processId) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").ExecuteBySql($"update FundsApply set ProcessId='{processId}',status='{status}' where Id='{keyValue}'"); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
public void ChangeStatusByProcessId(string processId, int status) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").ExecuteBySql($"update FundsApply set status='{status}' where ProcessId='{processId}'"); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -67,6 +67,24 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
} | |||
} | |||
public List<FundsApplyDetailEntity> GetListByApplyId(string applyId) | |||
{ | |||
try | |||
{ | |||
return fundsApplyDetailService.GetListByApplyId(applyId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -27,6 +27,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
FundsApplyDetailEntity GetFundsApplyDetailEntity(string keyValue); | |||
List<FundsApplyDetailEntity> GetListByApplyId(string applyId); | |||
#endregion | |||
#region 提交数据 | |||
@@ -4,6 +4,7 @@ using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
@@ -43,7 +44,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
return this.BaseRepository("CollegeMIS").FindList<FundsApplyDetailEntity>(strSql.ToString(),dp, pagination); | |||
return this.BaseRepository("CollegeMIS").FindList<FundsApplyDetailEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -82,6 +83,25 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
} | |||
} | |||
public List<FundsApplyDetailEntity> GetListByApplyId(string applyId) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindList<FundsApplyDetailEntity>(x => x.ApplyId == applyId).ToList(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -94,7 +114,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<FundsApplyDetailEntity>(t=>t.Id == keyValue); | |||
this.BaseRepository("CollegeMIS").Delete<FundsApplyDetailEntity>(t => t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -0,0 +1,208 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-11-09 11:05 | |||
/// 描 述:学生文章发表 | |||
/// </summary> | |||
public class StudentArticlePublicBLL : StudentArticlePublicIBLL | |||
{ | |||
private StudentArticlePublicService studentArticlePublicService = new StudentArticlePublicService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<StudentArticlePublicEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return studentArticlePublicService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取StudentArticlePublic表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public StudentArticlePublicEntity GetStudentArticlePublicEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return studentArticlePublicService.GetStudentArticlePublicEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <returns></returns> | |||
public IEnumerable<StudentArticlePublicEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
return studentArticlePublicService.GetList(queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取主表实体数据 | |||
/// </summary> | |||
/// <param name="processId">流程实例ID</param> | |||
/// <returns></returns> | |||
public StudentArticlePublicEntity GetEntityByProcessId(string processId) | |||
{ | |||
try | |||
{ | |||
return studentArticlePublicService.GetEntityByProcessId(processId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
studentArticlePublicService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, StudentArticlePublicEntity entity) | |||
{ | |||
try | |||
{ | |||
studentArticlePublicService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public void ChangeStatusByProcessId(string processId, int status) | |||
{ | |||
try | |||
{ | |||
studentArticlePublicService.ChangeStatusByProcessId(processId, status); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public void ChangeStatusById(string keyValue, int status, string processId) | |||
{ | |||
try | |||
{ | |||
studentArticlePublicService.ChangeStatusById(keyValue, status, processId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,138 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-11-09 11:05 | |||
/// 描 述:学生文章发表 | |||
/// </summary> | |||
public class StudentArticlePublicEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// Id | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// StuNo | |||
/// </summary> | |||
[Column("STUNO")] | |||
public string StuNo { get; set; } | |||
/// <summary> | |||
/// StuName | |||
/// </summary> | |||
[Column("STUNAME")] | |||
public string StuName { get; set; } | |||
/// <summary> | |||
/// DeptNo | |||
/// </summary> | |||
[Column("DEPTNO")] | |||
public string DeptNo { get; set; } | |||
/// <summary> | |||
/// MajorNo | |||
/// </summary> | |||
[Column("MAJORNO")] | |||
public string MajorNo { get; set; } | |||
/// <summary> | |||
/// ClassNo | |||
/// </summary> | |||
[Column("CLASSNO")] | |||
public string ClassNo { get; set; } | |||
/// <summary> | |||
/// 赛事名称 | |||
/// </summary> | |||
[Column("SCNAME")] | |||
public string SCName { get; set; } | |||
/// <summary> | |||
/// 赛事级别 | |||
/// </summary> | |||
[Column("SCLEVEL")] | |||
public string SCLevel { get; set; } | |||
/// <summary> | |||
/// 赛事获取时间 | |||
/// </summary> | |||
[Column("SCTIME")] | |||
public DateTime? SCTime { get; set; } | |||
/// <summary> | |||
/// 赛事种类 | |||
/// </summary> | |||
[Column("SCTYPE")] | |||
public string SCType { get; set; } | |||
/// <summary> | |||
/// 分值 | |||
/// </summary> | |||
[Column("SCORE")] | |||
public decimal? Score { get; set; } | |||
/// <summary> | |||
/// 附件 | |||
/// </summary> | |||
[Column("URL")] | |||
public string Url { get; set; } | |||
/// <summary> | |||
/// 颁发单位 | |||
/// </summary> | |||
[Column("UNIT")] | |||
public string Unit { get; set; } | |||
/// <summary> | |||
/// CreateTime | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
/// <summary> | |||
/// CreateUserId | |||
/// </summary> | |||
[Column("CREATEUSERID")] | |||
public string CreateUserId { get; set; } | |||
/// <summary> | |||
/// processId | |||
/// </summary> | |||
[Column("PROCESSID")] | |||
public string processId { get; set; } | |||
/// <summary> | |||
/// Status | |||
/// </summary> | |||
[Column("STATUS")] | |||
public int? Status { get; set; } | |||
/// <summary> | |||
/// 学年 | |||
/// </summary> | |||
[Column("ACADEMICYEARNO")] | |||
public string AcademicYearNo { get; set; } | |||
/// <summary> | |||
/// 学期 | |||
/// </summary> | |||
[Column("SEMESTER")] | |||
public string Semester { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
this.CreateTime = DateTime.Now; | |||
this.CreateUserId = LoginUserInfo.Get().userId; | |||
this.Status = 0; | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.Id = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,63 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-11-09 11:05 | |||
/// 描 述:学生文章发表 | |||
/// </summary> | |||
public interface StudentArticlePublicIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<StudentArticlePublicEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取StudentArticlePublic表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
StudentArticlePublicEntity GetStudentArticlePublicEntity(string keyValue); | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <returns></returns> | |||
IEnumerable<StudentArticlePublicEntity> GetList(string queryJson); | |||
/// <summary> | |||
/// 获取主表实体数据 | |||
/// </summary> | |||
/// <param name="processId">流程实例ID</param> | |||
/// <returns></returns> | |||
StudentArticlePublicEntity GetEntityByProcessId(string processId); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, StudentArticlePublicEntity entity); | |||
void ChangeStatusByProcessId(string processId, int status); | |||
void ChangeStatusById(string keyValue, int status,string processId); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,308 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-11-09 11:05 | |||
/// 描 述:学生文章发表 | |||
/// </summary> | |||
public class StudentArticlePublicService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<StudentArticlePublicEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.* | |||
"); | |||
strSql.Append(" FROM StudentArticlePublic t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["StuNo"].IsEmpty()) | |||
{ | |||
dp.Add("StuNo", "%" + queryParam["StuNo"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.StuNo Like @StuNo "); | |||
} | |||
if (!queryParam["StuName"].IsEmpty()) | |||
{ | |||
dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.StuName Like @StuName "); | |||
} | |||
if (!queryParam["DeptNo"].IsEmpty()) | |||
{ | |||
dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.DeptNo = @DeptNo "); | |||
} | |||
if (!queryParam["MajorNo"].IsEmpty()) | |||
{ | |||
dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.MajorNo = @MajorNo "); | |||
} | |||
if (!queryParam["ClassNo"].IsEmpty()) | |||
{ | |||
dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.ClassNo = @ClassNo "); | |||
} | |||
if (!queryParam["APName"].IsEmpty()) | |||
{ | |||
dp.Add("APName", "%" + queryParam["APName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.APName Like @APName "); | |||
} | |||
if (!queryParam["APLevel"].IsEmpty()) | |||
{ | |||
dp.Add("APLevel", queryParam["APLevel"].ToString(), DbType.String); | |||
strSql.Append(" AND t.APLevel = @APLevel "); | |||
} | |||
if (!queryParam["APTime"].IsEmpty()) | |||
{ | |||
dp.Add("APTime", queryParam["APTime"].ToDate(), DbType.DateTime); | |||
strSql.Append(" AND t.APTime = @APTime "); | |||
} | |||
if (!queryParam["Instructor"].IsEmpty()) | |||
{ | |||
dp.Add("Instructor", "%" + queryParam["Instructor"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Instructor Like @Instructor "); | |||
} | |||
if (!queryParam["Unit"].IsEmpty()) | |||
{ | |||
dp.Add("Unit", "%" + queryParam["Unit"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Unit Like @Unit "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<StudentArticlePublicEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取StudentArticlePublic表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public StudentArticlePublicEntity GetStudentArticlePublicEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<StudentArticlePublicEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取主表实体数据 | |||
/// </summary> | |||
/// <param name="processId">流程实例ID</param> | |||
/// <returns></returns> | |||
public StudentArticlePublicEntity GetEntityByProcessId(string processId) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<StudentArticlePublicEntity>(t => t.processId == processId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <returns></returns> | |||
public IEnumerable<StudentArticlePublicEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT t.* "); | |||
strSql.Append(" FROM StudentArticlePublic t "); | |||
strSql.Append(" WHERE 1=1 and t.Status=2 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["StuNo"].IsEmpty()) | |||
{ | |||
dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.StuNo = @StuNo "); | |||
} | |||
if (!queryParam["StuName"].IsEmpty()) | |||
{ | |||
dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.StuName Like @StuName "); | |||
} | |||
if (!queryParam["AcademicYearNo"].IsEmpty()) | |||
{ | |||
dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.AcademicYearNo = @AcademicYearNo "); | |||
} | |||
if (!queryParam["Semester"].IsEmpty()) | |||
{ | |||
dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); | |||
strSql.Append(" AND t.Semester = @Semester "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<StudentArticlePublicEntity>(strSql.ToString(), dp); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<StudentArticlePublicEntity>(t => t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, StudentArticlePublicEntity entity) | |||
{ | |||
try | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository("CollegeMIS").Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
public void ChangeStatusByProcessId(string processId, int status) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").ExecuteBySql($"update StudentArticlePublic set Status='{status}' where processId='{processId}'"); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
public void ChangeStatusById(string keyValue, int status, string processId) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").ExecuteBySql($"update StudentArticlePublic set Status='{status}',processId='{processId}' where Id='{keyValue}'"); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -265,6 +265,10 @@ | |||
<Compile Include="EducationalAdministration\ScoreStatistics\ScoreStatisticsIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\ScoreStatistics\ScoreStatisticsService.cs" /> | |||
<Compile Include="EducationalAdministration\SignUpHelper.cs" /> | |||
<Compile Include="EducationalAdministration\StudentArticlePublic\StudentArticlePublicBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StudentArticlePublic\StudentArticlePublicEntity.cs" /> | |||
<Compile Include="EducationalAdministration\StudentArticlePublic\StudentArticlePublicIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StudentArticlePublic\StudentArticlePublicService.cs" /> | |||
<Compile Include="EducationalAdministration\StudentCompetition\StudentCompetitionBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StudentCompetition\StudentCompetitionEntity.cs" /> | |||
<Compile Include="EducationalAdministration\StudentCompetition\StudentCompetitionIBLL.cs" /> | |||
@@ -97,6 +97,8 @@ | |||
<Compile Include="NodeMethod\ArrangeLessonTermAttemperMethod.cs" /> | |||
<Compile Include="NodeMethod\ADR_AddApplyMethod.cs" /> | |||
<Compile Include="NodeMethod\Ass_AcceptanceMethod.cs" /> | |||
<Compile Include="NodeMethod\FundsApplyMethod.cs" /> | |||
<Compile Include="NodeMethod\StudentArticlePublicMethod.cs" /> | |||
<Compile Include="NodeMethod\StudentCompetitionMethod.cs" /> | |||
<Compile Include="NodeMethod\StudentHonorMethod.cs" /> | |||
<Compile Include="NodeMethod\StudentCertificateMethod.cs" /> | |||
@@ -0,0 +1,27 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Learun.Application.TwoDevelopment.AssetManagementSystem; | |||
namespace Learun.Application.WorkFlow | |||
{ | |||
public class FundsApplyMethod : IWorkFlowMethod | |||
{ | |||
FundsApplyIBLL fundsApply = new FundsApplyBLL(); | |||
public void Execute(WfMethodParameter parameter) | |||
{ | |||
if (parameter.code == "agree") | |||
{ | |||
fundsApply.ChangeStatusByProcessId(parameter.processId, 2); | |||
} | |||
else | |||
{ | |||
fundsApply.ChangeStatusByProcessId(parameter.processId, 0); | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,27 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
namespace Learun.Application.WorkFlow | |||
{ | |||
public class StudentArticlePublicMethod : IWorkFlowMethod | |||
{ | |||
StudentArticlePublicIBLL asset = new StudentArticlePublicBLL(); | |||
public void Execute(WfMethodParameter parameter) | |||
{ | |||
if (parameter.code == "agree") | |||
{ | |||
asset.ChangeStatusByProcessId(parameter.processId, 2); | |||
} | |||
else | |||
{ | |||
asset.ChangeStatusByProcessId(parameter.processId, 0); | |||
} | |||
} | |||
} | |||
} |
@@ -22,12 +22,12 @@ export default { | |||
// ], | |||
"apiHost": [ | |||
// "http://cyzjzx.gnway.cc:31218/"//测试地址接口 | |||
"http://cyzjzx.gnway.cc:29904/"//正式地址接口 | |||
//"http://localhost:31173/" | |||
// "http://cyzjzx.gnway.cc:29904/"//正式地址接口 | |||
"http://192.168.10.58:8012/" | |||
], | |||
// "webHost":"http://cyzjzx.gnway.cc:30549/",//测试地址 | |||
"webHost":"http://wxd3f.cyzjzx.com/",//正式地址 | |||
//"webHost":"http://localhost:20472/", | |||
// "webHost":"http://wxd3f.cyzjzx.com/",//正式地址 | |||
"webHost":"http://192.168.10.58:8009/", | |||
// 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 | |||
"devAccount": [ | |||
// 20201130230 21364200000400266 老师 420528196310072253 学生 420528200606205026 420528200507261428 | |||
@@ -1090,11 +1090,47 @@ | |||
"style": { | |||
"navigationBarTitleText": "详情" | |||
} | |||
}, | |||
// 财政工资条 | |||
{ | |||
"path": "pages/Payslip/Payslip/list", | |||
"style": { | |||
"navigationBarTitleText": "财政工资条" | |||
} | |||
}, | |||
{ | |||
"path": "pages/Payslip/Payslip/single", | |||
"style": { | |||
"navigationBarTitleText": "详情" | |||
} | |||
}, | |||
// 外聘工资条 | |||
{ | |||
"path": "pages/Payslip/recruitPayslip/list", | |||
"style": { | |||
"navigationBarTitleText": "外聘工资条" | |||
} | |||
}, | |||
{ | |||
"path": "pages/Payslip/recruitPayslip/single", | |||
"style": { | |||
"navigationBarTitleText": "详情" | |||
} | |||
}, | |||
// 公益性岗位工资条 | |||
{ | |||
"path": "pages/Payslip/welfarePayslip/list", | |||
"style": { | |||
"navigationBarTitleText": "公益性岗位" | |||
} | |||
}, | |||
{ | |||
"path": "pages/Payslip/welfarePayslip/single", | |||
"style": { | |||
"navigationBarTitleText": "详情" | |||
} | |||
} | |||
], | |||
// 全局样式 | |||
@@ -0,0 +1,280 @@ | |||
<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_InvoiceId"> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">姓名:</text> | |||
{{ displayListItem(item, 'EmpName') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">人员类别:</text> | |||
{{ displayListItem(item, 'PeopleType') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">发放年份:</text> | |||
{{ displayListItem(item, 'IssueYear') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">发放月份:</text> | |||
{{ displayListItem(item, 'IssueMonth') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">应发合计:</text> | |||
{{ displayListItem(item, 'TotalGrossPay') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">实发合计:</text> | |||
{{ displayListItem(item, 'NetCombined') }} | |||
</view> | |||
<!-- 操作按钮组 --> | |||
<l-customlist-action @view="action('view', item)" @edit="action('edit', item)" :showEdit="false" /> | |||
</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.IssueYear" @change="searchChange()" title="年份" placeholder="按年份筛选,例:2022" /> | |||
<l-input v-model="queryData.IssueMonth" @change="searchChange()" title="月份" placeholder="按月份筛选,例:10" /> | |||
<l-input v-model="queryData.EmpName" @change="searchChange()" title="姓名" placeholder="按姓名筛选" /> | |||
<l-input v-model="queryData.PeopleType" @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('create')" /> --> | |||
</view> | |||
</template> | |||
<script> | |||
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_CustomerId: { type: 'select', dataSource: '1', dataSourceId: 'crmCustomer,f_fullname,f_customerid' }, | |||
// F_InvoiceContent: { type: 'texteditor' }, | |||
// 姓名EmpName | |||
EmpName: { type: 'text' }, | |||
// 人员类别PeopleType | |||
PeopleType: { type: 'text' }, | |||
// 发放年份IssueYear | |||
IssueYear: { type: 'text' }, | |||
// 发放月份IssueMonth | |||
IssueMonth: { type: 'text' }, | |||
// 应发合计TotalGrossPay | |||
TotalGrossPay: { type: 'text' }, | |||
// 实发合计NetCombined | |||
NetCombined: { type: 'text' }, | |||
}, | |||
// 筛选菜单值 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: { | |||
keyword: '' | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
F_CustomerId: [] | |||
}, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中…', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表条目与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad() { | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('invoice-list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
this.ON('invoice-list-change', this.refreshList) | |||
await Promise.all([ | |||
// 加载 F_CustomerId 字段的数据源:客户信息 | |||
// this.FETCH_DATASOURCE('crmCustomer').then(result => { | |||
// this.dataSource.F_CustomerId = result.data.map(t => ({ text: t.f_fullname, value: t.f_customerid })) | |||
// }), | |||
// 拉取列表信息 | |||
this.fetchList() | |||
]) | |||
this.defaultQueryData = this.COPY(this.queryData) | |||
this.ready = true | |||
}, | |||
// 拉取列表 | |||
async fetchList(isConcat=true) { | |||
if (this.page > this.total) { | |||
return | |||
} | |||
const result = await this.HTTP_GET( | |||
'learun/adms/WageSchedule/getlist', | |||
{ | |||
pagination: { rows: 10, page: this.page, sidx: 'CreateTime', sord: 'DESC' }, | |||
queryJson: JSON.stringify(this.searchData) | |||
}, | |||
'加载数据时出错' | |||
) | |||
if (!result) { | |||
return | |||
} | |||
this.total = result.total | |||
this.page = result.page + 1 | |||
this.list = isConcat?this.list.concat(result.rows):result.rows; | |||
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` | |||
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' | |||
}, | |||
// 刷新清空列表 | |||
async refreshList(isConcat=true) { | |||
this.page = 1 | |||
this.total = 2 | |||
this.list = [] | |||
await this.fetchList(isConcat); | |||
}, | |||
// 列表下拉 | |||
pullDown() { | |||
this.refreshList().then(() => { | |||
this.$refs.list.stopPullDown() | |||
}) | |||
}, | |||
// 点击「编辑」、「查看」、「添加」、「删除」按钮 | |||
action(type, item) { | |||
switch (type) { | |||
default: | |||
case 'create': | |||
this.NAV_TO('./single?type=create') | |||
return | |||
case 'view': | |||
this.NAV_TO('./single?type=view&&id='+item.Id, item, true) | |||
return | |||
case 'edit': | |||
this.NAV_TO('./single?type=edit', item, true) | |||
return | |||
} | |||
}, | |||
// 显示列表中的标题项 | |||
displayListItem(item, field) { | |||
const fieldItem = this.scheme[field] | |||
const value = item[field] | |||
switch (fieldItem.type) { | |||
case 'currentInfo': | |||
case 'organize': | |||
switch (fieldItem.dataType) { | |||
case 'user': | |||
return get(this.GET_GLOBAL('user'), `${value}.name`, '') | |||
case 'department': | |||
return get(this.GET_GLOBAL('department'), `${value}.name`, '') | |||
case 'company': | |||
return get(this.GET_GLOBAL('company'), `${value}.name`, '') | |||
default: | |||
return value || '' | |||
} | |||
case 'radio': | |||
case 'select': | |||
const selectItem = this.dataSource[field].find(t => t.value === 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 || '' | |||
} | |||
}, | |||
// 设置搜索条件 | |||
async searchChange() { | |||
const result = {} | |||
const queryObj = pickBy(this.queryData, t => (Array.isArray(t) ? t.length > 0 : t)) | |||
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) | |||
this.searchData = result | |||
await this.refreshList(false); | |||
}, | |||
// 点击「清空搜索条件」按钮 | |||
reset() { | |||
this.queryData = this.COPY(this.defaultQueryData) | |||
this.searchChange() | |||
} | |||
} | |||
} | |||
</script> | |||
<style lang="less" scoped> | |||
@import '~@/common/css/sidepage.less'; | |||
@import '~@/common/css/customlist.less'; | |||
</style> |
@@ -0,0 +1,542 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<view class="item-title">基本信息</view> | |||
<l-input | |||
@input="setValue('WageSchedule.EmpName', $event)" | |||
:value="getValue('WageSchedule.EmpName')" | |||
:disabled="!edit" | |||
title="姓名" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.IdCardNo', $event)" | |||
:value="getValue('WageSchedule.IdCardNo')" | |||
:disabled="!edit" | |||
title="身份证号" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.PeopleType', $event)" | |||
:value="getValue('WageSchedule.PeopleType')" | |||
:disabled="!edit" | |||
title="人员类别" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.PostType', $event)" | |||
:value="getValue('WageSchedule.PostType')" | |||
:disabled="!edit" | |||
title="岗位等级" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.PayGrade', $event)" | |||
:value="getValue('WageSchedule.PayGrade')" | |||
:disabled="!edit" | |||
title="薪级" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.TotalGrossPay', $event)" | |||
:value="getValue('WageSchedule.TotalGrossPay')" | |||
:disabled="!edit" | |||
title="应发合计" | |||
/> | |||
<view class="item-title">基本工资</view> | |||
<l-input | |||
@input="setValue('WageSchedule.PostWage', $event)" | |||
:value="getValue('WageSchedule.PostWage')" | |||
:disabled="!edit" | |||
title="岗位工资" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.PayGradeWage', $event)" | |||
:value="getValue('WageSchedule.PayGradeWage')" | |||
:disabled="!edit" | |||
title="薪级工资" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.TenPercent', $event)" | |||
:value="getValue('WageSchedule.TenPercent')" | |||
:disabled="!edit" | |||
title="百分之十" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.BasePay', $event)" | |||
:value="getValue('WageSchedule.BasePay')" | |||
:disabled="!edit" | |||
title="小计" | |||
/> | |||
<view class="item-title">津贴补贴</view> | |||
<l-input | |||
@input="setValue('WageSchedule.RoughEdgeAllowance', $event)" | |||
:value="getValue('WageSchedule.RoughEdgeAllowance')" | |||
:disabled="!edit" | |||
title="艰边津贴" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.NationAllowance', $event)" | |||
:value="getValue('WageSchedule.NationAllowance')" | |||
:disabled="!edit" | |||
title="民族津贴" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.TeachAllowance', $event)" | |||
:value="getValue('WageSchedule.TeachAllowance')" | |||
:disabled="!edit" | |||
title="教师津贴" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.SubsidiesAllowances', $event)" | |||
:value="getValue('WageSchedule.SubsidiesAllowances')" | |||
:disabled="!edit" | |||
title="小计" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WageSchedule.BasicsPerformance', $event)" | |||
:value="getValue('WageSchedule.BasicsPerformance')" | |||
:disabled="!edit" | |||
title="基础性绩效" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WageSchedule.GirlStaffSanitation', $event)" | |||
:value="getValue('WageSchedule.GirlStaffSanitation')" | |||
:disabled="!edit" | |||
title="女职工卫生费" | |||
/> | |||
<view class="item-title">改革性补贴</view> | |||
<l-input | |||
@input="setValue('WageSchedule.Transportation', $event)" | |||
:value="getValue('WageSchedule.Transportation')" | |||
:disabled="!edit" | |||
title="交通补贴" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.RealeState', $event)" | |||
:value="getValue('WageSchedule.RealeState')" | |||
:disabled="!edit" | |||
title="物业补贴" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.WorkKeep', $event)" | |||
:value="getValue('WageSchedule.WorkKeep')" | |||
:disabled="!edit" | |||
title="工改保留补贴" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.ReformSubsidySum', $event)" | |||
:value="getValue('WageSchedule.ReformSubsidySum')" | |||
:disabled="!edit" | |||
title="小计" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WageSchedule.HousingAllowance', $event)" | |||
:value="getValue('WageSchedule.HousingAllowance')" | |||
:disabled="!edit" | |||
title="住房补贴" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WageSchedule.HousingFundAllowance', $event)" | |||
:value="getValue('WageSchedule.HousingFundAllowance')" | |||
:disabled="!edit" | |||
title="住房公积金" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WageSchedule.TeacherAndTown', $event)" | |||
:value="getValue('WageSchedule.TeacherAndTown')" | |||
:disabled="!edit" | |||
title="特级教师津贴和乡镇补贴" | |||
/> | |||
<view class="item-title">扣款</view> | |||
<l-input | |||
@input="setValue('WageSchedule.DeductionsSubtotal', $event)" | |||
:value="getValue('WageSchedule.DeductionsSubtotal')" | |||
:disabled="!edit" | |||
title="小计" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.AccumulationFund', $event)" | |||
:value="getValue('WageSchedule.AccumulationFund')" | |||
:disabled="!edit" | |||
title="公积金" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.LaborUnionWage', $event)" | |||
:value="getValue('WageSchedule.LaborUnionWage')" | |||
:disabled="!edit" | |||
title="工会工费" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.PersonalIncomeTax', $event)" | |||
:value="getValue('WageSchedule.PersonalIncomeTax')" | |||
:disabled="!edit" | |||
title="个人所得税" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.EndowmentInsurance', $event)" | |||
:value="getValue('WageSchedule.EndowmentInsurance')" | |||
:disabled="!edit" | |||
title="养老保险" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.OccupationalAnnuities', $event)" | |||
:value="getValue('WageSchedule.OccupationalAnnuities')" | |||
:disabled="!edit" | |||
title="职业年金" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.MedicalInsurance', $event)" | |||
:value="getValue('WageSchedule.MedicalInsurance')" | |||
:disabled="!edit" | |||
title="医疗保险" | |||
/> | |||
<l-input | |||
@input="setValue('WageSchedule.UnemploymentInsurance', $event)" | |||
:value="getValue('WageSchedule.UnemploymentInsurance')" | |||
:disabled="!edit" | |||
title="失业保险" | |||
/> | |||
<l-textarea | |||
@input="setValue('WageSchedule.Other', $event)" | |||
:value="getValue('WageSchedule.Other')" | |||
:readonly="!edit" | |||
title="其他" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WageSchedule.FiscalDirect', $event)" | |||
:value="getValue('WageSchedule.FiscalDirect')" | |||
:disabled="!edit" | |||
title="财政直达" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WageSchedule.BankWithholding', $event)" | |||
:value="getValue('WageSchedule.BankWithholding')" | |||
:disabled="!edit" | |||
title="银行代扣" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WageSchedule.NetCombined', $event)" | |||
:value="getValue('WageSchedule.NetCombined')" | |||
:disabled="!edit" | |||
title="实发合计" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WageSchedule.WageCardNo', $event)" | |||
:value="getValue('WageSchedule.WageCardNo')" | |||
:disabled="!edit" | |||
title="工资卡号" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WageSchedule.CreateUser', $event)" | |||
:value="getValue('WageSchedule.CreateUser')" | |||
:disabled="!edit" | |||
title="创建用户" | |||
/> | |||
<l-datetime-picker | |||
class="top-15" | |||
@input="setValue('WageSchedule.CreateTime', $event)" | |||
:value="getValue('WageSchedule.CreateTime')" | |||
:disabled="!edit" | |||
title="创建时间" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WageSchedule.IssueMonth', $event)" | |||
:value="getValue('WageSchedule.IssueMonth')" | |||
: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-16 15:39 | |||
* 描 述:工作日志 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/EducationalAdministration/JournalSend/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: { | |||
WageSchedule: { | |||
// JTitle: { type: 'text', title: '日志主题' }, | |||
// JTypeId: { type: 'select', title: '日志类型', dataSource: '0' }, | |||
// JReceiveId: { type: 'organize', title: '接收人', dataType: 'user' }, | |||
// JContent: { type: 'textarea', title: '日志内容' }, | |||
// Id | |||
// 序号No | |||
No: { type: 'text', title: '序号' }, | |||
// 姓名EmpName | |||
EmpName: { type: 'text', title: '姓名' }, | |||
// 账号/身份证号IdCardNo | |||
IdCardNo: { type: 'text', title: '账号/身份证号' }, | |||
// 人员类别PeopleType | |||
PeopleType: { type: 'text', title: '人员类别' }, | |||
// 岗位等级PostType | |||
PostType: { type: 'text', title: '岗位等级'}, | |||
// 薪级PayGrade | |||
PayGrade: { type: 'text', title: '薪级'}, | |||
// 应发合计TotalGrossPay | |||
TotalGrossPay: { type: 'text', title: '应发合计'}, | |||
// 岗位工资PostWage | |||
PostWage: { type: 'text', title: '岗位工资'}, | |||
// 薪级工资PayGradeWage | |||
PayGradeWage: { type: 'text', title: '薪级工资'}, | |||
// 百分之十TenPercent | |||
TenPercent: { type: 'text', title: '百分之十'}, | |||
// 基本工资小计BasePay | |||
BasePay: { type: 'text', title: '基本工资小计'}, | |||
// 艰边津贴RoughEdgeAllowance | |||
RoughEdgeAllowance: { type: 'text', title: '艰边津贴'}, | |||
// 民族津贴NationAllowance | |||
NationAllowance: { type: 'text', title: '民族津贴'}, | |||
// 教师津贴TeachAllowance | |||
TeachAllowance: { type: 'text', title: '教师津贴'}, | |||
// 津贴补贴小计SubsidiesAllowances | |||
SubsidiesAllowances: { type: 'text', title: '津贴补贴小计'}, | |||
// 基础性绩效BasicsPerformance | |||
BasicsPerformance: { type: 'text', title: '基础性绩效'}, | |||
// 女职工卫生费GirlStaffSanitation | |||
GirlStaffSanitation: { type: 'text', title: 'http://cyzjzx.gnway.cc:29904'}, | |||
// 交通补贴Transportation | |||
Transportation: { type: 'text', title: '交通补贴'}, | |||
// 物业补贴RealeState | |||
BasicsPerformance: { type: 'text', title: '基础性绩效'}, | |||
// 工改保留补贴WorkKeep | |||
WorkKeep: { type: 'text', title: '工改保留补贴'}, | |||
// 改革性补贴小计ReformSubsidySum | |||
ReformSubsidySum: { type: 'text', title: '改革性补贴小计'}, | |||
// 住房补贴HousingAllowance | |||
HousingAllowance: { type: 'text', title: '住房补贴'}, | |||
// 住房公积金HousingFundAllowance | |||
HousingFundAllowance: { type: 'text', title: '住房公积金'}, | |||
// 特级教师津贴和乡镇补贴TeacherAndTown | |||
TeacherAndTown: { type: 'text', title: '特级教师津贴和乡镇补贴'}, | |||
// 扣款小计DeductionsSubtotal | |||
DeductionsSubtotal: { type: 'text', title: '扣款小计'}, | |||
// 公积金AccumulationFund | |||
AccumulationFund: { type: 'text', title: '公积金'}, | |||
// 工会工费LaborUnionWage | |||
LaborUnionWage: { type: 'text', title: '工会工费'}, | |||
// 个人所得税PersonalIncomeTax | |||
PersonalIncomeTax: { type: 'text', title: '个人所得税'}, | |||
// 养老保险EndowmentInsurance | |||
EndowmentInsurance: { type: 'text', title: '养老保险'}, | |||
// 职业年金OccupationalAnnuities | |||
OccupationalAnnuities: { type: 'text', title: '职业年金'}, | |||
// 医疗保险MedicalInsurance | |||
MedicalInsurance: { type: 'text', title: '医疗保险'}, | |||
// 失业保险UnemploymentInsurance | |||
UnemploymentInsurance: { type: 'text', title: '失业保险'}, | |||
// 其他Other | |||
Other: { type: 'text', title: '其他'}, | |||
// 财政直达FiscalDirect | |||
FiscalDirect: { type: 'text', title: '财政直达'}, | |||
// 银行代扣BankWithholding | |||
BankWithholding: { type: 'text', title: '银行代扣'}, | |||
// 实发合计NetCombined | |||
NetCombined: { type: 'text', title: '实发合计'}, | |||
// 工资卡号WageCardNo | |||
WageCardNo: { type: 'text', title: '工资卡号'}, | |||
// CreateUser | |||
CreateUser: { type: 'text', title: '创建用户'}, | |||
// CreateTime | |||
CreateTime: { type: 'text', title: '创建时间'}, | |||
// UpdateUser | |||
// UpdateTime | |||
// 发放月份IssueMonth | |||
IssueMonth: { type: 'text', title: '发放月份'}, | |||
// 发放年份IssueYear | |||
IssueYear: { type: 'text', title: '发放年份'}, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
JournalSend: { | |||
JTypeId: [], | |||
}, | |||
} | |||
} | |||
}, | |||
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('learun/adms/WageSchedule/form', this.id) | |||
this.origin = await this.formatFormData(result) | |||
} | |||
this.current = this.COPY(this.origin) | |||
}, | |||
// 点击 「编辑」、「重置」、「保存」、「删除」 按钮 | |||
async action(type) { | |||
switch (type) { | |||
case 'edit': | |||
this.edit = true | |||
break | |||
case 'reset': | |||
this.current = this.COPY(this.origin) | |||
this.edit = false | |||
break | |||
case 'save': | |||
const verifyResult = this.verifyForm() | |||
if (verifyResult.length > 0) { | |||
this.CONFIRM('表单验证失败', verifyResult.join('\n')) | |||
return | |||
} | |||
if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) { | |||
return | |||
} | |||
this.LOADING('正在提交...') | |||
const postData = await this.getPostData(this.id) | |||
this.HTTP_POST('learun/adms/EducationalAdministration/Journal/save', postData, '表单提交保存失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministrationJournalSend-list-change') | |||
this.NAV_BACK() | |||
this.TOAST('提交保存成功') | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('learun/adms/EducationalAdministration/Journal/delete', this.id, '删除失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministrationJournalSend-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> | |||
<style> | |||
.item-title{ | |||
color: #000; | |||
font-size: 16px; | |||
line-height: 36px; | |||
padding-left: 15px; | |||
} | |||
.top-15{ | |||
margin-top: 8px; | |||
} | |||
</style> |
@@ -0,0 +1,280 @@ | |||
<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_InvoiceId"> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">姓名:</text> | |||
{{ displayListItem(item, 'EmpName') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">人员类别:</text> | |||
{{ displayListItem(item, 'PeopleType') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">发放年份:</text> | |||
{{ displayListItem(item, 'IssueYear') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">发放月份:</text> | |||
{{ displayListItem(item, 'IssueMonth') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">应发合计:</text> | |||
{{ displayListItem(item, 'TotalGrossPay') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">实发合计:</text> | |||
{{ displayListItem(item, 'NetCombined') }} | |||
</view> | |||
<!-- 操作按钮组 --> | |||
<l-customlist-action @view="action('view', item)" @edit="action('edit', item)" :showEdit="false" /> | |||
</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.IssueYear" @change="searchChange()" title="年份" placeholder="按年份筛选,例:2022" /> | |||
<l-input v-model="queryData.IssueMonth" @change="searchChange()" title="月份" placeholder="按月份筛选,例:10" /> | |||
<l-input v-model="queryData.EmpName" @change="searchChange()" title="姓名" placeholder="按姓名筛选" /> | |||
<l-input v-model="queryData.PeopleType" @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('create')" /> --> | |||
</view> | |||
</template> | |||
<script> | |||
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_CustomerId: { type: 'select', dataSource: '1', dataSourceId: 'crmCustomer,f_fullname,f_customerid' }, | |||
// F_InvoiceContent: { type: 'texteditor' }, | |||
// 姓名EmpName | |||
EmpName: { type: 'text' }, | |||
// 人员类别PeopleType | |||
PeopleType: { type: 'text' }, | |||
// 发放年份IssueYear | |||
IssueYear: { type: 'text' }, | |||
// 发放月份IssueMonth | |||
IssueMonth: { type: 'text' }, | |||
// 应发合计TotalGrossPay | |||
TotalGrossPay: { type: 'text' }, | |||
// 实发合计NetCombined | |||
NetCombined: { type: 'text' }, | |||
}, | |||
// 筛选菜单值 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: { | |||
keyword: '' | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
F_CustomerId: [] | |||
}, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中…', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表条目与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad() { | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('invoice-list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
this.ON('invoice-list-change', this.refreshList) | |||
await Promise.all([ | |||
// 加载 F_CustomerId 字段的数据源:客户信息 | |||
// this.FETCH_DATASOURCE('crmCustomer').then(result => { | |||
// this.dataSource.F_CustomerId = result.data.map(t => ({ text: t.f_fullname, value: t.f_customerid })) | |||
// }), | |||
// 拉取列表信息 | |||
this.fetchList() | |||
]) | |||
this.defaultQueryData = this.COPY(this.queryData) | |||
this.ready = true | |||
}, | |||
// 拉取列表 | |||
async fetchList(isConcat=true) { | |||
if (this.page > this.total) { | |||
return | |||
} | |||
const result = await this.HTTP_GET( | |||
'learun/adms/Ououtsourcing/getlist', | |||
{ | |||
pagination: { rows: 10, page: this.page, sidx: 'CreateTime', sord: 'DESC' }, | |||
queryJson: JSON.stringify(this.searchData) | |||
}, | |||
'加载数据时出错' | |||
) | |||
if (!result) { | |||
return | |||
} | |||
this.total = result.total | |||
this.page = result.page + 1 | |||
this.list = isConcat?this.list.concat(result.rows):result.rows; | |||
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` | |||
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' | |||
}, | |||
// 刷新清空列表 | |||
async refreshList(isConcat=true) { | |||
this.page = 1 | |||
this.total = 2 | |||
this.list = [] | |||
await this.fetchList(isConcat); | |||
}, | |||
// 列表下拉 | |||
pullDown() { | |||
this.refreshList().then(() => { | |||
this.$refs.list.stopPullDown() | |||
}) | |||
}, | |||
// 点击「编辑」、「查看」、「添加」、「删除」按钮 | |||
action(type, item) { | |||
switch (type) { | |||
default: | |||
case 'create': | |||
this.NAV_TO('./single?type=create') | |||
return | |||
case 'view': | |||
this.NAV_TO('./single?type=view&&id='+item.WPID, item, true) | |||
return | |||
case 'edit': | |||
this.NAV_TO('./single?type=edit', item, true) | |||
return | |||
} | |||
}, | |||
// 显示列表中的标题项 | |||
displayListItem(item, field) { | |||
const fieldItem = this.scheme[field] | |||
const value = item[field] | |||
switch (fieldItem.type) { | |||
case 'currentInfo': | |||
case 'organize': | |||
switch (fieldItem.dataType) { | |||
case 'user': | |||
return get(this.GET_GLOBAL('user'), `${value}.name`, '') | |||
case 'department': | |||
return get(this.GET_GLOBAL('department'), `${value}.name`, '') | |||
case 'company': | |||
return get(this.GET_GLOBAL('company'), `${value}.name`, '') | |||
default: | |||
return value || '' | |||
} | |||
case 'radio': | |||
case 'select': | |||
const selectItem = this.dataSource[field].find(t => t.value === 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 || '' | |||
} | |||
}, | |||
// 设置搜索条件 | |||
async searchChange() { | |||
const result = {} | |||
const queryObj = pickBy(this.queryData, t => (Array.isArray(t) ? t.length > 0 : t)) | |||
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) | |||
this.searchData = result | |||
await this.refreshList(false); | |||
}, | |||
// 点击「清空搜索条件」按钮 | |||
reset() { | |||
this.queryData = this.COPY(this.defaultQueryData) | |||
this.searchChange() | |||
} | |||
} | |||
} | |||
</script> | |||
<style lang="less" scoped> | |||
@import '~@/common/css/sidepage.less'; | |||
@import '~@/common/css/customlist.less'; | |||
</style> |
@@ -0,0 +1,577 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<view class="item-title">基本信息</view> | |||
<l-input | |||
@input="setValue('Ououtsourcing.EmpName', $event)" | |||
:value="getValue('Ououtsourcing.EmpName')" | |||
:disabled="!edit" | |||
title="姓名" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.IdCardNo', $event)" | |||
:value="getValue('Ououtsourcing.IdCardNo')" | |||
:disabled="!edit" | |||
title="身份证号" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.WageCardNo', $event)" | |||
:value="getValue('Ououtsourcing.WageCardNo')" | |||
:disabled="!edit" | |||
title="工资卡号" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.PeopleType', $event)" | |||
:value="getValue('Ououtsourcing.PeopleType')" | |||
:disabled="!edit" | |||
title="人员类别" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.PostType', $event)" | |||
:value="getValue('Ououtsourcing.PostType')" | |||
:disabled="!edit" | |||
title="岗位等级" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.PayGrade', $event)" | |||
:value="getValue('Ououtsourcing.PayGrade')" | |||
:disabled="!edit" | |||
title="薪级" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.TotalGrossPay', $event)" | |||
:value="getValue('Ououtsourcing.TotalGrossPay')" | |||
:disabled="!edit" | |||
title="应发合计" | |||
/> | |||
<view class="item-title">基本工资</view> | |||
<l-input | |||
@input="setValue('Ououtsourcing.PostWage', $event)" | |||
:value="getValue('Ououtsourcing.PostWage')" | |||
:disabled="!edit" | |||
title="岗位工资" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.PayGradeWage', $event)" | |||
:value="getValue('Ououtsourcing.PayGradeWage')" | |||
:disabled="!edit" | |||
title="薪级工资" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.TenPercent', $event)" | |||
:value="getValue('Ououtsourcing.TenPercent')" | |||
:disabled="!edit" | |||
title="百分之十" | |||
/> | |||
<!-- <l-input | |||
@input="setValue('Ououtsourcing.BasePay', $event)" | |||
:value="getValue('Ououtsourcing.BasePay')" | |||
:disabled="!edit" | |||
title="小计" | |||
/> --> | |||
<view class="item-title">津贴补贴</view> | |||
<l-input | |||
@input="setValue('Ououtsourcing.RoughEdgeAllowance', $event)" | |||
:value="getValue('Ououtsourcing.RoughEdgeAllowance')" | |||
:disabled="!edit" | |||
title="艰边津贴" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.NationAllowance', $event)" | |||
:value="getValue('Ououtsourcing.NationAllowance')" | |||
:disabled="!edit" | |||
title="民族津贴" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.TeachAllowance', $event)" | |||
:value="getValue('Ououtsourcing.TeachAllowance')" | |||
:disabled="!edit" | |||
title="教师津贴" | |||
/> | |||
<!-- <l-input | |||
@input="setValue('Ououtsourcing.SubsidiesAllowances', $event)" | |||
:value="getValue('Ououtsourcing.SubsidiesAllowances')" | |||
:disabled="!edit" | |||
title="小计" | |||
/> --> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.BasicsPerformance', $event)" | |||
:value="getValue('Ououtsourcing.BasicsPerformance')" | |||
:disabled="!edit" | |||
title="基础性绩效" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.GirlStaffSanitation', $event)" | |||
:value="getValue('Ououtsourcing.GirlStaffSanitation')" | |||
:disabled="!edit" | |||
title="女职工卫生费" | |||
/> | |||
<view class="item-title">改革性补贴</view> | |||
<l-input | |||
@input="setValue('Ououtsourcing.Transportation', $event)" | |||
:value="getValue('Ououtsourcing.Transportation')" | |||
:disabled="!edit" | |||
title="交通补贴" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.RealeState', $event)" | |||
:value="getValue('Ououtsourcing.RealeState')" | |||
:disabled="!edit" | |||
title="物业补贴" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.WorkKeep', $event)" | |||
:value="getValue('Ououtsourcing.WorkKeep')" | |||
:disabled="!edit" | |||
title="工改保留补贴" | |||
/> | |||
<!-- <l-input | |||
@input="setValue('Ououtsourcing.ReformSubsidySum', $event)" | |||
:value="getValue('Ououtsourcing.ReformSubsidySum')" | |||
:disabled="!edit" | |||
title="小计" | |||
/> --> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.HousingAllowance', $event)" | |||
:value="getValue('Ououtsourcing.HousingAllowance')" | |||
:disabled="!edit" | |||
title="住房补贴" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.ProvidentFundPayment', $event)" | |||
:value="getValue('Ououtsourcing.ProvidentFundPayment')" | |||
:disabled="!edit" | |||
title="缴纳公积金" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.AssessmentWages', $event)" | |||
:value="getValue('Ououtsourcing.AssessmentWages')" | |||
:disabled="!edit" | |||
title="考核工资" | |||
/> | |||
<!-- <l-input | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.TeacherAndTown', $event)" | |||
:value="getValue('Ououtsourcing.TeacherAndTown')" | |||
:disabled="!edit" | |||
title="特级教师津贴和乡镇补贴" | |||
/> --> | |||
<view class="item-title">扣款</view> | |||
<l-input | |||
@input="setValue('Ououtsourcing.DeductionsCombined', $event)" | |||
:value="getValue('Ououtsourcing.DeductionsCombined')" | |||
:disabled="!edit" | |||
title="小计" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.ProvidentFundPayment', $event)" | |||
:value="getValue('Ououtsourcing.ProvidentFundPayment')" | |||
:disabled="!edit" | |||
title="(缴纳)公积金" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.LaborUnionWage', $event)" | |||
:value="getValue('Ououtsourcing.LaborUnionWage')" | |||
:disabled="!edit" | |||
title="工会工费" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.PersonalIncomeTax', $event)" | |||
:value="getValue('Ououtsourcing.PersonalIncomeTax')" | |||
:disabled="!edit" | |||
title="个人所得税" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.EndowmentInsurance', $event)" | |||
:value="getValue('Ououtsourcing.EndowmentInsurance')" | |||
:disabled="!edit" | |||
title="养老保险" | |||
/> | |||
<!-- <l-input | |||
@input="setValue('Ououtsourcing.OccupationalAnnuities', $event)" | |||
:value="getValue('Ououtsourcing.OccupationalAnnuities')" | |||
:disabled="!edit" | |||
title="职业年金" | |||
/> --> | |||
<l-input | |||
@input="setValue('Ououtsourcing.MedicalInsurance', $event)" | |||
:value="getValue('Ououtsourcing.MedicalInsurance')" | |||
:disabled="!edit" | |||
title="医疗保险" | |||
/> | |||
<l-input | |||
@input="setValue('Ououtsourcing.UnemploymentInsurance', $event)" | |||
:value="getValue('Ououtsourcing.UnemploymentInsurance')" | |||
:disabled="!edit" | |||
title="失业保险" | |||
/> | |||
<l-textarea | |||
@input="setValue('Ououtsourcing.Other', $event)" | |||
:value="getValue('Ououtsourcing.Other')" | |||
:readonly="!edit" | |||
title="其他" | |||
/> | |||
<!-- <l-input | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.FiscalDirect', $event)" | |||
:value="getValue('Ououtsourcing.FiscalDirect')" | |||
:disabled="!edit" | |||
title="财政直达" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.BankWithholding', $event)" | |||
:value="getValue('Ououtsourcing.BankWithholding')" | |||
:disabled="!edit" | |||
title="银行代扣" | |||
/> --> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.NetCombined', $event)" | |||
:value="getValue('Ououtsourcing.NetCombined')" | |||
:disabled="!edit" | |||
title="实发合计" | |||
/> | |||
<!-- <l-input | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.CreateUser', $event)" | |||
:value="getValue('Ououtsourcing.CreateUser')" | |||
:disabled="!edit" | |||
title="创建用户" | |||
/> | |||
<l-datetime-picker | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.CreateTime', $event)" | |||
:value="getValue('Ououtsourcing.CreateTime')" | |||
:disabled="!edit" | |||
title="创建时间" | |||
/> --> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.IssueMonth', $event)" | |||
:value="getValue('Ououtsourcing.IssueMonth')" | |||
:disabled="!edit" | |||
title="发放月份" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('Ououtsourcing.IssueYear', $event)" | |||
:value="getValue('Ououtsourcing.IssueYear')" | |||
:disabled="!edit" | |||
title="发放年份" | |||
/> | |||
<!-- <l-select | |||
@input="setValue('JournalSend.JTypeId', $event)" | |||
:value="getValue('JournalSend.JTypeId')" | |||
:disabled="!edit" | |||
:range="dataSource.JournalSend.JTypeId" | |||
title="日志类型" | |||
/> | |||
<l-organize-picker | |||
@input="setValue('JournalSend.JReceiveId', $event)" | |||
:value="getValue('JournalSend.JReceiveId')" | |||
:readonly="!edit" | |||
type="user" | |||
title="接收人" | |||
/> | |||
<l-textarea | |||
@input="setValue('JournalSend.JContent', $event)" | |||
:value="getValue('JournalSend.JContent')" | |||
: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-16 15:39 | |||
* 描 述:工作日志 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/OuoutsourcingSend/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: { | |||
Ououtsourcing: { | |||
// JTitle: { type: 'text', title: '日志主题' }, | |||
// JTypeId: { type: 'select', title: '日志类型', dataSource: '0' }, | |||
// JReceiveId: { type: 'organize', title: '接收人', dataType: 'user' }, | |||
// JContent: { type: 'textarea', title: '日志内容' }, | |||
// Id | |||
// 序号No | |||
No: { type: 'text', title: '序号' }, | |||
// 姓名EmpName | |||
EmpName: { type: 'text', title: '姓名' }, | |||
// 账号/身份证号IdCardNo | |||
IdCardNo: { type: 'text', title: '账号/身份证号' }, | |||
// 人员类别PeopleType | |||
PeopleType: { type: 'text', title: '人员类别' }, | |||
// 岗位等级PostType | |||
PostType: { type: 'text', title: '岗位等级'}, | |||
// 薪级PayGrade | |||
PayGrade: { type: 'text', title: '薪级'}, | |||
// 应发合计TotalGrossPay | |||
TotalGrossPay: { type: 'text', title: '应发合计'}, | |||
// 岗位工资PostWage | |||
PostWage: { type: 'text', title: '岗位工资'}, | |||
// 薪级工资PayGradeWage | |||
PayGradeWage: { type: 'text', title: '薪级工资'}, | |||
// 百分之十TenPercent | |||
TenPercent: { type: 'text', title: '百分之十'}, | |||
// 基本工资小计BasePay | |||
// BasePay: { type: 'text', title: '基本工资小计'}, | |||
// 艰边津贴RoughEdgeAllowance | |||
RoughEdgeAllowance: { type: 'text', title: '艰边津贴'}, | |||
// 民族津贴NationAllowance | |||
NationAllowance: { type: 'text', title: '民族津贴'}, | |||
// 教师津贴TeachAllowance | |||
TeachAllowance: { type: 'text', title: '教师津贴'}, | |||
// 津贴补贴小计SubsidiesAllowances | |||
// SubsidiesAllowances: { type: 'text', title: '津贴补贴小计'}, | |||
// 基础性绩效BasicsPerformance | |||
BasicsPerformance: { type: 'text', title: '基础性绩效'}, | |||
// 女职工卫生费GirlStaffSanitation | |||
GirlStaffSanitation: { type: 'text', title: 'http://cyzjzx.gnway.cc:29904'}, | |||
// 交通补贴Transportation | |||
Transportation: { type: 'text', title: '交通补贴'}, | |||
// 物业补贴RealeState | |||
BasicsPerformance: { type: 'text', title: '基础性绩效'}, | |||
// 工改保留补贴WorkKeep | |||
WorkKeep: { type: 'text', title: '工改保留补贴'}, | |||
// 改革性补贴小计ReformSubsidySum | |||
// ReformSubsidySum: { type: 'text', title: '改革性补贴小计'}, | |||
// 住房补贴HousingAllowance | |||
HousingAllowance: { type: 'text', title: '住房补贴'}, | |||
// 公积金ProvidentFundPayment | |||
ProvidentFundPayment: { type: 'text', title: '公积金'}, | |||
// 考核工资AssessmentWages | |||
AssessmentWages: { type: 'text', title: '考核工资'}, | |||
// 特级教师津贴和乡镇补贴TeacherAndTown | |||
// TeacherAndTown: { type: 'text', title: '特级教师津贴和乡镇补贴'}, | |||
// 扣款小计DeductionsCombined | |||
DeductionsCombined: { type: 'text', title: '扣款小计'}, | |||
// 公积金ProvidentFundPayment | |||
ProvidentFundPayment: { type: 'text', title: '(缴纳)公积金'}, | |||
// 工会工费LaborUnionWage | |||
LaborUnionWage: { type: 'text', title: '工会工费'}, | |||
// 个人所得税PersonalIncomeTax | |||
PersonalIncomeTax: { type: 'text', title: '个人所得税'}, | |||
// 养老保险EndowmentInsurance | |||
EndowmentInsurance: { type: 'text', title: '养老保险'}, | |||
// 职业年金OccupationalAnnuities | |||
// OccupationalAnnuities: { type: 'text', title: '职业年金'}, | |||
// 医疗保险MedicalInsurance | |||
MedicalInsurance: { type: 'text', title: '医疗保险'}, | |||
// 失业保险UnemploymentInsurance | |||
UnemploymentInsurance: { type: 'text', title: '失业保险'}, | |||
// 其他Other | |||
Other: { type: 'text', title: '其他'}, | |||
// 财政直达FiscalDirect | |||
// FiscalDirect: { type: 'text', title: '财政直达'}, | |||
// 银行代扣BankWithholding | |||
// BankWithholding: { type: 'text', title: '银行代扣'}, | |||
// 实发合计NetCombined | |||
NetCombined: { type: 'text', title: '实发合计'}, | |||
// 工资卡号WageCardNo | |||
WageCardNo: { type: 'text', title: '工资卡号'}, | |||
// CreateUser | |||
// CreateUser: { type: 'text', title: '创建用户'}, | |||
// CreateTime | |||
// CreateTime: { type: 'text', title: '创建时间'}, | |||
// UpdateUser | |||
// UpdateTime | |||
// 发放月份IssueMonth | |||
IssueMonth: { type: 'text', title: '发放月份'}, | |||
// 发放年份IssueYear | |||
IssueYear: { type: 'text', title: '发放年份'}, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
JournalSend: { | |||
JTypeId: [], | |||
}, | |||
} | |||
} | |||
}, | |||
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('learun/adms/Ououtsourcing/form', this.id) | |||
this.origin = await this.formatFormData(result) | |||
} | |||
this.current = this.COPY(this.origin) | |||
}, | |||
// 点击 「编辑」、「重置」、「保存」、「删除」 按钮 | |||
async action(type) { | |||
switch (type) { | |||
case 'edit': | |||
this.edit = true | |||
break | |||
case 'reset': | |||
this.current = this.COPY(this.origin) | |||
this.edit = false | |||
break | |||
case 'save': | |||
const verifyResult = this.verifyForm() | |||
if (verifyResult.length > 0) { | |||
this.CONFIRM('表单验证失败', verifyResult.join('\n')) | |||
return | |||
} | |||
if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) { | |||
return | |||
} | |||
this.LOADING('正在提交...') | |||
const postData = await this.getPostData(this.id) | |||
this.HTTP_POST('learun/adms/Ououtsourcing/save', postData, '表单提交保存失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministrationJournalSend-list-change') | |||
this.NAV_BACK() | |||
this.TOAST('提交保存成功') | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('learun/adms/Ououtsourcing/delete', this.id, '删除失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministrationJournalSend-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> | |||
<style> | |||
.item-title{ | |||
color: #000; | |||
font-size: 16px; | |||
line-height: 36px; | |||
padding-left: 15px; | |||
} | |||
.top-15{ | |||
margin-top: 8px; | |||
} | |||
</style> |
@@ -0,0 +1,280 @@ | |||
<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_InvoiceId"> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">姓名:</text> | |||
{{ displayListItem(item, 'EmpName') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">人员类别:</text> | |||
{{ displayListItem(item, 'PeopleType') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">发放年份:</text> | |||
{{ displayListItem(item, 'IssueYear') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">发放月份:</text> | |||
{{ displayListItem(item, 'IssueMonth') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">应发合计:</text> | |||
{{ displayListItem(item, 'TotalGrossPay') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">实发合计:</text> | |||
{{ displayListItem(item, 'NetCombined') }} | |||
</view> | |||
<!-- 操作按钮组 --> | |||
<l-customlist-action @view="action('view', item)" @edit="action('edit', item)" :showEdit="false" /> | |||
</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.IssueYear" @change="searchChange()" title="年份" placeholder="按年份筛选,例:2022" /> | |||
<l-input v-model="queryData.IssueMonth" @change="searchChange()" title="月份" placeholder="按月份筛选,例:10" /> | |||
<l-input v-model="queryData.EmpName" @change="searchChange()" title="姓名" placeholder="按姓名筛选" /> | |||
<l-input v-model="queryData.PeopleType" @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('create')" /> --> | |||
</view> | |||
</template> | |||
<script> | |||
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_CustomerId: { type: 'select', dataSource: '1', dataSourceId: 'crmCustomer,f_fullname,f_customerid' }, | |||
// F_InvoiceContent: { type: 'texteditor' }, | |||
// 姓名EmpName | |||
EmpName: { type: 'text' }, | |||
// 人员类别PeopleType | |||
PeopleType: { type: 'text' }, | |||
// 发放年份IssueYear | |||
IssueYear: { type: 'text' }, | |||
// 发放月份IssueMonth | |||
IssueMonth: { type: 'text' }, | |||
// 应发合计TotalGrossPay | |||
TotalGrossPay: { type: 'text' }, | |||
// 实发合计NetCombined | |||
NetCombined: { type: 'text' }, | |||
}, | |||
// 筛选菜单值 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: { | |||
keyword: '' | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
F_CustomerId: [] | |||
}, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中…', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表条目与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad() { | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('invoice-list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
this.ON('invoice-list-change', this.refreshList) | |||
await Promise.all([ | |||
// 加载 F_CustomerId 字段的数据源:客户信息 | |||
// this.FETCH_DATASOURCE('crmCustomer').then(result => { | |||
// this.dataSource.F_CustomerId = result.data.map(t => ({ text: t.f_fullname, value: t.f_customerid })) | |||
// }), | |||
// 拉取列表信息 | |||
this.fetchList() | |||
]) | |||
this.defaultQueryData = this.COPY(this.queryData) | |||
this.ready = true | |||
}, | |||
// 拉取列表 | |||
async fetchList(isConcat=true) { | |||
if (this.page > this.total) { | |||
return | |||
} | |||
const result = await this.HTTP_GET( | |||
'learun/adms/WelfarePosition/getlist', | |||
{ | |||
pagination: { rows: 10, page: this.page, sidx: 'CreateTime', sord: 'DESC' }, | |||
queryJson: JSON.stringify(this.searchData) | |||
}, | |||
'加载数据时出错' | |||
) | |||
if (!result) { | |||
return | |||
} | |||
this.total = result.total | |||
this.page = result.page + 1 | |||
this.list = isConcat?this.list.concat(result.rows):result.rows; | |||
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` | |||
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' | |||
}, | |||
// 刷新清空列表 | |||
async refreshList(isConcat=true) { | |||
this.page = 1 | |||
this.total = 2 | |||
this.list = [] | |||
await this.fetchList(isConcat); | |||
}, | |||
// 列表下拉 | |||
pullDown() { | |||
this.refreshList().then(() => { | |||
this.$refs.list.stopPullDown() | |||
}) | |||
}, | |||
// 点击「编辑」、「查看」、「添加」、「删除」按钮 | |||
action(type, item) { | |||
switch (type) { | |||
default: | |||
case 'create': | |||
this.NAV_TO('./single?type=create') | |||
return | |||
case 'view': | |||
this.NAV_TO('./single?type=view&&id='+item.GYID, item, true) | |||
return | |||
case 'edit': | |||
this.NAV_TO('./single?type=edit', item, true) | |||
return | |||
} | |||
}, | |||
// 显示列表中的标题项 | |||
displayListItem(item, field) { | |||
const fieldItem = this.scheme[field] | |||
const value = item[field] | |||
switch (fieldItem.type) { | |||
case 'currentInfo': | |||
case 'organize': | |||
switch (fieldItem.dataType) { | |||
case 'user': | |||
return get(this.GET_GLOBAL('user'), `${value}.name`, '') | |||
case 'department': | |||
return get(this.GET_GLOBAL('department'), `${value}.name`, '') | |||
case 'company': | |||
return get(this.GET_GLOBAL('company'), `${value}.name`, '') | |||
default: | |||
return value || '' | |||
} | |||
case 'radio': | |||
case 'select': | |||
const selectItem = this.dataSource[field].find(t => t.value === 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 || '' | |||
} | |||
}, | |||
// 设置搜索条件 | |||
async searchChange() { | |||
const result = {} | |||
const queryObj = pickBy(this.queryData, t => (Array.isArray(t) ? t.length > 0 : t)) | |||
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) | |||
this.searchData = result | |||
await this.refreshList(false); | |||
}, | |||
// 点击「清空搜索条件」按钮 | |||
reset() { | |||
this.queryData = this.COPY(this.defaultQueryData) | |||
this.searchChange() | |||
} | |||
} | |||
} | |||
</script> | |||
<style lang="less" scoped> | |||
@import '~@/common/css/sidepage.less'; | |||
@import '~@/common/css/customlist.less'; | |||
</style> |
@@ -0,0 +1,577 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<view class="item-title">基本信息</view> | |||
<l-input | |||
@input="setValue('WelfarePosition.EmpName', $event)" | |||
:value="getValue('WelfarePosition.EmpName')" | |||
:disabled="!edit" | |||
title="姓名" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.IdCardNo', $event)" | |||
:value="getValue('WelfarePosition.IdCardNo')" | |||
:disabled="!edit" | |||
title="身份证号" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.WageCardNo', $event)" | |||
:value="getValue('WelfarePosition.WageCardNo')" | |||
:disabled="!edit" | |||
title="工资卡号" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.PeopleType', $event)" | |||
:value="getValue('WelfarePosition.PeopleType')" | |||
:disabled="!edit" | |||
title="人员类别" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.PostType', $event)" | |||
:value="getValue('WelfarePosition.PostType')" | |||
:disabled="!edit" | |||
title="岗位等级" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.PayGrade', $event)" | |||
:value="getValue('WelfarePosition.PayGrade')" | |||
:disabled="!edit" | |||
title="薪级" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.TotalGrossPay', $event)" | |||
:value="getValue('WelfarePosition.TotalGrossPay')" | |||
:disabled="!edit" | |||
title="应发合计" | |||
/> | |||
<view class="item-title">基本工资</view> | |||
<l-input | |||
@input="setValue('WelfarePosition.PostWage', $event)" | |||
:value="getValue('WelfarePosition.PostWage')" | |||
:disabled="!edit" | |||
title="岗位工资" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.PayGradeWage', $event)" | |||
:value="getValue('WelfarePosition.PayGradeWage')" | |||
:disabled="!edit" | |||
title="薪级工资" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.TenPercent', $event)" | |||
:value="getValue('WelfarePosition.TenPercent')" | |||
:disabled="!edit" | |||
title="百分之十" | |||
/> | |||
<!-- <l-input | |||
@input="setValue('WelfarePosition.BasePay', $event)" | |||
:value="getValue('WelfarePosition.BasePay')" | |||
:disabled="!edit" | |||
title="小计" | |||
/> --> | |||
<view class="item-title">津贴补贴</view> | |||
<l-input | |||
@input="setValue('WelfarePosition.RoughEdgeAllowance', $event)" | |||
:value="getValue('WelfarePosition.RoughEdgeAllowance')" | |||
:disabled="!edit" | |||
title="艰边津贴" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.NationAllowance', $event)" | |||
:value="getValue('WelfarePosition.NationAllowance')" | |||
:disabled="!edit" | |||
title="民族津贴" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.TeachAllowance', $event)" | |||
:value="getValue('WelfarePosition.TeachAllowance')" | |||
:disabled="!edit" | |||
title="教师津贴" | |||
/> | |||
<!-- <l-input | |||
@input="setValue('WelfarePosition.SubsidiesAllowances', $event)" | |||
:value="getValue('WelfarePosition.SubsidiesAllowances')" | |||
:disabled="!edit" | |||
title="小计" | |||
/> --> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WelfarePosition.BasicsPerformance', $event)" | |||
:value="getValue('WelfarePosition.BasicsPerformance')" | |||
:disabled="!edit" | |||
title="基础性绩效" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WelfarePosition.GirlStaffSanitation', $event)" | |||
:value="getValue('WelfarePosition.GirlStaffSanitation')" | |||
:disabled="!edit" | |||
title="女职工卫生费" | |||
/> | |||
<view class="item-title">改革性补贴</view> | |||
<l-input | |||
@input="setValue('WelfarePosition.Transportation', $event)" | |||
:value="getValue('WelfarePosition.Transportation')" | |||
:disabled="!edit" | |||
title="交通补贴" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.RealeState', $event)" | |||
:value="getValue('WelfarePosition.RealeState')" | |||
:disabled="!edit" | |||
title="物业补贴" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.WorkKeep', $event)" | |||
:value="getValue('WelfarePosition.WorkKeep')" | |||
:disabled="!edit" | |||
title="工改保留补贴" | |||
/> | |||
<!-- <l-input | |||
@input="setValue('WelfarePosition.ReformSubsidySum', $event)" | |||
:value="getValue('WelfarePosition.ReformSubsidySum')" | |||
:disabled="!edit" | |||
title="小计" | |||
/> --> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WelfarePosition.HousingAllowance', $event)" | |||
:value="getValue('WelfarePosition.HousingAllowance')" | |||
:disabled="!edit" | |||
title="住房补贴" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WelfarePosition.ProvidentFundPayment', $event)" | |||
:value="getValue('WelfarePosition.ProvidentFundPayment')" | |||
:disabled="!edit" | |||
title="缴纳公积金" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WelfarePosition.AssessmentWages', $event)" | |||
:value="getValue('WelfarePosition.AssessmentWages')" | |||
:disabled="!edit" | |||
title="考核工资" | |||
/> | |||
<!-- <l-input | |||
class="top-15" | |||
@input="setValue('WelfarePosition.TeacherAndTown', $event)" | |||
:value="getValue('WelfarePosition.TeacherAndTown')" | |||
:disabled="!edit" | |||
title="特级教师津贴和乡镇补贴" | |||
/> --> | |||
<view class="item-title">扣款</view> | |||
<l-input | |||
@input="setValue('WelfarePosition.DeductionsCombined', $event)" | |||
:value="getValue('WelfarePosition.DeductionsCombined')" | |||
:disabled="!edit" | |||
title="小计" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.ProvidentFundPayment', $event)" | |||
:value="getValue('WelfarePosition.ProvidentFundPayment')" | |||
:disabled="!edit" | |||
title="(缴纳)公积金" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.LaborUnionWage', $event)" | |||
:value="getValue('WelfarePosition.LaborUnionWage')" | |||
:disabled="!edit" | |||
title="工会工费" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.PersonalIncomeTax', $event)" | |||
:value="getValue('WelfarePosition.PersonalIncomeTax')" | |||
:disabled="!edit" | |||
title="个人所得税" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.EndowmentInsurance', $event)" | |||
:value="getValue('WelfarePosition.EndowmentInsurance')" | |||
:disabled="!edit" | |||
title="养老保险" | |||
/> | |||
<!-- <l-input | |||
@input="setValue('WelfarePosition.OccupationalAnnuities', $event)" | |||
:value="getValue('WelfarePosition.OccupationalAnnuities')" | |||
:disabled="!edit" | |||
title="职业年金" | |||
/> --> | |||
<l-input | |||
@input="setValue('WelfarePosition.MedicalInsurance', $event)" | |||
:value="getValue('WelfarePosition.MedicalInsurance')" | |||
:disabled="!edit" | |||
title="医疗保险" | |||
/> | |||
<l-input | |||
@input="setValue('WelfarePosition.UnemploymentInsurance', $event)" | |||
:value="getValue('WelfarePosition.UnemploymentInsurance')" | |||
:disabled="!edit" | |||
title="失业保险" | |||
/> | |||
<l-textarea | |||
@input="setValue('WelfarePosition.Other', $event)" | |||
:value="getValue('WelfarePosition.Other')" | |||
:readonly="!edit" | |||
title="其他" | |||
/> | |||
<!-- <l-input | |||
class="top-15" | |||
@input="setValue('WelfarePosition.FiscalDirect', $event)" | |||
:value="getValue('WelfarePosition.FiscalDirect')" | |||
:disabled="!edit" | |||
title="财政直达" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WelfarePosition.BankWithholding', $event)" | |||
:value="getValue('WelfarePosition.BankWithholding')" | |||
:disabled="!edit" | |||
title="银行代扣" | |||
/> --> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WelfarePosition.NetCombined', $event)" | |||
:value="getValue('WelfarePosition.NetCombined')" | |||
:disabled="!edit" | |||
title="实发合计" | |||
/> | |||
<!-- <l-input | |||
class="top-15" | |||
@input="setValue('WelfarePosition.CreateUser', $event)" | |||
:value="getValue('WelfarePosition.CreateUser')" | |||
:disabled="!edit" | |||
title="创建用户" | |||
/> | |||
<l-datetime-picker | |||
class="top-15" | |||
@input="setValue('WelfarePosition.CreateTime', $event)" | |||
:value="getValue('WelfarePosition.CreateTime')" | |||
:disabled="!edit" | |||
title="创建时间" | |||
/> --> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WelfarePosition.IssueMonth', $event)" | |||
:value="getValue('WelfarePosition.IssueMonth')" | |||
:disabled="!edit" | |||
title="发放月份" | |||
/> | |||
<l-input | |||
class="top-15" | |||
@input="setValue('WelfarePosition.IssueYear', $event)" | |||
:value="getValue('WelfarePosition.IssueYear')" | |||
:disabled="!edit" | |||
title="发放年份" | |||
/> | |||
<!-- <l-select | |||
@input="setValue('JournalSend.JTypeId', $event)" | |||
:value="getValue('JournalSend.JTypeId')" | |||
:disabled="!edit" | |||
:range="dataSource.JournalSend.JTypeId" | |||
title="日志类型" | |||
/> | |||
<l-organize-picker | |||
@input="setValue('JournalSend.JReceiveId', $event)" | |||
:value="getValue('JournalSend.JReceiveId')" | |||
:readonly="!edit" | |||
type="user" | |||
title="接收人" | |||
/> | |||
<l-textarea | |||
@input="setValue('JournalSend.JContent', $event)" | |||
:value="getValue('JournalSend.JContent')" | |||
: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-16 15:39 | |||
* 描 述:工作日志 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/WelfarePositionSend/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: { | |||
WelfarePosition: { | |||
// JTitle: { type: 'text', title: '日志主题' }, | |||
// JTypeId: { type: 'select', title: '日志类型', dataSource: '0' }, | |||
// JReceiveId: { type: 'organize', title: '接收人', dataType: 'user' }, | |||
// JContent: { type: 'textarea', title: '日志内容' }, | |||
// Id | |||
// 序号No | |||
No: { type: 'text', title: '序号' }, | |||
// 姓名EmpName | |||
EmpName: { type: 'text', title: '姓名' }, | |||
// 账号/身份证号IdCardNo | |||
IdCardNo: { type: 'text', title: '账号/身份证号' }, | |||
// 人员类别PeopleType | |||
PeopleType: { type: 'text', title: '人员类别' }, | |||
// 岗位等级PostType | |||
PostType: { type: 'text', title: '岗位等级'}, | |||
// 薪级PayGrade | |||
PayGrade: { type: 'text', title: '薪级'}, | |||
// 应发合计TotalGrossPay | |||
TotalGrossPay: { type: 'text', title: '应发合计'}, | |||
// 岗位工资PostWage | |||
PostWage: { type: 'text', title: '岗位工资'}, | |||
// 薪级工资PayGradeWage | |||
PayGradeWage: { type: 'text', title: '薪级工资'}, | |||
// 百分之十TenPercent | |||
TenPercent: { type: 'text', title: '百分之十'}, | |||
// 基本工资小计BasePay | |||
// BasePay: { type: 'text', title: '基本工资小计'}, | |||
// 艰边津贴RoughEdgeAllowance | |||
RoughEdgeAllowance: { type: 'text', title: '艰边津贴'}, | |||
// 民族津贴NationAllowance | |||
NationAllowance: { type: 'text', title: '民族津贴'}, | |||
// 教师津贴TeachAllowance | |||
TeachAllowance: { type: 'text', title: '教师津贴'}, | |||
// 津贴补贴小计SubsidiesAllowances | |||
// SubsidiesAllowances: { type: 'text', title: '津贴补贴小计'}, | |||
// 基础性绩效BasicsPerformance | |||
BasicsPerformance: { type: 'text', title: '基础性绩效'}, | |||
// 女职工卫生费GirlStaffSanitation | |||
GirlStaffSanitation: { type: 'text', title: 'http://cyzjzx.gnway.cc:29904'}, | |||
// 交通补贴Transportation | |||
Transportation: { type: 'text', title: '交通补贴'}, | |||
// 物业补贴RealeState | |||
BasicsPerformance: { type: 'text', title: '基础性绩效'}, | |||
// 工改保留补贴WorkKeep | |||
WorkKeep: { type: 'text', title: '工改保留补贴'}, | |||
// 改革性补贴小计ReformSubsidySum | |||
// ReformSubsidySum: { type: 'text', title: '改革性补贴小计'}, | |||
// 住房补贴HousingAllowance | |||
HousingAllowance: { type: 'text', title: '住房补贴'}, | |||
// 公积金ProvidentFundPayment | |||
ProvidentFundPayment: { type: 'text', title: '公积金'}, | |||
// 考核工资AssessmentWages | |||
AssessmentWages: { type: 'text', title: '考核工资'}, | |||
// 特级教师津贴和乡镇补贴TeacherAndTown | |||
// TeacherAndTown: { type: 'text', title: '特级教师津贴和乡镇补贴'}, | |||
// 扣款小计DeductionsCombined | |||
DeductionsCombined: { type: 'text', title: '扣款小计'}, | |||
// 公积金ProvidentFundPayment | |||
ProvidentFundPayment: { type: 'text', title: '(缴纳)公积金'}, | |||
// 工会工费LaborUnionWage | |||
LaborUnionWage: { type: 'text', title: '工会工费'}, | |||
// 个人所得税PersonalIncomeTax | |||
PersonalIncomeTax: { type: 'text', title: '个人所得税'}, | |||
// 养老保险EndowmentInsurance | |||
EndowmentInsurance: { type: 'text', title: '养老保险'}, | |||
// 职业年金OccupationalAnnuities | |||
// OccupationalAnnuities: { type: 'text', title: '职业年金'}, | |||
// 医疗保险MedicalInsurance | |||
MedicalInsurance: { type: 'text', title: '医疗保险'}, | |||
// 失业保险UnemploymentInsurance | |||
UnemploymentInsurance: { type: 'text', title: '失业保险'}, | |||
// 其他Other | |||
Other: { type: 'text', title: '其他'}, | |||
// 财政直达FiscalDirect | |||
// FiscalDirect: { type: 'text', title: '财政直达'}, | |||
// 银行代扣BankWithholding | |||
// BankWithholding: { type: 'text', title: '银行代扣'}, | |||
// 实发合计NetCombined | |||
NetCombined: { type: 'text', title: '实发合计'}, | |||
// 工资卡号WageCardNo | |||
WageCardNo: { type: 'text', title: '工资卡号'}, | |||
// CreateUser | |||
// CreateUser: { type: 'text', title: '创建用户'}, | |||
// CreateTime | |||
// CreateTime: { type: 'text', title: '创建时间'}, | |||
// UpdateUser | |||
// UpdateTime | |||
// 发放月份IssueMonth | |||
IssueMonth: { type: 'text', title: '发放月份'}, | |||
// 发放年份IssueYear | |||
IssueYear: { type: 'text', title: '发放年份'}, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
JournalSend: { | |||
JTypeId: [], | |||
}, | |||
} | |||
} | |||
}, | |||
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('learun/adms/WelfarePosition/form', this.id) | |||
this.origin = await this.formatFormData(result) | |||
} | |||
this.current = this.COPY(this.origin) | |||
}, | |||
// 点击 「编辑」、「重置」、「保存」、「删除」 按钮 | |||
async action(type) { | |||
switch (type) { | |||
case 'edit': | |||
this.edit = true | |||
break | |||
case 'reset': | |||
this.current = this.COPY(this.origin) | |||
this.edit = false | |||
break | |||
case 'save': | |||
const verifyResult = this.verifyForm() | |||
if (verifyResult.length > 0) { | |||
this.CONFIRM('表单验证失败', verifyResult.join('\n')) | |||
return | |||
} | |||
if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) { | |||
return | |||
} | |||
this.LOADING('正在提交...') | |||
const postData = await this.getPostData(this.id) | |||
this.HTTP_POST('learun/adms/WelfarePosition/save', postData, '表单提交保存失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministrationJournalSend-list-change') | |||
this.NAV_BACK() | |||
this.TOAST('提交保存成功') | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('learun/adms/WelfarePosition/delete', this.id, '删除失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministrationJournalSend-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> | |||
<style> | |||
.item-title{ | |||
color: #000; | |||
font-size: 16px; | |||
line-height: 36px; | |||
padding-left: 15px; | |||
} | |||
.top-15{ | |||
margin-top: 8px; | |||
} | |||
</style> |