@@ -46,6 +46,12 @@ var bootstrap = function ($, learun) {
$('#lr_edit').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.layerForm({
id: 'formFundsApply',
title: '编辑',
@@ -71,10 +77,15 @@ var bootstrap = function ($, learun) {
$('#lr_delete').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) {
learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/FundsApply/DeleteForm', { keyValue: keyValue}, function () {
refreshGirdData();
learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/FundsApply/DeleteForm', { keyValue: keyValue }, function () {
page.search ();
});
}
});
@@ -103,7 +114,22 @@ var bootstrap = function ($, learun) {
});
}
});
//查看
$('#lr_look').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'formFundsApply',
title: '查看',
url: top.$.rootUrl + '/AssetManagementSystem/FundsApply/FormView?keyValue=' + keyValue,
width: 860,
height: 600,
callBack: function (id) {
}
});
}
});
},
// 初始化列表
initGird: function () {
@@ -111,27 +137,31 @@ var bootstrap = function ($, learun) {
url: top.$.rootUrl + '/AssetManagementSystem/FundsApply/GetPageList',
headData: [
{ 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', {
key: value,
callback: function (_data) {
callback(_data.name);
}
});
}},
{ label: "填报时间", name: "ApplyTime", width: 100, align: "left"},
{ label: "填报人", name: "ApplyUser", width: 100, align: "left",
formatterAsync: function (callback, value, row, op,$cell) {
learun.clientdata.getAsync('user', {
key: value,
callback: function (_data) {
callback(_data.name);
}
});
}},
{ label: "备注", name: "Remark", width: 100, align: "left"},
{ label: "总金额", name: "SumAmount", width: 100, align: "left"},
{
label: "申报部门", name: "ApplyDept", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('department', {
key: value,
callback: function (_data) {
callback(_data.name);
}
});
}
},
{ label: "填报时间", name: "ApplyTime", width: 100, align: "left" },
{
label: "填报人", name: "ApplyUser", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('user', {
key: value,
callback: function (_data) {
callback(_data.name);
}
});
}
},
{ label: "备注", name: "Remark", width: 100, align: "left" },
{ label: "总金额", name: "SumAmount", width: 100, align: "left" },
{ label: "人民币(大写)", name: "UpperAmount", width: 100, align: "left" },
{
label: "审批状态", name: "Status", width: 100, align: "left",
@@ -147,33 +177,31 @@ var bootstrap = function ($, learun) {
}
],
mainId:'Id',
mainId: 'Id',
isPage: true
});
page.search();
},
search: function (param) {
param = param || {};
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function (res, postData) {
if (!!res)
{
if (res.code == 200)
{
// 发起流程
var postData = {
schemeCode:'LC_FundsApply',// 填写流程对应模板编号
processId:processId,
level:'1',
} ;
learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function(data) {
learun.loading(false);
} );
if (!!res) {
if (res.code == 200) {
// 发起流程
var postData = {
schemeCode: 'LC_FundsApply',// 填写流程对应模板编号
processId: processId,
level: '1',
};
learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
learun.loading(false) ;
});
}
page.search( );
}
page.search();
}
};
page.init();
}