diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AcceptanceController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AcceptanceController.cs index 2f76dd8db..2ac772c77 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AcceptanceController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AcceptanceController.cs @@ -29,7 +29,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -38,7 +38,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } /// /// 表单页 @@ -47,7 +47,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [HttpGet] public ActionResult ViewForm() { - return View(); + return View(); } /// /// 表单页 @@ -92,8 +92,9 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var Ass_AcceptanceData = ass_AcceptanceIBLL.GetAss_AcceptanceEntity( keyValue ); - var jsonData = new { + var Ass_AcceptanceData = ass_AcceptanceIBLL.GetAss_AcceptanceEntity(keyValue); + var jsonData = new + { Ass_Acceptance = Ass_AcceptanceData, }; return Success(jsonData); @@ -107,8 +108,9 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [AjaxOnly] public ActionResult GetFormDataByProcessId(string processId) { - var Ass_AcceptanceData = ass_AcceptanceIBLL.GetEntityByProcessId( processId ); - var jsonData = new { + var Ass_AcceptanceData = ass_AcceptanceIBLL.GetEntityByProcessId(processId); + var jsonData = new + { Ass_Acceptance = Ass_AcceptanceData, }; return Success(jsonData); @@ -156,7 +158,8 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { Ass_AcceptanceEntity entity = strEntity.ToObject(); - ass_AcceptanceIBLL.SaveEntity(keyValue,entity); + entity.Status = "0"; + ass_AcceptanceIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } @@ -164,5 +167,52 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers } #endregion + #region 扩展数据 + /// + /// 审核 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Check(string keyValue) + { + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + var StuInfoBasicData = ass_AcceptanceIBLL.GetAss_AcceptanceEntity(item); + if (StuInfoBasicData != null) + { + StuInfoBasicData.Status = "1"; + ass_AcceptanceIBLL.SaveEntity(item, StuInfoBasicData); + } + } + + return Success("操作成功!"); + } + /// + /// 取消审核 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult UnCheck(string keyValue) + { + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + var StuInfoBasicData = ass_AcceptanceIBLL.GetAss_AcceptanceEntity(item); + if (StuInfoBasicData != null) + { + StuInfoBasicData.Status = "2"; + ass_AcceptanceIBLL.SaveEntity(item, StuInfoBasicData); + } + } + return Success("操作成功!"); + } + + #endregion + } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Form.js index 2d9d0e4b5..f497cd825 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Form.js @@ -94,6 +94,13 @@ var bootstrap = function ($, learun) { $('#Model').val(data.AModel);//规格型号 $('#AAIManufacturer').val(data.AManufacturer);//品牌 $('#Price').val(data.APrice)//单价 + $('#Stock').val(data.AStock)//数量 + if ($('#Price').val() > 0 && $('#Stock').val() > 0) { + var Price = $('#Price').val() + var Stock = $('#Stock').val() + var Stock = Price * Stock; + $('#TotalPrice').val(Stock); + } }); } }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Index.cshtml index 3c5c12f2e..4b46c0479 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Index.cshtml @@ -40,9 +40,10 @@  删除 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Index.js index ca30956a0..a7f733f33 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Index.js @@ -37,7 +37,7 @@ var bootstrap = function ($, learun) { res = top[id].validForm(); // 保存数据 if (res) { - res = top[id].save('', function() { + res = top[id].save('', function () { page.search(); }); } @@ -86,7 +86,7 @@ var bootstrap = function ($, learun) { url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/ViewForm?keyValue=' + keyValue, width: 600, height: 400, - btn:null + btn: null }); } }); @@ -102,7 +102,7 @@ var bootstrap = function ($, learun) { } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -113,7 +113,43 @@ var bootstrap = function ($, learun) { $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); }); - + //审核 + $('#check').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.postForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/Check', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //去审 + $('#uncheck').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + //var Status = Status.split(','); + if (Status != 0) { + learun.alert.warning("当前项无需验收!"); + return; + } + learun.layerConfirm('是否确认取消审核该项?', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/UnCheck', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); //  提交 $('#lr_submit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); @@ -139,73 +175,80 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/GetPageList', headData: [ - { label: "设备名称", name: "Name", width: 100, align: "left"}, - { label: "品牌", name: "Manufacturer", width: 100, align: "left"}, - { label: "规格型号", name: "Model", width: 100, align: "left"}, - { label: "单位", name: "Unit", width: 100, align: "left"}, - { label: "数量", name: "Stock", width: 100, align: "left"}, - { label: "单价", name: "Price", width: 100, align: "left"}, - { label: "总价", name: "TotalPrice", width: 100, align: "left"}, - { label: "使用部门", name: "DepartmentId", 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: "UserID", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { + { label: "设备名称", name: "Name", width: 100, align: "left" }, + { label: "品牌", name: "Manufacturer", width: 100, align: "left" }, + { label: "规格型号", name: "Model", width: 100, align: "left" }, + { label: "单位", name: "Unit", width: 100, align: "left" }, + { label: "数量", name: "Stock", width: 100, align: "left" }, + { label: "单价", name: "Price", width: 100, align: "left" }, + { label: "总价", name: "TotalPrice", width: 100, align: "left" }, + { + label: "使用部门", name: "DepartmentId", 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: "UserID", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsyncReal('user', { key: value, callback: function (_data) { callback(_data.name); } - }); - }}, + }); + } + }, { label: "放置地点", name: "Place", width: 100, align: "left" }, { label: "状态", name: "Status", width: 100, align: "left", formatter: function (cellvalue, row) { - if (cellvalue === '1') { + if (cellvalue === '0') { return '审批中'; - } else if (cellvalue === '2') { - return '已审核'; + } else if (cellvalue === '1') { + return '验收成功'; } else { - return '草稿'; + return '验收不合规'; } } }, - { label: "备注", name: "Remark", width: 100, align: "left"}, + { label: "备注", name: "Remark", width: 100, align: "left" }, ], - 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:'ASS_zcys',// 填写流程对应模板编号 - 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_zcys',// 填写流程对应模板编号 + // processId:processId, + // level:'1', + // }; + // learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function(data) { + // learun.loading(false); + // }); + // } + // page.search(); + // } + //}; + refreshGirdData = function () { + page.search(); }; page.init(); }