164 lines
6.2 KiB
Plaintext
164 lines
6.2 KiB
Plaintext
@{
|
||
ViewBag.Title = "Index";
|
||
Layout = "~/Views/Shared/_content.cshtml";
|
||
}
|
||
<script src="/Scripts/jquery.easyui.min.js" type="text/javascript"></script>
|
||
<link href="/Content/themes/blue/easyui.css" rel="stylesheet" />
|
||
<link href="/Content/Site.css" rel="stylesheet" />
|
||
<script src="/Scripts/common.js"></script>
|
||
<link href="/Content/data_grid_list.css" rel="stylesheet" />
|
||
<script src="/Scripts/op/jquery.rewrite.js"></script>
|
||
<style>
|
||
|
||
.userImg {
|
||
width:25px;
|
||
height:25px;
|
||
}
|
||
</style>
|
||
<div class="tabs-box">
|
||
<div class="layui-card" id="topcard" style="width:100%;">
|
||
<div class="layui-card-body " id="contentBody">
|
||
<form class="layui-form" id="myform">
|
||
<div class="layui-form-item">
|
||
<input type="hidden" value="@ViewBag.CmdId" name="cmdId" id="cmdId" />
|
||
<div class="ps">
|
||
<div class="ps_title">注意事项</div>
|
||
<p>已勾选人员为可发送人员,反之为不发送人员,通过重设人员可以设置屏蔽部分发送人员</p>
|
||
</div>
|
||
人员名称:
|
||
<div class="layui-inline">
|
||
<input type="text" name="name" required lay-verify="required" autocomplete="off" class="layui-input">
|
||
</div>
|
||
<div class="layui-inline">
|
||
<button type="button" class="layui-btn layui-btn-sm layui-btn-normal" onclick="saveInfo()">
|
||
<i class="layui-icon">
|
||
重设人员
|
||
</i>
|
||
</button>
|
||
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="search" type="button" value="查询" />
|
||
</div>
|
||
</div>
|
||
|
||
</form>
|
||
|
||
<table class="table" id="tab_cmdDetail" lay-filter="wochao"></table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
var winindex;
|
||
layui.use(['laypage', 'layer', 'table', 'laydate', 'form'], function () {
|
||
var form = layui.form;
|
||
var laydate = layui.laydate;
|
||
layer = layui.layer;
|
||
table = layui.table;
|
||
table.render({
|
||
id: 'listReload'//列表别名ID
|
||
, elem: '#tab_cmdDetail'
|
||
, url: 'GetCmdEditList'
|
||
, method: 'POST'
|
||
, page: false
|
||
, limit: Number.MAX_VALUE
|
||
, limits: []
|
||
, height: "full"
|
||
//, size:"sm"
|
||
, cols: [[
|
||
{ field: 'id', type: 'checkbox', }
|
||
, { field: 'infoTpl', title: '人员信息', templet: '#infoTpl' }
|
||
]], where: $("#myform").serializeFormJSON()
|
||
,
|
||
done: function (res, curr, count) {
|
||
for (var i = 0; i < res.data.length; i++) {
|
||
//判断复选框是否选中
|
||
if (res.data[i].UnEnabled != 1) {
|
||
//这句才是真正选中,通过设置关键字LAY_CHECKED为true选中
|
||
res.data[i]["LAY_CHECKED"] = 'true';
|
||
//下面三句是通过更改css来实现选中的效果
|
||
var index = res.data[i]['LAY_TABLE_INDEX'];
|
||
$('tr[data-index=' + index + '] input[type="checkbox"]').prop('checked', true);
|
||
$('tr[data-index=' + index + '] input[type="checkbox"]').next().addClass('layui-form-checked');
|
||
}
|
||
}
|
||
form.render();
|
||
}
|
||
});
|
||
var active = {
|
||
search: function () {
|
||
//alert($("#myform").serialize());
|
||
//console.log($("#myform").serialize());
|
||
//console.log($("#myform").serializeFormJSON());
|
||
var param = $("#myform").serializeFormJSON();
|
||
table.reload('listReload', {
|
||
where: param,
|
||
page: {
|
||
curr: 1
|
||
}
|
||
});
|
||
}
|
||
};
|
||
//监听行单击事件(单击事件为:rowDouble)
|
||
table.on('row(wochao)', function (obj) {
|
||
var data = obj.data;
|
||
//console.log(data);
|
||
//标注选中样式
|
||
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
|
||
selectRow = data;
|
||
});
|
||
form.on('select(corp_deptid)', function (data) {
|
||
console.log(data);
|
||
let mydeptid = "";
|
||
$(mydata.filter(m => m.corpid == data.value)).each(function (is, sw) {
|
||
mydeptid = sw.deptid;
|
||
});
|
||
$("#deptid").val(mydeptid);
|
||
});
|
||
$('.layui-btn').on('click', function () {
|
||
var othis = $(this), method = othis.data('method');
|
||
console.log(method);
|
||
active[method] ? active[method].call(this, othis) : '';
|
||
|
||
});
|
||
});
|
||
function saveInfo() {
|
||
var allData = table.cache["listReload"];
|
||
var allpostData = "";
|
||
var checkdata = table.checkStatus('listReload');
|
||
var uidata = checkdata.data;
|
||
var postdata = "";
|
||
for (var i = 0; i < uidata.length; i++) {
|
||
postdata += uidata[i].Pkid + ';'
|
||
}
|
||
for (var i = 0; i < allData.length; i++) {
|
||
allpostData += allData[i].Pkid + ';'
|
||
}
|
||
$.ajax({
|
||
type: "POST",
|
||
url: "SaveCmdDetail",
|
||
data: { cmdDetailIds: postdata, cmdId:@ViewBag.CmdId, allpostData: allpostData },
|
||
dataType: "json",
|
||
success: function (da) {
|
||
if (da.result == true) {
|
||
parent.layer.msg(da.retmsg, { icon: 1 });
|
||
parent.Closed();
|
||
parent.TableReload();
|
||
|
||
} else {
|
||
layer.msg(da.retmsg, { icon: 2 });
|
||
}
|
||
},
|
||
error: function () {
|
||
layer.msg('操作失败!', { icon: 2 });
|
||
}
|
||
});
|
||
}
|
||
</script>
|
||
|
||
<script type="text/html" id="infoTpl">
|
||
<div><img class="userImg" src="{{d.Avatar}}"/> <span>{{d.Nickname}}</span>
|
||
{{# if(d.Remark!="") { }}
|
||
<span>({{ d.Remark }})</span>
|
||
{{# } }}
|
||
</div>
|
||
</script>
|
||
|