|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+<!DOCTYPE html>
|
|
|
2
|
+<html>
|
|
|
3
|
+
|
|
|
4
|
+<head>
|
|
|
5
|
+ <meta charset="UTF-8">
|
|
|
6
|
+ <script src="../js/huayi.load.js"></script>
|
|
|
7
|
+ <title>工作时间</title>
|
|
|
8
|
+ <style>
|
|
|
9
|
+ .toolBar {
|
|
|
10
|
+ padding: 15px 0;
|
|
|
11
|
+ border-bottom: 1px solid #ccc;
|
|
|
12
|
+ }
|
|
|
13
|
+
|
|
|
14
|
+ .toolBar select {
|
|
|
15
|
+ width: 150px;
|
|
|
16
|
+ padding: 2px 2px 2px 10px;
|
|
|
17
|
+ height: 32px;
|
|
|
18
|
+ border: 1px solid rgb(204, 204, 204);
|
|
|
19
|
+ }
|
|
|
20
|
+
|
|
|
21
|
+ .tool_downs {
|
|
|
22
|
+ display: flex;
|
|
|
23
|
+ justify-content: center;
|
|
|
24
|
+ }
|
|
|
25
|
+
|
|
|
26
|
+ .tool_downs span {
|
|
|
27
|
+ display: block;
|
|
|
28
|
+ width: 100%;
|
|
|
29
|
+ height: 100%;
|
|
|
30
|
+ text-align: center;
|
|
|
31
|
+ }
|
|
|
32
|
+
|
|
|
33
|
+ .tool_downs a {
|
|
|
34
|
+ display: block;
|
|
|
35
|
+ list-style: none;
|
|
|
36
|
+ float: left;
|
|
|
37
|
+ padding-left: 10px;
|
|
|
38
|
+ }
|
|
|
39
|
+ </style>
|
|
|
40
|
+ <script>
|
|
|
41
|
+ $(document).ready(function () {
|
|
|
42
|
+ initTable();
|
|
|
43
|
+
|
|
|
44
|
+ $(".searchGo").click(function () {
|
|
|
45
|
+ initTable();
|
|
|
46
|
+ });
|
|
|
47
|
+
|
|
|
48
|
+ $(".addBtn").click(function () {
|
|
|
49
|
+ layer.open({
|
|
|
50
|
+ type: 2,
|
|
|
51
|
+ content: "./WorkTimeAdd.html", //iframe的url,no代表不显示滚动条
|
|
|
52
|
+ title: "工作时间",
|
|
|
53
|
+ area: ["500px", "600px"], //宽高
|
|
|
54
|
+ });
|
|
|
55
|
+ });
|
|
|
56
|
+ });
|
|
|
57
|
+
|
|
|
58
|
+ function initTable() {
|
|
|
59
|
+ //先销毁表格
|
|
|
60
|
+ $("#tableList").bootstrapTable("destroy");
|
|
|
61
|
+ //初始化表格,动态从服务器加载数据
|
|
|
62
|
+ $("#tableList").bootstrapTable({
|
|
|
63
|
+ method: "post", //使用get请求到服务器获取数据
|
|
|
64
|
+ url: huayi.config.callcenter_url + "SystemApi/GetWorkTimeList", //获取数据的Servlet地址
|
|
|
65
|
+ contentType: "application/x-www-form-urlencoded",
|
|
|
66
|
+ striped: true, //表格显示条纹
|
|
|
67
|
+ pagination: true, //启动分页
|
|
|
68
|
+ pageSize: 10, //每页显示的记录数
|
|
|
69
|
+ pageNumber: 1, //当前第几页
|
|
|
70
|
+ pageList: [10, 20, 50, 100], //记录数可选列表
|
|
|
71
|
+ search: false, //是否启用查询
|
|
|
72
|
+ showColumns: false, //显示下拉框勾选要显示的列
|
|
|
73
|
+ showRefresh: false, //显示刷新按钮
|
|
|
74
|
+ sidePagination: "server", //表示服务端请求
|
|
|
75
|
+ //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
|
|
76
|
+ //设置为limit可以获取limit, offset, search, sort, order
|
|
|
77
|
+ queryParamsType: "undefined",
|
|
|
78
|
+ queryParams: function queryParams(params) {
|
|
|
79
|
+ //设置查询参数
|
|
|
80
|
+ var param = {
|
|
|
81
|
+ currentPage: params.pageNumber,
|
|
|
82
|
+ pageSize: params.pageSize,
|
|
|
83
|
+ name: $("#keyvalue").val()
|
|
|
84
|
+ };
|
|
|
85
|
+ return param;
|
|
|
86
|
+ },
|
|
|
87
|
+ onLoadSuccess: function () {
|
|
|
88
|
+ //加载成功时执行
|
|
|
89
|
+ //layer.msg("加载成功");
|
|
|
90
|
+ },
|
|
|
91
|
+ onLoadError: function () {
|
|
|
92
|
+ //加载失败时执行
|
|
|
93
|
+ //layer.msg("加载数据失败", { time: 1500, icon: 2 });
|
|
|
94
|
+ },
|
|
|
95
|
+ });
|
|
|
96
|
+ }
|
|
|
97
|
+
|
|
|
98
|
+ function operation(val, row) {
|
|
|
99
|
+ return (
|
|
|
100
|
+ '<div class="tool_downs">' +
|
|
|
101
|
+ '<a href="javascript:;" class="aBtn" authorize="yes" onclick="editBtn(' +
|
|
|
102
|
+ row.id +
|
|
|
103
|
+ ')" title="编辑">编辑</a>' +
|
|
|
104
|
+ '<a href="javascript:;" class="aBtn" authorize="yes" onclick="deleteBtn(' +
|
|
|
105
|
+ row.id +
|
|
|
106
|
+ ')" title="删除">删除</a>' +
|
|
|
107
|
+ "</div>"
|
|
|
108
|
+ );
|
|
|
109
|
+ }
|
|
|
110
|
+
|
|
|
111
|
+
|
|
|
112
|
+ function editBtn(id) {
|
|
|
113
|
+ layer.open({
|
|
|
114
|
+ type: 2,
|
|
|
115
|
+ content: "./WorkTimeAdd.html?id=" + id, //iframe的url,no代表不显示滚动条
|
|
|
116
|
+ title: "工作时间",
|
|
|
117
|
+ area: ["500px", "600px"], //宽高
|
|
|
118
|
+ });
|
|
|
119
|
+ }
|
|
|
120
|
+
|
|
|
121
|
+ function deleteBtn(id) {
|
|
|
122
|
+ layer.confirm('确定删除吗?', {
|
|
|
123
|
+ btn: ['是', '否'] //按钮
|
|
|
124
|
+ }, function () {
|
|
|
125
|
+ $.getJSON(huayi.config.callcenter_url + "SystemApi/DeleteWorkTime", {
|
|
|
126
|
+ id: id
|
|
|
127
|
+ }, function (result) {
|
|
|
128
|
+ if (result.state.toLowerCase() == "success") {
|
|
|
129
|
+ layer.msg("删除成功");
|
|
|
130
|
+ initTable();
|
|
|
131
|
+ }
|
|
|
132
|
+ })
|
|
|
133
|
+ });
|
|
|
134
|
+ }
|
|
|
135
|
+ </script>
|
|
|
136
|
+</head>
|
|
|
137
|
+
|
|
|
138
|
+<body class="gray-bg">
|
|
|
139
|
+ <div class="container-fluid wrapper-content animated fadeInRight">
|
|
|
140
|
+ <div class="toolBar clearfix">
|
|
|
141
|
+ <div class="toolRight">
|
|
|
142
|
+ <span>
|
|
|
143
|
+ 名称:
|
|
|
144
|
+ <input id="keyvalue" type="text" class="">
|
|
|
145
|
+ </span>
|
|
|
146
|
+ <button class="btns searchGo">搜索</button>
|
|
|
147
|
+ <button class="btns addBtn">添加</button>
|
|
|
148
|
+ </div>
|
|
|
149
|
+ </div>
|
|
|
150
|
+ <div class="treeTable clearfix">
|
|
|
151
|
+
|
|
|
152
|
+ <div class="tableCon col-md-12">
|
|
|
153
|
+ <table id="tableList" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
|
|
|
154
|
+ <thead>
|
|
|
155
|
+ <tr>
|
|
|
156
|
+ <th data-field="name" data-align="center">名称</th>
|
|
|
157
|
+ <th data-field="startTime" data-align="center">开始时间</th>
|
|
|
158
|
+ <th data-field="endTime" data-align="center">结束时间</th>
|
|
|
159
|
+ <th data-field="remark" data-align="center">备注</th>
|
|
|
160
|
+ <th data-align="center" data-formatter="operation" data-width="150">操作</th>
|
|
|
161
|
+ </tr>
|
|
|
162
|
+ </thead>
|
|
|
163
|
+ <tbody id="tbody"></tbody>
|
|
|
164
|
+ </table>
|
|
|
165
|
+ </div>
|
|
|
166
|
+ </div>
|
|
|
167
|
+ </div>
|
|
|
168
|
+</body>
|
|
|
169
|
+
|
|
|
170
|
+</html>
|