You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
7.3 KiB
Plaintext

11 months ago
<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Dispatch/Views/Shared/PC.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Body" runat="server">
<div class="ibox-content">
<div class="row row-lg">
<div class="col-sm-12">
<div id="toolbar">
<div class="form-inline" role="form">
<div class="form-group">
<span>关键字: </span>
<input type="text" class="form-control" id="qIptKeyword" />
</div>
<button id="btnSearch" type="button" class="btn btn-primary">查询</button>
</div>
</div>
<table id="table"
data-toggle="table"
data-show-refresh="false"
data-show-toggle="false"
data-show-columns="true"
data-toolbar="#toolbar"
data-url="/SoftMng/Customer/WSUserData"
data-content-type="application/x-www-form-urlencoded"
data-pagination="true"
data-side-pagination="server"
data-total-field="Total"
data-data-field="Data"
data-page-number="1"
data-page-size="15"
data-query-params="queryParams"
data-method="post">
<thead>
<tr>
<th data-field="NAME">姓名</th>
<th data-field="COMPANY_NAME">公司名称</th>
<th data-field="MOBILE">手机</th>
<th data-field="CUST_NAME">绑定公司</th>
<th data-field="GID" data-formatter="operateFormatter" data-events="operateEvents">操作</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="bindModal" tabindex="-1" role="dialog" aria-labelledby="auditModelTitle">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="auditModelTitle">绑定公司</h4>
</div>
<div class="modal-body">
<form>
<input type="hidden" id="modelInputGID" />
<div class="form-group">
<label>姓名</label>
<input class="form-control" type="text" id="modelInputName" readonly />
</div>
<div class="form-group">
<label>手机号码</label>
<input class="form-control" type="text" id="modelInputMobile" readonly />
</div>
<div class="form-group">
<label>公司名称</label>
<input class="form-control" type="text" id="modelInputCompName" readonly />
</div>
<div class="form-group">
<label>选择绑定公司</label>
<div class="input-group">
<input type="text" class="form-control" id="modelInputInfoClient" autocomplete="off">
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
</ul>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="modelBtnSubmit">绑定</button>
</div>
</div>
</div>
</div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FooterScript" runat="server">
<script src="/Areas/Dispatch/Content/Dispatch/hplus/js/plugins/suggest/bootstrap-suggest.min.js"></script>
<script>
var bsSuggest;
var compToBind;
$(function () {
$('#table').bootstrapTable({ height: $(window).height() - 150 });
$("#btnSearch").click(function () {
$('#table').bootstrapTable('refresh')
})
$("#modelBtnSubmit").on("click", function () {
if (compToBind == null) {
layer.alert('请选择要绑定的公司');
} else {
var uid = $("#modelInputGID").val();
$.ajax({
type: "POST",
url: "/SoftMng/Customer/BindCompany",
dataType: "json",
data: "uid=" + uid + "&cid=" + compToBind,
success: function (data) {
layer.msg(data.Message, { icon: 1 }, function () {
location.reload();
});
}
});
}
});
bsSuggest = $("#modelInputInfoClient").bsSuggest('init', {
url: "/SoftMng/Customer/GetBindCompanyList?keyword=",
getDataMethod: "url",
clearable: true,
idField: "GID",
keyField: "SHORTNAME",
effectiveFields: ["CODENAME", "SHORTNAME"],
effectiveFieldsAlias: { CODENAME: "编码", SHORTNAME: "简称" },
showHeader: true,
showBtn: false,
clearable: true
}).on('onSetSelectValue', function (e, model) {
compToBind = model.id
});
})
function queryParams(params) {
params.keyword = $("#qIptKeyword").val();
return params
}
function operateFormatter(value, row, index) {
if (row.IsAudit) {
return '';
} else {
return [
'<a class="bind" href="javascript:void(0)" title="绑定">',
'<i class="fa fa-edit"></i>绑定',
'</a> '
].join('');
}
}
window.operateEvents = {
'click .bind': function (e, value, row, index) {
$("#modelInputGID").val(row.GID);
$("#modelInputName").val(row.NAME);
$("#modelInputMobile").val(row.MOBILE);
$("#modelInputCompName").val(row.COMPANY_NAME);
$('#bindModal').modal('show');
}
}
</script>
</asp:Content>