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 88cbd0844..5e4c93c5e 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
@@ -57,9 +57,11 @@ var bootstrap = function ($, learun) {
// });
//});
$("#detailedit").on('click', function () {
- var keyValue = $('#Ass_Acceptance').jfGridValue('Id');
+ var keyValue = $('#Ass_Acceptance').jfGridValue('AAIId');
+ var AAICode = $('#Ass_Acceptance').jfGridValue('AAICode');
selectedRow = $('#Ass_Acceptance').jfGridGet('rowdata');
- if (learun.checkrow(keyValue)) {
+
+ if (learun.checkrow(AAICode)) {
learun.layerForm({
id: 'formitem',
title: '编辑明细',
@@ -67,7 +69,6 @@ var bootstrap = function ($, learun) {
width: 860,
height: 600,
callBack: function (id) {
- //return top[id].acceptClick(refreshGirdData);
return top[id].acceptClick(refreshGirdData);
}
});
@@ -75,12 +76,12 @@ var bootstrap = function ($, learun) {
});
$("#detailadd").on('click', function () {
selectedRow = null;
- learun.layerFormForPercent({
+ learun.layerForm({
id: 'formitem',
title: '新增明细',
- url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/IndexTwo',
- width: "90%",
- height: "90%",
+ url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/FormItem',
+ width: 860,
+ height: 600,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
@@ -150,9 +151,23 @@ var bootstrap = function ($, learun) {
});
}
},
+ {
+ 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', {
@@ -164,6 +179,36 @@ var bootstrap = function ($, learun) {
});
}
},
+ {
+ 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',
+ 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['rname']);
+ }
+ });
+ }
+ },
{
label: '英文名称', name: 'AAIEName', width: 100, align: 'left'
},
@@ -172,62 +217,31 @@ var bootstrap = function ($, learun) {
},
{
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
});
- //$('#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: "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" },
- // ],
- // height: 400,
- // mainId: 'Id',
- // reloadSelected: false,
- //});
+
},
initData: function () {
if (!!keyValue) {
@@ -256,51 +270,50 @@ var bootstrap = function ($, learun) {
var list = [];
//总价计算
pricecount = 0;
- $.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,
- AAIId: learun.newGuid()
- }
- list.push(entity);
+ //$.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,
+ // AAIId: learun.newGuid()
+ // }
+ // list.push(entity);
- });
+ // });
+ //$.each(list,
+ // function (j, item2) {
+ // $.each(tempdatra,
+ // function (key, val) {
- $.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);
- }
- });
+ // if (tempdatra[key].AAICode === item2.AAICode) {
+ // tempdatra[key] = item2;
+ // ifnewrow = false;
+ // }
+ // });
+ // if (ifnewrow) {
+ // tempdatra.push(item2);
+ // }
+ // });
//var ifnewrow = true;
- //$.each(tempdatra, function (key, val) {
- // if (tempdatra[key].MainId === temprow.AICodeNumJY) {
- // tempdatra[key] = temprow;
- // ifnewrow = false;
- // }
- //});
- //if (ifnewrow) {
- // tempdatra.push(temprow);
- //}
+ $.each(tempdatra, function (key, val) {
+ if (tempdatra[key].AAICode === temprow.AAICode) {
+ tempdatra[key] = temprow;
+ ifnewrow = false;
+ }
+ });
+ if (ifnewrow) {
+ tempdatra.push(temprow);
+ }
for (var i = 0; i < tempdatra.length; i++) {
- pricecount = parseFloat(pricecount) + parseFloat(tempdatra[i].AAIPrice);
+ pricecount = parseFloat(pricecount) + parseFloat(tempdatra[i].AAIPrice * tempdatra[i].AAIStock);
}
$("#TotalPrice").val(pricecount);
$('#Ass_Acceptance').jfGridSet('refreshdata', tempdatra.sort(sortNumber));
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
index 3017a379f..7a3d6eccf 100644
--- 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
@@ -3,53 +3,69 @@
Layout = "~/Views/Shared/_Form.cshtml";
}