Browse Source

【修改】固定资产:增加审核、取消审核功能;

塔里木分支
dyy 7 months ago
parent
commit
24153ea560
7 changed files with 198 additions and 82 deletions
  1. +12
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_FixAssetsController.cs
  2. +9
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Index.cshtml
  3. +113
    -66
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Index.js
  4. +14
    -14
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/IndexOfTeacher.js
  5. +17
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsBLL.cs
  6. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsIBLL.cs
  7. +26
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsService.cs

+ 12
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_FixAssetsController.cs View File

@@ -173,6 +173,18 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers
return Success("保存成功!");
}
/// <summary>
/// 审核实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult Lock(string keyValue, int status)
{
ass_FixAssetsIBLL.DoCheck(keyValue, status);
return Success("操作成功!");
}
/// <summary>
/// 提交
/// </summary>
/// <param name="keyValue"></param>


+ 9
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Index.cshtml View File

@@ -70,6 +70,10 @@
<div class="lr-form-item-title">折旧/摊销状态</div>
<div id="DepreciationStatus"></div>
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">状态</div>
<div id="Status"></div>
</div>
</div>
</div>
</div>
@@ -83,9 +87,13 @@
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock"></i>&nbsp;审核</a>
<a id="lr_cancelCheck" class="btn btn-default"><i class="fa fa-unlock"></i>&nbsp;取消审核</a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_view" class="btn btn-default"><i class="fa fa-eye"></i>&nbsp;查看</a>
<a id="lr_submit" class="btn btn-default"><i class="fa fa-arrow-up"></i>&nbsp;提交</a>
@*<a id="lr_submit" class="btn btn-default"><i class="fa fa-arrow-up"></i>&nbsp;提交</a>*@
<a id="lr_import" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;导入</a>
</div>
</div>


+ 113
- 66
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Index.js View File

@@ -58,6 +58,7 @@ var bootstrap = function ($, learun) {
$('#CardStatus').lrDataItemSelect({ code: 'CardStatus' });
$('#StorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' });
$('#DepreciationStatus').lrDataItemSelect({ code: 'DepreciationStatus' });
$('#Status').lrselect({ data: [{ id: "0", text: "未审核" }, { id: "2", text: "已审核" }] });
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
@@ -88,9 +89,13 @@ var bootstrap = function ($, learun) {
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('FAId');
if (learun.checkrow(keyValue)) {
if (keyValue.indexOf(",") != -1) {
learun.alert.warning("只能选择一条记录进行编辑!");
return false;
}
var Status = $('#gridtable').jfGridValue('Status');
if (Status !== 0) {
learun.alert.warning("当前项目已提交不能编辑!");
if (Status == 2) {
learun.alert.warning("当前项目已审核不能编辑!");
return;
}
learun.layerForm({
@@ -119,8 +124,12 @@ var bootstrap = function ($, learun) {
var keyValue = $('#gridtable').jfGridValue('FAId');
if (learun.checkrow(keyValue)) {
var Status = $('#gridtable').jfGridValue('Status');
if (Status !== 0) {
learun.alert.warning("当前项目已提交不能删除!");
//if (Status !== 0) {
// learun.alert.warning("当前项目已提交不能删除!");
// return;
//}
if (Status.indexOf('2') != -1) {
learun.alert.warning("选中记录中包含已审核项目,不能删除!");
return;
}
learun.layerConfirm('是否确认删除该项!', function (res) {
@@ -132,62 +141,113 @@ var bootstrap = function ($, learun) {
});
}
});

// 查看
$('#lr_view').on('click', function () {
//审核
$('#lr_check').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('FAId');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'formAss_FixAssets',
title: '查看固定资产',
url: top.$.rootUrl + '/AssetManagementSystem/Ass_FixAssets/FormView?keyValue=' + keyValue,
width: 1000,
height: 800,
btn: null
var Status = $('#gridtable').jfGridValue('Status');
if (Status.indexOf('2') != -1) {
learun.alert.warning("选中记录中包含已审核项目!");
return;
}
learun.layerConfirm('是否确认审核该项!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/AssetManagementSystem/Ass_FixAssets/Lock', { keyValue: keyValue, status: 2 }, function () {
page.search();
});
}
});
}
});

//  提交
$('#lr_submit').on('click', function () {
//取消审核
$('#lr_cancelCheck').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('FAId');
if (learun.checkrow(keyValue)) {
var Status = $('#gridtable').jfGridValue('Status');
if (Status !== 0) {
learun.alert.warning("当前项目已提交,请耐心等待审批!");
if (Status.indexOf('0') != -1) {
learun.alert.warning("选中记录中包含未审核项目!");
return;
}
learun.layerConfirm('是否确认提交该项!', function (res) {
learun.layerConfirm('是否确认取消审核该项!', function (res) {
if (res) {
processId = learun.newGuid();
learun.postForm(top.$.rootUrl + '/AssetManagementSystem/Ass_FixAssets/ChangeStatusById', { keyValue: keyValue, status: 1, processId: processId }, function (res) {
refreshGirdData(res, {});
learun.postForm(top.$.rootUrl + '/AssetManagementSystem/Ass_FixAssets/Lock', { keyValue: keyValue, status: 0 }, function () {
page.search();
});
}
});
}
});
///上传
$('#lr_import').on('click',
function () {

// 查看
$('#lr_view').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('FAId');
if (learun.checkrow(keyValue)) {
if (keyValue.indexOf(",") != -1) {
learun.alert.warning("只能选择一条记录进行查看!");
return false;
}
learun.layerForm({
id: 'form',
title: '导入',
url: top.$.rootUrl + '/AssetManagementSystem/Ass_FixAssets/ImportForm',
width: 600,
height: 400,
btn: null,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
id: 'formAss_FixAssets',
title: '查看固定资产',
url: top.$.rootUrl + '/AssetManagementSystem/Ass_FixAssets/FormView?keyValue=' + keyValue,
width: 1000,
height: 800,
btn: null
});
}
});

//  提交
//$('#lr_submit').on('click', function () {
// var keyValue = $('#gridtable').jfGridValue('FAId');
// 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/Ass_FixAssets/ChangeStatusById', { keyValue: keyValue, status: 1, processId: processId }, function (res) {
// refreshGirdData(res, {});
// });
// }
// });
// }
//});
///上传
$('#lr_import').on('click', function () {
learun.layerForm({
id: 'form',
title: '导入',
url: top.$.rootUrl + '/AssetManagementSystem/Ass_FixAssets/ImportForm',
width: 600,
height: 400,
btn: null,
end: function () { page.search(); }
});
});
},
// 初始化列表
initGird: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/AssetManagementSystem/Ass_FixAssets/GetPageList',
headData: [
{
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 if (cellvalue === 3) {
return '<span class=\"label label-danger\">审核未通过</span>';
} else {
return '<span class=\"label label-default\" >未审核</span>';
}
}
},
{ label: "资产编号", name: "FACode", width: 100, align: "left" },
{ label: "资产名称", name: "FAName", width: 100, align: "left" },
{
@@ -390,25 +450,12 @@ var bootstrap = function ($, learun) {
});
}
},
{
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 if (cellvalue === 3) {
return '<span class=\"label label-danger\">审核未通过</span>';
} else {
return '<span class=\"label label-default\" >草稿</span>';
}
}
}
],
mainId: 'FAId',
isPage: true,
isMultiselect: true,
sidx: 'FACode,FAName',
sord:'asc'
sord: 'asc'
});
page.search();
},
@@ -417,21 +464,21 @@ var bootstrap = function ($, learun) {
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function (res, postData) {
if (!!res) {
if (res.code == 200) {
// 发起流程
var postData = {
schemeCode: 'Ass_FixAssets',// 填写流程对应模板编号
processId: processId,
level: '1',
};
learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
learun.loading(false);
});
}
page.search();
}
};
//refreshGirdData = function (res, postData) {
// if (!!res) {
// if (res.code == 200) {
// // 发起流程
// var postData = {
// schemeCode: 'Ass_FixAssets',// 填写流程对应模板编号
// processId: processId,
// level: '1',
// };
// learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
// learun.loading(false);
// });
// }
// page.search();
// }
//};
page.init();
}

