@@ -5,6 +5,7 @@ using System.Web.Mvc; | |||
using Learun.Application.TwoDevelopment.LR_CodeDemo; | |||
using System.Collections.Generic; | |||
using Learun.Application.Base.SystemModule; | |||
using System; | |||
namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
{ | |||
@@ -18,6 +19,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
public class Ass_AcceptanceController : MvcControllerBase | |||
{ | |||
private Ass_AcceptanceIBLL ass_AcceptanceIBLL = new Ass_AcceptanceBLL(); | |||
private Ass_AcceptanceMainIBLL ass_AcceptanceMainIBLL = new Ass_AcceptanceMainBLL(); | |||
private CodeRuleIBLL codeRuleIBLL = new CodeRuleBLL(); | |||
#region 视图功能 | |||
@@ -29,7 +31,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -38,7 +40,17 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
ViewBag.Code = "RKSQ_" + CommonHelper.CreateNo(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult FormItem() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -47,7 +59,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[HttpGet] | |||
public ActionResult ViewForm() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
#endregion | |||
@@ -64,7 +76,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = ass_AcceptanceIBLL.GetPageList(paginationobj, queryJson); | |||
var data = ass_AcceptanceMainIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
@@ -83,9 +95,12 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var Ass_AcceptanceData = ass_AcceptanceIBLL.GetAss_AcceptanceEntity( keyValue ); | |||
var jsonData = new { | |||
Ass_Acceptance = Ass_AcceptanceData, | |||
var Ass_AcceptanceMainData = ass_AcceptanceMainIBLL.GetAss_AcceptanceMainEntity(keyValue); | |||
var Ass_AcceptanceData = ass_AcceptanceIBLL.GetAss_AcceptanceListByMainId(Ass_AcceptanceMainData.Id); | |||
var jsonData = new | |||
{ | |||
Ass_AcceptanceMain = Ass_AcceptanceMainData, | |||
Ass_Acceptance = Ass_AcceptanceData | |||
}; | |||
return Success(jsonData); | |||
} | |||
@@ -98,8 +113,9 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[AjaxOnly] | |||
public ActionResult GetFormDataByProcessId(string processId) | |||
{ | |||
var Ass_AcceptanceData = ass_AcceptanceIBLL.GetEntityByProcessId( processId ); | |||
var jsonData = new { | |||
var Ass_AcceptanceData = ass_AcceptanceIBLL.GetEntityByProcessId(processId); | |||
var jsonData = new | |||
{ | |||
Ass_Acceptance = Ass_AcceptanceData, | |||
}; | |||
return Success(jsonData); | |||
@@ -135,24 +151,43 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
ass_AcceptanceIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
public ActionResult SaveForm(string keyValue, string strEntity, string strass_Ass_AcceptanceList) | |||
{ | |||
Ass_AcceptanceEntity entity = strEntity.ToObject<Ass_AcceptanceEntity>(); | |||
ass_AcceptanceIBLL.SaveEntity(keyValue,entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
Ass_AcceptanceMainEntity entity = strEntity.ToObject<Ass_AcceptanceMainEntity>(); | |||
entity.Status = 0; | |||
List<Ass_AcceptanceEntity> ass_AcceptanceList = strass_Ass_AcceptanceList.ToObject<List<Ass_AcceptanceEntity>>(); | |||
ass_AcceptanceMainIBLL.SaveEntity(keyValue, entity, ass_AcceptanceList); | |||
return Success("保存成功!"); | |||
} | |||
///// <summary> | |||
///// 保存实体数据(新增、修改) | |||
///// </summary> | |||
///// <param name="keyValue">主键</param> | |||
///// <param name="strEntity">实体</param> | |||
///// <returns></returns> | |||
//[HttpPost] | |||
//[ValidateAntiForgeryToken] | |||
//[AjaxOnly] | |||
//public ActionResult SaveForm(string keyValue, string strEntity) | |||
//{ | |||
// Ass_AcceptanceEntity entity = strEntity.ToObject<Ass_AcceptanceEntity>(); | |||
// ass_AcceptanceIBLL.SaveEntity(keyValue, entity); | |||
// if (string.IsNullOrEmpty(keyValue)) | |||
// { | |||
// } | |||
// return Success("保存成功!"); | |||
//} | |||
#endregion | |||
} | |||
@@ -53,6 +53,12 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
{ | |||
return View(); | |||
} | |||
[HttpGet] | |||
public ActionResult FormViewJYHC() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
@@ -27,7 +27,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -36,7 +36,17 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult FormJYHC() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 采购表单页 | |||
@@ -45,7 +55,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[HttpGet] | |||
public ActionResult FormPurchase() | |||
{ | |||
ViewBag.AssCode= DateTime.Now.ToString("yyyyMMddHHmmssffff"); | |||
ViewBag.AssCode = DateTime.Now.ToString("yyyyMMddHHmmssffff"); | |||
return View(); | |||
} | |||
#endregion | |||
@@ -80,8 +90,9 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var Ass_AssetsInfoItemApplyData = ass_AssetsInfoItemApplyIBLL.GetAss_AssetsInfoItemApplyEntity( keyValue ); | |||
var jsonData = new { | |||
var Ass_AssetsInfoItemApplyData = ass_AssetsInfoItemApplyIBLL.GetAss_AssetsInfoItemApplyEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
Ass_AssetsInfoItemApply = Ass_AssetsInfoItemApplyData, | |||
}; | |||
return Success(jsonData); | |||
@@ -113,7 +124,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
Ass_AssetsInfoItemApplyEntity entity = strEntity.ToObject<Ass_AssetsInfoItemApplyEntity>(); | |||
ass_AssetsInfoItemApplyIBLL.SaveEntity(keyValue,entity); | |||
ass_AssetsInfoItemApplyIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
@@ -1,55 +1,40 @@ | |||
@{ | |||
ViewBag.Title = "资产验收"; | |||
ViewBag.Title = "采购申请"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">选择已登记资产</div> | |||
<div id="AAOldCode"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">设备名称</div> | |||
<input id="Name" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">品牌</div> | |||
<input id="Manufacturer" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">规格型号</div> | |||
<input id="Model" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">单位</div> | |||
<input id="Unit" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">数量</div> | |||
<input id="Stock" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">单价</div> | |||
<input id="Price" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<script> | |||
var NewCode = "@ViewBag.Code"; | |||
</script> | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_AcceptanceMain"> | |||
<div class="lr-form-item-title">申请单号</div> | |||
<input id="Code" type="text" class="form-control" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_AcceptanceMain"> | |||
<div class="lr-form-item-title">申请名称</div> | |||
<input id="Name" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_AcceptanceMain"> | |||
<div class="lr-form-item-title">总价</div> | |||
<input id="TotalPrice" type="text" class="form-control" /> | |||
<input id="TotalPrice" type="text" class="form-control" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">使用部门</div> | |||
<div id="DepartmentId" ></div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AcceptanceMain"> | |||
<div class="lr-form-item-title">申请时间</div> | |||
<input id="CreateTime" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">使用人</div> | |||
<div id="UserID" ></div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AcceptanceMain"> | |||
<div class="lr-form-item-title">申请人</div> | |||
<input id="CreateUserId" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">放置地点</div> | |||
<input id="Place" type="text" class="form-control" /> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">明细操作</div> | |||
<input id="detailadd" type="button" class="btn btn-success" value="新增明细" /> | |||
<input id="detailedit" type="button" class="btn btn-warning" value="编辑明细" /> | |||
<input id="detaildel" type="button" class="btn btn-danger" value="移除明细" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;" ></textarea> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="Ass_Acceptance"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/Ass_Acceptance/Form.js") |
@@ -1,8 +1,8 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-18 10:46 | |||
* 描 述:资产验收 | |||
* 日 期:2019-03-25 12:00 | |||
* 描 述:入库申请 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
@@ -14,6 +14,11 @@ var setFormData; | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var refreshGirdData; | |||
var selectedRow; | |||
var tempdatra = new Array(); | |||
//总价计算 | |||
var pricecount = 0; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
@@ -38,143 +43,208 @@ var bootstrap = function ($, learun) { | |||
var page = { | |||
init: function () { | |||
$('.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); | |||
} | |||
}); | |||
}); | |||
$("#detailedit").on('click', function () { | |||
var keyValue = $('#Ass_Acceptance').jfGridValue('Id'); | |||
selectedRow = $('#Ass_Acceptance').jfGridGet('rowdata'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formitem', | |||
title: '编辑明细', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/FormItem?keyValue=' + keyValue, | |||
width: 860, | |||
height: 600, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
$("#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.initData(); | |||
}, | |||
bind: function () { | |||
$('#DepartmentId').lrselect({ | |||
type: 'tree', | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', | |||
param: {}, | |||
select: function (val) { | |||
console.log(val.value); | |||
$('#UserID').lrselectRefresh({ url: '/LR_OrganizationModule/User/GetListByDepartmentId?departmentId=' + val.value }); | |||
} | |||
}); | |||
$('#UserID').lrselect({ text: 'F_RealName', value: 'F_UserId' }); | |||
$("#AAOldCode").lrlayerselect({ | |||
treeUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsType/GetAllTree', | |||
treeParentId: 'atptid', | |||
treeValueId: 'atid', | |||
treeTextId: 'aname', | |||
dataUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetList', | |||
dataTreeId: 'ATId', | |||
dataValueId: 'AId', | |||
dataTextId: 'AName', | |||
$('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | |||
$('#CreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||
grid: [ | |||
{ label: '资产编号', name: 'ACode', width: 200, align: 'left' }, | |||
{ label: '资产名称', name: 'AName', width: 200, align: 'left' }, | |||
{ label: "英文名称", name: "AEName", width: 200, align: "left" }, | |||
{ label: "资产型号", name: "AModel", width: 200, align: "left" }, | |||
{ label: "生产厂家", name: "AManufacturer", width: 200, align: "left" }, | |||
$('#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({ | |||
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: "ASupplierId", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_SupplierData', | |||
label: "使用部门", name: "DepartmentId", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('department', { | |||
key: value, | |||
keyId: 'sid', | |||
callback: function (_data) { | |||
callback(_data['sname']); | |||
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" }, | |||
], | |||
select: function (values, texts) { | |||
if (values && values.length > 0) { | |||
//绑定 | |||
$.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetFormData?keyValue=' + values[0], function (data) { | |||
data = data.Ass_AssetsInfo; | |||
$('#Name').val(data.AName);//设备名称 | |||
$('#AAIUnit').lrselectSet(data.AUnit);//单位 | |||
$('#Model').val(data.AModel);//规格型号 | |||
$('#AAIManufacturer').val(data.AManufacturer);//品牌 | |||
$('#Price').val(data.APrice)//单价 | |||
}); | |||
} | |||
}, | |||
unknowselect: function () { | |||
$("#AAOldCode").find('span').text(""); | |||
$('#Name').val("");//设备名称 | |||
$('#Model').val("");//规格型号 | |||
$('#AAIManufacturer').val("");//品牌 | |||
}, | |||
isMultiple: false | |||
height: 400, | |||
mainId: 'Id', | |||
reloadSelected: false, | |||
}); | |||
$('#Stock').bind('change', function () { | |||
var stock = $(this).val(); | |||
var price = $('#Price').val(); | |||
$('#TotalPrice').val(stock * price); | |||
}) | |||
$('#Price').bind('change', function () { | |||
var stock = $('#Stock').val(); | |||
var price = $(this).val(); | |||
$('#TotalPrice').val(stock * price); | |||
}) | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
$.lrSetForm( | |||
top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/GetFormData?keyValue=' + keyValue, | |||
function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
tempdatra = data[id]; | |||
} else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
if (data[id].TotalPrice) { | |||
pricecount = data[id].TotalPrice; | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
}); | |||
} else { | |||
$("#Code").val(NewCode); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
var ifnewrow = true; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].MainId === temprow.Id) { | |||
tempdatra[key] = temprow; | |||
ifnewrow = false; | |||
} | |||
}); | |||
if (ifnewrow) { | |||
tempdatra.push(temprow); | |||
} | |||
//总价计算 | |||
pricecount = 0; | |||
for (var i = 0; i < tempdatra.length; i++) { | |||
pricecount = parseFloat(pricecount) +parseFloat(tempdatra[i].TotalPrice); | |||
} | |||
$("#TotalPrice").val(pricecount); | |||
$('#Ass_Acceptance').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | |||
}; | |||
function sortNumber(a, b) { | |||
return 1;//a.AAIOrder - b.AAIOrder; | |||
} | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
setFormData = function (processId) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
$.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_Acceptance' && data[id]) { | |||
keyValue = data[id].ID; | |||
if (id == 'Ass_AcceptanceMain') { | |||
keyValue = data[id].Id; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
callback && callback(); | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
if (!$('body').lrValidform()) { | |||
if (!$('.lr-form-wrap').lrValidform()) { | |||
return false; | |||
} | |||
var datas = $('#Ass_Acceptance').jfGridGet('rowdatas'); | |||
if (datas == null || datas.length == 0) { | |||
learun.alert.warning("申请未包含明细!请先新增明细!"); | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (processId, callBack, i) { | |||
var formData = $('body').lrGetFormData(); | |||
var postData = {}; | |||
var formData = $('[data-table="Ass_AcceptanceMain"]').lrGetFormData(); | |||
if (!!processId) { | |||
formData.ProcessId = processId; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify(formData) | |||
}; | |||
postData.strEntity = JSON.stringify(formData); | |||
postData.strass_Ass_AcceptanceList = JSON.stringify($('#Ass_Acceptance').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, i); | |||
callBack(res, formData, i); | |||
} | |||
}); | |||
}; | |||
@@ -0,0 +1,55 @@ | |||
@{ | |||
ViewBag.Title = "资产验收"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">选择已登记资产</div> | |||
<div id="AAOldCode"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">设备名称<font face="宋体">*</font></div> | |||
<input id="Name" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">品牌</div> | |||
<input id="Manufacturer" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">规格型号</div> | |||
<input id="Model" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">单位</div> | |||
<input id="Unit" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">数量<font face="宋体">*</font></div> | |||
<input id="Stock" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">单价<font face="宋体">*</font></div> | |||
<input id="Price" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">总价</div> | |||
<input id="TotalPrice" type="text" class="form-control" readonly="readonly"/> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">使用部门</div> | |||
<div id="DepartmentId" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">使用人</div> | |||
<div id="UserID" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">放置地点</div> | |||
<input id="Place" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_Acceptance" > | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;" ></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/Ass_Acceptance/FormItem.js") |
@@ -0,0 +1,181 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-18 10:46 | |||
* 描 述:资产验收 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#DepartmentId').lrselect({ | |||
type: 'tree', | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', | |||
param: {}, | |||
select: function (val) { | |||
console.log(val.value); | |||
$('#UserID').lrselectRefresh({ url: '/LR_OrganizationModule/User/GetListByDepartmentId?departmentId=' + val.value }); | |||
} | |||
}); | |||
$('#UserID').lrselect({ text: 'F_RealName', value: 'F_UserId' }); | |||
$("#AAOldCode").lrlayerselect({ | |||
treeUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsType/GetAllTree', | |||
treeParentId: 'atptid', | |||
treeValueId: 'atid', | |||
treeTextId: 'aname', | |||
dataUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetList', | |||
dataTreeId: 'ATId', | |||
dataValueId: 'AId', | |||
dataTextId: 'AName', | |||
grid: [ | |||
{ label: '资产编号', name: 'ACode', width: 200, align: 'left' }, | |||
{ label: '资产名称', name: 'AName', width: 200, align: 'left' }, | |||
{ label: "英文名称", name: "AEName", width: 200, align: "left" }, | |||
{ label: "资产型号", name: "AModel", width: 200, align: "left" }, | |||
{ label: "生产厂家", name: "AManufacturer", width: 200, align: "left" }, | |||
{ | |||
label: "供应商", name: "ASupplierId", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_SupplierData', | |||
key: value, | |||
keyId: 'sid', | |||
callback: function (_data) { | |||
callback(_data['sname']); | |||
} | |||
}); | |||
} | |||
} | |||
], | |||
select: function (values, texts) { | |||
if (values && values.length > 0) { | |||
//绑定 | |||
$.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetFormData?keyValue=' + values[0], function (data) { | |||
data = data.Ass_AssetsInfo; | |||
$('#Name').val(data.AName);//设备名称 | |||
$('#AAIUnit').lrselectSet(data.AUnit);//单位 | |||
$('#Model').val(data.AModel);//规格型号 | |||
$('#AAIManufacturer').val(data.AManufacturer);//品牌 | |||
$('#Price').val(data.APrice)//单价 | |||
}); | |||
} | |||
}, | |||
unknowselect: function () { | |||
$("#AAOldCode").find('span').text(""); | |||
$('#Name').val("");//设备名称 | |||
$('#Model').val("");//规格型号 | |||
$('#AAIManufacturer').val("");//品牌 | |||
}, | |||
isMultiple: false | |||
}); | |||
$('#Stock').bind('change', function () { | |||
var stock = $(this).val(); | |||
var price = $('#Price').val(); | |||
$('#TotalPrice').val(stock * price); | |||
}) | |||
$('#Price').bind('change', function () { | |||
var stock = $('#Stock').val(); | |||
var price = $(this).val(); | |||
$('#TotalPrice').val(stock * price); | |||
}) | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/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_Acceptance' && data[id]) { | |||
keyValue = data[id].ID; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
callback && callback(); | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = $('body').lrGetFormData(); | |||
if (!!keyValue) { | |||
if (!!selectedRow) { | |||
postData.MainId = selectedRow.MainId; | |||
} | |||
} else { | |||
postData.MainId = learun.newGuid(); | |||
} | |||
if (!!callBack) { | |||
callBack(postData); | |||
return true; | |||
} | |||
}; | |||
//// 保存数据 | |||
//save = function (processId, callBack, i) { | |||
// var formData = $('body').lrGetFormData(); | |||
// if (!!processId) { | |||
// formData.ProcessId = processId; | |||
// } | |||
// var postData = { | |||
// strEntity: JSON.stringify(formData) | |||
// }; | |||
// $.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// // 保存成功后才回调 | |||
// if (!!callBack) { | |||
// callBack(res, i); | |||
// } | |||
// }); | |||
//}; | |||
page.init(); | |||
} |
@@ -11,20 +11,12 @@ | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">设备名称</div> | |||
<input id="Name" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">使用部门</div> | |||
<div id="DepartmentId"></div> | |||
<div class="lr-form-item-title">验收单号</div> | |||
<input id="Code" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">使用人</div> | |||
<div id="User"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">放置地点</div> | |||
<input id="Place" type="text" class="form-control" /> | |||
<div id="CreateUserId"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -17,8 +17,7 @@ var bootstrap = function ($, learun) { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#DepartmentId').lrDepartmentSelect(); | |||
$('#User').lrDataItemSelect({ code: '' }); | |||
$('#CreateUserId').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
@@ -29,15 +28,15 @@ var bootstrap = function ($, learun) { | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/Form', | |||
width: 600, | |||
height: 400, | |||
width: 1000, | |||
height: 700, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
res = top[id].save('', function() { | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
} | |||
@@ -47,10 +46,10 @@ var bootstrap = function ($, learun) { | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var SendFlag = $('#gridtable').jfGridValue('Status'); | |||
if (SendFlag) { | |||
if (SendFlag != 0) { | |||
learun.alert.warning("当前项目已提交不能编辑!"); | |||
return; | |||
} | |||
@@ -58,8 +57,8 @@ var bootstrap = function ($, learun) { | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/Form?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
width: 1000, | |||
height: 700, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
@@ -86,7 +85,7 @@ var bootstrap = function ($, learun) { | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/ViewForm?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
btn:null | |||
btn: null | |||
}); | |||
} | |||
}); | |||
@@ -96,13 +95,13 @@ var bootstrap = function ($, learun) { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var SendFlag = $('#gridtable').jfGridValue('Status'); | |||
if (SendFlag) { | |||
if (SendFlag != 0) { | |||
learun.alert.warning("当前项目已提交不能不能删除!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认删除该项!', function (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(); | |||
}); | |||
} | |||
@@ -119,7 +118,7 @@ var bootstrap = function ($, learun) { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var SendFlag = $('#gridtable').jfGridValue('Status'); | |||
if (SendFlag) { | |||
if (SendFlag != 0) { | |||
learun.alert.warning("当前项目已提交,请耐心等待审批!"); | |||
return; | |||
} | |||
@@ -136,76 +135,116 @@ var bootstrap = function ($, learun) { | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/GetPageList', | |||
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', { | |||
{ label: "申请单号", name: "Code", width: 200, align: "left" }, | |||
{ label: "申请名称", name: "Name", width: 200, align: "left" }, | |||
{ label: "总价", name: "TotalPrice", width: 100, align: "left" }, | |||
{ label: "申请时间", name: "CreateTime", width: 150, align: "left" }, | |||
{ | |||
label: "申请人", name: "CreateUserId", 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.name); | |||
callback(_data['f_realname']); | |||
} | |||
}); | |||
}}, | |||
{ label: "放置地点", name: "Place", width: 100, align: "left" }, | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "状态", name: "Status", width: 100, align: "left", | |||
label: "审批状态", name: "Status", width: 100, align: "left", | |||
formatter: function (cellvalue, row) { | |||
if (cellvalue === '1') { | |||
if (cellvalue === 1) { | |||
return '<span class=\"label label-warning\">审批中</span>'; | |||
} else if (cellvalue === '2') { | |||
return '<span class=\"label label-success\">已审核</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"}, | |||
} | |||
], | |||
mainId:'ID', | |||
isPage: true | |||
mainId: 'Id', | |||
isPage: true, | |||
sidx: 'CreateTime', | |||
sord: 'DASC' | |||
}); | |||
//$('#gridtable').lrAuthorizeJfGrid({ | |||
// url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/GetPageList', | |||
// 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" }, | |||
// ], | |||
// mainId: 'ID', | |||
// isPage: true | |||
//}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function (res, postData) { | |||
if (!!res) | |||
{ | |||
if (res.code == 200) | |||
{ | |||
// 发起流程 | |||
var postData = { | |||
schemeCode:'ASS_zcys',// 填写流程对应模板编号 | |||
processId:processId, | |||
level:'1', | |||
}; | |||
learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function(data) { | |||
learun.loading(false); | |||
}); | |||
if (!!res) { | |||
if (res.code == 200) { | |||
// 发起流程 | |||
var postData = { | |||
schemeCode: 'ASS_zcys',// 填写流程对应模板编号 | |||
processId: processId, | |||
level: '1', | |||
}; | |||
learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { | |||
learun.loading(false); | |||
}); | |||
} | |||
page.search(); | |||
} | |||
page.search(); | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -32,7 +32,7 @@ var bootstrap = function ($, learun) { | |||
learun.layerForm({ | |||
id: 'formitem', | |||
title: '新增明细', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/Form', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/FormJYHC', | |||
width: 860, | |||
height: 600, | |||
callBack: function (id) { | |||
@@ -47,7 +47,7 @@ var bootstrap = function ($, learun) { | |||
learun.layerForm({ | |||
id: 'formitem', | |||
title: '编辑明细', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/Form?keyValue=' + keyValue, | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/FormJYHC?keyValue=' + keyValue, | |||
width: 860, | |||
height: 600, | |||
callBack: function (id) { | |||
@@ -0,0 +1,33 @@ | |||
@{ | |||
ViewBag.Title = "采购申请"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<script> | |||
var NewAACode = "@ViewBag.AACode"; | |||
</script> | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_AssetsInfoApply"> | |||
<div class="lr-form-item-title">采购申请单号</div> | |||
<input id="AACode" type="text" class="form-control" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_AssetsInfoApply"> | |||
<div class="lr-form-item-title">采购总价</div> | |||
<input id="AAPrice" type="text" class="form-control" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_AssetsInfoApply"> | |||
<div class="lr-form-item-title">资产属性</div> | |||
<div id="AAAssType" readonly="readonly"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoApply"> | |||
<div class="lr-form-item-title">申请时间</div> | |||
<input id="AACreateTime" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoApply"> | |||
<div class="lr-form-item-title">申请人</div> | |||
<input id="AACreateUserId" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="Ass_AssetsInfoItemApply"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/Ass_AssetsInfoApply/FormViewJYHC.js") |
@@ -0,0 +1,267 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2019-03-25 12:00 | |||
* 描 述:入库申请 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var refreshGirdData; | |||
var selectedRow; | |||
var tempdatra = new Array(); | |||
//总价计算 | |||
var pricecount = 0; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
setAuthorize = function (data) { | |||
}; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
$("#detailadd").on('click', function () { | |||
selectedRow = null; | |||
learun.layerForm({ | |||
id: 'formitem', | |||
title: '新增明细', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/Form', | |||
width: 860, | |||
height: 600, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
$("#detailedit").on('click', function () { | |||
var keyValue = $('#Ass_AssetsInfoItemApply').jfGridValue('AAIId'); | |||
selectedRow = $('#Ass_AssetsInfoItemApply').jfGridGet('rowdata'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formitem', | |||
title: '编辑明细', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/Form?keyValue=' + keyValue, | |||
width: 860, | |||
height: 600, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
$("#detaildel").on('click', function () { | |||
var keyValue = $('#Ass_AssetsInfoItemApply').jfGridValue('AAIId'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||
if (res) { | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].AAIId === keyValue) { | |||
pricecount -= tempdatra[key].AAIPrice * tempdatra[key].AAIStock; | |||
tempdatra.splice(key, 1); | |||
} | |||
}); | |||
$("#AAPrice").val(pricecount); | |||
$('#Ass_AssetsInfoItemApply').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | |||
top.layer.close(index); | |||
} | |||
}); | |||
} | |||
}); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#AACreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | |||
$('#AACreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||
$('#AAAssType').lrDataItemSelect({ code: 'AssType' }); | |||
$('#AACreateUserId').val(learun.clientdata.get(['userinfo']).realName); | |||
$('#Ass_AssetsInfoItemApply').jfGrid({ | |||
headData: [ | |||
{ | |||
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, | |||
keyId: 'atid', | |||
callback: function (_data) { | |||
callback(_data['aname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
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', { | |||
key: value, | |||
code: 'sldw', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: '生成耗材明细', name: 'AAIHasDetail', width: 80, align: 'left', formatter: function (cellvalue) { | |||
return (cellvalue === true || cellvalue === "true") ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||
} | |||
}, | |||
{ | |||
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' | |||
}, | |||
{ | |||
label: '英文名称', name: 'AAIEName', width: 100, align: 'left' | |||
}, | |||
{ | |||
label: '资产型号', name: 'AAIModel', width: 100, align: 'left' | |||
}, | |||
{ | |||
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, | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm( | |||
top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoApply/GetFormData?keyValue=' + keyValue, | |||
function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
tempdatra = data[id]; | |||
} else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
if (data[id].AAPrice) { | |||
pricecount = data[id].AAPrice; | |||
} | |||
} | |||
} | |||
}); | |||
} else { | |||
$("#AACode").val(NewAACode); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
var ifnewrow = true; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].AAIId === temprow.AAIId) { | |||
tempdatra[key] = temprow; | |||
ifnewrow = false; | |||
} | |||
}); | |||
if (ifnewrow) { | |||
tempdatra.push(temprow); | |||
} | |||
//总价计算 | |||
pricecount = 0; | |||
for (var i = 0; i < tempdatra.length; i++) { | |||
pricecount += tempdatra[i].AAIPrice * tempdatra[i].AAIStock; | |||
} | |||
$("#AAPrice").val(pricecount); | |||
$('#Ass_AssetsInfoItemApply').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | |||
}; | |||
function sortNumber(a, b) { | |||
return a.AAIOrder - b.AAIOrder; | |||
} | |||
// 设置表单数据 | |||
setFormData = function (processId,param,callback) { | |||
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_AssetsInfoApply') { | |||
keyValue = data[id].AAId; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
callback && callback(); | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
if (!$('#form').lrValidform()) { | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (processId, callBack, i) { | |||
var formData = {}; | |||
var res = {}; | |||
res.code = 200; | |||
if (!!processId) { | |||
formData.AAProcessId = processId; | |||
} | |||
callBack(res, i); | |||
}; | |||
page.init(); | |||
} |
@@ -136,7 +136,7 @@ var bootstrap = function ($, learun) { | |||
learun.layerForm({ | |||
id: 'formAss_AssetsInfoApply', | |||
title: '查看采购申请', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoApply/FormViewJY?keyValue=' + keyValue, | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoApply/FormViewJYHC?keyValue=' + keyValue, | |||
width: 1000, | |||
height: 600, | |||
btn: null | |||
@@ -0,0 +1,89 @@ | |||
@{ | |||
ViewBag.Title = "采购申请(耗材)明细"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
@Html.AppendCssFile("/Views/LR_Content/plugin/layerselect/lr-layerselect.css") | |||
@Html.AppendJsFile("/Views/LR_Content/plugin/layerselect/lr-layerselect.js") | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">选择已登记耗材<font face="宋体">*</font></div> | |||
<div id="AAOldCode"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">耗材类别<font face="宋体">*</font></div> | |||
<div id="AAITId" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">耗材编号<font face="宋体">*</font></div> | |||
<input id="AAICode" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">耗材名称<font face="宋体">*</font></div> | |||
<input id="AAIName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">英文名称</div> | |||
<input id="AAIEName" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">耗材型号</div> | |||
<input id="AAIModel" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">生产厂家</div> | |||
<input id="AAIManufacturer" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">耗材规格</div> | |||
<input id="AAISpecification" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">用途</div> | |||
<input id="AAIUse" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">耗材来源</div> | |||
<div id="AAISource"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">供应商</div> | |||
<div id="AAISupplierId"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">单价<font face="宋体">*</font></div> | |||
<input id="AAIPrice" type="text" class="form-control" isvalid="yes" checkexpession="PositiveFloatintZero" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">数量<font face="宋体">*</font></div> | |||
<input id="AAIStock" type="text" class="form-control" isvalid="yes" checkexpession="PositiveFloatint" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">数量单位</div> | |||
<div id="AAIUnit" ></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">排序<font face="宋体">*</font></div> | |||
<input id="AAIOrder" type="text" class="form-control" isvalid="yes" checkexpession="Num" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">楼宇名称<font face="宋体">*</font></div> | |||
<div id="AAIStorageId" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">房间号</div> | |||
<div id="AAIStoragePosition" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">生成明细<font face="宋体">*</font></div> | |||
<div id="AAIHasDetail" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">入库照片</div> | |||
<div id="AAIPhoto"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Ass_AssetsInfoItemApply"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="AAIContent" class="form-control" style="height: 120px;"></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItemApply/FormJYHC.js") |
@@ -0,0 +1,165 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2019-03-26 11:41 | |||
* 描 述:采购申请(耗材)明细 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var selectedRow; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
selectedRow = top["layer_formAss_AssetsInfoApply"].selectedRow; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#AAIAssType').lrDataItemSelect({ code: 'AssType' }); | |||
$('#AAITId').lrselect({ | |||
type: 'tree', | |||
// 展开最大高度 | |||
maxHeight: 200, | |||
// 是否允许搜索 | |||
allowSearch: true, | |||
// 访问数据接口地址 | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsType/GetAllTree' | |||
}); | |||
$("#AAOldCode").lrlayerselect({ | |||
treeUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsType/GetAllTree', | |||
treeParentId: 'atptid', | |||
treeValueId: 'atid', | |||
treeTextId: 'aname', | |||
dataUrl: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetList', | |||
dataTreeId: 'ATId', | |||
dataValueId: 'AId', | |||
dataTextId: 'AName', | |||
grid: [ | |||
{ label: '耗材编号', name: 'ACode', width: 200, align: 'left' }, | |||
{ label: '耗材名称', name: 'AName', width: 200, align: 'left' }, | |||
{ label: "英文名称", name: "AEName", width: 200, align: "left" }, | |||
{ label: "耗材型号", name: "AModel", width: 200, align: "left" }, | |||
{ label: "生产厂家", name: "AManufacturer", width: 200, align: "left" }, | |||
{ | |||
label: "供应商", name: "ASupplierId", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_SupplierData', | |||
key: value, | |||
keyId: 'sid', | |||
callback: function (_data) { | |||
callback(_data['sname']); | |||
} | |||
}); | |||
} | |||
} | |||
], | |||
select: function (values, texts) { | |||
if (values && values.length > 0) { | |||
//绑定 | |||
//$("#AAITId").attr("readonly", "readonly"); | |||
//$("#AAICode").attr("readonly", "readonly"); | |||
//$("#AAIName").attr("readonly", "readonly"); | |||
//$("#AAIUnit").attr("readonly", "readonly"); | |||
//$("#AAIHasDetail").attr("readonly", "readonly"); | |||
$.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfo/GetFormData?keyValue=' + values[0], function (data) { | |||
data = data.Ass_AssetsInfo; | |||
$('#AAITId').lrselectSet(data.ATId); | |||
$('#AAICode').val(data.ACode); | |||
$('#AAIName').val(data.AName); | |||
$('#AAIUnit').lrselectSet(data.AUnit); | |||
$('#AAIHasDetail').lrselectSet(data.HasDetail); | |||
$('#AAIEName').val(data.AEName); | |||
$('#AAIModel').val(data.AModel); | |||
$('#AAIManufacturer').val(data.AManufacturer); | |||
$('#AAISpecification').val(data.ASpecification); | |||
}); | |||
} | |||
}, | |||
unknowselect: function () { | |||
$("#AAOldCode").find('span').text(""); | |||
//$("#AAITId").removeAttr("readonly"); | |||
//$("#AAICode").removeAttr("readonly"); | |||
//$("#AAIName").removeAttr("readonly"); | |||
//$("#AAIUnit").removeAttr("readonly"); | |||
//$("#AAIHasDetail").removeAttr("readonly"); | |||
$('#AAITId').lrselectSet(""); | |||
$('#AAICode').val(""); | |||
$('#AAIName').val(""); | |||
$('#AAIUnit').lrselectSet(""); | |||
$('#AAIHasDetail').lrselectSet(""); | |||
$('#AAIEName').val(""); | |||
$('#AAIModel').val(""); | |||
$('#AAIManufacturer').val(""); | |||
$('#AAISpecification').val(""); | |||
}, | |||
isMultiple: false | |||
}); | |||
$('#AAISource').lrDataItemSelect({ code: 'zcly' }); | |||
$('#AAISupplierId').lrDataSourceSelect({ code: 'Ass_SupplierData', value: 'sid', text: 'sname' }); | |||
$('#AAIUnit').lrDataItemSelect({ code: 'sldw' }); | |||
//$('#AAIStorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' }); | |||
$('#AAIStorageId').lrselect({ | |||
type: 'tree', | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetTree', | |||
param: {}, | |||
select: function (val) { | |||
var storageId = ""; | |||
if (val) { | |||
storageId = val.value; | |||
} | |||
$('#AAIStoragePosition').lrselectRefresh({ | |||
url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetListForStorageId?storageId=' + storageId, | |||
text: "RCode", | |||
value: "RId" | |||
}); | |||
} | |||
}); | |||
//房间 | |||
$('#AAIStoragePosition').lrselect({ value: 'RId', text: 'RCode' }); | |||
$('#AAIHasDetail').lrDataItemSelect({ | |||
code: 'YesOrNoBit', select: function (item) { | |||
if (item != null && item != undefined) { | |||
if (item.id === true || item.id === "true") { | |||
$("#AAIStock").attr("checkexpession", "PositiveInteger"); | |||
} else { | |||
$("#AAIStock").attr("checkexpession", "PositiveFloatint"); | |||
} | |||
} | |||
} | |||
}); | |||
$('#AAIPhoto').lrUploader(); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
if (!!selectedRow) { | |||
$('#form').lrSetFormData(selectedRow); | |||
$("#AAOldCode").find('span').text(selectedRow.AAIName); | |||
} | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = $('body').lrGetFormData(); | |||
if (!!keyValue) { | |||
if (!!selectedRow) { | |||
postData.AAIId = selectedRow.AAIId; | |||
} | |||
} else { | |||
postData.AAIId = learun.newGuid(); | |||
} | |||
if (!!callBack) { | |||
callBack(postData); | |||
return true; | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -852,6 +852,7 @@ | |||
<Content Include="Areas\AssetManagementSystem\Views\AssScrap\Form.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\AssScrap\FormView.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\AssScrap\Index.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\Form.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\ViewForm.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AllocationItem\Form.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AllocationItem\Index.js" /> | |||
@@ -865,10 +866,12 @@ | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoApply\FormPurchase.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoApply\FormPurchaseJY.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoApply\FormView.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoApply\FormViewJYHC.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoApply\FormViewJY.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoApply\Index.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoApply\IndexJY.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoApply\IndexJYHC.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoItemApply\FormJYHC.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoItemApply\Form.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoItemApply\FormPurchase.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoItemApply\Index.js" /> | |||
@@ -6425,8 +6428,8 @@ | |||
<Content Include="Areas\PersonnelManagement\Views\ADR_AddApply\Form.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\Index.cshtml" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\Index.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\Form.cshtml" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\Form.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\FormItem.cshtml" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\FormItem.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\Form.cshtml" /> | |||
@@ -7339,6 +7342,9 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\PM_WorkerTechnology\StatisticIndex.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\FillinFrom\FormPeople.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\FillinFrom\FormIndex.cshtml" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoItemApply\FormJYHC.cshtml" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_AssetsInfoApply\FormViewJYHC.cshtml" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\Form.cshtml" /> | |||
<None Include="Areas\EducationalAdministration\Views\SchoolNews\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuEnroll\StuTuition.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuEnroll\IsHelpForm.cshtml" /> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.AssetManagementSystem; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-18 10:46 | |||
/// 描 述:资产验收 | |||
/// </summary> | |||
public class Ass_AcceptanceMainMap : EntityTypeConfiguration<Ass_AcceptanceMainEntity> | |||
{ | |||
public Ass_AcceptanceMainMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("ASS_ACCEPTANCEMAIN"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -63,6 +63,7 @@ | |||
<ItemGroup> | |||
<Compile Include="Ask\Ask_MainOfTeacherMap.cs" /> | |||
<Compile Include="Ask\Ask_TeacherMainMap.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_AcceptanceMainMap.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_InventoryItemApplyMap.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_PurchaseItemApplyMap.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_ScrapItemMap.cs" /> | |||
@@ -43,6 +43,29 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Ass_Acceptance表数据 | |||
/// </summary> | |||
/// <param name="mainId">主表Id</param> | |||
/// <returns></returns> | |||
public IEnumerable<Ass_AcceptanceEntity> GetAss_AcceptanceListByMainId(string mainId) | |||
{ | |||
try | |||
{ | |||
return ass_AcceptanceService.GetAss_AcceptanceListByMainId(mainId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Ass_Acceptance表实体数据 | |||
/// </summary> | |||
@@ -19,6 +19,12 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// </summary> | |||
[Column("ID")] | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// 编号 | |||
/// </summary> | |||
[Column("MAINID")] | |||
public string MainId { get; set; } | |||
/// <summary> | |||
/// 设备名称 | |||
/// </summary> | |||
@@ -22,6 +22,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<Ass_AcceptanceEntity> GetPageList(Pagination pagination, string queryJson); | |||
IEnumerable<Ass_AcceptanceEntity> GetAss_AcceptanceListByMainId(string mainId); | |||
/// <summary> | |||
/// 获取Ass_Acceptance表实体数据 | |||
/// </summary> | |||
@@ -58,7 +58,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
} | |||
if (!queryParam["DepartmentId"].IsEmpty()) | |||
{ | |||
dp.Add("DepartmentId",queryParam["DepartmentId"].ToString(), DbType.String); | |||
dp.Add("DepartmentId", queryParam["DepartmentId"].ToString(), DbType.String); | |||
strSql.Append(" AND t.DepartmentId = @DepartmentId "); | |||
} | |||
if (!queryParam["UserID"].IsEmpty()) | |||
@@ -71,7 +71,26 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
dp.Add("Place", "%" + queryParam["Place"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Place Like @Place "); | |||
} | |||
return this.BaseRepository().FindList<Ass_AcceptanceEntity>(strSql.ToString(),dp, pagination); | |||
return this.BaseRepository().FindList<Ass_AcceptanceEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<Ass_AcceptanceEntity> GetAss_AcceptanceListByMainId(string mainId) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindList<Ass_AcceptanceEntity>(x => x.MainId == mainId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -119,7 +138,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindEntity<Ass_AcceptanceEntity>(t=>t.ProcessId == processId); | |||
return this.BaseRepository().FindEntity<Ass_AcceptanceEntity>(t => t.ProcessId == processId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -146,7 +165,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
{ | |||
try | |||
{ | |||
this.BaseRepository().Delete<Ass_AcceptanceEntity>(t=>t.ID == keyValue); | |||
this.BaseRepository().Delete<Ass_AcceptanceEntity>(t => t.ID == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -201,7 +220,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
{ | |||
try | |||
{ | |||
BaseRepository().ExecuteBySql($"UPDATE dbo.Ass_Acceptance SET Status='{i}',ProcessId='{processId}' WHERE ID='{keyValue}'", null); | |||
BaseRepository().ExecuteBySql($"UPDATE dbo.Ass_AcceptanceMain SET Status='{i}',ProcessId='{processId}' WHERE Id='{keyValue}'", null); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -0,0 +1,186 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-18 10:46 | |||
/// 描 述:资产验收 | |||
/// </summary> | |||
public class Ass_AcceptanceMainBLL : Ass_AcceptanceMainIBLL | |||
{ | |||
private Ass_AcceptanceMainService ass_AcceptanceMainService = new Ass_AcceptanceMainService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Ass_AcceptanceMainEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return ass_AcceptanceMainService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Ass_Acceptance表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Ass_AcceptanceMainEntity GetAss_AcceptanceMainEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return ass_AcceptanceMainService.GetAss_AcceptanceMainEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取主表实体数据 | |||
/// </summary> | |||
/// <param name="processId">流程实例ID</param> | |||
/// <returns></returns> | |||
public Ass_AcceptanceMainEntity GetEntityByProcessId(string processId) | |||
{ | |||
try | |||
{ | |||
return ass_AcceptanceMainService.GetEntityByProcessId(processId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
ass_AcceptanceMainService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, Ass_AcceptanceMainEntity entity, List<Ass_AcceptanceEntity> ass_AcceptanceList) | |||
{ | |||
try | |||
{ | |||
ass_AcceptanceMainService.SaveEntity(keyValue, entity, ass_AcceptanceList); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public void ChangeStatusById(string keyValue, int i, string processId) | |||
{ | |||
try | |||
{ | |||
ass_AcceptanceMainService.ChangeStatusById(keyValue, i, processId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public void ChangeStatusByProcessId(string parameterProcessId, int p1) | |||
{ | |||
try | |||
{ | |||
ass_AcceptanceMainService.ChangeStatusByProcessId(parameterProcessId, p1); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,91 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-18 10:46 | |||
/// 描 述:资产验收 | |||
/// </summary> | |||
public class Ass_AcceptanceMainEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// 编号 | |||
/// </summary> | |||
[Column("Id")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// Code | |||
/// </summary> | |||
[Column("CODE")] | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// Name | |||
/// </summary> | |||
[Column("NAME")] | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// CreateTime | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
/// <summary> | |||
/// CreateUserId | |||
/// </summary> | |||
[Column("CREATEUSERID")] | |||
public string CreateUserId { get; set; } | |||
/// <summary> | |||
/// CreateDeptId | |||
/// </summary> | |||
[Column("CREATEDEPTID")] | |||
public String CreateDeptId { get; set; } | |||
/// <summary> | |||
/// 单价 | |||
/// </summary> | |||
[Column("TOTALPRICE")] | |||
public decimal? TotalPrice { get; set; } | |||
/// <summary> | |||
/// 备注 | |||
/// </summary> | |||
[Column("REMARK")] | |||
public string Remark { get; set; } | |||
/// <summary> | |||
/// 流程id | |||
/// </summary> | |||
[Column("PROCESSID")] | |||
public string ProcessId { get; set; } | |||
/// <summary> | |||
/// 审核状态 | |||
/// </summary> | |||
[Column("STATUS")] | |||
public int? Status { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.Id = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,57 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-18 10:46 | |||
/// 描 述:资产验收 | |||
/// </summary> | |||
public interface Ass_AcceptanceMainIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<Ass_AcceptanceMainEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取Ass_Acceptance表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
Ass_AcceptanceMainEntity GetAss_AcceptanceMainEntity(string keyValue); | |||
/// <summary> | |||
/// 获取主表实体数据 | |||
/// </summary> | |||
/// <param name="processId">流程实例ID</param> | |||
/// <returns></returns> | |||
Ass_AcceptanceMainEntity GetEntityByProcessId(string processId); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, Ass_AcceptanceMainEntity entity, List<Ass_AcceptanceEntity> ass_AcceptanceList); | |||
#endregion | |||
void ChangeStatusById(string keyValue, int i, string processId); | |||
void ChangeStatusByProcessId(string parameterProcessId, int p1); | |||
} | |||
} |
@@ -0,0 +1,223 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-18 10:46 | |||
/// 描 述:资产验收 | |||
/// </summary> | |||
public class Ass_AcceptanceMainService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Ass_AcceptanceMainEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.* | |||
"); | |||
strSql.Append(" FROM Ass_AcceptanceMain t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["Code"].IsEmpty()) | |||
{ | |||
dp.Add("Code", "%" + queryParam["Code"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Code Like @Code "); | |||
} | |||
if (!queryParam["CreateUserId"].IsEmpty()) | |||
{ | |||
dp.Add("CreateUserId", "%" + queryParam["CreateUserId"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.CreateUserId=@CreateUserId "); | |||
} | |||
return this.BaseRepository().FindList<Ass_AcceptanceMainEntity>(strSql.ToString(),dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Ass_Acceptance表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Ass_AcceptanceMainEntity GetAss_AcceptanceMainEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindEntity<Ass_AcceptanceMainEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取主表实体数据 | |||
/// </summary> | |||
/// <param name="processId">流程实例ID</param> | |||
/// <returns></returns> | |||
public Ass_AcceptanceMainEntity GetEntityByProcessId(string processId) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindEntity<Ass_AcceptanceMainEntity>(t=>t.ProcessId == processId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository().Delete<Ass_AcceptanceMainEntity>(t=>t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, Ass_AcceptanceMainEntity entity, List<Ass_AcceptanceEntity> ass_AcceptanceEntity) | |||
{ | |||
var db = this.BaseRepository().BeginTrans(); | |||
try | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
db.Update(entity); | |||
db.Delete<Ass_AcceptanceEntity>(t => t.MainId == keyValue); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
db.Insert(entity); | |||
} | |||
foreach (Ass_AcceptanceEntity item in ass_AcceptanceEntity) | |||
{ | |||
item.Create(); | |||
item.MainId = entity.Id; | |||
db.Insert(item); | |||
} | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
public void ChangeStatusById(string keyValue, int i, string processId) | |||
{ | |||
try | |||
{ | |||
BaseRepository().ExecuteBySql($"UPDATE dbo.Ass_Acceptance SET Status='{i}',ProcessId='{processId}' WHERE ID='{keyValue}'", null); | |||
} | |||
catch (Exception ex) | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
public void ChangeStatusByProcessId(string parameterProcessId, int p1) | |||
{ | |||
try | |||
{ | |||
if (p1 == 2) | |||
{ | |||
var entity = this.BaseRepository() | |||
.FindEntity<Ass_AcceptanceMainEntity>(a => a.ProcessId == parameterProcessId); | |||
if (null != entity) | |||
{ | |||
entity.Status = p1; | |||
} | |||
this.BaseRepository().Update(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
} |
@@ -402,6 +402,21 @@ on a.F_UserId=b.F_UserId where b.F_ObjectId in(" + string.Join(",", ppostid) + | |||
db.Rollback(); | |||
} | |||
} | |||
else if (status == 0) | |||
{ | |||
var db = BaseRepository().BeginTrans(); | |||
try | |||
{ | |||
var Sys_SendFile = db.FindEntity<Sys_SendFileEntity>(m => m.SProcessId == processId); | |||
Sys_SendFile.SendFlag = status; | |||
db.Update(Sys_SendFile); | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
} | |||
} | |||
} | |||
public void PushWeixin(List<UserEntity> needpostuserlist, string title) | |||
@@ -83,6 +83,10 @@ | |||
<Compile Include="AssetManagementSystem\AssScrap\AssScrapIBLL.cs" /> | |||
<Compile Include="AssetManagementSystem\AssScrap\AssScrapService.cs" /> | |||
<Compile Include="AssetManagementSystem\AssScrap\Ass_ScrapEntity.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_AcceptanceMain\Ass_AcceptanceMainBLL.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_AcceptanceMain\Ass_AcceptanceMainEntity.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_AcceptanceMain\Ass_AcceptanceMainIBLL.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_AcceptanceMain\Ass_AcceptanceMainService.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_InventoryItemApply\Ass_InventoryItemApplyBLL.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_InventoryItemApply\Ass_InventoryItemApplyEntity.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_InventoryItemApply\Ass_InventoryItemApplyIBLL.cs" /> | |||