@@ -7,17 +7,26 @@ | |||||
</script> | </script> | ||||
<div class="lr-form-wrap"> | <div class="lr-form-wrap"> | ||||
<div class="col-xs-12 lr-form-item" data-table="Ass_AssetsOutApply"> | <div class="col-xs-12 lr-form-item" data-table="Ass_AssetsOutApply"> | ||||
<div class="lr-form-item-title">出库单流水号</div> | |||||
<div class="lr-form-item-title">调拨单流水号</div> | |||||
<input id="AOCode" type="text" class="form-control" readonly="readonly" /> | <input id="AOCode" type="text" class="form-control" readonly="readonly" /> | ||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">出库总价</div> | |||||
<input id="AOPrice" type="text" class="form-control" readonly="readonly" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">出库原因</div> | |||||
@*<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">出库总价</div> | |||||
<input id="AOPrice" type="text" class="form-control" readonly="readonly" /> | |||||
</div>*@ | |||||
@*<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">调拨原因</div> | |||||
<div id="AOReasonType"></div> | <div id="AOReasonType"></div> | ||||
</div>*@ | |||||
@*<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">部门</div> | |||||
<div id="AODepartment"></div> | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">库房</div> | |||||
<div id="AOStorageId"></div> | |||||
</div>*@ | |||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | <div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | ||||
<div class="lr-form-item-title">申请时间</div> | <div class="lr-form-item-title">申请时间</div> | ||||
<input id="AOCreateTime" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | <input id="AOCreateTime" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | ||||
@@ -26,6 +35,10 @@ | |||||
<div class="lr-form-item-title">申请人</div> | <div class="lr-form-item-title">申请人</div> | ||||
<input id="AOCreateUserId" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | <input id="AOCreateUserId" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | ||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">项目名称</div> | |||||
<input id="AOProjectName" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | <div class="col-xs-12 lr-form-item"> | ||||
<div class="lr-form-item-title">明细操作</div> | <div class="lr-form-item-title">明细操作</div> | ||||
<input id="detailadd" type="button" class="btn btn-success" value="新增明细" /> | <input id="detailadd" type="button" class="btn btn-success" value="新增明细" /> | ||||
@@ -83,6 +83,13 @@ var bootstrap = function ($, learun) { | |||||
$('#AOCreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | $('#AOCreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | ||||
$('#AOCreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | $('#AOCreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | ||||
$('#AOCreateUserId').val(learun.clientdata.get(['userinfo']).realName); | $('#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({ | $('#Ass_AssetsOutItemApply').jfGrid({ | ||||
headData: [ | headData: [ | ||||
{ | { | ||||
@@ -106,9 +113,9 @@ var bootstrap = function ($, learun) { | |||||
{ | { | ||||
label: '单价', name: 'AOIPrice', width: 100, align: 'left' | label: '单价', name: 'AOIPrice', width: 100, align: 'left' | ||||
}, | }, | ||||
{ | |||||
label: '数量', name: 'AOIStock', width: 80, align: 'left' | |||||
}, | |||||
//{ | |||||
// label: '数量', name: 'AOIStock', width: 80, align: 'left' | |||||
//}, | |||||
{ | { | ||||
label: '单位', name: 'AOIUnit', width: 80, align: 'left', formatterAsync: function (callback, value, row, op, $cell) { | label: '单位', name: 'AOIUnit', width: 80, align: 'left', formatterAsync: function (callback, value, row, op, $cell) { | ||||
learun.clientdata.getAsync('dataItem', { | learun.clientdata.getAsync('dataItem', { | ||||
@@ -121,14 +128,95 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
label: '英文名称', name: 'AOIEName', width: 100, align: 'left' | |||||
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: "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: 'AOIModel', width: 100, align: 'left' | label: '资产型号', name: 'AOIModel', width: 100, align: 'left' | ||||
}, | }, | ||||
{ | { | ||||
label: '生产厂家', name: 'AOIManufacturer', 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, | height: 400, | ||||
mainId: 'AOIId', | mainId: 'AOIId', | ||||
@@ -215,6 +303,8 @@ var bootstrap = function ($, learun) { | |||||
if (!!processId) { | if (!!processId) { | ||||
formData.AOProcessId = processId; | formData.AOProcessId = processId; | ||||
} | } | ||||
//出库类型改为调拨(金隅) | |||||
formData.AOReasonType = 3; | |||||
postData.strEntity = JSON.stringify(formData); | postData.strEntity = JSON.stringify(formData); | ||||
postData.strass_AssetsOutItemApplyList = JSON.stringify($('#Ass_AssetsOutItemApply').jfGridGet('rowdatas')); | postData.strass_AssetsOutItemApplyList = JSON.stringify($('#Ass_AssetsOutItemApply').jfGridGet('rowdatas')); | ||||
$.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/SaveForm?keyValue=' + keyValue, postData, function (res) { | $.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/SaveForm?keyValue=' + keyValue, postData, function (res) { | ||||
@@ -3,27 +3,35 @@ | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | Layout = "~/Views/Shared/_Form.cshtml"; | ||||
} | } | ||||
<div class="lr-form-wrap"> | <div class="lr-form-wrap"> | ||||
<div class="col-xs-12 lr-form-item" data-table="Ass_AssetsOutApply" > | |||||
<div class="lr-form-item-title">出库单流水号</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">调拨单流水号</div> | |||||
<input id="AOCode" type="text" class="form-control" readonly="readonly" /> | <input id="AOCode" type="text" class="form-control" readonly="readonly" /> | ||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply" > | |||||
<div class="lr-form-item-title">出库总价</div> | |||||
<input id="AOPrice" type="text" class="form-control" readonly="readonly"/> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | <div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | ||||
<div class="lr-form-item-title">出库原因</div> | |||||
<div id="AOReasonType" readonly="readonly" ></div> | |||||
<div class="lr-form-item-title">调拨总价</div> | |||||
<input id="AOPrice" type="text" class="form-control" readonly="readonly" /> | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply" > | |||||
@*<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">出库原因</div> | |||||
<div id="AOReasonType" readonly="readonly"></div> | |||||
</div>*@ | |||||
@*<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">部门</div> | |||||
<div id="AODepartment"></div> | |||||
</div>*@ | |||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">申请时间</div> | <div class="lr-form-item-title">申请时间</div> | ||||
<input id="AOCreateTime" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | <input id="AOCreateTime" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | ||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply" > | |||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">申请人</div> | <div class="lr-form-item-title">申请人</div> | ||||
<input id="AOCreateUserId" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | <input id="AOCreateUserId" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | ||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item lr-form-item-grid" > | |||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||||
<div class="lr-form-item-title">项目名称</div> | |||||
<input id="AOProjectName" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||||
<div id="Ass_AssetsOutItemApply"></div> | <div id="Ass_AssetsOutItemApply"></div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -34,6 +34,12 @@ var bootstrap = function ($, learun) { | |||||
$('#AOReasonType').lrDataItemSelect({ code: 'ReasonType' }); | $('#AOReasonType').lrDataItemSelect({ code: 'ReasonType' }); | ||||
$('#AOCreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | $('#AOCreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | ||||
$('#AOCreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | $('#AOCreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | ||||
$('#AODepartment').lrselect({ | |||||
type: 'tree', | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', | |||||
param: {} | |||||
}); | |||||
$('#AOCreateUserId').val(learun.clientdata.get(['userinfo']).realName); | $('#AOCreateUserId').val(learun.clientdata.get(['userinfo']).realName); | ||||
$('#Ass_AssetsOutItemApply').jfGrid({ | $('#Ass_AssetsOutItemApply').jfGrid({ | ||||
headData: [ | headData: [ | ||||
@@ -72,6 +78,84 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
} | } | ||||
}, | }, | ||||
{ | |||||
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: "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: 'AOIEName', width: 100, align: 'left' | label: '英文名称', name: 'AOIEName', width: 100, align: 'left' | ||||
}, | }, | ||||
@@ -80,7 +164,13 @@ var bootstrap = function ($, learun) { | |||||
}, | }, | ||||
{ | { | ||||
label: '生产厂家', name: 'AOIManufacturer', 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, | height: 400, | ||||
mainId: 'AAIId', | mainId: 'AAIId', | ||||
@@ -129,7 +219,7 @@ var bootstrap = function ($, learun) { | |||||
return a.AOIOrder - b.AOIOrder; | return a.AOIOrder - b.AOIOrder; | ||||
} | } | ||||
// 设置表单数据 | // 设置表单数据 | ||||
setFormData = function (processId, param, callback) { | |||||
setFormData = function (processId,param,callback) { | |||||
if (!!processId) { | if (!!processId) { | ||||
$.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/GetFormDataByProcessId?processId=' + processId, function (data) { | $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/GetFormDataByProcessId?processId=' + processId, function (data) { | ||||
for (var id in data) { | for (var id in data) { | ||||
@@ -145,7 +235,7 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
callback && callback() | |||||
callback&& callback() | |||||
} | } | ||||
// 验证数据是否填写完整 | // 验证数据是否填写完整 | ||||
validForm = function () { | validForm = function () { | ||||
@@ -110,7 +110,7 @@ var bootstrap = function ($, learun) { | |||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
learun.layerForm({ | learun.layerForm({ | ||||
id: 'formAss_AssetsInfoApply', | id: 'formAss_AssetsInfoApply', | ||||
title: '查看出库申请', | |||||
title: '查看调拨申请', | |||||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/FormView?keyValue=' + keyValue, | url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/FormView?keyValue=' + keyValue, | ||||
width: 1000, | width: 1000, | ||||
height: 600, | height: 600, | ||||
@@ -170,7 +170,7 @@ var bootstrap = function ($, learun) { | |||||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApplyIncomplete/Form?keyValue=' + keyValue, | url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApplyIncomplete/Form?keyValue=' + keyValue, | ||||
width: 1000, | width: 1000, | ||||
height: 700, | height: 700, | ||||
btn: ["出库", "关闭"], | |||||
btn: ["调拨", "关闭"], | |||||
callBack: function (id) { | callBack: function (id) { | ||||
return top[id].acceptClick(refreshGirdData); | return top[id].acceptClick(refreshGirdData); | ||||
} | } | ||||
@@ -183,19 +183,19 @@ var bootstrap = function ($, learun) { | |||||
$('#gridtable').lrAuthorizeJfGrid({ | $('#gridtable').lrAuthorizeJfGrid({ | ||||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/GetPageList', | url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/GetPageList', | ||||
headData: [ | 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: "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: "AOProjectName", width: 150, align: "left" }, | ||||
{ label: "申请时间", name: "AOCreateTime", width: 150, align: "left" }, | { label: "申请时间", name: "AOCreateTime", width: 150, align: "left" }, | ||||
{ | { | ||||
@@ -222,14 +222,14 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
label: "出库状态", name: "AOOutStatus", width: 100, align: "left", | |||||
label: "调拨状态", name: "AOOutStatus", width: 100, align: "left", | |||||
formatter: function (cellvalue, row) { | formatter: function (cellvalue, row) { | ||||
if (cellvalue === 0) { | if (cellvalue === 0) { | ||||
return '<span class=\"label label-warning\">待出库</span>'; | |||||
return '<span class=\"label label-warning\">待调拨</span>'; | |||||
} else if (cellvalue === 2) { | } else if (cellvalue === 2) { | ||||
return '<span class=\"label label-success\">出库完成</span>'; | |||||
return '<span class=\"label label-success\">调拨完成</span>'; | |||||
} else { | } else { | ||||
return '<span class=\"label label-default\" >部分出库</span>'; | |||||
return '<span class=\"label label-default\" >部分调拨</span>'; | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -37,10 +37,10 @@ | |||||
<div class="lr-form-item-title">单价</div> | <div class="lr-form-item-title">单价</div> | ||||
<input id="AOIPrice" type="text" class="form-control" readonly="readonly" /> | <input id="AOIPrice" type="text" class="form-control" readonly="readonly" /> | ||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutItemApply"> | |||||
@*<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutItemApply"> | |||||
<div class="lr-form-item-title">数量<font face="宋体">*</font></div> | <div class="lr-form-item-title">数量<font face="宋体">*</font></div> | ||||
<input id="AOIStock" type="text" class="form-control" isvalid="yes" checkexpession="PositiveFloatint" /> | <input id="AOIStock" type="text" class="form-control" isvalid="yes" checkexpession="PositiveFloatint" /> | ||||
</div> | |||||
</div>*@ | |||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutItemApply"> | <div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutItemApply"> | ||||
<div class="lr-form-item-title">资产规格</div> | <div class="lr-form-item-title">资产规格</div> | ||||
<input id="AOISpecification" type="text" class="form-control" readonly="readonly" /> | <input id="AOISpecification" type="text" class="form-control" readonly="readonly" /> | ||||
@@ -49,7 +49,7 @@ | |||||
<div class="lr-form-item-title">用途</div> | <div class="lr-form-item-title">用途</div> | ||||
<input id="AOIUse" type="text" class="form-control" readonly="readonly" /> | <input id="AOIUse" type="text" class="form-control" readonly="readonly" /> | ||||
</div> | </div> | ||||
@*<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutItemApply"> | |||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutItemApply"> | |||||
<div class="lr-form-item-title">原使用部门</div> | <div class="lr-form-item-title">原使用部门</div> | ||||
<div id="AOIOldDepartment" readonly="readonly"> </div> | <div id="AOIOldDepartment" readonly="readonly"> </div> | ||||
</div> | </div> | ||||
@@ -72,7 +72,7 @@ | |||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutItemApply"> | <div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutItemApply"> | ||||
<div class="lr-form-item-title">新库存位置<font face="宋体">*</font></div> | <div class="lr-form-item-title">新库存位置<font face="宋体">*</font></div> | ||||
<div id="AOINewStorageId" isvalid="yes" checkexpession="NotNull" ></div> | <div id="AOINewStorageId" isvalid="yes" checkexpession="NotNull" ></div> | ||||
</div>*@ | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutItemApply"> | <div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutItemApply"> | ||||
<div class="lr-form-item-title">用途</div> | <div class="lr-form-item-title">用途</div> | ||||
<input id="AOIUse" type="text" class="form-control" readonly="readonly" /> | <input id="AOIUse" type="text" class="form-control" readonly="readonly" /> | ||||
@@ -27,38 +27,62 @@ var bootstrap = function ($, learun) { | |||||
// 访问数据接口地址 | // 访问数据接口地址 | ||||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsType/GetAllTree' | url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsType/GetAllTree' | ||||
}); | }); | ||||
$('#AOIUsePeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); | |||||
$('#AOIOldDepartment').lrselect({ | |||||
type: 'tree', | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', | |||||
param: {} | |||||
}); | |||||
$('#AOIStorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' }); | |||||
$('#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' }); | $('#AOINewUsePeople').lrselect({ value: 'F_UserId', text: 'F_RealName' }); | ||||
$('#AOINewStorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' }); | $('#AOINewStorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' }); | ||||
$("#AAOldCode").lrlayerselect({ | $("#AAOldCode").lrlayerselect({ | ||||
treeUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsType/GetAllTree', | 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', | |||||
treeParentId: '', | |||||
treeValueId: '', | |||||
treeTextId: '', | |||||
dataUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/GetList', | |||||
dataTreeId: 'AIASSClass', | |||||
dataValueId: 'aiid', | |||||
dataTextId: 'aiassname', | |||||
grid: [ | grid: [ | ||||
{ label: '资产编号', name: 'ACode', width: 200, align: 'left' }, | |||||
{ label: '资产名称', name: 'AName', width: 200, align: 'left' }, | |||||
{ label: "库存", name: "AStock", width: 80, align: "left" }, | |||||
{ label: '资产编号', name: 'aicodenumjy', width: 150, align: 'left' }, | |||||
{ label: '资产名称', name: 'aiassname', width: 150, align: 'left' }, | |||||
{ | { | ||||
label: "单位", name: "AUnit", width: 80, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('dataItem', { | |||||
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, | key: value, | ||||
code: 'sldw', | |||||
keyId: 'sid', | |||||
callback: function (_data) { | callback: function (_data) { | ||||
callback(_data.text); | |||||
callback(_data['sname']); | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}, | }, | ||||
{ label: "英文名称", name: "AEName", width: 200, align: "left" }, | |||||
{ label: "资产型号", name: "AModel", width: 200, align: "left" }, | |||||
{ label: "生产厂家", name: "AManufacturer", width: 200, align: "left" }, | |||||
{ label: "资产型号", name: "amodel", width: 150, align: "left" }, | |||||
{ label: "生产厂家", name: "amanufacturer", width: 150, align: "left" }, | |||||
{ | { | ||||
label: "供应商", name: "ASupplierId", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||||
label: "供应商", name: "asupplierid", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('custmerData', { | learun.clientdata.getAsync('custmerData', { | ||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_SupplierData', | url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_SupplierData', | ||||
key: value, | key: value, | ||||
@@ -73,27 +97,26 @@ var bootstrap = function ($, learun) { | |||||
select: function (values, texts) { | select: function (values, texts) { | ||||
if (values && values.length > 0) { | if (values && values.length > 0) { | ||||
//绑定 | //绑定 | ||||
$.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetFormData?keyValue=' + values[0], function (data) { | |||||
data = data.Ass_AssetsInfo; | |||||
$('#AOITId').lrselectSet(data.ATId); | |||||
$('#AOICode').val(data.ACode); | |||||
$('#AOIName').val(data.AName); | |||||
$('#AOIUnit').lrselectSet(data.AUnit); | |||||
$('#AOIEName').val(data.AEName); | |||||
$('#AOIModel').val(data.AModel); | |||||
$('#AOIManufacturer').val(data.AManufacturer); | |||||
$('#AOIPrice').val(data.APrice); | |||||
maxstock = data.AStock; | |||||
if (data.HasDetail === true) { | |||||
$("#AOIStock").attr("checkexpession", "PositiveInteger"); | |||||
} else { | |||||
$("#AOIStock").attr("checkexpession", "PositiveFloatint"); | |||||
} | |||||
$.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/GetFormData?keyValue=' + values[0], function (data) { | |||||
data = data.Ass_AssetsInfoItem; | |||||
$('#AOITId').lrselectSet(data.AIASSClass); | |||||
$('#AOICode').val(data.AICodeNumJY); | |||||
$('#AOIName').val(data.AIASSName); | |||||
$('#AOIUnit').lrselectSet(data.AIUnits); | |||||
$('#AOIModel').val(data.AISpecificationtype); | |||||
$('#AOIManufacturer').val(data.AIManufacturer); | |||||
$('#AOIPrice').val(data.AIAssValue); | |||||
$('#AOISpecification').val(data.AISpecification); | |||||
$('#AOIUse').val(data.AIUse); | |||||
$('#AOIOldDepartment').lrselectSet(data.AIDepartment); | |||||
$('#AOIUsePeople').lrselectSet(data.AIUsePeople); | |||||
$('#AOIStorageId').lrselectSet(data.AIIStorageId); | |||||
}); | }); | ||||
} | } | ||||
}, | }, | ||||
isMultiple: false | isMultiple: false | ||||
}); $('#AOIUnit').lrDataItemSelect({ code: 'sldw' }); | |||||
}); | |||||
$('#AOIUnit').lrDataItemSelect({ code: 'sldw' }); | |||||
$('#AOIPhoto').lrUploader(); | $('#AOIPhoto').lrUploader(); | ||||
}, | }, | ||||
@@ -278,7 +278,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
var assinfoapp = db.FindEntity<Ass_AssetsInfoApplyEntity>(m => m.AAProcessId == processId); | var assinfoapp = db.FindEntity<Ass_AssetsInfoApplyEntity>(m => m.AAProcessId == processId); | ||||
var assPurchase = db.FindEntity<Ass_PurchaseEntity>(a => a.PId == assinfoapp.PId); | var assPurchase = db.FindEntity<Ass_PurchaseEntity>(a => a.PId == assinfoapp.PId); | ||||
//通知申请人 | //通知申请人 | ||||
var purchaseApplyEntity = db.FindEntity<Ass_PurchaseApplyEntity>(a => a.PAId == assPurchase.PAId); | |||||
var purchaseApplyEntity = db.FindEntity<Ass_PurchaseApplyEntity>(a => a.PAId = assPurchase.PAId); | |||||
purchaseApplyEntity.PIsInStorage = "已入库"; | purchaseApplyEntity.PIsInStorage = "已入库"; | ||||
db.Update(purchaseApplyEntity); | db.Update(purchaseApplyEntity); | ||||
if (null != assPurchase) | if (null != assPurchase) | ||||
@@ -286,6 +286,8 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
ac.ACInOrOut = false; | ac.ACInOrOut = false; | ||||
ac.ACReasonType = assinfoapp.AOReasonType; | ac.ACReasonType = assinfoapp.AOReasonType; | ||||
ac.ACDetailId = assinfoapp.AOId; | ac.ACDetailId = assinfoapp.AOId; | ||||
ac.ACDepartment = assinfoapp.AODepartment; | |||||
ac.ACStorageId = assinfoapp.AOStorageId; | |||||
bool ifinsertac = false; | bool ifinsertac = false; | ||||
var Ass_AssetsOutItemApplyList = | var Ass_AssetsOutItemApplyList = | ||||
@@ -300,173 +302,220 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
Ass_AssetsOutApplyIncomplete.AOCreateTime = DateTime.Now; | Ass_AssetsOutApplyIncomplete.AOCreateTime = DateTime.Now; | ||||
Ass_AssetsOutApplyIncomplete.AOOutStatus = 0; | Ass_AssetsOutApplyIncomplete.AOOutStatus = 0; | ||||
//存放位置变动 | |||||
foreach (var outItemApply in Ass_AssetsOutItemApplyList) | foreach (var outItemApply in Ass_AssetsOutItemApplyList) | ||||
{ | { | ||||
//先检查库存 | |||||
var assinfoitem = assinfo.FirstOrDefault(m => m.ACode == outItemApply.AOICode); | |||||
if (assinfoitem.AStock >= outItemApply.AOIStock) | |||||
var Ass_AssetsInfoItemList = db.FindEntity<Ass_AssetsInfoItemEntity>(m => m.AICodeNumJY == outItemApply.AOICode); | |||||
if (Ass_AssetsInfoItemList != null) | |||||
{ | { | ||||
ifinsertac = true; | |||||
//库存充足 | |||||
if (assinfoitem.HasDetail == true)//有明细 | |||||
//调拨 | |||||
if (assinfoapp.AOReasonType.ToInt() == 3) | |||||
{ | { | ||||
//库存明细 | |||||
var Ass_AssetsInfoItemList = | |||||
db.FindList<Ass_AssetsInfoItemEntity>(m => m.AId == assinfoitem.AId && m.AIIsInStorage == true).Take(outItemApply.AOIStock.ToInt()).ToList(); | |||||
for (int i = 0; i < Ass_AssetsInfoItemList.Count; i++) | |||||
{ | |||||
var Ass_AssetsChangeItem = new Ass_AssetsChangeItemEntity(); | |||||
Ass_AssetsChangeItem.Create(); | |||||
Ass_AssetsChangeItem.ACId = ac.ACId; | |||||
Ass_AssetsChangeItem.AIId = Ass_AssetsInfoItemList[i].AIId; | |||||
Ass_AssetsChangeItem.ACOldStock = assinfoitem.AStock; | |||||
Ass_AssetsChangeItem.AAmount = 1; | |||||
Ass_AssetsChangeItem.ACNewStock = Ass_AssetsChangeItem.ACOldStock - 1; | |||||
Ass_AssetsChangeItem.ACTime = DateTime.Now; | |||||
Ass_AssetsChangeItem.ACUserId = assinfoapp.AOCreateUserId; | |||||
Ass_AssetsChangeItem.ACInOrOut = false; | |||||
Ass_AssetsChangeItem.ACReasonType = assinfoapp.AOReasonType; | |||||
Ass_AssetsChangeItem.ACCStorageId = Ass_AssetsInfoItemList[i].AIIStorageId; | |||||
Ass_AssetsChangeItem.ACCStoragePosition = Ass_AssetsInfoItemList[i].AIIStoragePosition; | |||||
db.Insert(Ass_AssetsChangeItem); | |||||
//明细在库状态 | |||||
Ass_AssetsInfoItemList[i].AIIsInStorage = false; | |||||
db.Update(Ass_AssetsInfoItemList[i]); | |||||
} | |||||
} | |||||
else//无明细 | |||||
{ | |||||
var Ass_AssetsInfoItem = | |||||
db.FindEntity<Ass_AssetsInfoItemEntity>(m => m.AId == assinfoitem.AId); | |||||
var Ass_AssetsChangeItem = new Ass_AssetsChangeItemEntity(); | |||||
Ass_AssetsChangeItem.Create(); | |||||
Ass_AssetsChangeItem.ACId = ac.ACId; | |||||
Ass_AssetsChangeItem.AIId = Ass_AssetsInfoItem.AIId; | |||||
Ass_AssetsChangeItem.ACOldStock = assinfoitem.AStock; | |||||
Ass_AssetsChangeItem.AAmount = outItemApply.AOIStock; | |||||
Ass_AssetsChangeItem.ACNewStock = Ass_AssetsChangeItem.ACOldStock - outItemApply.AOIStock; | |||||
Ass_AssetsChangeItem.ACTime = DateTime.Now; | |||||
Ass_AssetsChangeItem.ACUserId = assinfoapp.AOCreateUserId; | |||||
Ass_AssetsChangeItem.ACInOrOut = false; | |||||
Ass_AssetsChangeItem.ACReasonType = assinfoapp.AOReasonType; | |||||
Ass_AssetsChangeItem.ACCStorageId = Ass_AssetsInfoItem.AIIStorageId; | |||||
Ass_AssetsChangeItem.ACCStoragePosition = Ass_AssetsInfoItem.AIIStoragePosition; | |||||
db.Insert(Ass_AssetsChangeItem); | |||||
//在库状态 | |||||
if (Ass_AssetsChangeItem.ACNewStock == 0) | |||||
{ | |||||
Ass_AssetsInfoItem.AIIsInStorage = false; | |||||
db.Update(Ass_AssetsInfoItem); | |||||
} | |||||
} | |||||
//库存扣减 | |||||
assinfoitem.AStock = assinfoitem.AStock - outItemApply.AOIStock; | |||||
} | |||||
else | |||||
{ | |||||
//库存不足 | |||||
IsAllOutOrNot = false; | |||||
if (assinfoitem.HasDetail == true) //有明细 | |||||
{ | |||||
//库存明细 | |||||
var Ass_AssetsInfoItemList = | |||||
db.FindList<Ass_AssetsInfoItemEntity>(m => m.AId == assinfoitem.AId && m.AIIsInStorage == true).ToList(); | |||||
for (int i = 0; i < Ass_AssetsInfoItemList.Count; i++) | |||||
//消耗品 | |||||
if (Ass_AssetsInfoItemList.AIAssType == 1) | |||||
{ | { | ||||
ifinsertac = true; | |||||
var Ass_AssetsChangeItem = new Ass_AssetsChangeItemEntity(); | |||||
Ass_AssetsChangeItem.Create(); | |||||
Ass_AssetsChangeItem.ACId = ac.ACId; | |||||
Ass_AssetsChangeItem.AIId = Ass_AssetsInfoItemList[i].AIId; | |||||
Ass_AssetsChangeItem.ACOldStock = assinfoitem.AStock; | |||||
Ass_AssetsChangeItem.AAmount = 1; | |||||
Ass_AssetsChangeItem.ACNewStock = Ass_AssetsChangeItem.ACOldStock - 1; | |||||
Ass_AssetsChangeItem.ACTime = DateTime.Now; | |||||
Ass_AssetsChangeItem.ACUserId = assinfoapp.AOCreateUserId; | |||||
Ass_AssetsChangeItem.ACInOrOut = false; | |||||
Ass_AssetsChangeItem.ACReasonType = assinfoapp.AOReasonType; | |||||
Ass_AssetsChangeItem.ACCStorageId = Ass_AssetsInfoItemList[i].AIIStorageId; | |||||
Ass_AssetsChangeItem.ACCStoragePosition = Ass_AssetsInfoItemList[i].AIIStoragePosition; | |||||
db.Insert(Ass_AssetsChangeItem); | |||||
//明细在库状态 | |||||
Ass_AssetsInfoItemList[i].AIIsInStorage = false; | |||||
db.Update(Ass_AssetsInfoItemList[i]); | |||||
db.Delete(Ass_AssetsInfoItemList); | |||||
//库存减1 | |||||
var assinfofather = | |||||
db.FindEntity<Ass_AssetsInfoEntity>(a => a.AId == Ass_AssetsInfoItemList.AId); | |||||
if (assinfofather.AStock > 1) | |||||
{ | |||||
assinfofather.AStock = assinfofather.AStock - 1; | |||||
} | |||||
db.Update(assinfofather); | |||||
} | } | ||||
//缺货明细 | |||||
var Ass_AssetsOutItemApplyIncomplete = new Ass_AssetsOutItemApplyIncompleteEntity(); | |||||
Ass_AssetsOutItemApplyIncomplete.Create(); | |||||
Ass_AssetsOutItemApplyIncomplete.AOAIId = Ass_AssetsOutApplyIncomplete.AOAIId; | |||||
Ass_AssetsOutItemApplyIncomplete.AOICode = outItemApply.AOICode; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIName = outItemApply.AOIName; | |||||
Ass_AssetsOutItemApplyIncomplete.AOITId = outItemApply.AOITId; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIEName = outItemApply.AOIEName; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIPhoto = outItemApply.AOIPhoto; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIContent = outItemApply.AOIContent; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIOrder = outItemApply.AOIOrder; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIModel = outItemApply.AOIModel; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIManufacturer = outItemApply.AOIManufacturer; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIHopeStock = outItemApply.AOIStock; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIOutStock = Ass_AssetsInfoItemList.Count; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIStock = outItemApply.AOIStock - Ass_AssetsInfoItemList.Count; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIPrice = outItemApply.AOIPrice; | |||||
//总价计算 | |||||
Ass_AssetsOutApplyIncomplete.AOPrice += Ass_AssetsOutItemApplyIncomplete.AOIPrice * Ass_AssetsOutItemApplyIncomplete.AOIStock; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIUnit = outItemApply.AOIUnit; | |||||
db.Insert(Ass_AssetsOutItemApplyIncomplete); | |||||
Ass_AssetsInfoItemList.AIDepartment = outItemApply.AOINewDepartment; | |||||
Ass_AssetsInfoItemList.AIIStorageId = outItemApply.AOINewStorageId; | |||||
var storageInfo = | |||||
db.FindEntity<Ass_StorageEntity>(a => a.SId == outItemApply.AOINewStorageId); | |||||
Ass_AssetsInfoItemList.AIIStoragePosition = storageInfo?.SAdress; | |||||
Ass_AssetsInfoItemList.AIUsePeople = outItemApply.AOINewUsePeople; | |||||
} | } | ||||
//出库 | |||||
else | else | ||||
{ | { | ||||
if (assinfoitem.AStock > 0) | |||||
{ | |||||
ifinsertac = true; | |||||
var Ass_AssetsInfoItem = | |||||
db.FindEntity<Ass_AssetsInfoItemEntity>(m => m.AId == assinfoitem.AId); | |||||
var Ass_AssetsChangeItem = new Ass_AssetsChangeItemEntity(); | |||||
Ass_AssetsChangeItem.Create(); | |||||
Ass_AssetsChangeItem.ACId = ac.ACId; | |||||
Ass_AssetsChangeItem.AIId = Ass_AssetsInfoItem.AIId; | |||||
Ass_AssetsChangeItem.ACOldStock = assinfoitem.AStock; | |||||
Ass_AssetsChangeItem.AAmount = assinfoitem.AStock; | |||||
Ass_AssetsChangeItem.ACNewStock = 0; | |||||
Ass_AssetsChangeItem.ACTime = DateTime.Now; | |||||
Ass_AssetsChangeItem.ACUserId = assinfoapp.AOCreateUserId; | |||||
Ass_AssetsChangeItem.ACInOrOut = false; | |||||
Ass_AssetsChangeItem.ACReasonType = assinfoapp.AOReasonType; | |||||
Ass_AssetsChangeItem.ACCStorageId = Ass_AssetsInfoItem.AIIStorageId; | |||||
Ass_AssetsChangeItem.ACCStoragePosition = Ass_AssetsInfoItem.AIIStoragePosition; | |||||
db.Insert(Ass_AssetsChangeItem); | |||||
//在库状态 | |||||
Ass_AssetsInfoItem.AIIsInStorage = false; | |||||
db.Update(Ass_AssetsInfoItem); | |||||
} | |||||
//缺货明细 | |||||
var Ass_AssetsOutItemApplyIncomplete = new Ass_AssetsOutItemApplyIncompleteEntity(); | |||||
Ass_AssetsOutItemApplyIncomplete.Create(); | |||||
Ass_AssetsOutItemApplyIncomplete.AOAIId = Ass_AssetsOutApplyIncomplete.AOAIId; | |||||
Ass_AssetsOutItemApplyIncomplete.AOICode = outItemApply.AOICode; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIName = outItemApply.AOIName; | |||||
Ass_AssetsOutItemApplyIncomplete.AOITId = outItemApply.AOITId; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIEName = outItemApply.AOIEName; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIPhoto = outItemApply.AOIPhoto; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIContent = outItemApply.AOIContent; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIOrder = outItemApply.AOIOrder; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIModel = outItemApply.AOIModel; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIManufacturer = outItemApply.AOIManufacturer; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIHopeStock = outItemApply.AOIStock; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIOutStock = assinfoitem.AStock; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIStock = outItemApply.AOIStock - assinfoitem.AStock; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIPrice = outItemApply.AOIPrice; | |||||
//总价计算 | |||||
Ass_AssetsOutApplyIncomplete.AOPrice += Ass_AssetsOutItemApplyIncomplete.AOIPrice * Ass_AssetsOutItemApplyIncomplete.AOIStock; | |||||
Ass_AssetsOutItemApplyIncomplete.AOIUnit = outItemApply.AOIUnit; | |||||
db.Insert(Ass_AssetsOutItemApplyIncomplete); | |||||
Ass_AssetsInfoItemList.AIIsInStorage = false; | |||||
} | } | ||||
//库存扣减 | |||||
assinfoitem.AStock = 0; | |||||
db.Update(Ass_AssetsInfoItemList); | |||||
} | } | ||||
db.Update(assinfoitem); | |||||
////先检查库存 | |||||
//var assinfoitem = assinfo.FirstOrDefault(m => m.ACode == outItemApply.AOICode); | |||||
//if (assinfoitem.AStock >= outItemApply.AOIStock) | |||||
//{ | |||||
// ifinsertac = true; | |||||
// //库存充足 | |||||
// if (assinfoitem.HasDetail == true)//有明细 | |||||
// { | |||||
// //库存明细 | |||||
// var Ass_AssetsInfoItemList = | |||||
// db.FindList<Ass_AssetsInfoItemEntity>(m => m.AId == assinfoitem.AId && m.AIIsInStorage == true).Take(outItemApply.AOIStock.ToInt()).ToList(); | |||||
// for (int i = 0; i < Ass_AssetsInfoItemList.Count; i++) | |||||
// { | |||||
// var Ass_AssetsChangeItem = new Ass_AssetsChangeItemEntity(); | |||||
// Ass_AssetsChangeItem.Create(); | |||||
// Ass_AssetsChangeItem.ACId = ac.ACId; | |||||
// Ass_AssetsChangeItem.AIId = Ass_AssetsInfoItemList[i].AIId; | |||||
// Ass_AssetsChangeItem.ACOldStock = assinfoitem.AStock; | |||||
// Ass_AssetsChangeItem.AAmount = 1; | |||||
// Ass_AssetsChangeItem.ACNewStock = Ass_AssetsChangeItem.ACOldStock - 1; | |||||
// Ass_AssetsChangeItem.ACTime = DateTime.Now; | |||||
// Ass_AssetsChangeItem.ACUserId = assinfoapp.AOCreateUserId; | |||||
// Ass_AssetsChangeItem.ACInOrOut = false; | |||||
// Ass_AssetsChangeItem.ACReasonType = assinfoapp.AOReasonType; | |||||
// Ass_AssetsChangeItem.ACCStorageId = Ass_AssetsInfoItemList[i].AIIStorageId; | |||||
// Ass_AssetsChangeItem.ACCStoragePosition = Ass_AssetsInfoItemList[i].AIIStoragePosition; | |||||
// db.Insert(Ass_AssetsChangeItem); | |||||
// //明细在库状态 | |||||
// Ass_AssetsInfoItemList[i].AIIsInStorage = false; | |||||
// Ass_AssetsInfoItemList[i].AIDepartment = assinfoapp.AODepartment; | |||||
// Ass_AssetsInfoItemList[i].AIIStorageId = assinfoapp.AOStorageId; | |||||
// Ass_AssetsInfoItemList[i].AIIStoragePosition = this.BaseRepository().FindEntity<Ass_StorageEntity>(a => a.SId == assinfoapp.AOStorageId)?.SAdress; | |||||
// db.Update(Ass_AssetsInfoItemList[i]); | |||||
// } | |||||
// } | |||||
// else//无明细 | |||||
// { | |||||
// var Ass_AssetsInfoItem = | |||||
// db.FindEntity<Ass_AssetsInfoItemEntity>(m => m.AId == assinfoitem.AId); | |||||
// var Ass_AssetsChangeItem = new Ass_AssetsChangeItemEntity(); | |||||
// Ass_AssetsChangeItem.Create(); | |||||
// Ass_AssetsChangeItem.ACId = ac.ACId; | |||||
// Ass_AssetsChangeItem.AIId = Ass_AssetsInfoItem.AIId; | |||||
// Ass_AssetsChangeItem.ACOldStock = assinfoitem.AStock; | |||||
// Ass_AssetsChangeItem.AAmount = outItemApply.AOIStock; | |||||
// Ass_AssetsChangeItem.ACNewStock = Ass_AssetsChangeItem.ACOldStock - outItemApply.AOIStock; | |||||
// Ass_AssetsChangeItem.ACTime = DateTime.Now; | |||||
// Ass_AssetsChangeItem.ACUserId = assinfoapp.AOCreateUserId; | |||||
// Ass_AssetsChangeItem.ACInOrOut = false; | |||||
// Ass_AssetsChangeItem.ACReasonType = assinfoapp.AOReasonType; | |||||
// Ass_AssetsChangeItem.ACCStorageId = Ass_AssetsInfoItem.AIIStorageId; | |||||
// Ass_AssetsChangeItem.ACCStoragePosition = Ass_AssetsInfoItem.AIIStoragePosition; | |||||
// db.Insert(Ass_AssetsChangeItem); | |||||
// //在库状态 | |||||
// if (Ass_AssetsChangeItem.ACNewStock == 0) | |||||
// { | |||||
// Ass_AssetsInfoItem.AIIsInStorage = false; | |||||
// db.Update(Ass_AssetsInfoItem); | |||||
// } | |||||
// } | |||||
// //库存扣减 | |||||
// assinfoitem.AStock = assinfoitem.AStock - outItemApply.AOIStock; | |||||
//} | |||||
//else | |||||
//{ | |||||
// //库存不足 | |||||
// IsAllOutOrNot = false; | |||||
// if (assinfoitem.HasDetail == true) //有明细 | |||||
// { | |||||
// //库存明细 | |||||
// var Ass_AssetsInfoItemList = | |||||
// db.FindList<Ass_AssetsInfoItemEntity>(m => m.AId == assinfoitem.AId && m.AIIsInStorage == true).ToList(); | |||||
// for (int i = 0; i < Ass_AssetsInfoItemList.Count; i++) | |||||
// { | |||||
// ifinsertac = true; | |||||
// var Ass_AssetsChangeItem = new Ass_AssetsChangeItemEntity(); | |||||
// Ass_AssetsChangeItem.Create(); | |||||
// Ass_AssetsChangeItem.ACId = ac.ACId; | |||||
// Ass_AssetsChangeItem.AIId = Ass_AssetsInfoItemList[i].AIId; | |||||
// Ass_AssetsChangeItem.ACOldStock = assinfoitem.AStock; | |||||
// Ass_AssetsChangeItem.AAmount = 1; | |||||
// Ass_AssetsChangeItem.ACNewStock = Ass_AssetsChangeItem.ACOldStock - 1; | |||||
// Ass_AssetsChangeItem.ACTime = DateTime.Now; | |||||
// Ass_AssetsChangeItem.ACUserId = assinfoapp.AOCreateUserId; | |||||
// Ass_AssetsChangeItem.ACInOrOut = false; | |||||
// Ass_AssetsChangeItem.ACReasonType = assinfoapp.AOReasonType; | |||||
// Ass_AssetsChangeItem.ACCStorageId = Ass_AssetsInfoItemList[i].AIIStorageId; | |||||
// Ass_AssetsChangeItem.ACCStoragePosition = Ass_AssetsInfoItemList[i].AIIStoragePosition; | |||||
// db.Insert(Ass_AssetsChangeItem); | |||||
// //明细在库状态 | |||||
// Ass_AssetsInfoItemList[i].AIIsInStorage = false; | |||||
// db.Update(Ass_AssetsInfoItemList[i]); | |||||
// } | |||||
// //缺货明细 | |||||
// var Ass_AssetsOutItemApplyIncomplete = new Ass_AssetsOutItemApplyIncompleteEntity(); | |||||
// Ass_AssetsOutItemApplyIncomplete.Create(); | |||||
// Ass_AssetsOutItemApplyIncomplete.AOAIId = Ass_AssetsOutApplyIncomplete.AOAIId; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOICode = outItemApply.AOICode; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIName = outItemApply.AOIName; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOITId = outItemApply.AOITId; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIEName = outItemApply.AOIEName; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIPhoto = outItemApply.AOIPhoto; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIContent = outItemApply.AOIContent; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIOrder = outItemApply.AOIOrder; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIModel = outItemApply.AOIModel; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIManufacturer = outItemApply.AOIManufacturer; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIHopeStock = outItemApply.AOIStock; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIOutStock = Ass_AssetsInfoItemList.Count; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIStock = outItemApply.AOIStock - Ass_AssetsInfoItemList.Count; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIPrice = outItemApply.AOIPrice; | |||||
// //总价计算 | |||||
// Ass_AssetsOutApplyIncomplete.AOPrice += Ass_AssetsOutItemApplyIncomplete.AOIPrice * Ass_AssetsOutItemApplyIncomplete.AOIStock; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIUnit = outItemApply.AOIUnit; | |||||
// db.Insert(Ass_AssetsOutItemApplyIncomplete); | |||||
// } | |||||
// else | |||||
// { | |||||
// if (assinfoitem.AStock > 0) | |||||
// { | |||||
// ifinsertac = true; | |||||
// var Ass_AssetsInfoItem = | |||||
// db.FindEntity<Ass_AssetsInfoItemEntity>(m => m.AId == assinfoitem.AId); | |||||
// var Ass_AssetsChangeItem = new Ass_AssetsChangeItemEntity(); | |||||
// Ass_AssetsChangeItem.Create(); | |||||
// Ass_AssetsChangeItem.ACId = ac.ACId; | |||||
// Ass_AssetsChangeItem.AIId = Ass_AssetsInfoItem.AIId; | |||||
// Ass_AssetsChangeItem.ACOldStock = assinfoitem.AStock; | |||||
// Ass_AssetsChangeItem.AAmount = assinfoitem.AStock; | |||||
// Ass_AssetsChangeItem.ACNewStock = 0; | |||||
// Ass_AssetsChangeItem.ACTime = DateTime.Now; | |||||
// Ass_AssetsChangeItem.ACUserId = assinfoapp.AOCreateUserId; | |||||
// Ass_AssetsChangeItem.ACInOrOut = false; | |||||
// Ass_AssetsChangeItem.ACReasonType = assinfoapp.AOReasonType; | |||||
// Ass_AssetsChangeItem.ACCStorageId = Ass_AssetsInfoItem.AIIStorageId; | |||||
// Ass_AssetsChangeItem.ACCStoragePosition = Ass_AssetsInfoItem.AIIStoragePosition; | |||||
// db.Insert(Ass_AssetsChangeItem); | |||||
// //在库状态 | |||||
// Ass_AssetsInfoItem.AIIsInStorage = false; | |||||
// db.Update(Ass_AssetsInfoItem); | |||||
// } | |||||
// //缺货明细 | |||||
// var Ass_AssetsOutItemApplyIncomplete = new Ass_AssetsOutItemApplyIncompleteEntity(); | |||||
// Ass_AssetsOutItemApplyIncomplete.Create(); | |||||
// Ass_AssetsOutItemApplyIncomplete.AOAIId = Ass_AssetsOutApplyIncomplete.AOAIId; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOICode = outItemApply.AOICode; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIName = outItemApply.AOIName; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOITId = outItemApply.AOITId; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIEName = outItemApply.AOIEName; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIPhoto = outItemApply.AOIPhoto; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIContent = outItemApply.AOIContent; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIOrder = outItemApply.AOIOrder; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIModel = outItemApply.AOIModel; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIManufacturer = outItemApply.AOIManufacturer; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIHopeStock = outItemApply.AOIStock; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIOutStock = assinfoitem.AStock; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIStock = outItemApply.AOIStock - assinfoitem.AStock; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIPrice = outItemApply.AOIPrice; | |||||
// //总价计算 | |||||
// Ass_AssetsOutApplyIncomplete.AOPrice += Ass_AssetsOutItemApplyIncomplete.AOIPrice * Ass_AssetsOutItemApplyIncomplete.AOIStock; | |||||
// Ass_AssetsOutItemApplyIncomplete.AOIUnit = outItemApply.AOIUnit; | |||||
// db.Insert(Ass_AssetsOutItemApplyIncomplete); | |||||
// } | |||||
// //库存扣减 | |||||
// assinfoitem.AStock = 0; | |||||
//} | |||||
//db.Update(assinfoitem); | |||||
} | } | ||||
//出库单 | //出库单 | ||||
if (ifinsertac) | if (ifinsertac) | ||||