Browse Source

金隅分支
edy 3 years ago
parent
commit
a03a9f330e
3 changed files with 59 additions and 126 deletions
  1. +50
    -123
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsForm.js
  2. +1
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/IndexTwo.js
  3. +8
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsOutApply/Ass_AssetsOutApplyService.cs

+ 50
- 123
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/AssetsForm.js View File

@@ -28,7 +28,6 @@ var bootstrap = function ($, learun) {
init: function () {
$('.lr-form-wrap').lrscroll();
$("#detailadd").on('click', function () {
selectedRow = null;
learun.layerForm({
id: 'formitem',
title: '新增明细',
@@ -41,18 +40,16 @@ var bootstrap = function ($, learun) {
});
});
$("#detaildel").on('click', function () {
var keyValue = $('#Ass_AssetsOutItemApply').jfGridValue('AOIId');
console.log(keyValue);
var keyValue = $('#Ass_AssetsOutItemApply').jfGridValue('AOICode');
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;
if (tempdatra[key].AOICode === 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);
}
@@ -83,7 +80,7 @@ var bootstrap = function ($, learun) {
});
//新房间
$('#AOINewRoomId').lrselect({ value: 'RId', text: 'RCode', allowSearch: true });
$('#AOINewDepartment').lrselect({
$('#AOINewDepartment').lrDepartmentSelect({
type: 'tree',
allowSearch: true,
url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
@@ -112,6 +109,7 @@ var bootstrap = function ($, learun) {
param: {}
});
$('#AOStorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' });
console.log($('#Ass_AssetsOutItemApply').val())
$('#Ass_AssetsOutItemApply').jfGrid({
headData: [
{
@@ -162,97 +160,6 @@ var bootstrap = function ($, learun) {
});
}
},
{
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'
},
@@ -262,12 +169,12 @@ var bootstrap = function ($, learun) {
{
label: '资产规格', name: 'AOISpecification', width: 100, align: 'left'
},
{
label: '用途', name: 'AOIUse', width: 100, align: 'left'
},
//{
// label: '用途', name: 'AOIUse', width: 100, align: 'left'
//},
],
height: 400,
mainId: 'AOIId',
mainId: 'AAIId',
reloadSelected: false
});
},
@@ -276,14 +183,14 @@ var bootstrap = function ($, learun) {
$.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]);
//$('#' + id).jfGridSet('refreshdata', data[id]);
tempdatra = data[id];
}
else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
if (data[id].AOPrice) {
pricecount = data[id].AOPrice;
}
//if (data[id].AOPrice) {
// pricecount = data[id].AOPrice;
//}
}
}
});
@@ -294,25 +201,45 @@ var bootstrap = function ($, learun) {
};
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);
var list = [];
$.each(temprow,
function (i, item) {
var entity = {
//AOICode: item.AICode,
AOICode: item.AICodeNumJY,
AOIName: item.AIASSName,
AOISpecification: item.AISpecification,
AOITId: item.AIASSClass,
AOIUserPeople: item.AIUsePeople,
AOIRoomId: item.AIIStoragePosition,
AOIPrice: item.AIAssValue,
AOIUnit: item.AIUnits,
AOIEName: '',
AOIManufacturer: item.AIManufacturer,
AOIModel: item.AISpecificationtype,
AOIId: learun.newGuid()
}
list.push(entity);

});
$.each(list,
function (j, item2) {
$.each(tempdatra,
function (key, val) {

if (tempdatra[key].AOICode === item2.AOICode) {
tempdatra[key] = item2;
ifnewrow = false;
}
});
if (ifnewrow) {
tempdatra.push(item2);
}
});
$('#Ass_AssetsOutItemApply').jfGridSet('refreshdata', tempdatra.sort(sortNumber));
};
function sortNumber(a, b) {
return a.AOIOrder - b.AOIOrder;
return 1;//a.AAIOrder - b.AAIOrder;
}
// 设置表单数据
setFormData = function (processId) {
@@ -324,7 +251,7 @@ var bootstrap = function ($, learun) {
}
else {
if (id == 'Ass_AssetsOutApply') {
keyValue = data[id].AOId;
//keyValue = data[id].AOId;
}
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
}


+ 1
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsOutApply/IndexTwo.js View File

@@ -7,6 +7,7 @@
var refreshGirdData;
var acceptClick;
var AId = request("AId");
console.log(AId);
var currentUser = request("currentUser");//我的资产需要用到
var IsDelete = request("IsDelete");//报废资产需要使用
var bootstrap = function ($, learun) {
@@ -68,8 +69,6 @@ var bootstrap = function ($, learun) {
$('#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",
@@ -216,7 +215,6 @@ var bootstrap = function ($, learun) {
acceptClick = function (callBack) {
var selectedRow = $('#gridtable').jfGridGet('rowdata');
callBack(selectedRow);

};
page.init();
}


+ 8
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsOutApply/Ass_AssetsOutApplyService.cs View File

@@ -213,6 +213,10 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
allPrice += item.AOIPrice.ToDecimal();
item.Create();
item.AOId = ass_AssetsOutApplyEntityTmp.AOId;
item.AOINewUsePeople = entity.AOINewUsePeople;
item.AOINewRoomId = entity.AOINewRoomId;
item.AOINewDepartment = entity.AOINewDepartment;
item.AOINewStorageId = entity.AOINewStorageId;
db.Insert(item);
}
entity.AOPrice = allPrice;
@@ -226,6 +230,10 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
item.Create();
allPrice += item.AOIPrice.ToDecimal();
item.AOId = entity.AOId;
item.AOINewUsePeople = entity.AOINewUsePeople;
item.AOINewRoomId = entity.AOINewRoomId;
item.AOINewDepartment = entity.AOINewDepartment;
item.AOINewStorageId = entity.AOINewStorageId;
db.Insert(item);
}
entity.AOPrice = allPrice;


Loading…
Cancel
Save