226 lines
7.8 KiB
Plaintext
226 lines
7.8 KiB
Plaintext
@using WX.CRM.WebHelper;
|
||
@{
|
||
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 type="text/css">
|
||
.xm-option {
|
||
line-height: 30px;
|
||
}
|
||
|
||
.layui-card {
|
||
padding-top: 0px !important;
|
||
}
|
||
|
||
.avatar {
|
||
width: 60px;
|
||
height: 60px;
|
||
}
|
||
</style>
|
||
|
||
<!--确定宽度-->
|
||
<style>
|
||
.layui-form-label {
|
||
width: 150px
|
||
}
|
||
|
||
.layui-input-block {
|
||
margin-left: 0;
|
||
}
|
||
|
||
.dialogName {
|
||
width: 31%;
|
||
display: inline-block;
|
||
text-align: center;
|
||
}
|
||
|
||
.layui-table-cell {
|
||
height: auto !important;
|
||
line-height: 28px !important;
|
||
}
|
||
|
||
.myimage {
|
||
width: 100px;
|
||
padding: 3px 0px;
|
||
}
|
||
|
||
.mydiv {
|
||
/*width:250px;*/
|
||
}
|
||
</style>
|
||
<div class="layui-fluid" style="padding-left:0px;padding-top:10px;">
|
||
<div class="layui-card" id="topcard" style="width:100%;padding-top:10px;">
|
||
<div class="layui-card-body " id="contentBody">
|
||
<form class="layui-form selftopwhere" id="myform">
|
||
<div class="layui-form-item">
|
||
ID/名称/号码:
|
||
<div class="layui-inline">
|
||
<input type="text" name="name" required lay-verify="required" autocomplete="off" class="layui-input">
|
||
</div>
|
||
<div class="layui-inline">
|
||
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="search" type="button" value="查询" /><input class="layui-btn layui-btn-sm layui-btn-reset" type="reset" value="清空" />
|
||
</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>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<input type="text" name="userChose" id="userChose" required lay-verify="required" autocomplete="off" class="layui-input">
|
||
<table class="layui-hide" id="tab_kefuzhuangtaiyi1" lay-filter="wochao"></table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!--确定宽度-->
|
||
|
||
<script>
|
||
function onLoadSucced() {
|
||
}
|
||
//企业号的数据
|
||
var table;
|
||
$(function () {
|
||
|
||
});
|
||
</script>
|
||
<script>
|
||
layui.use('laydate', function () {
|
||
var laydate = layui.laydate;
|
||
//执行一个laydate实例
|
||
laydate.render({
|
||
elem: '#start' //指定元素
|
||
});
|
||
//执行一个laydate实例
|
||
laydate.render({
|
||
elem: '#end' //指定元素
|
||
});
|
||
});
|
||
var selectRow = {};
|
||
var winindex;
|
||
var layer;
|
||
var rowid;
|
||
var userChose = parent.GetQiweiData();
|
||
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
|
||
layui.use('element', function () {
|
||
var element = layui.element;
|
||
element.on('tab(tonghuajiankong)', function (n) {
|
||
$(".bodytable").addClass("hidden");
|
||
$("#kefuzhuangtai" + (n.index + 1)).removeClass("hidden");
|
||
});
|
||
element.on('tab(maintab)', function (n) {
|
||
if (n.index == 0)
|
||
$("#bottomcard").removeClass("hidden");
|
||
else
|
||
$("#bottomcard").addClass("hidden");
|
||
});
|
||
});
|
||
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_kefuzhuangtaiyi1'
|
||
, url: 'ChooseQWGetHtmlList'
|
||
, method: 'POST'
|
||
, cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
||
, page: true
|
||
, limit: 30
|
||
, height: "full-160"
|
||
, size:"sm"
|
||
, cols: [[
|
||
{ field: 'id', type: 'checkbox', },
|
||
{
|
||
field: 'thumb_avatar', title: '头像', width: 90, templet: function (d) {
|
||
return "<img class='avatar' src='" + d.thumb_avatar+"'>"
|
||
}
|
||
}
|
||
,{ field: 'corpname', title: '企业号' }
|
||
, { field: 'userid', title: 'ID' }
|
||
, { field: 'uname', title: '名称' }
|
||
, { field: 'mobile', title: '号码' }
|
||
]], where: $("#myform").serializeFormJSON()
|
||
, done: function (res, curr, count) {
|
||
var mydata = userChose;
|
||
for (var i = 0; i < res.data.length; i++) {
|
||
//判断复选框是否选中
|
||
$(mydata).each(function (aa, bb) {
|
||
if (bb.userid == res.data[i].userid) {
|
||
//这句才是真正选中,通过设置关键字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');
|
||
}
|
||
});
|
||
}
|
||
}
|
||
});
|
||
|
||
//监听行单击事件(单击事件为: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;
|
||
});
|
||
|
||
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
|
||
}
|
||
});
|
||
}
|
||
};
|
||
$('.layui-btn').on('click', function () {
|
||
var othis = $(this), method = othis.data('method');
|
||
console.log(method);
|
||
active[method] ? active[method].call(this, othis) : '';
|
||
|
||
});
|
||
});
|
||
function TableReload() {
|
||
table.reload('listReload', {
|
||
|
||
});
|
||
}
|
||
function GetIframeHtml(src) {
|
||
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
||
}
|
||
function saveInfo() {
|
||
var checkdata = table.checkStatus('listReload');
|
||
var uidata = checkdata.data;
|
||
var newData = [];
|
||
for (var i = 0; i < uidata.length; i++) {
|
||
var mydata = uidata[i];
|
||
var newObj = {
|
||
userid: mydata.userid,
|
||
corpname: mydata.corpname,
|
||
kfnickname: mydata.uname,
|
||
corpid: mydata.corpid,
|
||
};
|
||
newData.push(newObj);
|
||
}
|
||
userChose = newData;
|
||
parent.SetUserChoose(userChose);
|
||
parent.Closed();
|
||
}
|
||
</script> |