|
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
|
|
|
2
|
+ var keys;
|
|
|
3
|
+ var Cids; //分类id
|
|
|
4
|
+ var ids; //指标id
|
|
|
5
|
+ var CategoryName; //分类名称
|
|
|
6
|
+ var Sort; //排序
|
|
|
7
|
+ var Score; //分数
|
|
|
8
|
+ var Title; //标题
|
|
|
9
|
+ var Remark; //备注
|
|
|
10
|
+ var Pid; //父id
|
|
|
11
|
+ var Left_Cids;
|
|
|
12
|
+ var Left_Sort;
|
|
|
13
|
+ var Left_Score;
|
|
|
14
|
+ var Left_Pid;
|
|
|
15
|
+ var $tableLeft = $('#tbr');
|
|
|
16
|
+ var $tableLeft1 = $('#tb1');
|
|
|
17
|
+ var token=$.cookie("token");
|
|
|
18
|
+ Finish();
|
|
|
19
|
+ IndexCategoryGe();
|
|
|
20
|
+ Select();
|
|
|
21
|
+ //所有指标
|
|
|
22
|
+ $(".rightAll").click(function() {
|
|
|
23
|
+ Finish();
|
|
|
24
|
+
|
|
|
25
|
+ });
|
|
|
26
|
+ //搜索功能
|
|
|
27
|
+ $(".sear").click(function() {
|
|
|
28
|
+ keys = escape();
|
|
|
29
|
+ Finish(keys);
|
|
|
30
|
+ });
|
|
|
31
|
+ //*删除*/
|
|
|
32
|
+ $(".inpBox").hover(function(event) {
|
|
|
33
|
+ $(this).children(".de_icon").show();
|
|
|
34
|
+ event.stopPropagation();
|
|
|
35
|
+ }, function() {
|
|
|
36
|
+ $(this).children(".de_icon").hide();
|
|
|
37
|
+ });
|
|
|
38
|
+ $(".de_icon").click(function(event) {
|
|
|
39
|
+ event.stopPropagation();
|
|
|
40
|
+ $(this).siblings("input").eq(0).val("");
|
|
|
41
|
+ $(this).siblings("input").eq(1).val("");
|
|
|
42
|
+
|
|
|
43
|
+ if($(this).siblings("div").find("ul").attr("id") == "zrbmtree") {
|
|
|
44
|
+ getRY($(".zrid"), $("#zrbm").val());
|
|
|
45
|
+ }
|
|
|
46
|
+
|
|
|
47
|
+ });
|
|
|
48
|
+ $(".inpBox").mouseleave(function() {
|
|
|
49
|
+ $(this).children(".addTree").hide();
|
|
|
50
|
+ })
|
|
|
51
|
+ $(".xl").click(function() {
|
|
|
52
|
+ if($(this).parent().find(".addTree").is(":hidden")) {
|
|
|
53
|
+ $(this).parent().find(".addTree").show();
|
|
|
54
|
+ } else {
|
|
|
55
|
+ $(this).parent().find(".addTree").hide();
|
|
|
56
|
+ }
|
|
|
57
|
+ });
|
|
|
58
|
+ //清空选项
|
|
|
59
|
+ function Clean() {
|
|
|
60
|
+ $(".model").hide();
|
|
|
61
|
+ $("._CategoryName").val("");
|
|
|
62
|
+ $("._Score").val('');
|
|
|
63
|
+ $("._Sort").val('');
|
|
|
64
|
+ $(".F_Title").val('');
|
|
|
65
|
+ $(".F_Remark").val('');
|
|
|
66
|
+ }
|
|
|
67
|
+
|
|
|
68
|
+
|
|
|
69
|
+ ///////////////////////////////////左边表格
|
|
|
70
|
+ /*获取选中行对象*/
|
|
|
71
|
+ $tableLeft1.on("click-row.bs.table", function(e, row, ele) {
|
|
|
72
|
+ $('.success').removeClass('success'); //去除之前选中的行的,选中样式
|
|
|
73
|
+ $(ele).addClass('success'); //添加当前选中的 success样式用于区别
|
|
|
74
|
+ Left_Cids = row.F_CategoryId; //分类ID
|
|
|
75
|
+// ids = row.F_IndexId; //指标ID
|
|
|
76
|
+// CategoryName = row.F_CategoryName; //分类名称
|
|
|
77
|
+// Sort = row.F_Sort; //排序
|
|
|
78
|
+console.log(row.F_ParentId);
|
|
|
79
|
+ Left_Pid = row.F_ParentId; //父id
|
|
|
80
|
+ console.log(Left_Pid,Left_Cids);
|
|
|
81
|
+ Right(Left_Cids);
|
|
|
82
|
+ });
|
|
|
83
|
+ //获取指标分类列表
|
|
|
84
|
+ function IndexCategoryGe(){
|
|
|
85
|
+ //销毁表格
|
|
|
86
|
+ $tableLeft1.bootstrapTable('destroy');
|
|
|
87
|
+ //初始化表格,动态从服务器加载数据
|
|
|
88
|
+ $tableLeft1.bootstrapTable({
|
|
|
89
|
+ method: "get", //使用get请求到服务器获取数据
|
|
|
90
|
+
|
|
|
91
|
+ url: huayi.config.callcenter_url + "IndexCategory/GetList",
|
|
|
92
|
+ //url: "//117.158.196.116:8878/IndexCategory/GetList",
|
|
|
93
|
+ striped: true, //表格显示条纹
|
|
|
94
|
+ pagination: true, //启动分页
|
|
|
95
|
+ pageSize: 5, //每页显示的记录数
|
|
|
96
|
+ pageNumber: 1, //当前第几页
|
|
|
97
|
+ pageList: [5, 20, 50, 100], //记录数可选列表
|
|
|
98
|
+ search: false, //是否启用查询
|
|
|
99
|
+ showColumns: false, //显示下拉框勾选要显示的列
|
|
|
100
|
+ showRefresh: false, //显示刷新按钮
|
|
|
101
|
+ sidePagination: "server", //表示服务端请求
|
|
|
102
|
+ //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
|
|
103
|
+ //设置为limit可以获取limit, offset, search, sort, order
|
|
|
104
|
+ queryParamsType: "undefined",
|
|
|
105
|
+ queryParams: function queryParams(params) { //设置查询参数
|
|
|
106
|
+ var param = {
|
|
|
107
|
+ page: params.pageNumber,
|
|
|
108
|
+ pagesize: params.pageSize,
|
|
|
109
|
+ token:token
|
|
|
110
|
+ };
|
|
|
111
|
+ return param;
|
|
|
112
|
+ },
|
|
|
113
|
+ onLoadSuccess: function() { //加载成功时执行
|
|
|
114
|
+ // layer.msg("加载成功");
|
|
|
115
|
+ },
|
|
|
116
|
+ onLoadError: function() { //加载失败时执行
|
|
|
117
|
+ //layer.msg("加载数据失败", { time: 1500, icon: 2 });
|
|
|
118
|
+ }
|
|
|
119
|
+ });
|
|
|
120
|
+ }
|
|
|
121
|
+ //删除
|
|
|
122
|
+ $('.leftDelete').click(function() {
|
|
|
123
|
+ if(Left_Cids) {
|
|
|
124
|
+ DelIndexCategory(Left_Cids);
|
|
|
125
|
+ } else {
|
|
|
126
|
+ layer.msg('没有可删除的选项!');
|
|
|
127
|
+
|
|
|
128
|
+ }
|
|
|
129
|
+ })
|
|
|
130
|
+ //删除功能
|
|
|
131
|
+ function DelIndexCategory(Left_Cids){
|
|
|
132
|
+ $.ajax({
|
|
|
133
|
+ type: "get",
|
|
|
134
|
+ url: huayi.config.callcenter_url + "IndexCategory/DelIndexCategory",
|
|
|
135
|
+ //url: '//117.158.196.116:8878/IndexCategory/DelIndexCategory',
|
|
|
136
|
+ dataType: 'json',
|
|
|
137
|
+ data: {
|
|
|
138
|
+ id: Left_Cids
|
|
|
139
|
+ },
|
|
|
140
|
+ async: true,
|
|
|
141
|
+ success: function(data) {
|
|
|
142
|
+ layer.msg("删除成功");
|
|
|
143
|
+ IndexCategoryGe();
|
|
|
144
|
+ }
|
|
|
145
|
+ });
|
|
|
146
|
+ }
|
|
|
147
|
+ ///修改功能
|
|
|
148
|
+ $(".leftChange ").click(function() {
|
|
|
149
|
+ if(Left_Cids) {
|
|
|
150
|
+ layer.open({
|
|
|
151
|
+ type: 2,
|
|
|
152
|
+ content: "../Questionnaire/modify.html", //iframe的url,no代表不显示滚动条
|
|
|
153
|
+ title: '修改分类',
|
|
|
154
|
+ area: ['35%', '30%'], //宽高
|
|
|
155
|
+ });
|
|
|
156
|
+ GetIndexCategory(Left_Cids);
|
|
|
157
|
+
|
|
|
158
|
+ } else {
|
|
|
159
|
+ layer.msg('没有可修改的选项!');
|
|
|
160
|
+ Clean();
|
|
|
161
|
+ }
|
|
|
162
|
+ })
|
|
|
163
|
+ ///左边获取指标分类
|
|
|
164
|
+ function GetIndexCategory(Left_Cids){
|
|
|
165
|
+ $.ajax({
|
|
|
166
|
+ type: "get",
|
|
|
167
|
+ url: huayi.config.callcenter_url + "IndexCategory/GetIndexCategory",
|
|
|
168
|
+// url: '//117.158.196.116:8878/IndexCategory/GetIndexCategory',
|
|
|
169
|
+ dataType: 'json',
|
|
|
170
|
+ data: {
|
|
|
171
|
+ cid:Left_Cids,
|
|
|
172
|
+ token:token
|
|
|
173
|
+ },
|
|
|
174
|
+ async: true,
|
|
|
175
|
+ success: function(data) {
|
|
|
176
|
+ console.log(data);
|
|
|
177
|
+// IndexCategoryGe();
|
|
|
178
|
+ $("#Left_CategoryName").val(data.data.F_CategoryName);
|
|
|
179
|
+ $("#Left_Sort").val(data.data.F_Sort);
|
|
|
180
|
+ $("#Left_ParentId").val(data.data.F_ParentId);
|
|
|
181
|
+ }
|
|
|
182
|
+ });
|
|
|
183
|
+ }
|
|
|
184
|
+ //下拉框
|
|
|
185
|
+ function Select(){
|
|
|
186
|
+ $.ajax({
|
|
|
187
|
+ type: "get",
|
|
|
188
|
+ url: huayi.config.callcenter_url + "IndexCategory/GetList",
|
|
|
189
|
+ // url:'//117.158.196.116:8878/IndexCategory/GetList',
|
|
|
190
|
+ dataType: 'json',
|
|
|
191
|
+ async: true,
|
|
|
192
|
+ data:{
|
|
|
193
|
+ token:token
|
|
|
194
|
+ },
|
|
|
195
|
+ success: function(data) {
|
|
|
196
|
+ console.log(data.rows);
|
|
|
197
|
+ var conent=data.rows;
|
|
|
198
|
+ for(var i=0;i<conent.length;i++){
|
|
|
199
|
+ if(conent[i].F_ParentId==0){
|
|
|
200
|
+ $('<option value="'+conent[i].F_ParentId+'">'+conent[i].F_CategoryName+'</option>').appendTo($("#Left_ParentId"))
|
|
|
201
|
+ }
|
|
|
202
|
+ }
|
|
|
203
|
+ }
|
|
|
204
|
+ });
|
|
|
205
|
+ }
|
|
|
206
|
+ //编辑指标分类
|
|
|
207
|
+ function EditIndexCategory(Left_Cids,Left_CategoryName,Left_Sort,Left_Pid){
|
|
|
208
|
+ $.ajax({
|
|
|
209
|
+ type: "post",
|
|
|
210
|
+ url: huayi.config.callcenter_url + "IndexCategory/EditIndexCategory",
|
|
|
211
|
+// url: '//117.158.196.116:8878/IndexCategory/EditIndexCategory',
|
|
|
212
|
+ dataType: 'json',
|
|
|
213
|
+ data: {
|
|
|
214
|
+ cid:Left_Cids,
|
|
|
215
|
+ categoryName:Left_CategoryName,
|
|
|
216
|
+ sort:Left_Sort,
|
|
|
217
|
+ pid:Left_Pid,
|
|
|
218
|
+ token:token
|
|
|
219
|
+ },
|
|
|
220
|
+ async: true,
|
|
|
221
|
+ success: function(data) {
|
|
|
222
|
+ layer.msg("修改成功");
|
|
|
223
|
+ IndexCategoryGe();
|
|
|
224
|
+ Left_clean();
|
|
|
225
|
+ }
|
|
|
226
|
+ });
|
|
|
227
|
+ }
|
|
|
228
|
+
|
|
|
229
|
+ $("#Left_xgbtn").click(function(){
|
|
|
230
|
+ Left_CategoryName=escape($("#Left_CategoryName").val());
|
|
|
231
|
+ Left_Sort=$("#Left_Sort").val();
|
|
|
232
|
+ EditIndexCategory(Left_Cids,Left_CategoryName,Left_Sort,Left_Pid);
|
|
|
233
|
+ })
|
|
|
234
|
+ //增加
|
|
|
235
|
+ $(".leftAdd").click(function(){
|
|
|
236
|
+// if(Left_Pid){
|
|
|
237
|
+// $(".model").show();
|
|
|
238
|
+// $(".rightBox").hide();
|
|
|
239
|
+// $("#Left_xgbtn").hide();
|
|
|
240
|
+// $(".leftBox").show();
|
|
|
241
|
+// }
|
|
|
242
|
+// $(".model").show();
|
|
|
243
|
+// $(".rightBox").hide();
|
|
|
244
|
+// $("#Left_xgbtn").hide();
|
|
|
245
|
+// $(".leftBox").show();
|
|
|
246
|
+layer.open({
|
|
|
247
|
+ type: 2,
|
|
|
248
|
+ content: "../Questionnaire/add.html", //iframe的url,no代表不显示滚动条
|
|
|
249
|
+ title: '添加分类',
|
|
|
250
|
+ area: ['35%', '30%'], //宽高
|
|
|
251
|
+ });
|
|
|
252
|
+ });
|
|
|
253
|
+ $("#Left_add").click(function(){
|
|
|
254
|
+ Left_CategoryName=escape($("#Left_CategoryName").val());
|
|
|
255
|
+ Left_Sort=$("#Left_Sort").val();
|
|
|
256
|
+ console.log(Left_CategoryName,Left_Sort,Left_Pid);
|
|
|
257
|
+ AddIndexCategory(Left_CategoryName,Left_Sort,Left_Pid)
|
|
|
258
|
+ });
|
|
|
259
|
+ function AddIndexCategory(Left_CategoryName,Left_Sort,Left_Pid){
|
|
|
260
|
+ $.ajax({
|
|
|
261
|
+ type: "post",
|
|
|
262
|
+ url: huayi.config.callcenter_url + "IndexCategory/AddIndexCategory",
|
|
|
263
|
+// url: '//117.158.196.116:8878/IndexCategory/AddIndexCategory',
|
|
|
264
|
+ dataType: 'json',
|
|
|
265
|
+ data: {
|
|
|
266
|
+ categoryName:Left_CategoryName,
|
|
|
267
|
+ sort:Left_Sort,
|
|
|
268
|
+ pid:Left_Pid,
|
|
|
269
|
+ token:token
|
|
|
270
|
+ },
|
|
|
271
|
+ async: true,
|
|
|
272
|
+ success: function(data) {
|
|
|
273
|
+ layer.msg("添加成功");
|
|
|
274
|
+ IndexCategoryGe();
|
|
|
275
|
+ Left_clean();
|
|
|
276
|
+ }
|
|
|
277
|
+ });
|
|
|
278
|
+ }
|
|
|
279
|
+ function Left_clean(){
|
|
|
280
|
+ $("#Left_CategoryName").val('');
|
|
|
281
|
+ $("#Left_Sort").val('');
|
|
|
282
|
+ $(".model").hide();
|
|
|
283
|
+ }
|
|
|
284
|
+////////////////////////////////////////////////////////////////右边表格
|
|
|
285
|
+ function Finish(Keys,Left_Cids) {
|
|
|
286
|
+ //销毁表格
|
|
|
287
|
+ $tableLeft.bootstrapTable('destroy');
|
|
|
288
|
+ //初始化表格,动态从服务器加载数据
|
|
|
289
|
+ $tableLeft.bootstrapTable({
|
|
|
290
|
+ method: "get", //使用get请求到服务器获取数据
|
|
|
291
|
+ url: huayi.config.callcenter_url + "IndexBase/GetList",
|
|
|
292
|
+// url: "//117.158.196.116:8878/IndexBase/GetList",
|
|
|
293
|
+ striped: true, //表格显示条纹
|
|
|
294
|
+ pagination: true, //启动分页
|
|
|
295
|
+ pageSize: 5, //每页显示的记录数
|
|
|
296
|
+ pageNumber: 1, //当前第几页
|
|
|
297
|
+ pageList: [5, 20, 50, 100], //记录数可选列表
|
|
|
298
|
+ search: false, //是否启用查询
|
|
|
299
|
+ showColumns: false, //显示下拉框勾选要显示的列
|
|
|
300
|
+ showRefresh: false, //显示刷新按钮
|
|
|
301
|
+ sidePagination: "server", //表示服务端请求
|
|
|
302
|
+ //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
|
|
303
|
+ //设置为limit可以获取limit, offset, search, sort, order
|
|
|
304
|
+ queryParamsType: "undefined",
|
|
|
305
|
+ queryParams: function queryParams(params) { //设置查询参数
|
|
|
306
|
+ var param = {
|
|
|
307
|
+ page: params.pageNumber,
|
|
|
308
|
+ pagesize: params.pageSize,
|
|
|
309
|
+ categoryid:Left_Cids,
|
|
|
310
|
+ key: Keys
|
|
|
311
|
+
|
|
|
312
|
+ };
|
|
|
313
|
+ return param;
|
|
|
314
|
+ },
|
|
|
315
|
+ onLoadSuccess: function() { //加载成功时执行
|
|
|
316
|
+ // layer.msg("加载成功");
|
|
|
317
|
+ },
|
|
|
318
|
+ onLoadError: function() { //加载失败时执行
|
|
|
319
|
+ //layer.msg("加载数据失败", { time: 1500, icon: 2 });
|
|
|
320
|
+ }
|
|
|
321
|
+ });
|
|
|
322
|
+ }
|
|
|
323
|
+ function Right(Left_Cids){
|
|
|
324
|
+ $tableLeft.bootstrapTable('destroy');
|
|
|
325
|
+ //初始化表格,动态从服务器加载数据
|
|
|
326
|
+ $tableLeft.bootstrapTable({
|
|
|
327
|
+ method: "get", //使用get请求到服务器获取数据
|
|
|
328
|
+ url: huayi.config.callcenter_url + "IndexBase/GetList",
|
|
|
329
|
+// url: "//117.158.196.116:8878/IndexBase/GetList",
|
|
|
330
|
+ striped: true, //表格显示条纹
|
|
|
331
|
+ pagination: true, //启动分页
|
|
|
332
|
+ pageSize: 5, //每页显示的记录数
|
|
|
333
|
+ pageNumber: 1, //当前第几页
|
|
|
334
|
+ pageList: [5, 20, 50, 100], //记录数可选列表
|
|
|
335
|
+ search: false, //是否启用查询
|
|
|
336
|
+ showColumns: false, //显示下拉框勾选要显示的列
|
|
|
337
|
+ showRefresh: false, //显示刷新按钮
|
|
|
338
|
+ sidePagination: "server", //表示服务端请求
|
|
|
339
|
+ //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
|
|
340
|
+ //设置为limit可以获取limit, offset, search, sort, order
|
|
|
341
|
+ queryParamsType: "undefined",
|
|
|
342
|
+ queryParams: function queryParams(params) { //设置查询参数
|
|
|
343
|
+ var param = {
|
|
|
344
|
+ page: params.pageNumber,
|
|
|
345
|
+ pagesize: params.pageSize,
|
|
|
346
|
+ categoryid:Left_Cids,
|
|
|
347
|
+
|
|
|
348
|
+ };
|
|
|
349
|
+ return param;
|
|
|
350
|
+ },
|
|
|
351
|
+ onLoadSuccess: function() { //加载成功时执行
|
|
|
352
|
+ // layer.msg("加载成功");
|
|
|
353
|
+ },
|
|
|
354
|
+ onLoadError: function() { //加载失败时执行
|
|
|
355
|
+ //layer.msg("加载数据失败", { time: 1500, icon: 2 });
|
|
|
356
|
+ }
|
|
|
357
|
+ });
|
|
|
358
|
+ }
|
|
|
359
|
+ /*获取选中行对象*/
|
|
|
360
|
+ $tableLeft.on("click-row.bs.table", function(e, row, ele) {
|
|
|
361
|
+ $('.success').removeClass('success'); //去除之前选中的行的,选中样式
|
|
|
362
|
+ $(ele).addClass('success'); //添加当前选中的 success样式用于区别
|
|
|
363
|
+ Cids = row.F_CategoryId; //分类ID
|
|
|
364
|
+ ids = row.F_IndexId; //指标ID
|
|
|
365
|
+ CategoryName = row.F_CategoryName; //分类名称
|
|
|
366
|
+ Sort = row.F_Sort; //排序
|
|
|
367
|
+ Pid = row.F_ParentId; //父id
|
|
|
368
|
+ });
|
|
|
369
|
+ //增加
|
|
|
370
|
+ $(".rightAdd").click(function() {
|
|
|
371
|
+// $(".model").show();
|
|
|
372
|
+// $(".rightBox").show();
|
|
|
373
|
+// $(".leftBox").hide();
|
|
|
374
|
+// $("#add").show();
|
|
|
375
|
+// $('#xg_btn').hide();
|
|
|
376
|
+layer.open({
|
|
|
377
|
+ type: 2,
|
|
|
378
|
+ content: "../Questionnaire/AddRight.html", //iframe的url,no代表不显示滚动条
|
|
|
379
|
+ title: '添加分类',
|
|
|
380
|
+ area: ['45%', '60%'], //宽高
|
|
|
381
|
+ });
|
|
|
382
|
+
|
|
|
383
|
+ })
|
|
|
384
|
+ //修改功能
|
|
|
385
|
+ $(".rightChange ").click(function() {
|
|
|
386
|
+ if(Cids, ids) {
|
|
|
387
|
+ $(".model").show();
|
|
|
388
|
+ $(".rightBox").show();
|
|
|
389
|
+ $("#add").hide();
|
|
|
390
|
+ $(".leftBox").hide();
|
|
|
391
|
+ $("#xg_btn").show();
|
|
|
392
|
+ GetIndexBase(ids);
|
|
|
393
|
+
|
|
|
394
|
+ } else {
|
|
|
395
|
+ layer.msg('没有可修改的选项!');
|
|
|
396
|
+ Clean();
|
|
|
397
|
+ }
|
|
|
398
|
+ })
|
|
|
399
|
+ //删除
|
|
|
400
|
+ $('.rightDelete').click(function() {
|
|
|
401
|
+ if(Cids, ids) {
|
|
|
402
|
+ Delet(Cids, ids);
|
|
|
403
|
+ GetIndexCategory();
|
|
|
404
|
+ } else {
|
|
|
405
|
+ layer.msg('没有可删除的选项!');
|
|
|
406
|
+
|
|
|
407
|
+ }
|
|
|
408
|
+ })
|
|
|
409
|
+ //编号
|
|
|
410
|
+ function setCode(val, row, index) {
|
|
|
411
|
+ return index + 1;
|
|
|
412
|
+ }
|
|
|
413
|
+ //删除指标
|
|
|
414
|
+ function Delet(Cids, ids) {
|
|
|
415
|
+ $.ajax({
|
|
|
416
|
+ type: "get",
|
|
|
417
|
+ url: huayi.config.callcenter_url + "IndexBase/DelIndexBase",
|
|
|
418
|
+// url: '//117.158.196.116:8878/IndexBase/DelIndexBase',
|
|
|
419
|
+ dataType: 'json',
|
|
|
420
|
+ data: {
|
|
|
421
|
+ id: ids,
|
|
|
422
|
+ cid: Cids,
|
|
|
423
|
+ token:token
|
|
|
424
|
+ },
|
|
|
425
|
+ async: true,
|
|
|
426
|
+ success: function(data) {
|
|
|
427
|
+ layer.msg("删除成功");
|
|
|
428
|
+ Finish();
|
|
|
429
|
+ }
|
|
|
430
|
+ });
|
|
|
431
|
+ }
|
|
|
432
|
+ //关闭阴影
|
|
|
433
|
+ $(".rbtr").click(function() {
|
|
|
434
|
+ $(".model").hide();
|
|
|
435
|
+ })
|
|
|
436
|
+ //获取指标
|
|
|
437
|
+ function GetIndexBase(ids) {
|
|
|
438
|
+ $.ajax({
|
|
|
439
|
+ type: "get",
|
|
|
440
|
+ url: huayi.config.callcenter_url + "IndexBase/GetIndexBase",
|
|
|
441
|
+// url: '//117.158.196.116:8878/IndexBase/GetIndexBase',
|
|
|
442
|
+ dataType: 'json',
|
|
|
443
|
+ data: {
|
|
|
444
|
+ id: ids,
|
|
|
445
|
+ token:token
|
|
|
446
|
+ },
|
|
|
447
|
+ async: true,
|
|
|
448
|
+ success: function(data) {
|
|
|
449
|
+ if(data.state == "success") {
|
|
|
450
|
+ $("._CategoryName").val(data.data.F_CategoryName);
|
|
|
451
|
+ $("._Score").val(data.data.F_Score);
|
|
|
452
|
+ $("._Sort").val(data.data.F_Sort);
|
|
|
453
|
+ $(".F_Title").val(data.data.F_Title);
|
|
|
454
|
+ $(".F_Remark").val(data.data.F_Remark);
|
|
|
455
|
+ } else {
|
|
|
456
|
+ alert("获取失败");
|
|
|
457
|
+ }
|
|
|
458
|
+ }
|
|
|
459
|
+ });
|
|
|
460
|
+ }
|
|
|
461
|
+
|
|
|
462
|
+//修改保存
|
|
|
463
|
+ $("#xg_btn").click(function() {
|
|
|
464
|
+ CategoryName = $("._CategoryName").val();
|
|
|
465
|
+ Score = $("._Score").val();
|
|
|
466
|
+ Sort = $("._Sort").val();
|
|
|
467
|
+ Title = $(".F_Title").val();
|
|
|
468
|
+ Remark = $(".F_Remark").val();
|
|
|
469
|
+ console.log(Score, Sort, Title, Remark, Cids, ids);
|
|
|
470
|
+ EditIndexBas(Cids, ids, Sort, Score, Title, Remark);
|
|
|
471
|
+ });
|
|
|
472
|
+//增加按钮
|
|
|
473
|
+$("#add").click(function(){
|
|
|
474
|
+ Score = $("._Score").val();
|
|
|
475
|
+ Sort = $("._Sort").val();
|
|
|
476
|
+ Title = $(".F_Title").val();
|
|
|
477
|
+ Remark = escape($(".F_Remark").val());
|
|
|
478
|
+ AddIndexBase(Cids, Sort, Score, Title, Remark)
|
|
|
479
|
+});
|
|
|
480
|
+//编辑指标
|
|
|
481
|
+ function EditIndexBas(Cids, ids, Sort, Score, Title, Remark) {
|
|
|
482
|
+ $.ajax({
|
|
|
483
|
+ type: "post",
|
|
|
484
|
+ // url: huayi.config.callcenter_url + "IndexBase/EditIndexBasey",
|
|
|
485
|
+ url: '//117.158.196.116:8878/IndexBase/EditIndexBase',
|
|
|
486
|
+ dataType: 'json',
|
|
|
487
|
+ data: {
|
|
|
488
|
+ id: ids,
|
|
|
489
|
+ cid: Cids, //指标分类id
|
|
|
490
|
+ sort: Sort, //排序
|
|
|
491
|
+ score: Score,
|
|
|
492
|
+ title: Title,
|
|
|
493
|
+ remark: Remark,
|
|
|
494
|
+ token:token
|
|
|
495
|
+ },
|
|
|
496
|
+ async: true,
|
|
|
497
|
+ success: function(data) {
|
|
|
498
|
+ if(data.state == "success") {
|
|
|
499
|
+ Clean();
|
|
|
500
|
+ layer.msg('修改成功!');
|
|
|
501
|
+ Finish();
|
|
|
502
|
+ } else {
|
|
|
503
|
+ alert("修改失败");
|
|
|
504
|
+ $(".model").hide();
|
|
|
505
|
+ }
|
|
|
506
|
+ }
|
|
|
507
|
+ });
|
|
|
508
|
+ }
|
|
|
509
|
+
|
|
|
510
|
+//添加指标
|
|
|
511
|
+ function AddIndexBase(Cids, Sort, Score, Title, Remark) {
|
|
|
512
|
+ $.ajax({
|
|
|
513
|
+ type: "post",
|
|
|
514
|
+ url: huayi.config.callcenter_url + "IndexBase/AddIndexBase",
|
|
|
515
|
+// url: '//117.158.196.116:8878/IndexBase/AddIndexBase',
|
|
|
516
|
+ dataType: 'json',
|
|
|
517
|
+ data: {
|
|
|
518
|
+ cid: Cids, //指标分类id
|
|
|
519
|
+ sort: Sort, //排序
|
|
|
520
|
+ score: Score,
|
|
|
521
|
+ title: Title,
|
|
|
522
|
+ remark: Remark,
|
|
|
523
|
+ token:token
|
|
|
524
|
+ },
|
|
|
525
|
+ async: true,
|
|
|
526
|
+ success: function(data) {
|
|
|
527
|
+ if(data.state == "success") {
|
|
|
528
|
+ Clean();
|
|
|
529
|
+ layer.msg('添加成功!');
|
|
|
530
|
+ Finish();
|
|
|
531
|
+ } else {
|
|
|
532
|
+ alert("2");
|
|
|
533
|
+ $(".model").hide();
|
|
|
534
|
+ }
|
|
|
535
|
+ }
|
|
|
536
|
+ });
|
|
|
537
|
+ }
|