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 a3e53994a..2f67d13be 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 @@ -5,6 +5,7 @@ using System.Web.Mvc; using Learun.Application.TwoDevelopment.LR_CodeDemo; using System.Collections.Generic; using Learun.Application.Base.SystemModule; +using System; namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers { @@ -18,6 +19,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers public class Ass_AcceptanceController : MvcControllerBase { private Ass_AcceptanceIBLL ass_AcceptanceIBLL = new Ass_AcceptanceBLL(); + private Ass_AcceptanceMainIBLL ass_AcceptanceMainIBLL = new Ass_AcceptanceMainBLL(); private CodeRuleIBLL codeRuleIBLL = new CodeRuleBLL(); #region 视图功能 @@ -29,7 +31,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -38,7 +40,17 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [HttpGet] public ActionResult Form() { - return View(); + ViewBag.Code = "RKSQ_" + CommonHelper.CreateNo(); + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormItem() + { + return View(); } /// /// 表单页 @@ -47,7 +59,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [HttpGet] public ActionResult ViewForm() { - return View(); + return View(); } #endregion @@ -64,7 +76,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers public ActionResult GetPageList(string pagination, string queryJson) { Pagination paginationobj = pagination.ToObject(); - var data = ass_AcceptanceIBLL.GetPageList(paginationobj, queryJson); + var data = ass_AcceptanceMainIBLL.GetPageList(paginationobj, queryJson); var jsonData = new { rows = data, @@ -83,9 +95,12 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var Ass_AcceptanceData = ass_AcceptanceIBLL.GetAss_AcceptanceEntity( keyValue ); - var jsonData = new { - Ass_Acceptance = Ass_AcceptanceData, + var Ass_AcceptanceMainData = ass_AcceptanceMainIBLL.GetAss_AcceptanceMainEntity(keyValue); + var Ass_AcceptanceData = ass_AcceptanceIBLL.GetAss_AcceptanceListByMainId(Ass_AcceptanceMainData.Id); + var jsonData = new + { + Ass_AcceptanceMain = Ass_AcceptanceMainData, + Ass_Acceptance = Ass_AcceptanceData }; return Success(jsonData); } @@ -98,8 +113,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); @@ -135,24 +151,43 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers ass_AcceptanceIBLL.DeleteEntity(keyValue); return Success("删除成功!"); } + /// /// 保存实体数据(新增、修改) - /// /// 主键 - /// 实体 + /// /// [HttpPost] [ValidateAntiForgeryToken] [AjaxOnly] - public ActionResult SaveForm(string keyValue, string strEntity) + public ActionResult SaveForm(string keyValue, string strEntity, string strass_Ass_AcceptanceList) { - Ass_AcceptanceEntity entity = strEntity.ToObject(); - ass_AcceptanceIBLL.SaveEntity(keyValue,entity); - if (string.IsNullOrEmpty(keyValue)) - { - } + Ass_AcceptanceMainEntity entity = strEntity.ToObject(); + entity.Status = 0; + List ass_AcceptanceList = strass_Ass_AcceptanceList.ToObject>(); + ass_AcceptanceMainIBLL.SaveEntity(keyValue, entity, ass_AcceptanceList); return Success("保存成功!"); } + + + ///// + ///// 保存实体数据(新增、修改) + ///// + ///// 主键 + ///// 实体 + ///// + //[HttpPost] + //[ValidateAntiForgeryToken] + //[AjaxOnly] + //public ActionResult SaveForm(string keyValue, string strEntity) + //{ + // Ass_AcceptanceEntity entity = strEntity.ToObject(); + // ass_AcceptanceIBLL.SaveEntity(keyValue, entity); + // if (string.IsNullOrEmpty(keyValue)) + // { + // } + // return Success("保存成功!"); + //} #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoApplyController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoApplyController.cs index 9f942b47e..350531acb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoApplyController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoApplyController.cs @@ -53,6 +53,12 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers { return View(); } + [HttpGet] + public ActionResult FormViewJYHC() + { + return View(); + } + /// /// 表单页 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemApplyController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemApplyController.cs index ad80c6981..d24464c39 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemApplyController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemApplyController.cs @@ -27,7 +27,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -36,7 +36,17 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); + } + + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormJYHC() + { + return View(); } /// /// 采购表单页 @@ -45,7 +55,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [HttpGet] public ActionResult FormPurchase() { - ViewBag.AssCode= DateTime.Now.ToString("yyyyMMddHHmmssffff"); + ViewBag.AssCode = DateTime.Now.ToString("yyyyMMddHHmmssffff"); return View(); } #endregion @@ -80,8 +90,9 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var Ass_AssetsInfoItemApplyData = ass_AssetsInfoItemApplyIBLL.GetAss_AssetsInfoItemApplyEntity( keyValue ); - var jsonData = new { + var Ass_AssetsInfoItemApplyData = ass_AssetsInfoItemApplyIBLL.GetAss_AssetsInfoItemApplyEntity(keyValue); + var jsonData = new + { Ass_AssetsInfoItemApply = Ass_AssetsInfoItemApplyData, }; return Success(jsonData); @@ -113,7 +124,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { Ass_AssetsInfoItemApplyEntity entity = strEntity.ToObject(); - ass_AssetsInfoItemApplyIBLL.SaveEntity(keyValue,entity); + ass_AssetsInfoItemApplyIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Form.cshtml index 00badca1b..c715ac4d0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/Form.cshtml @@ -1,55 +1,40 @@ @{ - ViewBag.Title = "资产验收"; + ViewBag.Title = "采购申请"; Layout = "~/Views/Shared/_Form.cshtml"; } -
-
-
选择已登记资产
-
-
-
-
设备名称
- -
-
-
品牌
- -
-
-
规格型号
- -
-
-
单位
- -
-
-
数量
- -
-
-
单价
- -
-
+ +
+
+
申请单号
+ +
+
+
申请名称
+ +
+ +
总价
- +
-
-
使用部门
-
+
+
申请时间
+
-
-
使用人
-
+
+
申请人
+
-
-
放置地点
- +
+
明细操作
+ + +
-
-
备注
- +
+
@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/Ass_Acceptance/Form.js") 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..8813d610a 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 @@ -1,8 +1,8 @@ -/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) - * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 - * 日 期:2020-11-18 10:46 - * 描 述:资产验收 + * 日 期:2019-03-25 12:00 + * 描 述:入库申请 */ var acceptClick; var keyValue = request('keyValue'); @@ -14,6 +14,11 @@ var setFormData; var validForm; // 保存数据 var save; +var refreshGirdData; +var selectedRow; +var tempdatra = new Array(); +//总价计算 +var pricecount = 0; var bootstrap = function ($, learun) { "use strict"; // 设置权限 @@ -38,143 +43,208 @@ var bootstrap = function ($, learun) { var page = { init: function () { $('.lr-form-wrap').lrscroll(); + $("#detailadd").on('click', function () { + selectedRow = null; + learun.layerForm({ + id: 'formitem', + title: '新增明细', + url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/FormItem', + width: 860, + height: 600, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + $("#detailedit").on('click', function () { + var keyValue = $('#Ass_Acceptance').jfGridValue('Id'); + selectedRow = $('#Ass_Acceptance').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formitem', + title: '编辑明细', + url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/FormItem?keyValue=' + keyValue, + width: 860, + height: 600, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + $("#detaildel").on('click', function () { + var keyValue = $('#Ass_Acceptance').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res, index) { + if (res) { + $.each(tempdatra, function (key, val) { + if (tempdatra[key].MainId === keyValue) { + pricecount -= tempdatra[key].TotalPrice; + tempdatra.splice(key, 1); + } + }); + $("#Price").val(pricecount); + $('#Ass_Acceptance').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); + top.layer.close(index); + } + }); + } + }); page.bind(); page.initData(); }, bind: function () { - $('#DepartmentId').lrselect({ - type: 'tree', - allowSearch: true, - url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', - param: {}, - select: function (val) { - console.log(val.value); - $('#UserID').lrselectRefresh({ url: '/LR_OrganizationModule/User/GetListByDepartmentId?departmentId=' + val.value }); - } - }); - $('#UserID').lrselect({ text: 'F_RealName', value: 'F_UserId' }); - - - $("#AAOldCode").lrlayerselect({ - treeUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsType/GetAllTree', - treeParentId: 'atptid', - treeValueId: 'atid', - treeTextId: 'aname', - dataUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetList', - dataTreeId: 'ATId', - dataValueId: 'AId', - dataTextId: 'AName', + $('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#CreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; - grid: [ - { label: '资产编号', name: 'ACode', width: 200, align: 'left' }, - { label: '资产名称', name: 'AName', width: 200, align: 'left' }, - { label: "英文名称", name: "AEName", width: 200, align: "left" }, - { label: "资产型号", name: "AModel", width: 200, align: "left" }, - { label: "生产厂家", name: "AManufacturer", width: 200, align: "left" }, + $('#CreateUserId').val(learun.clientdata.get(['userinfo']).realName); + //$('#CreateDeptId').lrselect({ + // type: 'tree', + // // 展开最大高度 + // maxHeight: 200, + // // 是否允许搜索 + // allowSearch: true, + // // 访问数据接口地址 + // url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree' + //}); + $('#Ass_Acceptance').jfGrid({ + 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: "ASupplierId", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_SupplierData', + label: "使用部门", name: "DepartmentId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('department', { key: value, - keyId: 'sid', callback: function (_data) { - callback(_data['sname']); + 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') { + // return '审批中'; + // } else if (cellvalue === '2') { + // return '已审核'; + // } else { + // return '草稿'; + // } + // } + //}, + { label: "备注", name: "Remark", width: 100, align: "left" }, ], - select: function (values, texts) { - if (values && values.length > 0) { - //绑定 - $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetFormData?keyValue=' + values[0], function (data) { - data = data.Ass_AssetsInfo; - $('#Name').val(data.AName);//设备名称 - $('#AAIUnit').lrselectSet(data.AUnit);//单位 - $('#Model').val(data.AModel);//规格型号 - $('#AAIManufacturer').val(data.AManufacturer);//品牌 - $('#Price').val(data.APrice)//单价 - }); - } - }, - unknowselect: function () { - $("#AAOldCode").find('span').text(""); - $('#Name').val("");//设备名称 - $('#Model').val("");//规格型号 - $('#AAIManufacturer').val("");//品牌 - }, - isMultiple: false + height: 400, + mainId: 'Id', + reloadSelected: false, }); - - $('#Stock').bind('change', function () { - var stock = $(this).val(); - var price = $('#Price').val(); - $('#TotalPrice').val(stock * price); - - }) - $('#Price').bind('change', function () { - var stock = $('#Stock').val(); - var price = $(this).val(); - $('#TotalPrice').val(stock * price); - - }) - - }, initData: function () { if (!!keyValue) { - $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/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]); + $.lrSetForm( + top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/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].TotalPrice) { + pricecount = data[id].TotalPrice; + } + } } - } - }); + }); + } else { + $("#Code").val(NewCode); + } + } + }; + refreshGirdData = function (temprow) { + var ifnewrow = true; + $.each(tempdatra, function (key, val) { + if (tempdatra[key].MainId === temprow.Id) { + tempdatra[key] = temprow; + ifnewrow = false; } + }); + if (ifnewrow) { + tempdatra.push(temprow); + } + //总价计算 + pricecount = 0; + for (var i = 0; i < tempdatra.length; i++) { + pricecount = parseFloat(pricecount) +parseFloat(tempdatra[i].TotalPrice); } + $("#TotalPrice").val(pricecount); + $('#Ass_Acceptance').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); }; + function sortNumber(a, b) { + return 1;//a.AAIOrder - b.AAIOrder; + } // 设置表单数据 - setFormData = function (processId, param, callback) { + setFormData = function (processId) { if (!!processId) { - $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/GetFormDataByProcessId?processId=' + processId, function (data) { + $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoApply/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 == 'Ass_Acceptance' && data[id]) { - keyValue = data[id].ID; + if (id == 'Ass_AcceptanceMain') { + keyValue = data[id].Id; } $('[data-table="' + id + '"]').lrSetFormData(data[id]); } } }); } - callback && callback(); } // 验证数据是否填写完整 validForm = function () { - if (!$('body').lrValidform()) { + if (!$('.lr-form-wrap').lrValidform()) { + return false; + } + var datas = $('#Ass_Acceptance').jfGridGet('rowdatas'); + if (datas == null || datas.length == 0) { + learun.alert.warning("申请未包含明细!请先新增明细!"); return false; } return true; }; // 保存数据 save = function (processId, callBack, i) { - var formData = $('body').lrGetFormData(); + var postData = {}; + var formData = $('[data-table="Ass_AcceptanceMain"]').lrGetFormData(); if (!!processId) { formData.ProcessId = processId; } - var postData = { - strEntity: JSON.stringify(formData) - }; + postData.strEntity = JSON.stringify(formData); + postData.strass_Ass_AcceptanceList = JSON.stringify($('#Ass_Acceptance').jfGridGet('rowdatas')); $.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { - callBack(res, i); + callBack(res, formData, i); } }); }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormItem.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormItem.cshtml new file mode 100644 index 000000000..3017a379f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormItem.cshtml @@ -0,0 +1,55 @@ +@{ + ViewBag.Title = "资产验收"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
选择已登记资产
+
+
+
+
设备名称*
+ +
+
+
品牌
+ +
+
+
规格型号
+ +
+
+
单位
+ +
+
+
数量*
+ +
+
+
单价*
+ +
+
+
总价
+ +
+
+
使用部门
+
+
+
+
使用人
+
+
+
+
放置地点
+ +
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormItem.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormItem.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormItem.js new file mode 100644 index 000000000..9443a317b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormItem.js @@ -0,0 +1,181 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2020-11-18 10:46 + * 描 述:资产验收 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +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 () { + $('#DepartmentId').lrselect({ + type: 'tree', + allowSearch: true, + url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', + param: {}, + select: function (val) { + console.log(val.value); + $('#UserID').lrselectRefresh({ url: '/LR_OrganizationModule/User/GetListByDepartmentId?departmentId=' + val.value }); + } + }); + $('#UserID').lrselect({ text: 'F_RealName', value: 'F_UserId' }); + + + $("#AAOldCode").lrlayerselect({ + treeUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsType/GetAllTree', + treeParentId: 'atptid', + treeValueId: 'atid', + treeTextId: 'aname', + dataUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetList', + dataTreeId: 'ATId', + dataValueId: 'AId', + dataTextId: 'AName', + + grid: [ + { label: '资产编号', name: 'ACode', width: 200, align: 'left' }, + { label: '资产名称', name: 'AName', width: 200, align: 'left' }, + { label: "英文名称", name: "AEName", width: 200, align: "left" }, + { label: "资产型号", name: "AModel", width: 200, align: "left" }, + { label: "生产厂家", name: "AManufacturer", width: 200, align: "left" }, + { + label: "供应商", name: "ASupplierId", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_SupplierData', + key: value, + keyId: 'sid', + callback: function (_data) { + callback(_data['sname']); + } + }); + } + } + ], + select: function (values, texts) { + if (values && values.length > 0) { + //绑定 + $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetFormData?keyValue=' + values[0], function (data) { + data = data.Ass_AssetsInfo; + $('#Name').val(data.AName);//设备名称 + $('#AAIUnit').lrselectSet(data.AUnit);//单位 + $('#Model').val(data.AModel);//规格型号 + $('#AAIManufacturer').val(data.AManufacturer);//品牌 + $('#Price').val(data.APrice)//单价 + }); + } + }, + unknowselect: function () { + $("#AAOldCode").find('span').text(""); + $('#Name').val("");//设备名称 + $('#Model').val("");//规格型号 + $('#AAIManufacturer').val("");//品牌 + }, + isMultiple: false + }); + + $('#Stock').bind('change', function () { + var stock = $(this).val(); + var price = $('#Price').val(); + $('#TotalPrice').val(stock * price); + + }) + $('#Price').bind('change', function () { + var stock = $('#Stock').val(); + var price = $(this).val(); + $('#TotalPrice').val(stock * price); + + }) + + + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/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 + '/AssetManagementSystem/Ass_Acceptance/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 == 'Ass_Acceptance' && data[id]) { + keyValue = data[id].ID; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + callback && callback(); + } + // 验证数据是否填写完整 + validForm = function () { + if (!$('body').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = $('body').lrGetFormData(); + if (!!keyValue) { + if (!!selectedRow) { + postData.MainId = selectedRow.MainId; + } + } else { + postData.MainId = learun.newGuid(); + } + if (!!callBack) { + callBack(postData); + return true; + } + }; + //// 保存数据 + //save = function (processId, callBack, i) { + // var formData = $('body').lrGetFormData(); + // if (!!processId) { + // formData.ProcessId = processId; + // } + // var postData = { + // strEntity: JSON.stringify(formData) + // }; + // $.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/SaveForm?keyValue=' + keyValue, postData, function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(res, i); + // } + // }); + //}; + page.init(); +} 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..fbfb5fbf0 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 @@ -11,20 +11,12 @@
-
设备名称
- -
-
-
使用部门
-
+
验收单号
+
使用人
-
-
-
-
放置地点
- +
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..69739a218 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 @@ -17,8 +17,7 @@ var bootstrap = function ($, learun) { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); - $('#DepartmentId').lrDepartmentSelect(); - $('#User').lrDataItemSelect({ code: '' }); + $('#CreateUserId').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -29,15 +28,15 @@ var bootstrap = function ($, learun) { id: 'form', title: '新增', url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/Form', - width: 600, - height: 400, + width: 1000, + height: 700, callBack: function (id) { var res = false; // 验证数据 res = top[id].validForm(); // 保存数据 if (res) { - res = top[id].save('', function() { + res = top[id].save('', function () { page.search(); }); } @@ -47,10 +46,10 @@ var bootstrap = function ($, learun) { }); // 编辑 $('#lr_edit').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('ID'); + var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var SendFlag = $('#gridtable').jfGridValue('Status'); - if (SendFlag) { + if (SendFlag != 0) { learun.alert.warning("当前项目已提交不能编辑!"); return; } @@ -58,8 +57,8 @@ var bootstrap = function ($, learun) { id: 'form', title: '编辑', url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/Form?keyValue=' + keyValue, - width: 600, - height: 400, + width: 1000, + height: 700, callBack: function (id) { var res = false; // 验证数据 @@ -86,7 +85,7 @@ var bootstrap = function ($, learun) { url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/ViewForm?keyValue=' + keyValue, width: 600, height: 400, - btn:null + btn: null }); } }); @@ -96,13 +95,13 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { var SendFlag = $('#gridtable').jfGridValue('Status'); - if (SendFlag) { + if (SendFlag != 0) { learun.alert.warning("当前项目已提交不能不能删除!"); return; } 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(); }); } @@ -119,7 +118,7 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { var SendFlag = $('#gridtable').jfGridValue('Status'); - if (SendFlag) { + if (SendFlag != 0) { learun.alert.warning("当前项目已提交,请耐心等待审批!"); return; } @@ -136,76 +135,116 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ 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) { - learun.clientdata.getAsyncReal('user', { + { label: "申请单号", name: "Code", width: 200, align: "left" }, + { label: "申请名称", name: "Name", width: 200, align: "left" }, + { label: "总价", name: "TotalPrice", width: 100, align: "left" }, + { label: "申请时间", name: "CreateTime", width: 150, align: "left" }, + { + label: "申请人", name: "CreateUserId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser', key: value, + keyId: 'f_userid', callback: function (_data) { - callback(_data.name); + callback(_data['f_realname']); } - }); - }}, - { label: "放置地点", name: "Place", width: 100, align: "left" }, + }); + } + }, { - label: "状态", name: "Status", width: 100, align: "left", + label: "审批状态", name: "Status", width: 100, align: "left", formatter: function (cellvalue, row) { - if (cellvalue === '1') { + if (cellvalue === 1) { return '审批中'; - } else if (cellvalue === '2') { - return '已审核'; + } else if (cellvalue === 2) { + return '审批通过'; } else { return '草稿'; } } - }, - { label: "备注", name: "Remark", width: 100, align: "left"}, + } ], - mainId:'ID', - isPage: true + mainId: 'Id', + isPage: true, + sidx: 'CreateTime', + sord: 'DASC' }); + //$('#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) { + // 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') { + // return '审批中'; + // } else if (cellvalue === '2') { + // return '已审核'; + // } else { + // return '草稿'; + // } + // } + // }, + // { label: "备注", name: "Remark", width: 100, align: "left" }, + // ], + // 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); - }); + 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(); } - page.search(); - } }; page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/FormJYHC.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/FormJYHC.js index 80ce9570b..7db342604 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/FormJYHC.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/FormJYHC.js @@ -32,7 +32,7 @@ var bootstrap = function ($, learun) { learun.layerForm({ id: 'formitem', title: '新增明细', - url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/Form', + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/FormJYHC', width: 860, height: 600, callBack: function (id) { @@ -47,7 +47,7 @@ var bootstrap = function ($, learun) { learun.layerForm({ id: 'formitem', title: '编辑明细', - url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/Form?keyValue=' + keyValue, + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/FormJYHC?keyValue=' + keyValue, width: 860, height: 600, callBack: function (id) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/FormViewJYHC.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/FormViewJYHC.cshtml new file mode 100644 index 000000000..1114a368d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/FormViewJYHC.cshtml @@ -0,0 +1,33 @@ +@{ + ViewBag.Title = "采购申请"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+
+
采购申请单号
+ +
+
+
采购总价
+ +
+
+
资产属性
+
+
+
+
申请时间
+ +
+
+
申请人
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/FormViewJYHC.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/FormViewJYHC.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/FormViewJYHC.js new file mode 100644 index 000000000..69a4663cb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/FormViewJYHC.js @@ -0,0 +1,267 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-03-25 12:00 + * 描 述:入库申请 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var refreshGirdData; +var selectedRow; +var tempdatra = new Array(); +//总价计算 +var pricecount = 0; +var bootstrap = function ($, learun) { + "use strict"; + // 设置权限 + setAuthorize = function (data) { + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + $("#detailadd").on('click', function () { + selectedRow = null; + learun.layerForm({ + id: 'formitem', + title: '新增明细', + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/Form', + width: 860, + height: 600, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + $("#detailedit").on('click', function () { + var keyValue = $('#Ass_AssetsInfoItemApply').jfGridValue('AAIId'); + selectedRow = $('#Ass_AssetsInfoItemApply').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formitem', + title: '编辑明细', + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/Form?keyValue=' + keyValue, + width: 860, + height: 600, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + $("#detaildel").on('click', function () { + var keyValue = $('#Ass_AssetsInfoItemApply').jfGridValue('AAIId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res, index) { + if (res) { + $.each(tempdatra, function (key, val) { + if (tempdatra[key].AAIId === keyValue) { + pricecount -= tempdatra[key].AAIPrice * tempdatra[key].AAIStock; + tempdatra.splice(key, 1); + } + }); + $("#AAPrice").val(pricecount); + $('#Ass_AssetsInfoItemApply').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); + top.layer.close(index); + } + }); + } + }); + page.bind(); + page.initData(); + }, + bind: function () { + $('#AACreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#AACreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#AAAssType').lrDataItemSelect({ code: 'AssType' }); + $('#AACreateUserId').val(learun.clientdata.get(['userinfo']).realName); + $('#Ass_AssetsInfoItemApply').jfGrid({ + headData: [ + { + label: '耗材编号', name: 'AAICode', width: 150, align: 'left' + }, + { + label: '耗材名称', name: 'AAIName', width: 150, align: 'left' + }, + { + label: '耗材类别', name: 'AAITId', width: 150, align: 'left', formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_AssetsType', + key: value, + keyId: 'atid', + callback: function (_data) { + callback(_data['aname']); + } + }); + } + }, + { + label: '耗材来源', name: 'AAISource', width: 100, align: 'left', formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'zcly', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: '单价', name: 'AAIPrice', width: 100, align: 'left' + }, + { + label: '数量', name: 'AAIStock', width: 80, align: 'left' + }, + { + label: '单位', name: 'AAIUnit', width: 80, align: 'left', formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'sldw', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: '生成耗材明细', name: 'AAIHasDetail', width: 80, align: 'left', formatter: function (cellvalue) { + return (cellvalue === true || cellvalue === "true") ? "" : ""; + } + }, + { + label: '库房', name: 'AAIStorageId', width: 100, align: 'left', formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_StorageData', + key: value, + keyId: 'sid', + callback: function (_data) { + callback(_data['sname']); + } + }); + } + }, + { + label: '库位', name: 'AAIStoragePosition', width: 100, align: 'left' + }, + { + label: '英文名称', name: 'AAIEName', width: 100, align: 'left' + }, + { + label: '资产型号', name: 'AAIModel', width: 100, align: 'left' + }, + { + label: '生产厂家', name: 'AAIManufacturer', width: 100, align: 'left' + }, + { + label: '资产规格', name: 'AAISpecification', width: 100, align: 'left' + }, + { + label: '用途', name: 'AAIUse', width: 100, align: 'left' + }, + { + label: '供应商', name: 'AAISupplierId', width: 100, align: 'left', formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_SupplierData', + key: value, + keyId: 'sid', + callback: function (_data) { + callback(_data['sname']); + } + }); + } + } + ], + height: 400, + mainId: 'AAIId', + reloadSelected: false, + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm( + top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoApply/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].AAPrice) { + pricecount = data[id].AAPrice; + } + } + } + }); + } else { + $("#AACode").val(NewAACode); + } + } + }; + refreshGirdData = function (temprow) { + var ifnewrow = true; + $.each(tempdatra, function (key, val) { + if (tempdatra[key].AAIId === temprow.AAIId) { + tempdatra[key] = temprow; + ifnewrow = false; + } + }); + if (ifnewrow) { + tempdatra.push(temprow); + } + //总价计算 + pricecount = 0; + for (var i = 0; i < tempdatra.length; i++) { + pricecount += tempdatra[i].AAIPrice * tempdatra[i].AAIStock; + } + $("#AAPrice").val(pricecount); + $('#Ass_AssetsInfoItemApply').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/Ass_AssetsInfoApply/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 == 'Ass_AssetsInfoApply') { + keyValue = data[id].AAId; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + callback && callback(); + } + // 验证数据是否填写完整 + validForm = function () { + if (!$('#form').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + var formData = {}; + var res = {}; + res.code = 200; + if (!!processId) { + formData.AAProcessId = processId; + } + callBack(res, i); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/IndexJYHC.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/IndexJYHC.js index 082214d19..c8611bac4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/IndexJYHC.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/IndexJYHC.js @@ -136,7 +136,7 @@ var bootstrap = function ($, learun) { learun.layerForm({ id: 'formAss_AssetsInfoApply', title: '查看采购申请', - url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoApply/FormViewJY?keyValue=' + keyValue, + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoApply/FormViewJYHC?keyValue=' + keyValue, width: 1000, height: 600, btn: null diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItemApply/FormJYHC.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItemApply/FormJYHC.cshtml new file mode 100644 index 000000000..90dbfdc10 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItemApply/FormJYHC.cshtml @@ -0,0 +1,89 @@ +@{ + ViewBag.Title = "采购申请(耗材)明细"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +@Html.AppendCssFile("/Views/LR_Content/plugin/layerselect/lr-layerselect.css") +@Html.AppendJsFile("/Views/LR_Content/plugin/layerselect/lr-layerselect.js") +
+
+
选择已登记耗材*
+
+
+
+
耗材类别*
+
+
+
+
耗材编号*
+ +
+
+
耗材名称*
+ +
+
+
英文名称
+ +
+
+
耗材型号
+ +
+
+
生产厂家
+ +
+
+
耗材规格
+ +
+
+
用途
+ +
+
+
耗材来源
+
+
+
+
供应商
+
+
+
+
单价*
+ +
+
+
数量*
+ +
+
+
数量单位
+
+
+
+
排序*
+ +
+
+
楼宇名称*
+
+
+
+
房间号
+
+
+
+
生成明细*
+
+
+
+
入库照片
+
+
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItemApply/FormJYHC.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItemApply/FormJYHC.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItemApply/FormJYHC.js new file mode 100644 index 000000000..9d1e1766b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItemApply/FormJYHC.js @@ -0,0 +1,165 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-03-26 11:41 + * 描 述:采购申请(耗材)明细 + */ +var acceptClick; +var keyValue = request('keyValue'); +var selectedRow; +var bootstrap = function ($, learun) { + "use strict"; + selectedRow = top["layer_formAss_AssetsInfoApply"].selectedRow; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#AAIAssType').lrDataItemSelect({ code: 'AssType' }); + $('#AAITId').lrselect({ + type: 'tree', + // 展开最大高度 + maxHeight: 200, + // 是否允许搜索 + allowSearch: true, + // 访问数据接口地址 + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsType/GetAllTree' + }); + $("#AAOldCode").lrlayerselect({ + treeUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsType/GetAllTree', + treeParentId: 'atptid', + treeValueId: 'atid', + treeTextId: 'aname', + dataUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetList', + dataTreeId: 'ATId', + dataValueId: 'AId', + dataTextId: 'AName', + + grid: [ + { label: '耗材编号', name: 'ACode', width: 200, align: 'left' }, + { label: '耗材名称', name: 'AName', width: 200, align: 'left' }, + { label: "英文名称", name: "AEName", width: 200, align: "left" }, + { label: "耗材型号", name: "AModel", width: 200, align: "left" }, + { label: "生产厂家", name: "AManufacturer", width: 200, align: "left" }, + { + label: "供应商", name: "ASupplierId", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_SupplierData', + key: value, + keyId: 'sid', + callback: function (_data) { + callback(_data['sname']); + } + }); + } + } + ], + select: function (values, texts) { + if (values && values.length > 0) { + //绑定 + //$("#AAITId").attr("readonly", "readonly"); + //$("#AAICode").attr("readonly", "readonly"); + //$("#AAIName").attr("readonly", "readonly"); + //$("#AAIUnit").attr("readonly", "readonly"); + //$("#AAIHasDetail").attr("readonly", "readonly"); + $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetFormData?keyValue=' + values[0], function (data) { + data = data.Ass_AssetsInfo; + $('#AAITId').lrselectSet(data.ATId); + $('#AAICode').val(data.ACode); + $('#AAIName').val(data.AName); + $('#AAIUnit').lrselectSet(data.AUnit); + $('#AAIHasDetail').lrselectSet(data.HasDetail); + $('#AAIEName').val(data.AEName); + $('#AAIModel').val(data.AModel); + $('#AAIManufacturer').val(data.AManufacturer); + $('#AAISpecification').val(data.ASpecification); + }); + } + }, + unknowselect: function () { + $("#AAOldCode").find('span').text(""); + //$("#AAITId").removeAttr("readonly"); + //$("#AAICode").removeAttr("readonly"); + //$("#AAIName").removeAttr("readonly"); + //$("#AAIUnit").removeAttr("readonly"); + //$("#AAIHasDetail").removeAttr("readonly"); + $('#AAITId').lrselectSet(""); + $('#AAICode').val(""); + $('#AAIName').val(""); + $('#AAIUnit').lrselectSet(""); + $('#AAIHasDetail').lrselectSet(""); + $('#AAIEName').val(""); + $('#AAIModel').val(""); + $('#AAIManufacturer').val(""); + $('#AAISpecification').val(""); + }, + isMultiple: false + }); + $('#AAISource').lrDataItemSelect({ code: 'zcly' }); + $('#AAISupplierId').lrDataSourceSelect({ code: 'Ass_SupplierData', value: 'sid', text: 'sname' }); + $('#AAIUnit').lrDataItemSelect({ code: 'sldw' }); + //$('#AAIStorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' }); + $('#AAIStorageId').lrselect({ + type: 'tree', + allowSearch: true, + url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetTree', + param: {}, + select: function (val) { + var storageId = ""; + if (val) { + storageId = val.value; + } + $('#AAIStoragePosition').lrselectRefresh({ + url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetListForStorageId?storageId=' + storageId, + text: "RCode", + value: "RId" + }); + } + }); + //房间 + $('#AAIStoragePosition').lrselect({ value: 'RId', text: 'RCode' }); + $('#AAIHasDetail').lrDataItemSelect({ + code: 'YesOrNoBit', select: function (item) { + if (item != null && item != undefined) { + if (item.id === true || item.id === "true") { + $("#AAIStock").attr("checkexpession", "PositiveInteger"); + } else { + $("#AAIStock").attr("checkexpession", "PositiveFloatint"); + } + } + } + }); + $('#AAIPhoto').lrUploader(); + }, + initData: function () { + if (!!keyValue) { + if (!!selectedRow) { + $('#form').lrSetFormData(selectedRow); + $("#AAOldCode").find('span').text(selectedRow.AAIName); + } + } + + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = $('body').lrGetFormData(); + if (!!keyValue) { + if (!!selectedRow) { + postData.AAIId = selectedRow.AAIId; + } + } else { + postData.AAIId = learun.newGuid(); + } + if (!!callBack) { + callBack(postData); + return true; + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index d185c4128..41dfb570c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -852,6 +852,7 @@ + @@ -865,10 +866,12 @@ + + @@ -6425,8 +6428,8 @@ - - + + @@ -7339,6 +7342,9 @@ + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/AssetManagementSystem/Ass_AcceptanceMainMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/AssetManagementSystem/Ass_AcceptanceMainMap.cs new file mode 100644 index 000000000..8449ad513 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/AssetManagementSystem/Ass_AcceptanceMainMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.AssetManagementSystem; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2020-11-18 10:46 + /// 描 述:资产验收 + /// + public class Ass_AcceptanceMainMap : EntityTypeConfiguration + { + public Ass_AcceptanceMainMap() + { + #region 表、主键 + //表 + this.ToTable("ASS_ACCEPTANCEMAIN"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index 9392cd2d5..4ecf4f969 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -63,6 +63,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceBLL.cs index 01a5e4988..c7d278993 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceBLL.cs @@ -43,6 +43,29 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem } } + /// + /// 获取Ass_Acceptance表数据 + /// + /// 主表Id + /// + public IEnumerable GetAss_AcceptanceListByMainId(string mainId) + { + try + { + return ass_AcceptanceService.GetAss_AcceptanceListByMainId(mainId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取Ass_Acceptance表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceEntity.cs index a97b6ec04..fc4b9a2bc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceEntity.cs @@ -19,6 +19,12 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem ///
[Column("ID")] public string ID { get; set; } + /// + /// 编号 + /// + [Column("MAINID")] + public string MainId { get; set; } + /// /// 设备名称 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceIBLL.cs index 3e5e74da8..6efa1614a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceIBLL.cs @@ -22,6 +22,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetAss_AcceptanceListByMainId(string mainId); /// /// 获取Ass_Acceptance表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceService.cs index 3234ce66d..4634fd4d7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Acceptance/Ass_AcceptanceService.cs @@ -58,7 +58,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem } if (!queryParam["DepartmentId"].IsEmpty()) { - dp.Add("DepartmentId",queryParam["DepartmentId"].ToString(), DbType.String); + dp.Add("DepartmentId", queryParam["DepartmentId"].ToString(), DbType.String); strSql.Append(" AND t.DepartmentId = @DepartmentId "); } if (!queryParam["UserID"].IsEmpty()) @@ -71,7 +71,26 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem dp.Add("Place", "%" + queryParam["Place"].ToString() + "%", DbType.String); strSql.Append(" AND t.Place Like @Place "); } - return this.BaseRepository().FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public IEnumerable GetAss_AcceptanceListByMainId(string mainId) + { + try + { + return this.BaseRepository().FindList(x => x.MainId == mainId); } catch (Exception ex) { @@ -119,7 +138,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem { try { - return this.BaseRepository().FindEntity(t=>t.ProcessId == processId); + return this.BaseRepository().FindEntity(t => t.ProcessId == processId); } catch (Exception ex) { @@ -146,7 +165,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem { try { - this.BaseRepository().Delete(t=>t.ID == keyValue); + this.BaseRepository().Delete(t => t.ID == keyValue); } catch (Exception ex) { @@ -201,7 +220,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem { try { - BaseRepository().ExecuteBySql($"UPDATE dbo.Ass_Acceptance SET Status='{i}',ProcessId='{processId}' WHERE ID='{keyValue}'", null); + BaseRepository().ExecuteBySql($"UPDATE dbo.Ass_AcceptanceMain SET Status='{i}',ProcessId='{processId}' WHERE Id='{keyValue}'", null); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AcceptanceMain/Ass_AcceptanceMainBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AcceptanceMain/Ass_AcceptanceMainBLL.cs new file mode 100644 index 000000000..9a4dcf235 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AcceptanceMain/Ass_AcceptanceMainBLL.cs @@ -0,0 +1,186 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.AssetManagementSystem +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2020-11-18 10:46 + /// 描 述:资产验收 + /// + public class Ass_AcceptanceMainBLL : Ass_AcceptanceMainIBLL + { + private Ass_AcceptanceMainService ass_AcceptanceMainService = new Ass_AcceptanceMainService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return ass_AcceptanceMainService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Ass_Acceptance表实体数据 + /// + /// 主键 + /// + public Ass_AcceptanceMainEntity GetAss_AcceptanceMainEntity(string keyValue) + { + try + { + return ass_AcceptanceMainService.GetAss_AcceptanceMainEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + public Ass_AcceptanceMainEntity GetEntityByProcessId(string processId) + { + try + { + return ass_AcceptanceMainService.GetEntityByProcessId(processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + ass_AcceptanceMainService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Ass_AcceptanceMainEntity entity, List ass_AcceptanceList) + { + try + { + ass_AcceptanceMainService.SaveEntity(keyValue, entity, ass_AcceptanceList); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void ChangeStatusById(string keyValue, int i, string processId) + { + try + { + ass_AcceptanceMainService.ChangeStatusById(keyValue, i, processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void ChangeStatusByProcessId(string parameterProcessId, int p1) + { + try + { + ass_AcceptanceMainService.ChangeStatusByProcessId(parameterProcessId, p1); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AcceptanceMain/Ass_AcceptanceMainEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AcceptanceMain/Ass_AcceptanceMainEntity.cs new file mode 100644 index 000000000..55567e8a7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AcceptanceMain/Ass_AcceptanceMainEntity.cs @@ -0,0 +1,91 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.AssetManagementSystem +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2020-11-18 10:46 + /// 描 述:资产验收 + /// + public class Ass_AcceptanceMainEntity + { + #region 实体成员 + /// + /// 编号 + /// + [Column("Id")] + public string Id { get; set; } + /// + /// Code + /// + [Column("CODE")] + public string Code { get; set; } + /// + /// Name + /// + [Column("NAME")] + public string Name { get; set; } + /// + /// CreateTime + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + /// + /// CreateUserId + /// + [Column("CREATEUSERID")] + public string CreateUserId { get; set; } + /// + /// CreateDeptId + /// + [Column("CREATEDEPTID")] + public String CreateDeptId { get; set; } + /// + /// 单价 + /// + [Column("TOTALPRICE")] + public decimal? TotalPrice { get; set; } + + /// + /// 备注 + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// 流程id + /// + [Column("PROCESSID")] + public string ProcessId { get; set; } + /// + /// 审核状态 + /// + [Column("STATUS")] + public int? Status { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AcceptanceMain/Ass_AcceptanceMainIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AcceptanceMain/Ass_AcceptanceMainIBLL.cs new file mode 100644 index 000000000..107606624 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AcceptanceMain/Ass_AcceptanceMainIBLL.cs @@ -0,0 +1,57 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.AssetManagementSystem +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2020-11-18 10:46 + /// 描 述:资产验收 + /// + public interface Ass_AcceptanceMainIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取Ass_Acceptance表实体数据 + /// + /// 主键 + /// + Ass_AcceptanceMainEntity GetAss_AcceptanceMainEntity(string keyValue); + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + Ass_AcceptanceMainEntity GetEntityByProcessId(string processId); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Ass_AcceptanceMainEntity entity, List ass_AcceptanceList); + #endregion + + void ChangeStatusById(string keyValue, int i, string processId); + void ChangeStatusByProcessId(string parameterProcessId, int p1); + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AcceptanceMain/Ass_AcceptanceMainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AcceptanceMain/Ass_AcceptanceMainService.cs new file mode 100644 index 000000000..0f188278f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AcceptanceMain/Ass_AcceptanceMainService.cs @@ -0,0 +1,223 @@ +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.AssetManagementSystem +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2020-11-18 10:46 + /// 描 述:资产验收 + /// + public class Ass_AcceptanceMainService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.* + "); + strSql.Append(" FROM Ass_AcceptanceMain t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["Code"].IsEmpty()) + { + dp.Add("Code", "%" + queryParam["Code"].ToString() + "%", DbType.String); + strSql.Append(" AND t.Code Like @Code "); + } + if (!queryParam["CreateUserId"].IsEmpty()) + { + dp.Add("CreateUserId", "%" + queryParam["CreateUserId"].ToString() + "%", DbType.String); + strSql.Append(" AND t.CreateUserId=@CreateUserId "); + } + return this.BaseRepository().FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Ass_Acceptance表实体数据 + /// + /// 主键 + /// + public Ass_AcceptanceMainEntity GetAss_AcceptanceMainEntity(string keyValue) + { + try + { + return this.BaseRepository().FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + public Ass_AcceptanceMainEntity GetEntityByProcessId(string processId) + { + try + { + return this.BaseRepository().FindEntity(t=>t.ProcessId == processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository().Delete(t=>t.Id == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Ass_AcceptanceMainEntity entity, List ass_AcceptanceEntity) + { + var db = this.BaseRepository().BeginTrans(); + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + db.Update(entity); + db.Delete(t => t.MainId == keyValue); + + } + else + { + entity.Create(); + db.Insert(entity); + } + foreach (Ass_AcceptanceEntity item in ass_AcceptanceEntity) + { + item.Create(); + item.MainId = entity.Id; + db.Insert(item); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + public void ChangeStatusById(string keyValue, int i, string processId) + { + try + { + BaseRepository().ExecuteBySql($"UPDATE dbo.Ass_Acceptance SET Status='{i}',ProcessId='{processId}' WHERE ID='{keyValue}'", null); + } + catch (Exception ex) + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + + public void ChangeStatusByProcessId(string parameterProcessId, int p1) + { + try + { + if (p1 == 2) + { + var entity = this.BaseRepository() + .FindEntity(a => a.ProcessId == parameterProcessId); + if (null != entity) + { + entity.Status = p1; + } + + this.BaseRepository().Update(entity); + } + } + catch (Exception ex) + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileService.cs index 6515d0e89..e1e2a19d5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileService.cs @@ -402,6 +402,21 @@ on a.F_UserId=b.F_UserId where b.F_ObjectId in(" + string.Join(",", ppostid) + db.Rollback(); } } + else if (status == 0) + { + var db = BaseRepository().BeginTrans(); + try + { + var Sys_SendFile = db.FindEntity(m => m.SProcessId == processId); + Sys_SendFile.SendFlag = status; + db.Update(Sys_SendFile); + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + } + } } public void PushWeixin(List needpostuserlist, string title) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 5f1e90ab3..812e47769 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -83,6 +83,10 @@ + + + +