+ 14
- 14
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/IndexOfTeacher.js View File

@@ -81,6 +81,20 @@ var bootstrap = function ($, learun) {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/AssetManagementSystem/Ass_FixAssets/GetPageList',
headData: [
{
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 if (cellvalue === 3) {
return '<span class=\"label label-danger\">审核未通过</span>';
} else {
return '<span class=\"label label-default\" >未审核</span>';
}
}
},
{ label: "资产编号", name: "FACode", width: 100, align: "left" },
{ label: "资产名称", name: "FAName", width: 100, align: "left" },
{
@@ -283,20 +297,6 @@ var bootstrap = function ($, learun) {
});
}
},
{
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 if (cellvalue === 3) {
return '<span class=\"label label-danger\">审核未通过</span>';
} else {
return '<span class=\"label label-default\" >草稿</span>';
}
}
}
],
mainId: 'FAId',
isPage: true,


+ 17
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsBLL.cs View File

@@ -166,6 +166,23 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
}
}

/// <summary>
/// 审批
/// </summary>
/// <param name="keyValue"></param>
/// <param name="status"></param>
public void DoCheck(string keyValue, int status)
{
try
{
ass_FixAssetsService.DoCheck(keyValue, status);
}
catch (Exception ex)
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}

/// <summary>
/// 修改审批状态
/// </summary>


+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsIBLL.cs View File

@@ -56,6 +56,13 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
void SaveEntity(string keyValue, Ass_FixAssetsEntity entity);

/// <summary>
/// 审批
/// </summary>
/// <param name="keyValue"></param>
/// <param name="status"></param>
void DoCheck(string keyValue, int status);
/// <summary>
/// 修改审批状态
/// </summary>


+ 26
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsService.cs View File

@@ -230,7 +230,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
{
try
{
this.BaseRepository().Delete<Ass_FixAssetsEntity>(t => t.FAId == keyValue);
this.BaseRepository().Delete<Ass_FixAssetsEntity>(t => keyValue.Contains(t.FAId));
}
catch (Exception ex)
{
@@ -279,6 +279,31 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
}
}

/// <summary>
/// 审批
/// </summary>
/// <param name="keyValue"></param>
/// <param name="status"></param>
public void DoCheck(string keyValue, int status)
{
try
{
var kv = string.Join("','", keyValue.Split(','));
if (status == 2)//审核
{
this.BaseRepository().ExecuteBySql($"update Ass_FixAssets set Status={status},SubmitTime='{DateTime.Now}',SubmitUserId='{LoginUserInfo.Get().userId}' where FAId in ('{kv}')", null);
}
else//取消审核
{
this.BaseRepository().ExecuteBySql($"update Ass_FixAssets set Status={status},SubmitTime=null,SubmitUserId=null where FAId in ('{kv}')", null);
}
}
catch (Exception ex)
{
throw ExceptionEx.ThrowServiceException(ex);
}
}

/// <summary>
/// 修改审批状态
/// </summary>


Loading…
Cancel
Save