| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <link href="../css/init.css" rel="stylesheet" />
- <link href="../css/Table/table1.css" rel="stylesheet" />
- <title>班组管理</title>
- <style>
- .th-bar{
- height: initial;
- }
- </style>
- </head>
- <body class="gray-bg">
- <div class="daoHang clearfix">
- <div class="dhLeft">
- <sapn><i class="syIcon"></i>位置:<a id="ReIndex" href="javaScript:;">首页</a>><a href="javaScript:;">系统管理</a>><a href="" class="nowPosition">班组管理</a></sapn>
- </div>
- <div class="dhRight">
- <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
- </div>
- </div>
- <div class="wrapper wrapper-content">
- <div class="th-top clearfix">
- <div class="form-inline th-bar clearfix">
- <div class="time-box form-group" >
- <i class="tub fa fa-search"></i>
- <input class="form-control" type="text" id="name" placeholder="请输入班组名称"/>
- </div>
- <div class="form-group tool_bars pull-right">
- <button class="btns" id="sc_btns">搜索</button>
- <button class="btns add">添加</button>
- <button class="btns xg">修改</button>
- <button class="btns remove">删除</button>
- </div>
- </div>
- </div>
-
- <div style="width: 100%;padding: 10px;">
- <table id="list" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
- <thead>
- <tr>
- <th data-field="state" data-checkbox="true"></th>
- <th data-align="center" data-formatter="setCode">编号</th>
- <th data-field="F_GroupName">班组名称</th>
- <th data-field="F_GroupCode">班组代码</th>
- <th data-field="F_Remark">说明</th>
- <th data-field="UserName">创建人</th>
- <th data-field="F_CreateTime">创建时间</th>
- </tr>
- </thead>
- <tbody id="tbody"></tbody>
- </table>
- </div>
- </div>
- <script>
- $(document).ready(function () {
- /*搜索*/
- $("#sc_btns").click(function () {
- initTable();
- })
- $(".add").click(function () {
- layer.open({
- type: 2,
- content: "GroupEdit.html" , //iframe的url,no代表不显示滚动条
- title: '新增班组',
- area: ['40%', '50%'] //宽高
- });
- });
- $(".xg").click(function () {
- var id = $.map($('#list').bootstrapTable('getSelections'),
- function(row) {
- return row.F_Id;
- });
- if (id.length != 1) {
- layer.confirm('请选择一行进行修改?', {
- btn: ['确定'] //按钮
- });
- return;
- } else {
- layer.open({
- type: 2,
- content: "GroupEdit.html?id=" + id, //iframe的url,no代表不显示滚动条
- title: '修改班组',
- area: ['40%', '50%'] //宽高
- });
- }
- });
- /*删除内容*/
- $(".remove").click(function () {
- var ids = $.map($('#list').bootstrapTable('getSelections'),
- function (row) {
- return row.F_Id;
- });
- /*判断长度*/
- if (ids.length <= 0) {
- layer.confirm('没有可删除的选项?', {
- btn: ['确定'] //按钮
- });
- return;
- }
- layer.confirm('确定删除选中的选项?', {
- btn: ['是', '否'] //按钮
- }, function () {
- /*执行删除*/
- var ids = $.map($('#list').bootstrapTable('getSelections'),
- function (row) {
- return row.F_Id;
- });
- /*发送请求*/
- $.post(huayi.config.callcenter_url + "Group/DelGroup", {
- ids: ids,
- token: $.cookie("token")
- }, function (result) {
- result = JSON.parse(result);
- if (result.state.toLowerCase() == "success") {
- layer.msg("删除成功");
- initTable();
- }
- })
- });
- });
- initTable();
- })
- function initTable() {
- //先销毁表格
- $('#list').bootstrapTable('destroy');
- //初始化表格,动态从服务器加载数据
- $("#list").bootstrapTable({
- method: "get", //使用get请求到服务器获取数据
- url: huayi.config.callcenter_url + "Group/GetList", //获取数据的Servlet地址
- contentType: "application/x-www-form-urlencoded", striped: true, //表格显示条纹
- pagination: true, //启动分页
- pageSize: 10, //每页显示的记录数
- pageNumber: 1, //当前第几页
- pageList: [10, 20, 50, 100], //记录数可选列表
- search: false, //是否启用查询
- showColumns: false, //显示下拉框勾选要显示的列
- showRefresh: false, //显示刷新按钮
- sidePagination: "server", //表示服务端请求
- //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
- //设置为limit可以获取limit, offset, search, sort, order
- queryParamsType: "undefined",
- queryParams: function queryParams(params) { //设置查询参数
- var param = {
- page: params.pageNumber,
- pagesize: params.pageSize,
- name: $("#name").val(),
- token: $.cookie("token")
- };
- return param;
- },
- onLoadSuccess: function (data) { //加载成功时执行
- //layer.msg("加载成功");
- },
- onLoadError: function () { //加载失败时执行
- //layer.msg("加载数据失败", { time: 1500, icon: 2 });
- }
- });
- }
- //编号
- function setCode(val, row, index) {
- return index + 1;
- }
- </script>
- </body>
- </html>
|