@@ -7,14 +7,26 @@ | |||
<div class="lr-form-item-title">主题<font face="宋体">*</font></div> | |||
<input id="Title" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
@*<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="ReceiverIddiv"> | |||
<div class="lr-form-item-title">已接收人<font face="宋体">*</font></div> | |||
<div id="ReceiverId" ></div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" > | |||
<div class="lr-form-item-title">接收对象<font face="宋体">*</font></div> | |||
<div id="SendType" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="ReceiverIddiv"> | |||
<div class="lr-form-item-title">未接收人<font face="宋体">*</font></div> | |||
<div id="NoReceiver" ></div> | |||
</div>*@ | |||
<div class="lr-form-item-title">接收人<font face="宋体">*</font></div> | |||
<div id="ReceiverUserId" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="DeptIddiv"> | |||
<div class="lr-form-item-title">接收部门<font face="宋体">*</font></div> | |||
<div id="DeptId" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="PostIddiv"> | |||
<div class="lr-form-item-title">接收岗位<font face="宋体">*</font></div> | |||
<div id="PostId" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="CompanyIddiv"> | |||
<div class="lr-form-item-title">接收校区<font face="宋体">*</font></div> | |||
<div id="CompanyId" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" > | |||
<div class="lr-form-item-title">文件</div> | |||
<div id="Url" ></div> | |||
@@ -24,4 +36,4 @@ | |||
<div id="Contents" style="height:300px;"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Sys_SendFile/Form.js") | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Sys_SendFile/Form.js") |
@@ -26,8 +26,70 @@ var bootstrap = function ($, learun) { | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
//$('#ReceiverId').lrUserSelect({ type: '1' }); | |||
//$('#NoReceiver').lrUserSelect({ type: '1' }); | |||
$('#CompanyId').lrCompanySelect({ type: 'multiple' }); | |||
$('#DeptId').lrDepartmentSelect({ type: 'treemultiple' }); | |||
$('#PostId').lrPostSelect({ type: 'treemultiple' }); | |||
$('#ReceiverUserId').lrUserSelect({ type: '1' }); | |||
$('#SendType').lrDataItemSelect({ | |||
code: 'FileSendType', select: function (item) { | |||
if (item != null && item != undefined) { | |||
if (item.id === 1 || item.id === "1") { | |||
$("#CompanyIddiv").show(); | |||
$("#CompanyId").attr("isvalid", "yes"); | |||
$("#CompanyId").attr("checkexpession", "NotNull"); | |||
$("#DeptIddiv").hide(); | |||
$("#DeptId").removeAttr("isvalid"); | |||
$("#DeptId").removeAttr("NotNull"); | |||
$("#ReceiverIddiv").hide(); | |||
$("#ReceiverUserId").removeAttr("isvalid"); | |||
$("#ReceiverUserId").removeAttr("NotNull"); | |||
$("#PostIddiv").hide(); | |||
$("#PostId").removeAttr("isvalid"); | |||
$("#PostId").removeAttr("NotNull"); | |||
} else if (item.id === 2 || item.id === "2") { | |||
$("#CompanyIddiv").hide(); | |||
$("#CompanyId").removeAttr("isvalid"); | |||
$("#CompanyId").removeAttr("NotNull"); | |||
$("#DeptIddiv").show(); | |||
$("#DeptId").attr("isvalid", "yes"); | |||
$("#DeptId").attr("checkexpession", "NotNull"); | |||
$("#ReceiverIddiv").hide(); | |||
$("#ReceiverUserId").removeAttr("isvalid"); | |||
$("#ReceiverUserId").removeAttr("NotNull"); | |||
$("#PostIddiv").hide(); | |||
$("#PostId").removeAttr("isvalid"); | |||
$("#PostId").removeAttr("NotNull"); | |||
} else if (item.id === 3 || item.id === "3") { | |||
$("#CompanyIddiv").hide(); | |||
$("#CompanyId").removeAttr("isvalid"); | |||
$("#CompanyId").removeAttr("NotNull"); | |||
$("#DeptIddiv").hide(); | |||
$("#DeptId").removeAttr("isvalid"); | |||
$("#DeptId").removeAttr("NotNull"); | |||
$("#ReceiverIddiv").hide(); | |||
$("#ReceiverUserId").removeAttr("isvalid"); | |||
$("#ReceiverUserId").removeAttr("NotNull"); | |||
$("#PostIddiv").show(); | |||
$("#PostId").attr("isvalid", "yes"); | |||
$("#PostId").attr("checkexpession", "NotNull"); | |||
} else { | |||
$("#CompanyIddiv").hide(); | |||
$("#CompanyId").removeAttr("isvalid"); | |||
$("#CompanyId").removeAttr("NotNull"); | |||
$("#DeptIddiv").hide(); | |||
$("#DeptId").removeAttr("isvalid"); | |||
$("#DeptId").removeAttr("NotNull"); | |||
$("#ReceiverIddiv").show(); | |||
$("#ReceiverUserId").attr("isvalid", "yes"); | |||
$("#ReceiverUserId").attr("checkexpession", "NotNull"); | |||
$("#PostIddiv").hide(); | |||
$("#PostId").removeAttr("isvalid"); | |||
$("#PostId").removeAttr("NotNull"); | |||
} | |||
} | |||
} | |||
}); | |||
$('#SendType').lrselectSet("1"); | |||
$('#Url').lrUploader(); | |||
var ContentsUE = UE.getEditor('Contents'); | |||
$('#Contents')[0].ue = ContentsUE; | |||
@@ -41,6 +103,63 @@ var bootstrap = function ($, learun) { | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
if (data[id].SendType === 1 || data[id].SendType == "1") { | |||
$("#CompanyIddiv").show(); | |||
$("#CompanyId").attr("isvalid", "yes"); | |||
$("#CompanyId").attr("checkexpession", "NotNull"); | |||
$("#DeptIddiv").hide(); | |||
$("#DeptId").removeAttr("isvalid"); | |||
$("#DeptId").removeAttr("NotNull"); | |||
$("#ReceiverIddiv").hide(); | |||
$("#ReceiverUserId").removeAttr("isvalid"); | |||
$("#ReceiverUserId").removeAttr("NotNull"); | |||
$("#PostIddiv").hide(); | |||
$("#PostId").removeAttr("isvalid"); | |||
$("#PostId").removeAttr("NotNull"); | |||
$("#CompanyId").lrselectSet(data[id].ReceiverId); | |||
} else if (data[id].SendType === 2 || data[id].SendType == "2") { | |||
$("#CompanyIddiv").hide(); | |||
$("#CompanyId").removeAttr("isvalid"); | |||
$("#CompanyId").removeAttr("NotNull"); | |||
$("#DeptIddiv").show(); | |||
$("#DeptId").attr("isvalid", "yes"); | |||
$("#DeptId").attr("checkexpession", "NotNull"); | |||
$("#ReceiverIddiv").hide(); | |||
$("#ReceiverUserId").removeAttr("isvalid"); | |||
$("#ReceiverUserId").removeAttr("NotNull"); | |||
$("#PostIddiv").hide(); | |||
$("#PostId").removeAttr("isvalid"); | |||
$("#PostId").removeAttr("NotNull"); | |||
$("#DeptId").lrselectSet(data[id].ReceiverId); | |||
} else if (data[id].SendType === 3 || data[id].SendType === "3") { | |||
$("#CompanyIddiv").hide(); | |||
$("#CompanyId").removeAttr("isvalid"); | |||
$("#CompanyId").removeAttr("NotNull"); | |||
$("#DeptIddiv").hide(); | |||
$("#DeptId").removeAttr("isvalid"); | |||
$("#DeptId").removeAttr("NotNull"); | |||
$("#ReceiverIddiv").hide(); | |||
$("#ReceiverUserId").removeAttr("isvalid"); | |||
$("#ReceiverUserId").removeAttr("NotNull"); | |||
$("#PostIddiv").show(); | |||
$("#PostId").attr("isvalid", "yes"); | |||
$("#PostId").attr("checkexpession", "NotNull"); | |||
$("#PostId").lrselectSet(data[id].ReceiverId); | |||
} else { | |||
$("#CompanyIddiv").hide(); | |||
$("#CompanyId").removeAttr("isvalid"); | |||
$("#CompanyId").removeAttr("NotNull"); | |||
$("#DeptIddiv").hide(); | |||
$("#DeptId").removeAttr("isvalid"); | |||
$("#DeptId").removeAttr("NotNull"); | |||
$("#ReceiverIddiv").show(); | |||
$("#ReceiverUserId").attr("isvalid", "yes"); | |||
$("#ReceiverUserId").attr("checkexpession", "NotNull"); | |||
$("#PostIddiv").hide(); | |||
$("#PostId").removeAttr("isvalid"); | |||
$("#PostId").removeAttr("NotNull"); | |||
$("#ReceiverUserId").lrformselectSet(data[id].ReceiverId); | |||
} | |||
} | |||
} | |||
@@ -61,6 +180,63 @@ var bootstrap = function ($, learun) { | |||
keyValue = data[id].SFileId; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
if (data[id].SendType === 1 || data[id].SendType == "1") { | |||
$("#CompanyIddiv").show(); | |||
$("#CompanyId").attr("isvalid", "yes"); | |||
$("#CompanyId").attr("checkexpession", "NotNull"); | |||
$("#DeptIddiv").hide(); | |||
$("#DeptId").removeAttr("isvalid"); | |||
$("#DeptId").removeAttr("NotNull"); | |||
$("#ReceiverIddiv").hide(); | |||
$("#ReceiverUserId").removeAttr("isvalid"); | |||
$("#ReceiverUserId").removeAttr("NotNull"); | |||
$("#PostIddiv").hide(); | |||
$("#PostId").removeAttr("isvalid"); | |||
$("#PostId").removeAttr("NotNull"); | |||
$("#CompanyId").lrselectSet(data[id].ReceiverId); | |||
} else if (data[id].SendType === 2 || data[id].SendType == "2") { | |||
$("#CompanyIddiv").hide(); | |||
$("#CompanyId").removeAttr("isvalid"); | |||
$("#CompanyId").removeAttr("NotNull"); | |||
$("#DeptIddiv").show(); | |||
$("#DeptId").attr("isvalid", "yes"); | |||
$("#DeptId").attr("checkexpession", "NotNull"); | |||
$("#ReceiverIddiv").hide(); | |||
$("#ReceiverUserId").removeAttr("isvalid"); | |||
$("#ReceiverUserId").removeAttr("NotNull"); | |||
$("#PostIddiv").hide(); | |||
$("#PostId").removeAttr("isvalid"); | |||
$("#PostId").removeAttr("NotNull"); | |||
$("#DeptId").lrselectSet(data[id].ReceiverId); | |||
} else if (data[id].SendType === 3 || data[id].SendType === "3") { | |||
$("#CompanyIddiv").hide(); | |||
$("#CompanyId").removeAttr("isvalid"); | |||
$("#CompanyId").removeAttr("NotNull"); | |||
$("#DeptIddiv").hide(); | |||
$("#DeptId").removeAttr("isvalid"); | |||
$("#DeptId").removeAttr("NotNull"); | |||
$("#ReceiverIddiv").hide(); | |||
$("#ReceiverUserId").removeAttr("isvalid"); | |||
$("#ReceiverUserId").removeAttr("NotNull"); | |||
$("#PostIddiv").show(); | |||
$("#PostId").attr("isvalid", "yes"); | |||
$("#PostId").attr("checkexpession", "NotNull"); | |||
$("#PostId").lrselectSet(data[id].ReceiverId); | |||
} else { | |||
$("#CompanyIddiv").hide(); | |||
$("#CompanyId").removeAttr("isvalid"); | |||
$("#CompanyId").removeAttr("NotNull"); | |||
$("#DeptIddiv").hide(); | |||
$("#DeptId").removeAttr("isvalid"); | |||
$("#DeptId").removeAttr("NotNull"); | |||
$("#ReceiverIddiv").show(); | |||
$("#ReceiverUserId").attr("isvalid", "yes"); | |||
$("#ReceiverUserId").attr("checkexpession", "NotNull"); | |||
$("#PostIddiv").hide(); | |||
$("#PostId").removeAttr("isvalid"); | |||
$("#PostId").removeAttr("NotNull"); | |||
$("#ReceiverUserId").lrformselectSet(data[id].ReceiverId); | |||
} | |||
} | |||
} | |||
}); | |||
@@ -76,6 +252,20 @@ var bootstrap = function ($, learun) { | |||
// 保存数据 | |||
save = function (processId, callBack, i) { | |||
var formData = $('body').lrGetFormData(); | |||
var sendtype = $('#SendType').lrselectGet(); | |||
if (sendtype == "1") { | |||
formData.ReceiverId = $("#CompanyId").lrselectGet(); | |||
formData.Receiver = $("#CompanyId").find(".lr-select-placeholder").text(); | |||
} else if (sendtype == "2") { | |||
formData.ReceiverId = $("#DeptId").lrselectGet(); | |||
formData.Receiver = $("#DeptId").find(".lr-select-placeholder").text(); | |||
} else if (sendtype == "3") { | |||
formData.ReceiverId = $("#PostId").lrselectGet(); | |||
formData.Receiver = $("#PostId").find(".lr-select-placeholder").text(); | |||
} else { | |||
formData.ReceiverId = $("#ReceiverUserId").lrformselectGet(); | |||
formData.Receiver = $("#ReceiverUserId").find("span").text(); | |||
} | |||
if (!!processId) { | |||
formData.SProcessId = processId; | |||
} | |||
@@ -3,17 +3,25 @@ | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile"> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" > | |||
<div class="lr-form-item-title">主题<font face="宋体">*</font></div> | |||
<input id="Title" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
<input id="Title" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile"> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" > | |||
<div class="lr-form-item-title">接收对象<font face="宋体">*</font></div> | |||
<div id="SendType" isvalid="yes" checkexpession="NotNull" readonly="readonly" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="ReceiverIddiv"> | |||
<div class="lr-form-item-title">接收人<font face="宋体">*</font></div> | |||
<input id="Receiver" type="text" class="form-control" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" > | |||
<div class="lr-form-item-title">文件</div> | |||
<div id="Url" readonly="readonly" style="padding-right: 60px;"></div> | |||
<div id="Url" readonly="readonly" style="padding-right: 60px;"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile"> | |||
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" > | |||
<div class="lr-form-item-title">正文</div> | |||
<div id="Contents" style="height:300px; margin-top: 6px;"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Sys_SendFile/FormView.js") | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Sys_SendFile/FormView.js") |
@@ -27,6 +27,9 @@ var bootstrap = function ($, learun) { | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#SendType').lrDataItemSelect({ | |||
code: 'FileSendType' | |||
}); | |||
$('#Url').lrUploader(); | |||
var ContentsUE = UE.getEditor('Contents'); | |||
$('#Contents')[0].ue = ContentsUE; | |||
@@ -78,21 +81,13 @@ var bootstrap = function ($, learun) { | |||
}; | |||
// 保存数据 | |||
save = function (processId, callBack, i) { | |||
var formData = $('body').lrGetFormData(); | |||
var postData = { | |||
strEntity: JSON.stringify(formData) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Sys_SendFile/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, i); | |||
} | |||
}); | |||
var formData = {}; | |||
var res = {}; | |||
res.code = 200; | |||
if (!!processId) { | |||
formData.SProcessId = processId; | |||
} | |||
callBack(res, i); | |||
}; | |||
page.init(); | |||
} |
@@ -29,10 +29,8 @@ | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i> 提交</a> | |||
<a id="lr_view" class="btn btn-default"><i class="fa fa-search-minus"></i> 查看</a> | |||
<a id="lr_IssueSpecifyReceiver" class="btn btn-default"><i class="fa fa-envelope"></i> 下发审批指定接收人</a> | |||
<a id="lr_OverIssue" class="btn btn-default"><i class="fa fa-minus-square"></i> 结束下发</a> | |||
<a id="lr_read" class="btn btn-default"><i class="fa fa-calendar-minus-o"></i> 查阅情况</a> | |||
<a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 查看</a> | |||
<a id="lr_read" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 查阅情况</a> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -138,51 +138,6 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}); | |||
// 下发审批指定接收人 | |||
$('#lr_IssueSpecifyReceiver').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('SFileId'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '下发审批指定接收人', | |||
url: top.$.rootUrl + '/EducationalAdministration/Sys_SendFile/IssueForm?keyValue=' + keyValue, | |||
width: 800, | |||
height: 200, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
} | |||
return res; | |||
} | |||
}); | |||
} | |||
}); | |||
// 结束 | |||
$('#lr_OverIssue').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('SFileId'); | |||
if (learun.checkrow(keyValue)) { | |||
var SendFlag = $('#gridtable').jfGridValue('SendFlag'); | |||
if (SendFlag !== 2) { | |||
learun.alert.warning("当前公文未审批通过,请耐心等待审批!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否结束下发!', function (res) { | |||
if (res) { | |||
processId = learun.newGuid(); | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/Sys_SendFile/OverIssue', { keyValue: keyValue, }, function (res) { | |||
refreshGirdData(res, {}); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
@@ -190,21 +145,34 @@ var bootstrap = function ($, learun) { | |||
url: top.$.rootUrl + '/EducationalAdministration/Sys_SendFile/GetPageList', | |||
headData: [ | |||
{ label: "主题", name: "Title", width: 300, align: "left" }, | |||
{ label: "已接收", name: "Receiver", width: 300, align: "left" }, | |||
{ label: "审批意见", name: "SpecifyReceiver", width: 300, align: "left" }, | |||
{ label: "下发人", name: "Sender", width: 100, align: "left" }, | |||
{ label: "下发时间", name: "SendTime", width: 150, align: "left" }, | |||
{ | |||
label: "接收对象", name: "SendType", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'FileSendType', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "接收人", name: "Receiver", width: 300, align: "left" | |||
}, | |||
{ | |||
label: "下发人", name: "Sender", width: 100, align: "left" | |||
}, | |||
{ | |||
label: "下发时间", name: "SendTime", width: 150, align: "left" | |||
}, | |||
{ | |||
label: "状态", name: "SendFlag", 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-info\">审批通过</span>'; | |||
} else if (cellvalue === 3) { | |||
return '<span class=\"label label-danger\" >审批失败</span>'; | |||
} else if (cellvalue === 4) { | |||
return '<span class=\"label label-success\" >下发完毕</span>'; | |||
return '<span class=\"label label-success\">已下发</span>'; | |||
} else { | |||
return '<span class=\"label label-default\" >草稿</span>'; | |||
} | |||
@@ -17,7 +17,6 @@ | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
<a id="lr_Issue" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 下发</a> | |||
</div> | |||
</div> | |||
@@ -26,4 +25,4 @@ | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Sys_SendFile/ReadList.js") | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Sys_SendFile/ReadList.js") |
@@ -24,40 +24,6 @@ var bootstrap = function ($, learun) { | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
$('#lr_Issue').on('click', | |||
function () { | |||
var keyValue = $('#gridtable').jfGridValue('SFileId'); | |||
var rFileId = $('#gridtable').jfGridValue('RFileId'); | |||
var specifyReceiver = $('#gridtable').jfGridValue('SpecifyReceiver'); | |||
if (learun.checkrow(rFileId)) { | |||
var SendStatus = $('#gridtable').jfGridValue('SendStatus'); | |||
if (SendStatus) { | |||
learun.alert.warning("已下发!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'formIssue', | |||
title: '下发', | |||
url: top.$.rootUrl + '/EducationalAdministration/Sys_SendFile/IssueForm?keyValue=' + keyValue + '&rFileId=' + rFileId + '&specifyReceiver=' + specifyReceiver, | |||
width: 500, | |||
height: 500, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
} | |||
return res; | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
@@ -70,30 +36,6 @@ var bootstrap = function ($, learun) { | |||
{ | |||
label: "查阅时间", name: "ReadTime", width: 150, align: "left" | |||
}, | |||
{ | |||
label: "指定接收人", name: "SpecifyReceiver", width: 150, align: "left", formatterAsync: | |||
function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('user', | |||
{ | |||
key: value, | |||
callback: function (_data) { | |||
if (_data.length > 0) { | |||
var text = ''; | |||
$.each(_data, | |||
function (i, item) { | |||
if (item) { | |||
text += item.name + ','; | |||
} | |||
}); | |||
text = text.substring(0, text.lastIndexOf(',')); | |||
callback(text); | |||
} else { | |||
callback(_data.name); | |||
} | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "状态", name: "ReadFlag", width: 100, align: "left", | |||
formatter: function (cellvalue, row) { | |||
@@ -103,16 +45,6 @@ var bootstrap = function ($, learun) { | |||
return '<span class=\"label label-warning\">未读</span>'; | |||
} | |||
} | |||
}, | |||
{ | |||
label: "下发状态", name: "SendStatus", width: 100, align: "left", | |||
formatter: function (cellvalue, row) { | |||
if (cellvalue === true) { | |||
return '<span class=\"label label-success\">已下发</span>'; | |||
} else { | |||
return '<span class=\"label label-warning\">未下发</span>'; | |||
} | |||
} | |||
} | |||
], | |||
mainId: 'RFileId', | |||
@@ -125,7 +57,6 @@ var bootstrap = function ($, learun) { | |||
search: function (param) { | |||
param = param || {}; | |||
param.SFileId = keyValue; | |||
param.STypeId = 1; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
@@ -27,7 +27,6 @@ | |||
被委托人:<span>@ViewBag.UserName</span>(身份证号码:<span style="width: 237px;">@ViewBag.IDCard</span>) | |||
</div> | |||
<div class="entrTxt"> | |||
(签字) | |||
</div> | |||
<div class="entrTxt"> | |||
委托人:<span>关亮</span>(身份证号码:<span style="width: 237px;">110111196506121035</span>) | |||
@@ -57,8 +56,8 @@ | |||
</html> | |||
<script> | |||
//盖章图片 | |||
var stampUrl = '/LR_NewWorkFlow/StampInfo/GetImg?keyValue=00324dc8-e0db-457f-b078-ebd1aac46463';// + @ViewBag.StampImg; | |||
var signUrl = '/LR_SystemModule/Img/GetImg?keyValue=90ddf143-ba5a-4900-b9c5-96fb3336d4a7';// + @ViewBag.SignImg; | |||
var stampUrl = '/LR_NewWorkFlow/StampInfo/GetImg?keyValue=@ViewBag.StampImg'; | |||
var signUrl = '/LR_SystemModule/Img/GetImg?keyValue=@ViewBag.SignImg'; | |||
$('#signImg').attr('src', signUrl); | |||
$('#stampImg').attr('src', stampUrl); | |||
@@ -603,6 +603,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
baseUser.F_HeadIcon = url; | |||
baseUser.F_RealName = entity.EmpName; | |||
baseUser.F_IdentityCardNo = entity.IdentityCardNo; | |||
baseUser.F_Mobile = entity.mobile; | |||
userIBLL.SaveEntity(baseUser.F_UserId, baseUser); | |||
} | |||
} | |||
@@ -228,24 +228,163 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="status"></param> | |||
public void ChangeStatusByProcessId(string processId, int status) | |||
{ | |||
var db = BaseRepository().BeginTrans(); | |||
try | |||
if (status == 2) | |||
{ | |||
var Sys_SendFile = db.FindEntity<Sys_SendFileEntity>(m => m.SProcessId == processId); | |||
Sys_SendFile.SendFlag = status; | |||
//获取校长的审批意见 | |||
if (status == 2) | |||
var db = BaseRepository().BeginTrans(); | |||
try | |||
{ | |||
var needpostuserlist = new List<UserEntity>(); | |||
var Sys_SendFile = db.FindEntity<Sys_SendFileEntity>(m => m.SProcessId == processId); | |||
if (Sys_SendFile.SendType == "1") | |||
{ | |||
var teacherlist = db.FindList<UserEntity>(m => | |||
m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师" && | |||
m.F_CompanyId == Sys_SendFile.ReceiverId); | |||
needpostuserlist = teacherlist.ToList(); | |||
foreach (var tEntity in teacherlist) | |||
{ | |||
Sys_ReceiveFileEntity receiveFile = new Sys_ReceiveFileEntity(); | |||
receiveFile.Create(); | |||
receiveFile.SFileId = Sys_SendFile.SFileId; | |||
receiveFile.SenderId = Sys_SendFile.SenderId; | |||
receiveFile.Sender = Sys_SendFile.Sender; | |||
receiveFile.ReceiverId = tEntity.F_UserId; | |||
receiveFile.Receiver = tEntity.F_RealName; | |||
receiveFile.Title = Sys_SendFile.Title; | |||
receiveFile.Contents = Sys_SendFile.Contents; | |||
receiveFile.Url = Sys_SendFile.Url; | |||
receiveFile.ReadFlag = false; | |||
receiveFile.SendTime = DateTime.Now; | |||
receiveFile.SendType = Sys_SendFile.SendType; | |||
receiveFile.DelFlag = false; | |||
receiveFile.STypeId = Sys_SendFile.STypeId; | |||
receiveFile.ReplyFlag = false; | |||
receiveFile.SLastDate = Sys_SendFile.SLastDate; | |||
receiveFile.RUrl = Guid.NewGuid().ToString(); | |||
db.Insert(receiveFile); | |||
} | |||
} | |||
else if (Sys_SendFile.SendType == "2") | |||
{ | |||
var teacherlist = db.FindList<UserEntity>(m => | |||
m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师" && | |||
Sys_SendFile.ReceiverId.Contains(m.F_DepartmentId)); | |||
needpostuserlist = teacherlist.ToList(); | |||
foreach (var tEntity in teacherlist) | |||
{ | |||
Sys_ReceiveFileEntity receiveFile = new Sys_ReceiveFileEntity(); | |||
receiveFile.Create(); | |||
receiveFile.SFileId = Sys_SendFile.SFileId; | |||
receiveFile.SenderId = Sys_SendFile.SenderId; | |||
receiveFile.Sender = Sys_SendFile.Sender; | |||
receiveFile.ReceiverId = tEntity.F_UserId; | |||
receiveFile.Receiver = tEntity.F_RealName; | |||
receiveFile.Title = Sys_SendFile.Title; | |||
receiveFile.Contents = Sys_SendFile.Contents; | |||
receiveFile.Url = Sys_SendFile.Url; | |||
receiveFile.ReadFlag = false; | |||
receiveFile.SendTime = DateTime.Now; | |||
receiveFile.SendType = Sys_SendFile.SendType; | |||
receiveFile.DelFlag = false; | |||
receiveFile.STypeId = Sys_SendFile.STypeId; | |||
receiveFile.ReplyFlag = false; | |||
receiveFile.SLastDate = Sys_SendFile.SLastDate; | |||
receiveFile.RUrl = Guid.NewGuid().ToString(); | |||
db.Insert(receiveFile); | |||
} | |||
} | |||
else if (Sys_SendFile.SendType == "3") | |||
{ | |||
List<string> ppostid = Sys_SendFile.ReceiverId.Split(',').ToList(); | |||
for (int i = 0; i < ppostid.Count; i++) | |||
{ | |||
ppostid[i] = "'" + ppostid[i] + "'"; | |||
} | |||
var teacherlist = db.FindList<UserEntity>( | |||
@"select distinct a.* from [dbo].[LR_Base_User] a left join [dbo].[LR_Base_UserRelation] b | |||
on a.F_UserId=b.F_UserId where b.F_ObjectId in(" + string.Join(",", ppostid) + | |||
") and a.F_DeleteMark<>1 and a.F_EnabledMark=1 and a.F_Description='教师'"); | |||
needpostuserlist = teacherlist.ToList(); | |||
foreach (var tEntity in teacherlist) | |||
{ | |||
Sys_ReceiveFileEntity receiveFile = new Sys_ReceiveFileEntity(); | |||
receiveFile.Create(); | |||
receiveFile.SFileId = Sys_SendFile.SFileId; | |||
receiveFile.SenderId = Sys_SendFile.SenderId; | |||
receiveFile.Sender = Sys_SendFile.Sender; | |||
receiveFile.ReceiverId = tEntity.F_UserId; | |||
receiveFile.Receiver = tEntity.F_RealName; | |||
receiveFile.Title = Sys_SendFile.Title; | |||
receiveFile.Contents = Sys_SendFile.Contents; | |||
receiveFile.Url = Sys_SendFile.Url; | |||
receiveFile.ReadFlag = false; | |||
receiveFile.SendTime = DateTime.Now; | |||
receiveFile.SendType = Sys_SendFile.SendType; | |||
receiveFile.DelFlag = false; | |||
receiveFile.STypeId = Sys_SendFile.STypeId; | |||
receiveFile.ReplyFlag = false; | |||
receiveFile.SLastDate = Sys_SendFile.SLastDate; | |||
receiveFile.RUrl = Guid.NewGuid().ToString(); | |||
db.Insert(receiveFile); | |||
} | |||
} | |||
else | |||
{ | |||
var teacherlist = db.FindList<UserEntity>(m => | |||
m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师" && | |||
Sys_SendFile.ReceiverId.Contains(m.F_UserId)); | |||
needpostuserlist = teacherlist.ToList(); | |||
foreach (var tEntity in teacherlist) | |||
{ | |||
Sys_ReceiveFileEntity receiveFile = new Sys_ReceiveFileEntity(); | |||
receiveFile.Create(); | |||
receiveFile.SFileId = Sys_SendFile.SFileId; | |||
receiveFile.SenderId = Sys_SendFile.SenderId; | |||
receiveFile.Sender = Sys_SendFile.Sender; | |||
receiveFile.ReceiverId = tEntity.F_UserId; | |||
receiveFile.Receiver = tEntity.F_RealName; | |||
receiveFile.Title = Sys_SendFile.Title; | |||
receiveFile.Contents = Sys_SendFile.Contents; | |||
receiveFile.Url = Sys_SendFile.Url; | |||
receiveFile.ReadFlag = false; | |||
receiveFile.SendTime = DateTime.Now; | |||
receiveFile.SendType = Sys_SendFile.SendType; | |||
receiveFile.DelFlag = false; | |||
receiveFile.STypeId = Sys_SendFile.STypeId; | |||
receiveFile.ReplyFlag = false; | |||
receiveFile.SLastDate = Sys_SendFile.SLastDate; | |||
receiveFile.RUrl = Guid.NewGuid().ToString(); | |||
db.Insert(receiveFile); | |||
} | |||
} | |||
Sys_SendFile.SendFlag = 2; | |||
Sys_SendFile.SendTime = DateTime.Now; | |||
db.Update(Sys_SendFile); | |||
db.Commit(); | |||
//微信推送 | |||
try | |||
{ | |||
PushWeixin(needpostuserlist, Sys_SendFile.Title); | |||
} | |||
catch (Exception e) | |||
{ | |||
} | |||
//飞星推送 | |||
Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", Sys_SendFile.SenderId, Sys_SendFile.Title, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)).Substring(0, 20), "sendfile", string.Join(",", needpostuserlist.Select(m => m.F_UserId)), ""); | |||
} | |||
}); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
} | |||
db.Update(Sys_SendFile); | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
} | |||
} | |||