@{
|
ViewBag.Title = "MemoBook";
|
Layout = "~/Views/Shared/_Layout_Search.cshtml";
|
}
|
@{PltUser user = (PltUser)ViewData["curentuser"];}
|
@section headerStyle{
|
<script type="text/javascript">
|
var Dept = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Dept))';
|
var User = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.User))';
|
var Wancheng = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Wancheng))';
|
|
dataCol = [
|
{ label: 'id', name: 'Id', labtype: 'txt', hidden: true },
|
{
|
label: '安排时间', name: 'Createtime', labtype: 'txt', width: 100, hidden: false,
|
formatter: function (cellvalue, options, rowObject) {
|
return new Date(cellvalue).Format("yyyy-MM-dd");
|
}
|
},
|
{ label: '工作内容', name: 'Context', labtype: 'txt', width: 300, hidden: false },
|
{
|
label: '要求完成时间', name: 'Time', labtype: 'txt', width: 100, hidden: false,
|
formatter: function (cellvalue, options, rowObject) {
|
return new Date(cellvalue).Format("yyyy-MM-dd hh:mm");
|
}
|
},
|
{ label: '办理情况', name: 'BanLi', labtype: 'txt', width: 300, hidden: false },
|
{ label: '完成时间', name: 'WanchengTimeName', labtype: 'txt', width: 100, hidden: false },
|
{
|
label: '工作考核', name: 'KaoHe', labtype: 'txt', width: 100, hidden: false,
|
formatter: function (cellvalue, options, rowObject) {
|
if (cellvalue == null || cellvalue == "" ) {
|
return '<a href="javascript: void (0)" onclick="kaohe(\'' + rowObject.Rtype + '\',\'' + rowObject.Id + '\');">考核</a>';
|
} else {
|
return rowObject.KaoHeName;
|
}
|
|
|
}
|
},
|
{ label: '申诉', name: 'ShenSu', labtype: 'txt', width: 100, hidden: false },
|
//{
|
// label: '提醒类型', name: 'Rtype', labtype: 'txt', width: 100, hidden: false,
|
// formatter: function (cellvalue, options, rowObject) {
|
|
// let value = '';
|
// for (var i = 0; i < rtype.length; i++) {
|
// if (rtype[i].code === cellvalue) {
|
// value = rtype[i].label;
|
// break;
|
// }
|
// }
|
// return value;
|
// }
|
//},
|
|
{ label: '安排人', name: 'Creater', labtype: 'txt', width: 100, hidden: true },
|
{ label: '被安排人', name: 'ToUserId', labtype: 'txt', width: 100, hidden: false },
|
|
{
|
label: '操作', name: 'RecStatus', align: "center", align: "center", sortable: false, width: 100, labtype: 'txt',
|
formatter: function (cellvalue, options, rowObject) {
|
return '<a href="javascript:void(0)" onclick="edit(\'' + rowObject.Rtype + '\',\'' + rowObject.Id + '\');"> <span style="background: #ECF3FF;"> 修改 </span> </a > '
|
+ ' <a href="javascript:void(0)" onclick="del(\'' + rowObject.Id + '\');"> <span style="background: #ECF3FF;"> 删除 </span></a>'
|
}
|
},
|
|
{ label: '状态', name: 'RecStatus', labtype: 'txt', hidden: true },
|
{ label: '创建人', name: 'Creater', labtype: 'txt', hidden: true },
|
{ label: '创建时间', name: 'Createtime', labtype: 'txt', hidden: true },
|
{ label: '修改人', name: 'Modifier', labtype: 'txt', hidden: true },
|
{ label: '修改时间', name: 'Modifytime', labtype: 'txt', hidden: true }
|
|
];
|
dataUrl = "/DailyManagement/GetWorkAnPaiList?Creater=" + "@user.Id" +"&Rtype=3"
|
searchCol = [
|
{ label: '时间', name: 'Createtime', labtype: 'datearea', hidden: false },
|
{ label: '工作部门', name: 'WorkDept', labtype: 'combox', hidden: false, data: JSON.parse(Dept) /*,cwidth: '5%', cccwidth: '28%' */ },
|
|
{ label: '职工姓名', name: 'ToUserId', labtype: 'combox', hidden: false, data: JSON.parse(User) /*,cwidth: '5%', cccwidth: '28%' */ },
|
{ label: '完成情况', name: 'HaveRead', labtype: 'combox', hidden: false, data: JSON.parse(Wancheng) /*,cwidth: '5%', cccwidth: '28%' */ },
|
];
|
|
var _pageAdd = function () {
|
OpenWindow("安排工作", "500px", "600px", "/DailyManagement/EditWorkAnPai/?Rtype=3");
|
}
|
|
function _pageMemo() {
|
OpenWindow("安排工作", "500px", "600px", "/DailyManagement/EditWorkAnPai/?Rtype=3");
|
}
|
|
function edit(op, id) {
|
let caption;
|
if (op === "3") {
|
caption = "安排工作";
|
} else {
|
caption = "安排工作";
|
}
|
OpenWindow(caption, "500px", "600px", "/DailyManagement/EditWorkAnPai/?id=" + id);
|
|
}
|
|
function kaohe(op, id) {
|
let caption;
|
if (op === "3") {
|
caption = "安排工作";
|
} else {
|
caption = "安排工作";
|
}
|
OpenWindow(caption, "500px", "600px", "/DailyManagement/EditWorkKaoHe/?id=" + id);
|
|
}
|
|
function del(id) {
|
$.ajax({
|
type: "POST",
|
url: "/DailyManagement/ModifyWorkAnPaiStatus?id=" + id + "&isReaded=false",
|
dataType: "json",
|
global: false,
|
async: false,
|
data: '',
|
success: function (data) {
|
|
|
if (data.Result) {
|
window._reloadPageData();
|
toastr.success("删除成功");
|
|
}
|
else {
|
toastr.error(data.Message);
|
}
|
|
},
|
error: function () {
|
|
toastr.error("删除失败");
|
}
|
});
|
}
|
|
var _afterSave = function (result) {
|
if (result) {
|
toastr.success("保存成功");
|
} else {
|
toastr.error("保存失败");
|
}
|
|
}
|
|
var _afterDel = function (result) {
|
if (result) {
|
toastr.success("删除成功");
|
} else {
|
/**/
|
toastr.error("删除成功");
|
/**/
|
}
|
}
|
|
|
|
</script>
|
}
|
|
@section footerScripts{
|
<script type="text/javascript">
|
|
function send() {
|
|
var msg = $("#PBSWorkDept");
|
|
|
if (msg.length > 0) {
|
$("#PBSWorkDept").change(function () {
|
var checkDeptId = $("#PBSWorkDept").val();
|
$.ajax({
|
type: "GET",
|
url: "/User/GetList?DeptId=" + checkDeptId,
|
dataType: "json",
|
global: false,
|
data: "",
|
success: function (data) {
|
|
var city = $("#PBSToUserId");
|
city.find('option').remove();
|
var aaa = '<option value="" hassubinfo="true"> </option>';
|
city.append(aaa);
|
if (data.length > 0) {
|
for (var i = 0; i < data.length; i++) {
|
|
var o = '<option value="' + data[i].Id + '" hassubinfo="true">' + data[i].UserName + '</option>';
|
city.append(o);
|
}
|
}
|
$("#PBSToUserId").trigger('chosen:updated');//更新选项
|
},
|
error: function () {
|
|
|
parent.layer.msg('失败', { icon: 5 });
|
}
|
});
|
});
|
|
} else {
|
setTimeout(send, 1000);
|
}
|
}
|
|
|
send();
|
|
|
|
|
|
|
|
|
function sendZhiwustatus() {
|
|
var msg = $("#PBSHaveRead");
|
|
|
if (msg.length > 0) {
|
$("#PBSHaveRead").val("0");
|
$("#PBSHaveRead").trigger('chosen:updated');//更新选项
|
_pageSearch();
|
} else {
|
setTimeout(sendZhiwustatus, 300);
|
}
|
}
|
|
|
sendZhiwustatus();
|
|
</script>
|
}
|