@@ -5,6 +5,7 @@ using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
using System; | |||
using System.Linq; | |||
using Learun.Application.WorkFlow; | |||
namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
{ | |||
@@ -18,6 +19,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
public class Ass_AssetsOutApplyController : MvcControllerBase | |||
{ | |||
private Ass_AssetsOutApplyIBLL ass_AssetsOutApplyIBLL = new Ass_AssetsOutApplyBLL(); | |||
private NWFTaskIBLL nWFTaskIBLL = new NWFTaskBLL(); | |||
#region 视图功能 | |||
@@ -164,6 +166,18 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
/// <param name="processId"></param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetNWFTaskLogData(string processId) | |||
{ | |||
var TaskLogList = (List<NWFTaskLogEntity>)nWFTaskIBLL.GetLogList(processId); | |||
return Success(TaskLogList); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -6,6 +6,7 @@ | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var ProcessId = request('ProcessId'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
@@ -255,10 +256,11 @@ var bootstrap = function ($, learun) { | |||
//打印 | |||
$('#detailprint').on('click', function () { | |||
console.log(ProcessId); | |||
learun.layerForm({ | |||
id: 'print', | |||
title: '北京金隅科技学校固定资产验收单', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/Print?keyValue=' + keyValue, | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/Print?keyValue=' + keyValue + '&ProcessId=' + ProcessId, | |||
width: 1100, | |||
height: 800, | |||
btn: null | |||
@@ -274,12 +276,14 @@ var bootstrap = function ($, learun) { | |||
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 { | |||
@@ -299,6 +303,7 @@ var bootstrap = function ($, learun) { | |||
} else { | |||
if (id == 'Ass_AcceptanceMain' && data[id]) { | |||
keyValue = data[id].Id; | |||
ProcessId = data[id].ProcessId; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
@@ -79,11 +79,12 @@ var bootstrap = function ($, learun) { | |||
// 查看 | |||
$('#lr_view').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
var ProcessId = $('#gridtable').jfGridValue('ProcessId'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formAss_Acceptance', | |||
title: '查看', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/FormView?keyValue=' + keyValue, | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_Acceptance/FormView?keyValue=' + keyValue + '&ProcessId=' + ProcessId, | |||
width: 1000, | |||
height: 700, | |||
btn: null | |||
@@ -36,20 +36,23 @@ | |||
<table class="t_option" style="border: none"> | |||
<tr> | |||
<td> 部门资产管理员(签字):</td> | |||
<td></td> | |||
<td><span id="bmgl"></span></td> | |||
<td> 部门负责人(签字):</td> | |||
<td></td> | |||
<td> 财务负责人(签字):</td> | |||
<td></td> | |||
<td><span id="bmuser"></span></td> | |||
@*<td> 财务负责人(签字):</td> | |||
<td><span id="cwuser"></span></td>*@ | |||
</tr> | |||
<tr><td></td> </tr> | |||
<tr> | |||
<td> 设备管理员(签字):</td> | |||
<td></td> | |||
<td><span id="sbgl"></span></td> | |||
<td> 设备管理负责人(签字):</td> | |||
<td></td> | |||
<td><span id="sbgluser"></span></td> | |||
</tr> | |||
<tr> | |||
<td> 校领导审核(签字):</td> | |||
<td></td> | |||
<td><span id="xld"></span></td> | |||
</tr> | |||
</table> | |||
</div> | |||
@@ -65,6 +68,7 @@ | |||
$(function () { | |||
var tempdatra = ''; | |||
var TaskLogData = {}; | |||
if (top["layer_formAss_Acceptance"]) { | |||
tempdatra = top["layer_formAss_Acceptance"].tempdatra; | |||
@@ -79,6 +83,12 @@ | |||
} | |||
} | |||
var ProcessId = getQueryString('ProcessId'); | |||
if (ProcessId) { | |||
TaskLogData = top.learun.httpGet( | |||
top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/GetNWFTaskLogData?processId=' + ProcessId, ''); | |||
} | |||
if (tempdatra) { | |||
var html = ''; | |||
@@ -197,8 +207,82 @@ | |||
//$('.table tbody').empty().append(html); | |||
$('#t_tbody').html(html); | |||
if (TaskLogData && TaskLogData.data) { | |||
var bmgl = "", bmuser = '', cwuser = '', sbgl = '', sbgluser = '', xld = ''; | |||
for (var i = 0; i < TaskLogData.data.length; i++) { | |||
var item = TaskLogData.data[i]; | |||
if (item && item.F_NodeId) { | |||
//部门资产管理员 | |||
if (item.F_NodeId == '7d6318b6-b5aa-a6c0-0d1d-ee47fd9aaf18') { | |||
bmgl = getUser(item.F_CreateUserId, item.F_CreateUserName); | |||
} | |||
//部门负责人1 | |||
if (item.F_NodeId == '400c0918-cd01-45b7-7d1b-94211516c3cd') { | |||
bmuser = getUser(item.F_CreateUserId, item.F_CreateUserName); | |||
} | |||
////财务负责人 | |||
//if (item.F_NodeId == '1627782c-9244-f5ff-0da8-c36d348f032a') { | |||
// cwuser = getUser(item.F_CreateUserId, item.F_CreateUserName); | |||
//} | |||
//设备管理员2 | |||
if (item.F_NodeId == 'a2b32308-ce97-219d-01e8-3088946faf74') { | |||
sbgl = getUser(item.F_CreateUserId, item.F_CreateUserName); | |||
} | |||
//设备管理负责人3 | |||
if (item.F_NodeId == '35e03210-12b3-10a5-de59-0daeeaedd7d0') { | |||
sbgluser = getUser(item.F_CreateUserId, item.F_CreateUserName); | |||
} | |||
//校领导审核4 | |||
if (item.F_NodeId == '199c2bd4-46d7-2142-2429-a9bb429181bf') { | |||
xld = getUser(item.F_CreateUserId, item.F_CreateUserName); | |||
} | |||
} | |||
} | |||
$('#bmgl').html(bmgl); | |||
$('#bmuser').html(bmuser); | |||
$('#cwuser').html(cwuser); | |||
$('#sbgl').html(sbgl); | |||
$('#sbgluser').html(sbgluser); | |||
$('#xld').html(xld); | |||
} | |||
} | |||
}); | |||
function getUser(uid, name) { | |||
var deptid = ''; | |||
var deptname = ''; | |||
var result = ''; | |||
top.learun.clientdata.getAsync('custmerData', | |||
{ | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser', | |||
key: uid, | |||
keyId: 'f_userid', | |||
callback: function (_data) { | |||
deptid = _data['f_departmentid']; | |||
} | |||
}); | |||
top.learun.clientdata.getAsync('custmerData', | |||
{ | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: deptid, | |||
keyId: 'id', | |||
callback: function (_data) { | |||
if (_data['name'] && _data['name'] != 'undefined') { | |||
deptname = _data['name']; | |||
} | |||
} | |||
}); | |||
if (deptname && deptname != 'undefined') { | |||
return '【' + deptname + '】' + name; | |||
} else { | |||
return name; | |||
} | |||
} | |||
function getQueryString(name) { | |||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", 'i'); // 匹配目标参数 | |||
var result = window.location.search.substr(1).match(reg); // 对querystring匹配目标参数 | |||
@@ -6,6 +6,7 @@ | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var AOProcessId = request('AOProcessId'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
@@ -118,7 +119,7 @@ var bootstrap = function ($, learun) { | |||
learun.layerForm({ | |||
id: 'print', | |||
title: '固定资产调拨单', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/Print', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/Print?keyValue=' + keyValue + '&AOProcessId=' + AOProcessId, | |||
width: 1100, | |||
height: 800, | |||
btn: null | |||
@@ -107,11 +107,12 @@ var bootstrap = function ($, learun) { | |||
// 查看申请 | |||
$('#lr_view').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('AOId'); | |||
var AOProcessId = $('#gridtable').jfGridValue('AOProcessId'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formAss_AssetsOutApply', | |||
title: '查看调拨申请', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/AssetsFormView?keyValue=' + keyValue, | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/AssetsFormView?keyValue=' + keyValue + '&AOProcessId=' + AOProcessId, | |||
width: 1000, | |||
height: 600, | |||
btn: null | |||
@@ -7,14 +7,14 @@ | |||
<div class="lr-form-item-title">调拨单流水号</div> | |||
<input id="AOCode" type="text" class="form-control" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||
<div class="lr-form-item-title">调拨总价</div> | |||
<input id="AOPrice" type="text" class="form-control" readonly="readonly" /> | |||
</div> | |||
@*<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||
<div class="lr-form-item-title">出库原因</div> | |||
<div id="AOReasonType" readonly="readonly"></div> | |||
</div>*@ | |||
@* <div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||
<div class="lr-form-item-title">调拨总价</div> | |||
<input id="AOPrice" type="text" class="form-control" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||
<div class="lr-form-item-title">出库原因</div> | |||
<div id="AOReasonType" readonly="readonly"></div> | |||
</div>*@ | |||
@*<div class="col-xs-6 lr-form-item" data-table="Ass_AssetsOutApply"> | |||
<div class="lr-form-item-title">部门</div> | |||
<div id="AODepartment"></div> | |||
@@ -6,6 +6,7 @@ | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var AOProcessId = request('AOProcessId'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
@@ -32,7 +33,7 @@ var bootstrap = function ($, learun) { | |||
}, | |||
bind: function () { | |||
$('#AOReasonType').lrDataItemSelect({ code: 'ReasonType' }); | |||
$('#AOCreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | |||
// $('#AOCreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | |||
$('#AOCreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||
$('#AODepartment').lrselect({ | |||
type: 'tree', | |||
@@ -40,14 +41,14 @@ var bootstrap = function ($, learun) { | |||
url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', | |||
param: {} | |||
}); | |||
$('#AOCreateUserId').val(learun.clientdata.get(['userinfo']).realName); | |||
//$('#AOCreateUserId').val(learun.clientdata.get(['userinfo']).realName); | |||
//打印 | |||
$('#detailprint').on('click', function () { | |||
learun.layerForm({ | |||
id: 'print', | |||
title: '固定资产调拨单', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/Print?keyValue=' + keyValue, | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/Print?keyValue=' + keyValue + '&AOProcessId=' + AOProcessId, | |||
width: 1100, | |||
height: 800, | |||
btn: null | |||
@@ -277,6 +278,7 @@ var bootstrap = function ($, learun) { | |||
else { | |||
if (id == 'Ass_AssetsOutApply') { | |||
keyValue = data[id].AOId; | |||
AOProcessId = data[id].AOProcessId; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
@@ -107,11 +107,12 @@ var bootstrap = function ($, learun) { | |||
// 查看申请 | |||
$('#lr_view').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('AOId'); | |||
var AOProcessId = $('#gridtable').jfGridValue('AOProcessId'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formAss_AssetsOutApply', | |||
title: '查看调拨申请', | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/FormView?keyValue=' + keyValue, | |||
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/FormView?keyValue=' + keyValue + '&AOProcessId=' + AOProcessId, | |||
width: 1000, | |||
height: 700, | |||
btn: null | |||
@@ -35,22 +35,22 @@ | |||
<table class="t_option" style="border: none"> | |||
<tr> | |||
<td> 调出部门设备管理人(签字):</td> | |||
<td></td> | |||
<td><span id="dcbmsb"></span></td> | |||
<td> 调入部门设备管理人(签字):</td> | |||
<td></td> | |||
<td><span id="drbmsb"></span></td> | |||
</tr> | |||
<tr><td></td> </tr> | |||
<tr> | |||
<td> 调出部门负责人(签字):</td> | |||
<td></td> | |||
<td><span id="dcbm"></span></td> | |||
<td> 调入部门负责人(签字):</td> | |||
<td></td> | |||
<td><span id="drbm"></span></td> | |||
</tr> | |||
<tr> | |||
<td> 设备部门负责人(签字):</td> | |||
<td></td> | |||
<td><span id="sbbm"></span></td> | |||
<td> 财务部门负责人(签字):</td> | |||
<td></td> | |||
<td><span id="cwbm"></span></td> | |||
</tr> | |||
</table> | |||
</div> | |||
@@ -66,6 +66,7 @@ | |||
$(function () { | |||
var tempdatra = ''; | |||
var TaskLogData = {}; | |||
if (top["layer_formAss_AssetsOutApply"]) { | |||
tempdatra = top["layer_formAss_AssetsOutApply"].tempdatra; | |||
} | |||
@@ -79,6 +80,13 @@ | |||
} | |||
} | |||
var AOProcessId = getQueryString('AOProcessId'); | |||
if (AOProcessId) { | |||
TaskLogData = top.learun.httpGet( | |||
top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutApply/GetNWFTaskLogData?processId=' + AOProcessId, ''); | |||
} | |||
//console.log('tempdatra', tempdatra); | |||
if (tempdatra) { | |||
var html = ''; | |||
@@ -198,23 +206,83 @@ | |||
html += '</tr>'; | |||
} | |||
//html += '<tr>'; | |||
//html += '<td></td>'; | |||
//html += '<td>合计</td>'; | |||
//html += '<td></td>'; | |||
//html += '<td></td>'; | |||
//html += '<td>' + num + '</td>'; | |||
//html += '<td></td>'; | |||
//html += '<td></td>'; | |||
//html += '<td></td>'; | |||
//html += '<td></td>'; | |||
//html += '<td></td>'; | |||
//html += '</tr>'; | |||
//$('.table tbody').empty().append(html); | |||
$('#t_tbody').html(html); | |||
if (TaskLogData && TaskLogData.data) { | |||
var dcbmsb = "", drbmsb = '', dcbm = '', drbm = '', sbbm = '', cwbm = ''; | |||
for (var i = 0; i < TaskLogData.data.length; i++) { | |||
var item = TaskLogData.data[i]; | |||
if (item && item.F_NodeId) { | |||
//设备部门负责人--申请人 | |||
if (item.F_NodeId == 'c275693f-cac9-03c6-1798-290e490f4803') { | |||
sbbm = getUser(item.F_CreateUserId, item.F_CreateUserName); | |||
} | |||
//主任--调出部门负责人 | |||
if (item.F_NodeId == '49887601-2ffd-0201-b994-3cbb3370c8f1') { | |||
dcbm = getUser(item.F_CreateUserId, item.F_CreateUserName); | |||
} | |||
//主任--调出部门设备管理人 | |||
if (item.F_NodeId == '1627782c-9244-f5ff-0da8-c36d348f032a') { | |||
dcbmsb = getUser(item.F_CreateUserId, item.F_CreateUserName); | |||
} | |||
//调入部门设备管理人 | |||
if (item.F_NodeId == '6b600403-29b3-c620-2ce1-ec6863f0c084') { | |||
drbmsb = getUser(item.F_CreateUserId, item.F_CreateUserName); | |||
} | |||
//调入部门负责人 | |||
if (item.F_NodeId == 'f20c9630-38d0-95f9-6431-c3094bcf5af5') { | |||
drbm = getUser(item.F_CreateUserId, item.F_CreateUserName); | |||
} | |||
//财务部门负责人 | |||
if (item.F_NodeId == 'd40789b6-4ec8-cef6-3689-17bc40bccb0a') { | |||
cwbm = getUser(item.F_CreateUserId, item.F_CreateUserName); | |||
} | |||
} | |||
} | |||
$('#sbbm').html(sbbm); | |||
$('#dcbm').html(dcbm); | |||
$('#dcbmsb').html(dcbmsb); | |||
$('#drbmsb').html(drbmsb); | |||
$('#drbm').html(drbm); | |||
$('#cwbm').html(cwbm); | |||
} | |||
} | |||
}); | |||
function getUser(uid, name) { | |||
var deptid = ''; | |||
var deptname = ''; | |||
var result = ''; | |||
top.learun.clientdata.getAsync('custmerData', | |||
{ | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser', | |||
key: uid, | |||
keyId: 'f_userid', | |||
callback: function (_data) { | |||
deptid = _data['f_departmentid']; | |||
} | |||
}); | |||
top.learun.clientdata.getAsync('custmerData', | |||
{ | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: deptid, | |||
keyId: 'id', | |||
callback: function (_data) { | |||
if (_data['name'] && _data['name'] != 'undefined') { | |||
deptname = _data['name']; | |||
} | |||
} | |||
}); | |||
if (deptname && deptname != 'undefined') { | |||
return '【' + deptname + '】' + name; | |||
} else { | |||
return name; | |||
} | |||
} | |||
function getQueryString(name) { | |||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", 'i'); // 匹配目标参数 | |||
var result = window.location.search.substr(1).match(reg); // 对querystring匹配目标参数 | |||
@@ -224,6 +292,7 @@ | |||
return null; | |||
} | |||
} | |||
</script> | |||
</body> | |||
</html> |