From 1450895de077937d735aff231fc2c59a1e4c2666 Mon Sep 17 00:00:00 2001 From: edy Date: Fri, 16 Jul 2021 09:40:37 +0800 Subject: [PATCH] --- .../Ass_AssetsOutApplyController.cs | 35 ++ .../Ass_AssetsOutApply/AssetsForm.cshtml | 67 ++++ .../Views/Ass_AssetsOutApply/AssetsForm.js | 366 ++++++++++++++++++ .../Ass_AssetsOutApply/AssetsIndex.cshtml | 44 +++ .../Views/Ass_AssetsOutApply/AssetsIndex.js | 267 +++++++++++++ .../Views/Ass_AssetsOutApply/IndexTwo.cshtml | 75 ++++ .../Views/Ass_AssetsOutApply/IndexTwo.js | 286 ++++++++++++++ .../Learun.Application.Web.csproj | 6 + .../Ass_AssetsOutApplyEntity.cs | 21 + 9 files changed, 1167 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsForm.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsForm.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsIndex.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsIndex.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/IndexTwo.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/IndexTwo.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsOutApplyController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsOutApplyController.cs index cbf1b2a46..91b6d9511 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsOutApplyController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsOutApplyController.cs @@ -4,6 +4,7 @@ using Learun.Application.TwoDevelopment.AssetManagementSystem; using System.Web.Mvc; using System.Collections.Generic; using System; +using System.Linq; namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers { @@ -38,6 +39,36 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers { return View(); } + + /// + /// 资产调拨多选页面 + /// + /// + [HttpGet] + public ActionResult AssetsIndex() + { + return View(); + } + + /// + /// 资产调拨多选页面 + /// + /// + [HttpGet] + public ActionResult AssetsForm() + { + return View(); + } + /// + /// 资产调拨多选页面 + /// + /// + [HttpGet] + public ActionResult IndexTwo() + { + return View(); + } + /// /// 表单页 /// @@ -82,6 +113,10 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers { var Ass_AssetsOutApplyData = ass_AssetsOutApplyIBLL.GetAss_AssetsOutApplyEntity( keyValue ); var Ass_AssetsOutItemApplyData = ass_AssetsOutApplyIBLL.GetAss_AssetsOutItemApplyList( Ass_AssetsOutApplyData.AOId ); + Ass_AssetsOutApplyData.AOINewDepartment = Ass_AssetsOutItemApplyData.FirstOrDefault().AOINewDepartment; + Ass_AssetsOutApplyData.AOINewUsePeople = Ass_AssetsOutItemApplyData.FirstOrDefault().AOINewUsePeople; + Ass_AssetsOutApplyData.AOINewStorageId = Ass_AssetsOutItemApplyData.FirstOrDefault().AOINewStorageId; + Ass_AssetsOutApplyData.AOINewRoomId = Ass_AssetsOutItemApplyData.FirstOrDefault().AOINewRoomId; var jsonData = new { Ass_AssetsOutApply = Ass_AssetsOutApplyData, Ass_AssetsOutItemApply = Ass_AssetsOutItemApplyData, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsForm.cshtml new file mode 100644 index 000000000..dd8e68185 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsForm.cshtml @@ -0,0 +1,67 @@ +@{ + ViewBag.Title = "调拨申请"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+
+
调拨单流水号
+ +
+ @*
+
出库总价
+ +
*@ + @*
+
调拨原因
+
+
*@ + + @*
+
部门
+
+
+
+
库房
+
+
*@ +
+
申请时间
+ +
+
+
申请人
+ +
+
+
新使用部门*
+
+
+
+
新使用人员*
+
+
+
+
新楼宇名称*
+
+
+
+
新房间号*
+
+
+
+
项目名称
+ +
+
+
明细操作
+ + +
+
+
+
+
+@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsForm.js new file mode 100644 index 000000000..2d1ac363a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsForm.js @@ -0,0 +1,366 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-03-29 11:49 + * 描 述:出库申请 + */ +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_AssetsOutApply/IndexTwo', + width: 860, + height: 600, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + $("#detaildel").on('click', function () { + var keyValue = $('#Ass_AssetsOutItemApply').jfGridValue('AOIId'); + console.log(keyValue); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res, index) { + if (res) { + $.each(tempdatra, function (key, val) { + if (tempdatra[key].AOIId === keyValue) { + pricecount -= tempdatra[key].AOIPrice * tempdatra[key].AOIStock; + tempdatra.splice(key, 1); + } + }); + $("#AOPrice").val(pricecount); + $('#Ass_AssetsOutItemApply').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); + top.layer.close(index); + } + }); + } + }); + page.bind(); + page.initData(); + }, + bind: function () { + //新楼宇 + $('#AOINewStorageId').lrselect({ + type: 'tree', + allowSearch: true, + url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetTree', + param: {}, + select: function (val) { + var storageId = ""; + if (val) { + storageId = val.value; + } + $('#AOINewRoomId').lrselectRefresh({ + url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetListForStorageId?storageId=' + storageId, + text: "RCode", + value: "RId", allowSearch: true + }); + } + }); + //新房间 + $('#AOINewRoomId').lrselect({ value: 'RId', text: 'RCode', allowSearch: true }); + $('#AOINewDepartment').lrselect({ + type: 'tree', + allowSearch: true, + url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', + param: {}, + select: function (val) { + var departmentId = ""; + if (val) { + departmentId = val.value; + } + $('#AOINewUsePeople').lrselectRefresh({ + url: top.$.rootUrl + '/LR_OrganizationModule/User/GetListByDepartmentId?departmentId=' + departmentId, + text: "F_RealName", + value: "F_UserId", + }) + } + }); + $('#AOINewUsePeople').lrselect({ value: 'F_UserId', text: 'F_RealName' }); + $('#AOReasonType').lrDataItemSelect({ code: 'ReasonType' }); + $('#AOCreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#AOCreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#AOCreateUserId').val(learun.clientdata.get(['userinfo']).realName); + $('#AODepartment').lrselect({ + type: 'tree', + allowSearch: true, + url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', + param: {} + }); + $('#AOStorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' }); + $('#Ass_AssetsOutItemApply').jfGrid({ + headData: [ + { + label: '资产编号', name: 'AOICode', width: 150, align: 'left' + }, + { + label: '资产名称', name: 'AOIName', width: 150, align: 'left' + }, + { + label: '资产类别', name: 'AOITId', 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: 'AOIPrice', width: 100, align: 'left' + }, + //{ + // label: '数量', name: 'AOIStock', width: 80, align: 'left' + //}, + { + label: '单位', name: 'AOIUnit', 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: "AOIUserPeople", 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['f_realname']); + } + }); + } + }, + { + label: "原部门", name: "AOIOldDepartment", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "原楼宇", name: "AOIStorageId", 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: "AOIRoomId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_Storage_Room', + key: value, + keyId: 'rid', + callback: function (_data) { + callback(_data['rcode']); + } + }); + } + }, + { + label: "新使用人", name: "AOINewUsePeople", 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['f_realname']); + } + }); + } + }, + { + label: "新部门", name: "AOINewDepartment", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "新楼宇", name: "AOINewStorageId", 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: "AOINewRoomId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_Storage_Room', + key: value, + keyId: 'rid', + callback: function (_data) { + callback(_data['rcode']); + } + }); + } + }, + { + label: '资产型号', name: 'AOIModel', width: 100, align: 'left' + }, + { + label: '生产厂家', name: 'AOIManufacturer', width: 100, align: 'left' + }, + { + label: '资产规格', name: 'AOISpecification', width: 100, align: 'left' + }, + { + label: '用途', name: 'AOIUse', width: 100, align: 'left' + }, + ], + height: 400, + mainId: 'AOIId', + reloadSelected: false + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/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].AOPrice) { + pricecount = data[id].AOPrice; + } + } + } + }); + } else { + $("#AOCode").val(NewAOCode); + } + } + }; + refreshGirdData = function (temprow) { + var ifnewrow = true; + $.each(tempdatra, function (key, val) { + if (tempdatra[key].AOIId === temprow.AOIId) { + tempdatra[key] = temprow; + ifnewrow = false; + } + }); + if (ifnewrow) { + tempdatra.push(temprow); + } + //总价计算 + pricecount = 0; + for (var i = 0; i < tempdatra.length; i++) { + pricecount += tempdatra[i].AOIPrice * tempdatra[i].AOIStock; + } + $("#AOPrice").val(pricecount); + $('#Ass_AssetsOutItemApply').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); + }; + function sortNumber(a, b) { + return a.AOIOrder - b.AOIOrder; + } + // 设置表单数据 + setFormData = function (processId) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/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_AssetsOutApply') { + keyValue = data[id].AOId; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + // 验证数据是否填写完整 + validForm = function () { + if (!$('#form').lrValidform()) { + return false; + } + var datas = $('#Ass_AssetsOutItemApply').jfGridGet('rowdatas'); + if (datas == null || datas.length == 0) { + learun.alert.warning("申请未包含明细!请先新增明细!"); + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + var postData = {}; + var formData = $('[data-table="Ass_AssetsOutApply"]').lrGetFormData(); + if (!!processId) { + formData.AOProcessId = processId; + } + //出库类型改为调拨(金隅) + formData.AOReasonType = 3; + postData.strEntity = JSON.stringify(formData); + postData.strass_AssetsOutItemApplyList = JSON.stringify($('#Ass_AssetsOutItemApply').jfGridGet('rowdatas')); + $.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, formData, i); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsIndex.cshtml new file mode 100644 index 000000000..a33087d69 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsIndex.cshtml @@ -0,0 +1,44 @@ +@{ + ViewBag.Title = "出库申请"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
+
+
+
申请单号
+ +
+
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsIndex.js new file mode 100644 index 000000000..e83b196cc --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsIndex.js @@ -0,0 +1,267 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-03-29 11:49 + * 描 述:出库申请 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var startTime; + var endTime; + var processId = ''; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '3', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'formAss_AssetsOutApply', + title: '新增', + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/AssetsForm', + width: 1000, + height: 750, + callBack: function (id) { + var res = false; + // 验证数据 + res = top[id].validForm(); + // 保存数据 + if (res) { + //processId = learun.newGuid(); + //res = top[id].save(processId, refreshGirdData); + res = top[id].save('', function () { + page.search(); + }); + } + return res; + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('AOId'); + if (learun.checkrow(keyValue)) { + var AAStatus = $('#gridtable').jfGridValue('AOStatus'); + if (AAStatus !== 0) { + learun.alert.warning("当前项目已提交不能编辑!"); + return; + } + learun.layerForm({ + id: 'formAss_AssetsOutApply', + title: '编辑', + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/AssetsForm?keyValue=' + keyValue, + width: 1000, + height: 750, + callBack: function (id) { + var res = false; + // 验证数据 + res = top[id].validForm(); + // 保存数据 + if (res) { + res = top[id].save('', function () { + page.search(); + }); + } + return res; + } + }); + } + }); + // 查看申请 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('AOId'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formAss_AssetsInfoApply', + title: '查看调拨申请', + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/FormView?keyValue=' + keyValue, + width: 1000, + height: 600, + btn: null + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('AOId'); + console.log(keyValue); + if (learun.checkrow(keyValue)) { + var AAStatus = $('#gridtable').jfGridValue('AOStatus'); + if (AAStatus !== 0) { + learun.alert.warning("当前项目已提交不能删除!"); + return; + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutItemApply/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //  提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('AOId'); + if (learun.checkrow(keyValue)) { + var AAStatus = $('#gridtable').jfGridValue('AOStatus'); + if (AAStatus !== 0) { + learun.alert.warning("当前项目已提交,请耐心等待审批!"); + return; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutItemApply/ChangeStatusById', { keyValue: keyValue, processId: processId }, function (res) { + refreshGirdData(res, {}); + }); + } + }); + } + }); + //缺货单 + $('#lr_incom').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('AOId'); + if (learun.checkrow(keyValue)) { + var AOAIId = $('#gridtable').jfGridValue('AOAIId'); + if (AOAIId == null || AOAIId === undefined || AOAIId === "") { + learun.alert.warning("当前项目不含缺货单!"); + return; + } + learun.layerForm({ + id: 'formAss_AssetsOutApplyIncomplete', + title: '查看缺货单', + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApplyIncomplete/AssetsForm?keyValue=' + keyValue, + width: 1000, + height: 700, + btn: ["调拨", "关闭"], + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/GetPageList', + headData: [ + { label: "调拨单流水号", name: "AOCode", width: 200, align: "left" }, + { label: "调拨总价", name: "AOPrice", width: 100, align: "left" }, + //{ + // label: "出库原因", name: "AOReasonType", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('dataItem', { + // key: value, + // code: 'ReasonType', + // callback: function (_data) { + // callback(_data.text); + // } + // }); + // } + //}, + { label: "项目名称", name: "AOProjectName", width: 150, align: "left" }, + { label: "申请时间", name: "AOCreateTime", width: 150, align: "left" }, + { + label: "申请人", name: "AOCreateUserId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('user', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + } + }, + { + label: "审批状态", name: "AOStatus", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue === 1) { + return '审批中'; + } else if (cellvalue === 2) { + return '审批通过'; + } else { + return '草稿'; + } + } + }, + { + label: "调拨状态", name: "AOOutStatus", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue === 0) { + return '待调拨'; + } else if (cellvalue === 2) { + return '调拨完成'; + } else { + return '部分调拨'; + } + } + } + ], + mainId: 'AOId', + isPage: true, + sidx: 'AOCreateTime', + sord: 'DASC' + }); + }, + search: function (param) { + param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function (res, postData) { + if (res && res.code && res.code == 200) { + // 发起流程 + var postData = { + schemeCode: 'Ass_AssetsOutApply',// 填写流程对应模板编号 + processId: processId, + level: '1', + }; + learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { + learun.loading(false); + }); + + } + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/IndexTwo.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/IndexTwo.cshtml new file mode 100644 index 000000000..553e8603b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/IndexTwo.cshtml @@ -0,0 +1,75 @@ +@{ + /**/ + + ViewBag.Title = "在册登记明细"; + Layout = "~/Views/Shared/_Index.cshtml"; +} + + + +
+
+
+
资产类别
+
+
+
+
+
+
+ 列表信息 +
+
+
+
+
+
+
+
金隅编号
+ +
+
+
部门
+
+
+
+
资产名称
+ +
+
+
楼宇名称
+
+
+
+
房间号
+
+
+
+
资产状态
+
+
+
+
资产属性
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/IndexTwo.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/IndexTwo.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/IndexTwo.js new file mode 100644 index 000000000..3fd16df3e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/IndexTwo.js @@ -0,0 +1,286 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-03-29 11:27 + * 描 述:在册登记明细 + */ +var refreshGirdData; +var acceptClick; +var AId = request("AId"); +var currentUser = request("currentUser");//我的资产需要用到 +var IsDelete = request("IsDelete");//报废资产需要使用 +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + if (currentUser) { + setTimeout("hiddenButton()", 300); + + } + + }, + bind: function () { + + // 初始化左侧树形数据lr_printBar + $('#dataTree').lrtree({ + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/GetTypeTree', + nodeClick: function (item) { + page.search({ AIASSClass: item.value }); + } + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 400, 400); + //$('#AIIStorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' }); + $('#AIIStorageId').lrselect({ + type: 'tree', + allowSearch: true, + url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetTree', + param: {}, + select: function (val) { + var storageId = ""; + if (val) { + storageId = val.value; + } + $('#AIIStoragePosition').lrselectRefresh({ + url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetListForStorageId?storageId=' + storageId, + text: "RCode", + value: "RId", allowSearch: true + }); + } + }); + //房间 + $('#AIIStoragePosition').lrselect({ value: 'RId', text: 'RCode', allowSearch: true }); + $('#AIASSState').lrDataItemSelect({ code: 'AssState' }); + $('#AIAssType').lrDataItemSelect({ code: 'AssType' }); + $('#AIDepartment').lrDepartmentSelect(); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + + + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/GetPageList', + headData: [ + //{ label: "明细编号", name: "AICode", width: 200, align: "left" }, + //{ label: "序号", name: "AICodeNum", width: 100, align: "left" }, + { label: "资产编号", name: "AICodeNumJY", width: 200, align: "left" }, + { + label: "楼宇名称", name: "AIIStorageId", 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: "AIIStoragePosition", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_Storage_Room', + key: value, + keyId: 'rid', + callback: function (_data) { + callback(_data['rcode']); + } + }); + } + }, + { + label: "房间功能", name: "RFunction", width: 150, align: "left" + }, + { + label: "房间面积", name: "RArea", width: 100, align: "left" + }, + { + label: "房间状态", name: "REnabled", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'RoomState', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "资产名称", name: "AIASSName", width: 200, align: "left" }, + { label: "资产规格", name: "AISpecification", width: 100, align: "left" }, + { + label: "资产型号", name: "AISpecificationtype", width: 100, align: "left" + }, + { + label: "计量单位", name: "AIUnits", width: 100, 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: "AIASSState", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'AssState', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + //{ label: "管理部门", name: "AdministrativeDepartment", width: 100, align: "left" }, + { + label: "管理部门", name: "AIDepartment", 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: "AIUsePeople", 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['f_realname']); + } + }); + } + }, + { label: "存放地点", name: "AIPlace", width: 100, align: "left" }, + { label: "资产原价值", name: "AIAssValue", width: 100, align: "left" }, + { label: "购置日期", name: "AIAddTime", width: 100, align: "left" }, + { label: "备注", name: "AIRemark", width: 100, align: "left" }, + { label: "折旧方法", name: "DepreciationMethod", width: 100, align: "left" }, + { label: "折旧状态", name: "DepreciationStatus", width: 100, align: "left" }, + { label: "折旧年限", name: "UsefulLife", width: 100, align: "left" }, + { label: "月折旧额", name: "MonthlyDepreciation", width: 100, align: "left" }, + { label: "已提折旧月数", name: "MonthsOfDepreciation", width: 100, align: "left" }, + { label: "月折旧率", name: "MonthlyDepreciationRate", width: 100, align: "left" }, + { label: "累计折旧", name: "AccumulatedDepreciation", width: 100, align: "left" }, + { label: "净值", name: "NetWorth", width: 100, align: "left" }, + { label: "车辆行驶证所有人", name: "VehicleLicenseUser", width: 100, align: "left" }, + { label: "车辆识别号", name: "AIVehicleNumber", width: 100, align: "left" }, + { label: "车牌号", name: "AIPlateNumber", width: 100, align: "left" }, + { label: "面积", name: "AIBuiltArea", width: 100, align: "left" }, + { label: "权属证号", name: "AIOwnership", width: 100, align: "left" }, + { label: "土地使用权类型", name: "LandUseType", width: 100, align: "left" }, + { label: "土地使用权人/房屋所有权人", name: "LandUseUser", width: 200, align: "left" } + + ], + mainId: 'AIId', + isMultiselect: true, + isPage: true, + sidx: 'AICodeNum' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.AId = AId; + if (currentUser) { + var userInfo = top.learun.clientdata.get(['userinfo']); + param.userId = userInfo.userId; + } + param.AIIsScrap = false; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + // 保存数据 + acceptClick = function (callBack) { + var selectedRow = $('#gridtable').jfGridGet('rowdata'); + callBack(selectedRow); + + }; + page.init(); +} + + +Date.prototype.Format = function (fmt) { //author: meizz + var o = { + "M+": this.getMonth() + 1, //月份 + "d+": this.getDate(), //日 + "H+": this.getHours(), //小时 + "m+": this.getMinutes(), //分 + "s+": this.getSeconds(), //秒 + "q+": Math.floor((this.getMonth() + 3) / 3), //季度 + "S": this.getMilliseconds() //毫秒 + }; + if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); + for (var k in o) + if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); + return fmt; +} + + +function datedifference(sDate1, sDate2) { //sDate1和sDate2是2006-12-18格式 + var dateSpan, + tempDate, + iDays; + sDate1 = Date.parse(sDate1); + sDate2 = Date.parse(sDate2); + dateSpan = sDate2 - sDate1; + dateSpan = Math.abs(dateSpan); + iDays = Math.floor(dateSpan / (24 * 3600 * 1000)); + return iDays; +}; + + + +function AddPrintContent(html) { + var myHtml = myHtml = html; + // var strBodyStyle=""; + // var strFormHtml=strBodyStyle+""+myHtml+""; + var strFormHtml = "" + myHtml + ""; + + LODOP = getLodop(); + LODOP.PRINT_INIT("资产编号"); + LODOP.SET_PRINT_PAGESIZE(2, '40mm', '32.3mm', ""); + + LODOP.SET_PRINT_MODE("PRINT_DUPLEX", 2); + LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", 7); + + LODOP.ADD_PRINT_HTM(10, 8, '40mm', '30mm', strFormHtml); + //打印预览 + // LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1); + // var TaskID1=LODOP.PREVIEW(); + // 直接打印 + var TaskID1 = LODOP.PRINT(); + +}; +function hiddenButton() { + + $("#lr_add").hide(); + $("#lr_printBar").hide(); + $("#lr_edit").hide(); + $("#lr_delete").hide(); + $("#lr_detail").hide(); + $("#lr_import").hide(); +} + 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 510589233..b8e3e30c2 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 @@ -878,6 +878,7 @@ + @@ -891,7 +892,9 @@ + + @@ -7350,6 +7353,9 @@ + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsOutApply/Ass_AssetsOutApplyEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsOutApply/Ass_AssetsOutApplyEntity.cs index b27c0eb95..d4b894f45 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsOutApply/Ass_AssetsOutApplyEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsOutApply/Ass_AssetsOutApplyEntity.cs @@ -72,6 +72,27 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem [Column("AOPROJECTNAME")] public string AOProjectName { get; set; } + /// + /// 新使用部门 + /// + [NotMapped] + public string AOINewDepartment { get; set; } + /// + /// 新使用人员 + /// + [NotMapped] + public string AOINewUsePeople { get; set; } + /// + /// 新楼宇名称 + /// + [NotMapped] + public string AOINewStorageId { get; set; } + /// + /// 新房间号 + /// + [NotMapped] + public string AOINewRoomId { get; set; } + #endregion #region 扩展操作