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..2f76dd8db 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 @@ -49,6 +49,15 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers { return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } #endregion #region 获取数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormView.cshtml new file mode 100644 index 000000000..f9b14951a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormView.cshtml @@ -0,0 +1,55 @@ +@{ + ViewBag.Title = "资产验收"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
选择已登记资产
+
+
+
+
设备名称
+ +
+
+
品牌
+ +
+
+
规格型号
+ +
+
+
单位
+ +
+
+
数量
+ +
+
+
单价
+ +
+
+
总价
+ +
+
+
使用部门
+
+
+
+
使用人
+
+
+
+
放置地点
+ +
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormView.js new file mode 100644 index 000000000..857bf3963 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormView.js @@ -0,0 +1,176 @@ +/* * 版 本 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"; + // 设置权限 + setAuthorize = function (data) { + if (!!data) { + for (var field in data) { + if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 + $('#' + data[field].fieldId).parent().remove(); + } + else { + if (data[field].isEdit != 1) { + $('#' + data[field].fieldId).attr('disabled', 'disabled'); + if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { + $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); + $('#' + data[field].fieldId).find('.btn-success').remove(); + } + } + } + } + } + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#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; + }; + // 保存数据 + save = function (processId, callBack, i) { + var formData = {}; + var res = {}; + res.code = 200; + if (!!processId) { + formData.AOProcessId = processId; + } + callBack(res, i); + }; + 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 7acc5b0b0..e114e09c3 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 @@ -872,6 +872,7 @@ + @@ -7908,6 +7909,7 @@ +