From a41145765b9f55ab7dc690fbbf48fb5d736b2a8c Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 13 Jul 2021 11:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=97=E6=9D=90=E9=A2=86=E5=8F=96=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=98=8E=E7=BB=86=E6=94=B9=E4=B8=BA=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E8=B5=84=E4=BA=A7=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Ass_Receive/Form.cshtml | 21 +- .../Views/Ass_Receive/Form.js | 323 +++++++++++++----- .../Views/Ass_Receive/FormView.cshtml | 15 +- .../Views/Ass_Receive/FormView.js | 112 +++--- .../Views/Ass_Receive/Index.js | 11 +- .../Ass_Receive/Ass_ReceiveEntity.cs | 8 + .../Ass_Receive/Ass_ReceiveService.cs | 31 +- .../Ass_ReceiveItem/Ass_ReceiveItemEntity.cs | 107 +++++- .../Ass_ReceiveItem/Ass_ReceiveItemService.cs | 5 +- 9 files changed, 423 insertions(+), 210 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/Form.cshtml index 3d3b4d4e0..fc6452177 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/Form.cshtml @@ -4,16 +4,27 @@ }
+
标题
+ +
+
申请人
-
+
-
-
申请人部门
-
+
+
申请部门*
+
申请时间
- + + @**@ +
+
+
明细操作
+ + @**@ +
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/Form.js index 73e5764cc..3809ada8f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/Form.js @@ -14,117 +14,210 @@ var setFormData; var validForm; // 保存数据 var save; +var refreshGirdData; +var selectedRow; +var tempdatra = new Array(); var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { $('.lr-form-wrap').lrscroll(); - + $("#detailadd").on('click', function () { + selectedRow = null; + learun.layerFormForPercent({ + id: 'formitem', + title: '新增明细', + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/IndexTwo', + width: "90%", + height: "90%", + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + $("#detaildel").on('click', function () { + var keyValue = $('#Ass_ReceiveItem').jfGridValue('RIID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res, index) { + if (res) { + $.each(tempdatra, function (key, val) { + if (val && val.RIID === keyValue) { + tempdatra.splice(key, 1); + } + }); + $('#Ass_ReceiveItem').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); + top.layer.close(index); + } + }); + } + }); page.bind(); page.initData(); }, bind: function () { - var loginInfo = top.learun.clientdata.get(['userinfo']); - $('#ReceiveUser').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }).lrselectSet(loginInfo.userId); - $('#PDepartment').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }).lrselectSet(loginInfo.departmentId); + + $('#RTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#ReceiveUser')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + + $('#ReceiveUser').val(learun.clientdata.get(['userinfo']).realName); + $('#PDepartment').lrselect({ + type: 'tree', + // 展开最大高度 + maxHeight: 200, + // 是否允许搜索 + allowSearch: true, + // 访问数据接口地址 + url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree' + }); + $('#PDepartment').lrselectSet(learun.clientdata.get(['userinfo']).departmentId); + + $('#Ass_ReceiveItem').jfGrid({ headData: [ { - label: "资产名称", name: "AName", width: 100, align: "left", - edit: { - type: 'input', - init: function (row, $edit) { - }, - }, - + label: '资产编号', name: 'AAICode', width: 150, align: 'left' }, { - label: "库存数量", name: "ACNum", width: 100, align: "left", + label: '资产名称', name: 'AAIName', width: 150, align: 'left' }, { - label: "领取数量", name: "ANum", width: 100, align: "left", - edit: { - type: 'input', - inputType: 'number', + 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: "AID", width: 100, align: "left", - edit: { - type: 'input', + label: '单价', name: 'AAIPrice', width: 100, 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: 'AAIEName', width: 100, align: 'left' + }, + { + label: '资产型号', name: 'AAIModel', width: 100, align: 'left' + }, + { + label: '生产厂家', name: 'AAIManufacturer', width: 100, align: 'left' + } ], + height: 400, mainId: 'RIID', - isEdit: true, + reloadSelected: false }); + //$('#ReceiveUser').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }).lrselectSet(loginInfo.userId); + //$('#PDepartment').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }).lrselectSet(loginInfo.departmentId); - $('#Ass_ReceiveItem').on('click', function (e) { - var et = e.target || e.srcElement; - var $et = $(et); - if ($et.attr('rowindex') && $et.attr('rownum') && $et.attr('colname') == 'AName') { - var $input = $('#jfgrid_edit_Ass_ReceiveItem_AName'); - $input.removeClass('lr-layerselect').removeAttr('lrlayerselect').unbind('click')[0].dfop = null; + //$('#Ass_ReceiveItem').jfGrid({ + // headData: [ + // { + // label: "资产名称", name: "AName", width: 100, align: "left", + // edit: { + // type: 'input', + // init: function (row, $edit) { + // }, + // }, - $input.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', + // }, + // { + // label: "库存数量", name: "ACNum", width: 100, align: "left", + // }, + // { + // label: "领取数量", name: "ANum", width: 100, align: "left", + // edit: { + // type: 'input', + // inputType: 'number', + // } + // }, + // { + // label: "资产编号", name: "AID", width: 100, align: "left", + // edit: { + // type: 'input', + // } + // }, + // ], + // mainId: 'RIID', + // isEdit: true, + //}); + //$('#Ass_ReceiveItem').on('click', function (e) { + // var et = e.target || e.srcElement; + // var $et = $(et); + // if ($et.attr('rowindex') && $et.attr('rownum') && $et.attr('colname') == 'AName') { + // var $input = $('#jfgrid_edit_Ass_ReceiveItem_AName'); + // $input.removeClass('lr-layerselect').removeAttr('lrlayerselect').unbind('click')[0].dfop = null; - 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) { + // $input.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', - $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetFormData?keyValue=' + values[0], function (data) { - data = data.Ass_AssetsInfo; - var rowIndex = $et.attr('rowindex'); - $input.val(data.AName); - //$('#Ass_ReceiveItem')[0].dfop.running.rowdata[rowIndex]['jfgridRowData']['AName'] = data.AName; - //$('.jfgrid-data-cell[colname="AName"][rowIndex="' + rowIndex + '"]').attr('title', data.AName).html(data.AName); - $input.trigger('propertychange'); + // 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) { - $('jfgrid_edit_Ass_ReceiveItem_' + 'ANum').val(0); - $('.jfgrid-data-cell[colname="ANum"][rowIndex="' + rowIndex + '"]').attr('title', data.AId).html(0); - $('#Ass_ReceiveItem')[0].dfop.running.rowdata[rowIndex]['jfgridRowData']['ANum'] = 0; + // $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetFormData?keyValue=' + values[0], function (data) { + // data = data.Ass_AssetsInfo; + // var rowIndex = $et.attr('rowindex'); + // $input.val(data.AName); + // $input.trigger('propertychange'); - $('jfgrid_edit_Ass_ReceiveItem_' + 'AID').val(data.AId); - $('.jfgrid-data-cell[colname="AID"][rowIndex="' + rowIndex + '"]').attr('title', data.AId).html(data.AId); - $('#Ass_ReceiveItem')[0].dfop.running.rowdata[rowIndex]['jfgridRowData']['AID'] = data.AId; + // $('jfgrid_edit_Ass_ReceiveItem_' + 'ANum').val(0); + // $('.jfgrid-data-cell[colname="ANum"][rowIndex="' + rowIndex + '"]').attr('title', data.AId).html(0); + // $('#Ass_ReceiveItem')[0].dfop.running.rowdata[rowIndex]['jfgridRowData']['ANum'] = 0; - $('jfgrid_edit_Ass_ReceiveItem_' + 'ACNum').val(data.AId); - $('.jfgrid-data-cell[colname="ACNum"][rowIndex="' + rowIndex + '"]').attr('title', data.AStock).html(data.AStock); - $('#Ass_ReceiveItem')[0].dfop.running.rowdata[rowIndex]['jfgridRowData']['ACNum'] = data.AStock; + // $('jfgrid_edit_Ass_ReceiveItem_' + 'AID').val(data.AId); + // $('.jfgrid-data-cell[colname="AID"][rowIndex="' + rowIndex + '"]').attr('title', data.AId).html(data.AId); + // $('#Ass_ReceiveItem')[0].dfop.running.rowdata[rowIndex]['jfgridRowData']['AID'] = data.AId; - }); - } - }, - isMultiple: false - }); - } - }) + // $('jfgrid_edit_Ass_ReceiveItem_' + 'ACNum').val(data.AId); + // $('.jfgrid-data-cell[colname="ACNum"][rowIndex="' + rowIndex + '"]').attr('title', data.AStock).html(data.AStock); + // $('#Ass_ReceiveItem')[0].dfop.running.rowdata[rowIndex]['jfgridRowData']['ACNum'] = data.AStock; + + // }); + // } + // }, + // isMultiple: false + // }); + // } + //}) }, initData: function () { if (!!keyValue) { @@ -132,6 +225,7 @@ var bootstrap = function ($, learun) { 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]); @@ -167,6 +261,47 @@ var bootstrap = function ($, learun) { } return true; }; + refreshGirdData = function (temprow) { + var ifnewrow = true; + var list = []; + $.each(temprow, + function (i, item) { + var entity = { + //AAICode: item.AICode, + AAICode: item.AICodeNumJY, + AAIName: item.AIASSName, + AAITId: item.AIASSClass, + AAIPrice: item.AIAssValue, + AAIUnit: item.AIUnits, + AAIEName: '', + AAIModel: item.AISpecificationtype, + AAIManufacturer: item.AIManufacturer, + RIID: learun.newGuid() + } + list.push(entity); + + }); + + $.each(list, + function (j, item2) { + $.each(tempdatra, + function (key, val) { + + if (tempdatra[key].AAICode === item2.AAICode) { + tempdatra[key] = item2; + ifnewrow = false; + } + }); + if (ifnewrow) { + tempdatra.push(item2); + } + }); + + $('#Ass_ReceiveItem').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); + }; + function sortNumber(a, b) { + return 1;//a.AAIOrder - b.AAIOrder; + }; // 保存数据 save = function (processId, callBack, i) { var formData = $('body').lrGetFormData(); @@ -176,21 +311,21 @@ var bootstrap = function ($, learun) { var postData = { strEntity: JSON.stringify($('[data-table="Ass_Receive"]').lrGetFormData()), }; - var itemList = $('#Ass_ReceiveItem').jfGridGet('rowdatas'); - var num = 0; - $.each(itemList, function (i, item) { - if (item.ANum <= 0) { - learun.alert.warning("请填写<" + item.AName + ">的申请数量"); - num++; - } - if (item.ANum > item.ACNum) { - learun.alert.warning("领取数量不能大于库存数量!"); - num++; - } - }) - if (num > 0) { - return; - } + //var itemList = $('#Ass_ReceiveItem').jfGridGet('rowdatas'); + //var num = 0; + //$.each(itemList, function (i, item) { + // if (item.ANum <= 0) { + // learun.alert.warning("请填写<" + item.AName + ">的申请数量"); + // num++; + // } + // if (item.ANum > item.ACNum) { + // learun.alert.warning("领取数量不能大于库存数量!"); + // num++; + // } + //}) + //if (num > 0) { + // return; + //} postData.receItemList = JSON.stringify($('#Ass_ReceiveItem').jfGridGet('rowdatas')); $.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Receive/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/FormView.cshtml index 8c65bfe64..3ff2088b8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/FormView.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/FormView.cshtml @@ -4,16 +4,21 @@ }
+
标题
+ +
+
申请人
-
+
-
-
申请人部门
-
+
+
申请部门*
+
申请时间
- + + @**@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/FormView.js index 24e22686a..5c8d3967e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/FormView.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/FormView.js @@ -30,80 +30,52 @@ var bootstrap = function ($, learun) { $('#Ass_ReceiveItem').jfGrid({ headData: [ { - label: "资产名称", name: "AName", width: 100, align: "left", + label: '资产编号', name: 'AAICode', width: 150, align: 'left' }, { - label: "数量", name: "ANum", width: 100, align: "left", + label: '资产名称', name: 'AAIName', width: 150, align: 'left' }, { - label: "资产编号", name: "AID", width: 100, 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: 'AAIPrice', width: 100, 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: 'AAIEName', width: 100, align: 'left' + }, + { + label: '资产型号', name: 'AAIModel', width: 100, align: 'left' + }, + { + label: '生产厂家', name: 'AAIManufacturer', width: 100, align: 'left' + } ], + height: 400, mainId: 'RIID', - + reloadSelected: false }); - - $('#Ass_ReceiveItem').on('click', function (e) { - var et = e.target || e.srcElement; - var $et = $(et); - if ($et.attr('rowindex') && $et.attr('rownum') && $et.attr('colname') == 'AName') { - var $input = $('#jfgrid_edit_Ass_ReceiveItem_AName'); - $input.removeClass('lr-layerselect').removeAttr('lrlayerselect').unbind('click')[0].dfop = null; - - $input.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; - var rowIndex = $et.attr('rowindex'); - $input.val(data.AName); - $('#Ass_ReceiveItem')[0].dfop.running.rowdata[rowIndex]['jfgridRowData']['AName'] = data.AName; - $('.jfgrid-data-cell[colname="AName"][rowIndex="' + rowIndex + '"]').attr('title', data.AName).html(data.AName); - - $('jfgrid_edit_Ass_ReceiveItem_' + 'ANum').val(0); - $('.jfgrid-data-cell[colname="ANum"][rowIndex="' + rowIndex + '"]').attr('title', data.AId).html(0); - $('#Ass_ReceiveItem')[0].dfop.running.rowdata[rowIndex]['jfgridRowData']['ANum'] = 0; - - $('jfgrid_edit_Ass_ReceiveItem_' + 'AID').val(data.AId); - $('.jfgrid-data-cell[colname="AID"][rowIndex="' + rowIndex + '"]').attr('title', data.AId).html(data.AId); - $('#Ass_ReceiveItem')[0].dfop.running.rowdata[rowIndex]['jfgridRowData']['AID'] = data.AId; - - }); - } - }, - isMultiple: false - }); - } - }) + }, initData: function () { if (!!keyValue) { @@ -148,12 +120,12 @@ var bootstrap = function ($, learun) { }; // 保存数据 save = function (processId, callBack, i) { - var formData = {}; + //var formData = {}; var res = {}; res.code = 200; - if (!!processId) { - formData.SProcessId = processId; - } + //if (!!processId) { + // formData.PID = processId; + //} callBack(res, i); }; page.init(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/Index.js index 797b70fcb..bd261a195 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_Receive/Index.js @@ -54,7 +54,7 @@ var bootstrap = function ($, learun) { title: '新增', url: top.$.rootUrl + '/AssetManagementSystem/Ass_Receive/Form', width: 1000, - height: 600, + height: 700, callBack: function (id) { var res = false; // 验证数据 @@ -84,7 +84,7 @@ var bootstrap = function ($, learun) { id: 'form', title: '编辑', url: top.$.rootUrl + '/AssetManagementSystem/Ass_Receive/Form?keyValue=' + keyValue, - width: 800, + width: 1000, height: 700, callBack: function (id) { var res = false; @@ -109,7 +109,7 @@ var bootstrap = function ($, learun) { id: 'forminfoitem', title: '查看', url: top.$.rootUrl + '/AssetManagementSystem/Ass_Receive/FormView?keyValue=' + keyValue, - width: 800, + width: 1000, height: 700, btn: '', callBack: function (id) { @@ -160,14 +160,15 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/AssetManagementSystem/Ass_Receive/GetPageList', headData: [ + { label: "标题", name: "RTitle", width: 100, align: "left" }, { label: "申请人", name: "ReceiveUser", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser', key: value, keyId: 'f_userid', callback: function (_data) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Receive/Ass_ReceiveEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Receive/Ass_ReceiveEntity.cs index 7ee36e36f..c561b56a6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Receive/Ass_ReceiveEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Receive/Ass_ReceiveEntity.cs @@ -20,6 +20,11 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem [Column("RID")] public string RID { get; set; } /// + /// 标题 + /// + [Column("RTITLE")] + public string RTitle { get; set; } + /// /// 领取人 /// [Column("RECEIVEUSER")] @@ -55,6 +60,9 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem this.RID = Guid.NewGuid().ToString(); this.RTime = DateTime.Now; this.PStatus = "0"; + var userinfo = LoginUserInfo.Get(); + this.ReceiveUser = userinfo.userId; + this.PDepartment = userinfo.departmentId; } /// /// 编辑调用 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Receive/Ass_ReceiveService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Receive/Ass_ReceiveService.cs index 5eab54432..84e22f39b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Receive/Ass_ReceiveService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_Receive/Ass_ReceiveService.cs @@ -34,6 +34,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem strSql.Append(@" t.RID, t.ReceiveUser, +t.RTitle, t.PDepartment, t.PStatus, t.RTime @@ -92,7 +93,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem { try { - return this.BaseRepository().FindEntity(a=>a.PID==ProcessID); + return this.BaseRepository().FindEntity(a => a.PID == ProcessID); } catch (Exception ex) { @@ -211,20 +212,20 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem db.Update(receiveEntity); //根据领取单减少资产库的库存 - foreach (var item in receiveItem) - { - var num = int.Parse(item.ANum); - if (num > 0) - { - var assInfoEntity = db.FindEntity(a => a.AId == item.AID); - if (assInfoEntity.AStock >= num) - { - assInfoEntity.AStock = assInfoEntity.AStock - num; - db.Update(assInfoEntity); - } - } - - } + //foreach (var item in receiveItem) + //{ + // var num = int.Parse(item.ANum); + // if (num > 0) + // { + // var assInfoEntity = db.FindEntity(a => a.AId == item.AID); + // if (assInfoEntity.AStock >= num) + // { + // assInfoEntity.AStock = assInfoEntity.AStock - num; + // db.Update(assInfoEntity); + // } + // } + + //} } db.Commit(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_ReceiveItem/Ass_ReceiveItemEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_ReceiveItem/Ass_ReceiveItemEntity.cs index ba296f96a..4ea211bf8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_ReceiveItem/Ass_ReceiveItemEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_ReceiveItem/Ass_ReceiveItemEntity.cs @@ -20,25 +20,108 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem [Column("RIID")] public string RIID { get; set; } /// - /// 资产编号 + /// 申请单号 /// - [Column("AID")] - public string AID { get; set; } + [Column("RID")] + public string RID { get; set; } /// - /// 资产名称 + /// AAICode /// - [Column("ANAME")] - public string AName { get; set; } + [Column("AAICODE")] + public string AAICode { get; set; } /// - /// 数量 + /// AAIName /// - [Column("ANUM")] - public string ANum { get; set; } + [Column("AAINAME")] + public string AAIName { get; set; } /// - /// 申请单号 + /// AAITId /// - [Column("RID")] - public string RID { get; set; } + [Column("AAITID")] + public string AAITId { get; set; } + /// + /// AAIEName + /// + [Column("AAIENAME")] + public string AAIEName { get; set; } + /// + /// AAIPhoto + /// + [Column("AAIPHOTO")] + public string AAIPhoto { get; set; } + /// + /// AAIContent + /// + [Column("AAICONTENT")] + public string AAIContent { get; set; } + /// + /// AAIOrder + /// + [Column("AAIORDER")] + public int? AAIOrder { get; set; } + /// + /// AAIModel + /// + [Column("AAIMODEL")] + public string AAIModel { get; set; } + /// + /// AAIManufacturer + /// + [Column("AAIMANUFACTURER")] + public string AAIManufacturer { get; set; } + /// + /// AAISupplierId + /// + [Column("AAISUPPLIERID")] + public string AAISupplierId { get; set; } + /// + /// AAISource + /// + [Column("AAISOURCE")] + public string AAISource { get; set; } + /// + /// AAIPrice + /// + [Column("AAIPRICE")] + public decimal? AAIPrice { get; set; } + + /// + /// AAISTOCK + /// + [Column("AAISTOCK")] + public decimal? AAIStock { get; set; } + /// + /// AAIUNIT + /// + [Column("AAIUNIT")] + public string AAIUnit { get; set; } + /// + /// AAIREALNUM + /// + [Column("AAIREALNUM")] + public decimal? AAIRealNum { get; set; } + + /// + /// AAIREALNUM + /// + [Column("AISCHECK")] + public bool? AIsCheck { get; set; } + + /// + /// AResult + /// + [Column("ARESULT")] + public int? AResult { get; set; } + /// + /// ARemark + /// + [Column("AREMARK")] + public string ARemark { get; set; } + /// + /// AAddress + /// + [Column("AADDRESS")] + public string AAddress { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_ReceiveItem/Ass_ReceiveItemService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_ReceiveItem/Ass_ReceiveItemService.cs index fb90f7413..7e9b7e9fb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_ReceiveItem/Ass_ReceiveItemService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_ReceiveItem/Ass_ReceiveItemService.cs @@ -31,10 +31,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem var strSql = new StringBuilder(); strSql.Append("SELECT "); strSql.Append(@" - t.RIID, - t.AName, - t.AID, - t.ANum + t.* "); strSql.Append(" FROM Ass_ReceiveItem t "); strSql.Append(" WHERE 1=1 ");