@@ -70,7 +70,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||||
{ | { | ||||
return View(); | return View(); | ||||
} | } | ||||
#endregion | #endregion | ||||
#region 获取数据 | #region 获取数据 | ||||
@@ -160,7 +160,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||||
[AjaxOnly] | [AjaxOnly] | ||||
public ActionResult DeleteForm(string keyValue) | public ActionResult DeleteForm(string keyValue) | ||||
{ | { | ||||
ass_AcceptanceIBLL.DeleteEntity(keyValue); | |||||
ass_AcceptanceMainIBLL.DeleteEntity(keyValue); | |||||
return Success("删除成功!"); | return Success("删除成功!"); | ||||
} | } | ||||
@@ -173,9 +173,13 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||||
[ValidateAntiForgeryToken] | [ValidateAntiForgeryToken] | ||||
[AjaxOnly] | [AjaxOnly] | ||||
public ActionResult SaveForm(string keyValue, string strEntity, string strass_Ass_AcceptanceList) | public ActionResult SaveForm(string keyValue, string strEntity, string strass_Ass_AcceptanceList) | ||||
{ | |||||
{ | |||||
Ass_AcceptanceMainEntity entity = strEntity.ToObject<Ass_AcceptanceMainEntity>(); | Ass_AcceptanceMainEntity entity = strEntity.ToObject<Ass_AcceptanceMainEntity>(); | ||||
entity.Status = 0; | |||||
if (string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
entity.Status = 0; | |||||
} | |||||
List<Ass_AcceptanceEntity> ass_AcceptanceList = strass_Ass_AcceptanceList.ToObject<List<Ass_AcceptanceEntity>>(); | List<Ass_AcceptanceEntity> ass_AcceptanceList = strass_Ass_AcceptanceList.ToObject<List<Ass_AcceptanceEntity>>(); | ||||
ass_AcceptanceMainIBLL.SaveEntity(keyValue, entity, ass_AcceptanceList); | ass_AcceptanceMainIBLL.SaveEntity(keyValue, entity, ass_AcceptanceList); | ||||
return Success("保存成功!"); | return Success("保存成功!"); | ||||
@@ -30,7 +30,7 @@ | |||||
<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="新增明细" /> | ||||
<input id="detailedit" type="button" class="btn btn-warning" value="编辑明细" /> | |||||
@*<input id="detailedit" type="button" class="btn btn-warning" value="编辑明细" />*@ | |||||
<input id="detaildel" type="button" class="btn btn-danger" value="移除明细" /> | <input id="detaildel" type="button" class="btn btn-danger" value="移除明细" /> | ||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | <div class="col-xs-12 lr-form-item lr-form-item-grid"> | ||||
@@ -43,19 +43,19 @@ var bootstrap = function ($, learun) { | |||||
var page = { | var page = { | ||||
init: function () { | init: function () { | ||||
$('.lr-form-wrap').lrscroll(); | $('.lr-form-wrap').lrscroll(); | ||||
$("#detailadd").on('click', function () { | |||||
selectedRow = null; | |||||
learun.layerForm({ | |||||
id: 'formitem', | |||||
title: '新增明细', | |||||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/FormItem', | |||||
width: 860, | |||||
height: 600, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
//$("#detailadd").on('click', function () { | |||||
// selectedRow = null; | |||||
// learun.layerForm({ | |||||
// id: 'formitem', | |||||
// title: '新增明细', | |||||
// url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/FormItem', | |||||
// width: 860, | |||||
// height: 600, | |||||
// callBack: function (id) { | |||||
// return top[id].acceptClick(refreshGirdData); | |||||
// } | |||||
// }); | |||||
//}); | |||||
$("#detailedit").on('click', function () { | $("#detailedit").on('click', function () { | ||||
var keyValue = $('#Ass_Acceptance').jfGridValue('Id'); | var keyValue = $('#Ass_Acceptance').jfGridValue('Id'); | ||||
selectedRow = $('#Ass_Acceptance').jfGridGet('rowdata'); | selectedRow = $('#Ass_Acceptance').jfGridGet('rowdata'); | ||||
@@ -67,29 +67,61 @@ var bootstrap = function ($, learun) { | |||||
width: 860, | width: 860, | ||||
height: 600, | height: 600, | ||||
callBack: function (id) { | callBack: function (id) { | ||||
//return top[id].acceptClick(refreshGirdData); | |||||
return top[id].acceptClick(refreshGirdData); | return top[id].acceptClick(refreshGirdData); | ||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
$("#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 () { | $("#detaildel").on('click', function () { | ||||
var keyValue = $('#Ass_Acceptance').jfGridValue('Id'); | |||||
var keyValue = $('#Ass_Acceptance').jfGridValue('AAIId'); | |||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | learun.layerConfirm('是否确认删除该项!', function (res, index) { | ||||
if (res) { | if (res) { | ||||
$.each(tempdatra, function (key, val) { | $.each(tempdatra, function (key, val) { | ||||
if (tempdatra[key].MainId === keyValue) { | |||||
pricecount -= tempdatra[key].TotalPrice; | |||||
if (tempdatra[key].AAIId === keyValue) { | |||||
pricecount -= tempdatra[key].AAIPrice; | |||||
tempdatra.splice(key, 1); | tempdatra.splice(key, 1); | ||||
} | } | ||||
}); | }); | ||||
$("#Price").val(pricecount); | |||||
$("#TotalPrice").val(pricecount); | |||||
$('#Ass_Acceptance').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | $('#Ass_Acceptance').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | ||||
top.layer.close(index); | top.layer.close(index); | ||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
//$("#detaildel").on('click', function () { | |||||
// var keyValue = $('#Ass_Acceptance').jfGridValue('Id'); | |||||
// if (learun.checkrow(keyValue)) { | |||||
// learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||||
// if (res) { | |||||
// $.each(tempdatra, function (key, val) { | |||||
// if (tempdatra[key].MainId === keyValue) { | |||||
// pricecount -= tempdatra[key].TotalPrice; | |||||
// tempdatra.splice(key, 1); | |||||
// } | |||||
// }); | |||||
// $("#Price").val(pricecount); | |||||
// $('#Ass_Acceptance').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | |||||
// top.layer.close(index); | |||||
// } | |||||
// }); | |||||
// } | |||||
//}); | |||||
page.bind(); | page.bind(); | ||||
page.initData(); | page.initData(); | ||||
}, | }, | ||||
@@ -98,65 +130,104 @@ var bootstrap = function ($, learun) { | |||||
$('#CreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | $('#CreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | ||||
$('#CreateUserId').val(learun.clientdata.get(['userinfo']).realName); | $('#CreateUserId').val(learun.clientdata.get(['userinfo']).realName); | ||||
//$('#CreateDeptId').lrselect({ | |||||
// type: 'tree', | |||||
// // 展开最大高度 | |||||
// maxHeight: 200, | |||||
// // 是否允许搜索 | |||||
// allowSearch: true, | |||||
// // 访问数据接口地址 | |||||
// url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree' | |||||
//}); | |||||
$('#Ass_Acceptance').jfGrid({ | $('#Ass_Acceptance').jfGrid({ | ||||
headData: [ | 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', { | |||||
label: '资产编号', name: 'AAICode', width: 150, align: 'left' | |||||
}, | |||||
{ | |||||
label: '资产名称', name: 'AAIName', width: 150, 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, | key: value, | ||||
keyId: 'atid', | |||||
callback: function (_data) { | callback: function (_data) { | ||||
callback(_data.name); | |||||
callback(_data['aname']); | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
label: "使用人", name: "UserID", width: 100, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsyncReal('user', { | |||||
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, | key: value, | ||||
code: 'sldw', | |||||
callback: function (_data) { | callback: function (_data) { | ||||
callback(_data.name); | |||||
callback(_data.text); | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}, | }, | ||||
{ label: "放置地点", name: "Place", width: 100, align: "left" }, | |||||
//{ | |||||
// label: "状态", name: "Status", width: 100, align: "left", | |||||
// formatter: function (cellvalue, row) { | |||||
// if (cellvalue === '1') { | |||||
// return '<span class=\"label label-warning\">审批中</span>'; | |||||
// } else if (cellvalue === '2') { | |||||
// return '<span class=\"label label-success\">已审核</span>'; | |||||
// } else { | |||||
// return '<span class=\"label label-default\" >草稿</span>'; | |||||
// } | |||||
// } | |||||
//}, | |||||
{ label: "备注", name: "Remark", width: 100, align: "left" }, | |||||
{ | |||||
label: '英文名称', name: 'AAIEName', width: 100, align: 'left' | |||||
}, | |||||
{ | |||||
label: '资产型号', name: 'AAIModel', width: 100, align: 'left' | |||||
}, | |||||
{ | |||||
label: '生产厂家', name: 'AAIManufacturer', width: 100, align: 'left' | |||||
} | |||||
], | ], | ||||
height: 400, | height: 400, | ||||
mainId: 'Id', | |||||
reloadSelected: false, | |||||
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 '<span class=\"label label-warning\">审批中</span>'; | |||||
// // } else if (cellvalue === '2') { | |||||
// // return '<span class=\"label label-success\">已审核</span>'; | |||||
// // } else { | |||||
// // return '<span class=\"label label-default\" >草稿</span>'; | |||||
// // } | |||||
// // } | |||||
// //}, | |||||
// { label: "备注", name: "Remark", width: 100, align: "left" }, | |||||
// ], | |||||
// height: 400, | |||||
// mainId: 'Id', | |||||
// reloadSelected: false, | |||||
//}); | |||||
}, | }, | ||||
initData: function () { | initData: function () { | ||||
if (!!keyValue) { | if (!!keyValue) { | ||||
@@ -182,44 +253,65 @@ var bootstrap = function ($, learun) { | |||||
}; | }; | ||||
refreshGirdData = function (temprow) { | refreshGirdData = function (temprow) { | ||||
var ifnewrow = true; | var ifnewrow = true; | ||||
$.each(tempdatra, function (key, val) { | |||||
if (tempdatra[key].MainId === temprow.Id) { | |||||
tempdatra[key] = temprow; | |||||
ifnewrow = false; | |||||
} | |||||
}); | |||||
if (ifnewrow) { | |||||
tempdatra.push(temprow); | |||||
} | |||||
var list = []; | |||||
//总价计算 | //总价计算 | ||||
pricecount = 0; | pricecount = 0; | ||||
$.each(temprow, | |||||
function (i, item) { | |||||
if (item.AIAssValue) { | |||||
pricecount = parseFloat(pricecount) + parseFloat(item.AIAssValue); | |||||
} | |||||
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) { | |||||
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); | |||||
//} | |||||
for (var i = 0; i < tempdatra.length; i++) { | for (var i = 0; i < tempdatra.length; i++) { | ||||
pricecount = parseFloat(pricecount) +parseFloat(tempdatra[i].TotalPrice); | |||||
//pricecount = parseFloat(pricecount) +parseFloat(tempdatra[i].TotalPrice); | |||||
} | } | ||||
$("#TotalPrice").val(pricecount); | $("#TotalPrice").val(pricecount); | ||||
$('#Ass_Acceptance').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | $('#Ass_Acceptance').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | ||||
}; | }; | ||||
function sortNumber(a, b) { | function sortNumber(a, b) { | ||||
return 1;//a.AAIOrder - b.AAIOrder; | return 1;//a.AAIOrder - b.AAIOrder; | ||||
} | |||||
// 设置表单数据 | |||||
//setFormData = function (processId) { | |||||
// if (!!processId) { | |||||
// $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoApply/GetFormDataByProcessId?processId=' + processId, function (data) { | |||||
// for (var id in data) { | |||||
// if (!!data[id] && data[id].length > 0) { | |||||
// $('#' + id).jfGridSet('refreshdata', data[id]); | |||||
// } | |||||
// else { | |||||
// if (id == 'Ass_AcceptanceMain') { | |||||
// keyValue = data[id].Id; | |||||
// } | |||||
// $('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||||
// } | |||||
// } | |||||
// }); | |||||
// } | |||||
//} | |||||
}; | |||||
// 验证数据是否填写完整 | // 验证数据是否填写完整 | ||||
validForm = function () { | validForm = function () { | ||||
if (!$('.lr-form-wrap').lrValidform()) { | if (!$('.lr-form-wrap').lrValidform()) { | ||||
@@ -109,53 +109,51 @@ var bootstrap = function ($, learun) { | |||||
//}); | //}); | ||||
$('#Ass_Acceptance').jfGrid({ | $('#Ass_Acceptance').jfGrid({ | ||||
headData: [ | 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', { | |||||
label: '资产编号', name: 'AAICode', width: 150, align: 'left' | |||||
}, | |||||
{ | |||||
label: '资产名称', name: 'AAIName', width: 150, 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, | key: value, | ||||
keyId: 'atid', | |||||
callback: function (_data) { | callback: function (_data) { | ||||
callback(_data.name); | |||||
callback(_data['aname']); | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
label: "使用人", name: "UserID", width: 100, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsyncReal('user', { | |||||
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, | key: value, | ||||
code: 'sldw', | |||||
callback: function (_data) { | callback: function (_data) { | ||||
callback(_data.name); | |||||
callback(_data.text); | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}, | }, | ||||
{ label: "放置地点", name: "Place", width: 100, align: "left" }, | |||||
//{ | |||||
// label: "状态", name: "Status", width: 100, align: "left", | |||||
// formatter: function (cellvalue, row) { | |||||
// if (cellvalue === '1') { | |||||
// return '<span class=\"label label-warning\">审批中</span>'; | |||||
// } else if (cellvalue === '2') { | |||||
// return '<span class=\"label label-success\">已审核</span>'; | |||||
// } else { | |||||
// return '<span class=\"label label-default\" >草稿</span>'; | |||||
// } | |||||
// } | |||||
//}, | |||||
{ label: "备注", name: "Remark", width: 100, align: "left" }, | |||||
{ | |||||
label: '英文名称', name: 'AAIEName', width: 100, align: 'left' | |||||
}, | |||||
{ | |||||
label: '资产型号', name: 'AAIModel', width: 100, align: 'left' | |||||
}, | |||||
{ | |||||
label: '生产厂家', name: 'AAIManufacturer', width: 100, align: 'left' | |||||
} | |||||
], | ], | ||||
height: 400, | height: 400, | ||||
mainId: 'Id', | |||||
reloadSelected: false, | |||||
mainId: 'AAIId', | |||||
reloadSelected: false | |||||
}); | }); | ||||
}, | }, | ||||
initData: function () { | initData: function () { | ||||
@@ -240,7 +238,7 @@ var bootstrap = function ($, learun) { | |||||
code: 200 | code: 200 | ||||
}; | }; | ||||
if (!!callBack) { | if (!!callBack) { | ||||
callBack(res, {}, i); | |||||
callBack(res, i); | |||||
} | } | ||||
//var postData = {}; | //var postData = {}; | ||||
//var formData = $('[data-table="Ass_AcceptanceMain"]').lrGetFormData(); | //var formData = $('[data-table="Ass_AcceptanceMain"]').lrGetFormData(); | ||||
@@ -253,7 +251,7 @@ var bootstrap = function ($, learun) { | |||||
//$.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/SaveForm?keyValue=' + keyValue, postData, function (res) { | //$.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/SaveForm?keyValue=' + keyValue, postData, function (res) { | ||||
// // 保存成功后才回调 | // // 保存成功后才回调 | ||||
// if (!!callBack) { | // if (!!callBack) { | ||||
// callBack(res, formData, i); | |||||
// callBack(res, i); | |||||
// } | // } | ||||
//}); | //}); | ||||
}; | }; | ||||
@@ -5,6 +5,7 @@ | |||||
* 描 述:资产验收 | * 描 述:资产验收 | ||||
*/ | */ | ||||
var refreshGirdData; | var refreshGirdData; | ||||
var refreshGirdData2; | |||||
var bootstrap = function ($, learun) { | var bootstrap = function ($, learun) { | ||||
"use strict"; | "use strict"; | ||||
var processId = ''; | var processId = ''; | ||||
@@ -92,7 +93,7 @@ var bootstrap = function ($, learun) { | |||||
// 删除 | // 删除 | ||||
$('#lr_delete').on('click', function () { | $('#lr_delete').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
var SendFlag = $('#gridtable').jfGridValue('Status'); | var SendFlag = $('#gridtable').jfGridValue('Status'); | ||||
if (SendFlag != 0) { | if (SendFlag != 0) { | ||||
@@ -102,7 +103,7 @@ var bootstrap = function ($, learun) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res) { | learun.layerConfirm('是否确认删除该项!', function (res) { | ||||
if (res) { | if (res) { | ||||
learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/DeleteForm', { keyValue: keyValue }, function () { | learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/DeleteForm', { keyValue: keyValue }, function () { | ||||
refreshGirdData(); | |||||
refreshGirdData2(); | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
@@ -246,5 +247,8 @@ var bootstrap = function ($, learun) { | |||||
page.search(); | page.search(); | ||||
} | } | ||||
}; | }; | ||||
refreshGirdData2 = function () { | |||||
page.search(); | |||||
}; | |||||
page.init(); | page.init(); | ||||
} | } |
@@ -18,7 +18,7 @@ namespace Learun.Application.Mapping | |||||
//表 | //表 | ||||
this.ToTable("ASS_ACCEPTANCE"); | this.ToTable("ASS_ACCEPTANCE"); | ||||
//主键 | //主键 | ||||
this.HasKey(t => t.ID); | |||||
this.HasKey(t => t.AAIId); | |||||
#endregion | #endregion | ||||
#region 配置关系 | #region 配置关系 | ||||
@@ -89,31 +89,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 获取主表实体数据 | |||||
/// </summary> | |||||
/// <param name="processId">流程实例ID</param> | |||||
/// <returns></returns> | |||||
public Ass_AcceptanceEntity GetEntityByProcessId(string processId) | |||||
{ | |||||
try | |||||
{ | |||||
return ass_AcceptanceService.GetEntityByProcessId(processId); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
@@ -183,26 +159,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
} | } | ||||
} | } | ||||
} | } | ||||
public void ChangeStatusByProcessId(string parameterProcessId, int p1) | |||||
{ | |||||
try | |||||
{ | |||||
ass_AcceptanceService.ChangeStatusByProcessId(parameterProcessId, p1); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -13,92 +13,126 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
/// </summary> | /// </summary> | ||||
public class Ass_AcceptanceEntity | public class Ass_AcceptanceEntity | ||||
{ | { | ||||
#region 实体成员 | |||||
#region 实体成员 | |||||
/// <summary> | /// <summary> | ||||
/// 编号 | |||||
/// AAIId | |||||
/// </summary> | /// </summary> | ||||
[Column("ID")] | |||||
public string ID { get; set; } | |||||
[Column("AAIID")] | |||||
public string AAIId { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 编号 | |||||
/// MAINID | |||||
/// </summary> | /// </summary> | ||||
[Column("MAINID")] | [Column("MAINID")] | ||||
public string MainId { get; set; } | public string MainId { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 设备名称 | |||||
/// AAICode | |||||
/// </summary> | /// </summary> | ||||
[Column("NAME")] | |||||
public string Name { get; set; } | |||||
[Column("AAICODE")] | |||||
public string AAICode { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 品牌 | |||||
/// AAIName | |||||
/// </summary> | /// </summary> | ||||
[Column("MANUFACTURER")] | |||||
public string Manufacturer { get; set; } | |||||
[Column("AAINAME")] | |||||
public string AAIName { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 规格型号 | |||||
/// AAITId | |||||
/// </summary> | /// </summary> | ||||
[Column("MODEL")] | |||||
public string Model { get; set; } | |||||
[Column("AAITID")] | |||||
public string AAITId { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 单位 | |||||
/// AAIEName | |||||
/// </summary> | /// </summary> | ||||
[Column("UNIT")] | |||||
public string Unit { get; set; } | |||||
[Column("AAIENAME")] | |||||
public string AAIEName { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 数量 | |||||
/// AAIPhoto | |||||
/// </summary> | /// </summary> | ||||
[Column("STOCK")] | |||||
public int? Stock { get; set; } | |||||
[Column("AAIPHOTO")] | |||||
public string AAIPhoto { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 单价 | |||||
/// AAIContent | |||||
/// </summary> | /// </summary> | ||||
[Column("PRICE")] | |||||
public decimal? Price { get; set; } | |||||
[Column("AAICONTENT")] | |||||
public string AAIContent { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 总价 | |||||
/// AAIOrder | |||||
/// </summary> | /// </summary> | ||||
[Column("TOTALPRICE")] | |||||
public decimal? TotalPrice { get; set; } | |||||
[Column("AAIORDER")] | |||||
public int? AAIOrder { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 使用部门 | |||||
/// AAIModel | |||||
/// </summary> | /// </summary> | ||||
[Column("DEPARTMENTID")] | |||||
public string DepartmentId { get; set; } | |||||
[Column("AAIMODEL")] | |||||
public string AAIModel { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 放置地点 | |||||
/// AAIManufacturer | |||||
/// </summary> | /// </summary> | ||||
[Column("PLACE")] | |||||
public string Place { get; set; } | |||||
[Column("AAIMANUFACTURER")] | |||||
public string AAIManufacturer { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 使用人 | |||||
/// AAISupplierId | |||||
/// </summary> | /// </summary> | ||||
[Column("USERID")] | |||||
public string UserID { get; set; } | |||||
[Column("AAISUPPLIERID")] | |||||
public string AAISupplierId { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 备注 | |||||
/// AAISource | |||||
/// </summary> | /// </summary> | ||||
[Column("REMARK")] | |||||
public string Remark { get; set; } | |||||
[Column("AAISOURCE")] | |||||
public string AAISource { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 流程id | |||||
/// AAIPrice | |||||
/// </summary> | /// </summary> | ||||
[Column("PROCESSID")] | |||||
public string ProcessId { get; set; } | |||||
[Column("AAIPRICE")] | |||||
public decimal? AAIPrice { get; set; } | |||||
/// <summary> | |||||
/// AAISTOCK | |||||
/// </summary> | |||||
[Column("AAISTOCK")] | |||||
public decimal? AAIStock { get; set; } | |||||
/// <summary> | |||||
/// AAIUNIT | |||||
/// </summary> | |||||
[Column("AAIUNIT")] | |||||
public string AAIUnit { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 审核状态 | |||||
/// AAIREALNUM | |||||
/// </summary> | /// </summary> | ||||
[Column("STATUS")] | |||||
public string Status { get; set; } | |||||
[Column("AAIREALNUM")] | |||||
public decimal? AAIRealNum { get; set; } | |||||
/// <summary> | |||||
/// AAIREALNUM | |||||
/// </summary> | |||||
[Column("AISCHECK")] | |||||
public bool? AIsCheck { get; set; } | |||||
/// <summary> | |||||
/// AResult | |||||
/// </summary> | |||||
[Column("ARESULT")] | |||||
public int? AResult { get; set; } | |||||
/// <summary> | |||||
/// ARemark | |||||
/// </summary> | |||||
[Column("AREMARK")] | |||||
public string ARemark { get; set; } | |||||
/// <summary> | |||||
/// AAddress | |||||
/// </summary> | |||||
[Column("AADDRESS")] | |||||
public string AAddress { get; set; } | |||||
#endregion | #endregion | ||||
#region 扩展操作 | |||||
#region 扩展操作 | |||||
/// <summary> | /// <summary> | ||||
/// 新增调用 | /// 新增调用 | ||||
/// </summary> | /// </summary> | ||||
public void Create() | public void Create() | ||||
{ | { | ||||
this.ID = Guid.NewGuid().ToString(); | |||||
this.AAIId = Guid.NewGuid().ToString(); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 编辑调用 | /// 编辑调用 | ||||
@@ -106,10 +140,27 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
/// <param name="keyValue"></param> | /// <param name="keyValue"></param> | ||||
public void Modify(string keyValue) | public void Modify(string keyValue) | ||||
{ | { | ||||
this.ID = keyValue; | |||||
this.AAIId = keyValue; | |||||
} | |||||
/// <summary> | |||||
/// 新增调用 | |||||
/// </summary> | |||||
public void Create(UserInfo userInfo) | |||||
{ | |||||
this.AAIId = Guid.NewGuid().ToString(); | |||||
} | |||||
/// <summary> | |||||
/// 编辑调用 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
public void Modify(string keyValue, UserInfo userInfo) | |||||
{ | |||||
this.AAIId = keyValue; | |||||
} | } | ||||
#endregion | #endregion | ||||
#region 扩展字段 | |||||
#region 扩展字段 | |||||
#endregion | #endregion | ||||
} | } | ||||
} | } | ||||
@@ -29,12 +29,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Ass_AcceptanceEntity GetAss_AcceptanceEntity(string keyValue); | Ass_AcceptanceEntity GetAss_AcceptanceEntity(string keyValue); | ||||
/// <summary> | |||||
/// 获取主表实体数据 | |||||
/// </summary> | |||||
/// <param name="processId">流程实例ID</param> | |||||
/// <returns></returns> | |||||
Ass_AcceptanceEntity GetEntityByProcessId(string processId); | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
@@ -53,6 +47,5 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
#endregion | #endregion | ||||
void ChangeStatusById(string keyValue, int i, string processId); | void ChangeStatusById(string keyValue, int i, string processId); | ||||
void ChangeStatusByProcessId(string parameterProcessId, int p1); | |||||
} | } | ||||
} | } |
@@ -32,19 +32,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append("SELECT "); | strSql.Append("SELECT "); | ||||
strSql.Append(@" | strSql.Append(@" | ||||
t.ID, | |||||
t.Name, | |||||
t.Manufacturer, | |||||
t.Model, | |||||
t.Unit, | |||||
t.Stock, | |||||
t.Price, | |||||
t.TotalPrice, | |||||
t.DepartmentId, | |||||
t.Place, | |||||
t.UserID, | |||||
t.Status, | |||||
t.Remark | |||||
t.* | |||||
"); | "); | ||||
strSql.Append(" FROM Ass_Acceptance t "); | strSql.Append(" FROM Ass_Acceptance t "); | ||||
strSql.Append(" WHERE 1=1 "); | strSql.Append(" WHERE 1=1 "); | ||||
@@ -128,31 +116,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 获取主表实体数据 | |||||
/// </summary> | |||||
/// <param name="processId">流程实例ID</param> | |||||
/// <returns></returns> | |||||
public Ass_AcceptanceEntity GetEntityByProcessId(string processId) | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository().FindEntity<Ass_AcceptanceEntity>(t => t.ProcessId == processId); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
@@ -165,7 +129,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
this.BaseRepository().Delete<Ass_AcceptanceEntity>(t => t.ID == keyValue); | |||||
this.BaseRepository().Delete<Ass_AcceptanceEntity>(t => t.AAIId == keyValue); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -228,23 +192,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
} | } | ||||
} | } | ||||
public void ChangeStatusByProcessId(string parameterProcessId, int p1) | |||||
{ | |||||
try | |||||
{ | |||||
var entity = this.BaseRepository() | |||||
.FindEntity<Ass_AcceptanceEntity>(a => a.ProcessId == parameterProcessId); | |||||
if (null != entity) | |||||
{ | |||||
entity.Status = p1.ToString(); | |||||
} | |||||
this.BaseRepository().Update(entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | } | ||||
} | } |
@@ -125,6 +125,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
try | try | ||||
{ | { | ||||
this.BaseRepository().Delete<Ass_AcceptanceMainEntity>(t => t.Id == keyValue); | this.BaseRepository().Delete<Ass_AcceptanceMainEntity>(t => t.Id == keyValue); | ||||
this.BaseRepository().Delete<Ass_AcceptanceEntity>(t => t.MainId == keyValue); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||