|
|
@@ -122,6 +122,44 @@
|
|
122
|
122
|
#sponsor li:hover{
|
|
123
|
123
|
background: #00a1cb;
|
|
124
|
124
|
}
|
|
|
125
|
+ .thumbnail {
|
|
|
126
|
+ margin: 0 10px 10px;
|
|
|
127
|
+ padding: 4px;
|
|
|
128
|
+ float: left;
|
|
|
129
|
+ width: 30%;
|
|
|
130
|
+ height: 200px;
|
|
|
131
|
+ background-color: #fff;
|
|
|
132
|
+ border: 1px solid #ddd;
|
|
|
133
|
+ border-radius: 4px;
|
|
|
134
|
+ position: relative;
|
|
|
135
|
+ cursor: pointer;
|
|
|
136
|
+ }
|
|
|
137
|
+
|
|
|
138
|
+ .thumbnail img {
|
|
|
139
|
+ width: 100%;
|
|
|
140
|
+ height: 100%;
|
|
|
141
|
+ }
|
|
|
142
|
+ .thumbnail .info {
|
|
|
143
|
+ position: absolute;
|
|
|
144
|
+ left: 4px;
|
|
|
145
|
+ bottom: 4px;
|
|
|
146
|
+ right: 4px;
|
|
|
147
|
+ height: 35px;
|
|
|
148
|
+ line-height: 35px;
|
|
|
149
|
+ text-indent: 5px;
|
|
|
150
|
+ background: rgba(0, 0, 0, 0.6);
|
|
|
151
|
+ color: white;
|
|
|
152
|
+ overflow: hidden;
|
|
|
153
|
+ white-space: nowrap;
|
|
|
154
|
+ text-overflow: ellipsis;
|
|
|
155
|
+ font-size: 12px;
|
|
|
156
|
+ z-index: 10;
|
|
|
157
|
+ display: none;
|
|
|
158
|
+ }
|
|
|
159
|
+
|
|
|
160
|
+ .thumbnail:hover .info {
|
|
|
161
|
+ display: block;
|
|
|
162
|
+ }
|
|
125
|
163
|
</style>
|
|
126
|
164
|
</head>
|
|
127
|
165
|
|
|
|
@@ -274,8 +312,9 @@
|
|
274
|
312
|
<i class="loader_icon"></i>
|
|
275
|
313
|
</div>
|
|
276
|
314
|
|
|
277
|
|
- <div id='image_list0' class="row image-list"></div>
|
|
|
315
|
+ <div id='image_list0' class="row image-list "></div>
|
|
278
|
316
|
</div>
|
|
|
317
|
+
|
|
279
|
318
|
</div>
|
|
280
|
319
|
|
|
281
|
320
|
<!--<div class="form-group">
|
|
|
@@ -297,6 +336,7 @@
|
|
297
|
336
|
<script src="../js/addEquipmentRepair.js"></script>
|
|
298
|
337
|
<script>
|
|
299
|
338
|
var ids = helper.request.queryString("ids");
|
|
|
339
|
+ var ajaxUrl;
|
|
300
|
340
|
//报修时间
|
|
301
|
341
|
function getFormatDate() {
|
|
302
|
342
|
var nowDate = new Date();
|
|
|
@@ -327,11 +367,54 @@
|
|
327
|
367
|
// helper.getDropList.getlistDropByDic($('#repairreplace'), 'BXDD');
|
|
328
|
368
|
//故障类型
|
|
329
|
369
|
// helper.getDropList.getlistDropByDic($('#faulttype'), 'GZLX');
|
|
330
|
|
-
|
|
|
370
|
+ if (ids) {
|
|
|
371
|
+ $("#filePicker0").hide()
|
|
|
372
|
+ ajaxUrl = "equipmentapi/api/worepairbase/update";
|
|
|
373
|
+ getValue(ids);
|
|
|
374
|
+ } else {
|
|
|
375
|
+ $("#filePicker0").show()
|
|
|
376
|
+ ajaxUrl = "equipmentapi/api/worepairbase/add";
|
|
|
377
|
+ }
|
|
331
|
378
|
//省市
|
|
332
|
379
|
getProvinceCity($('#province'));
|
|
333
|
380
|
getequipment()
|
|
334
|
381
|
})
|
|
|
382
|
+ //获取详情
|
|
|
383
|
+ function getValue(ids) {
|
|
|
384
|
+ $.ajax({
|
|
|
385
|
+ type: "get",
|
|
|
386
|
+ url: huayi.config.callcenter_url + "equipmentapi/api/worepairbase/getsingle",
|
|
|
387
|
+ async: true,
|
|
|
388
|
+ dataType: 'json',
|
|
|
389
|
+ data: {
|
|
|
390
|
+ id: ids
|
|
|
391
|
+ },
|
|
|
392
|
+ success: function(data) {
|
|
|
393
|
+ if (data.state.toLowerCase() == 'success') {
|
|
|
394
|
+ var modelList = data.data.model
|
|
|
395
|
+ $('#channel').selectpicker('val', modelList.channel.toString()).trigger('change') //渠道
|
|
|
396
|
+ $("#formComplainedUnit").val(modelList.repairman) // 报修人
|
|
|
397
|
+ $('#contactway').val(modelList.contactway) //联系方式
|
|
|
398
|
+ $('#build').selectpicker('val', modelList.buildid.toString()).trigger('change') //楼
|
|
|
399
|
+ $('#repairoom').val(modelList.repairoom) // 报修地点
|
|
|
400
|
+ $('#floor').selectpicker('val', modelList.floorid.toString()).trigger('change') //科室
|
|
|
401
|
+ $(".selequipname").val(modelList.faultdescripe) //设备名称
|
|
|
402
|
+
|
|
|
403
|
+
|
|
|
404
|
+ if (modelList.faultpic) {
|
|
|
405
|
+ $(modelList.faultpic).each(function(g, h) {
|
|
|
406
|
+ $('<div class="thumbnail" data-fileurl="' + h.fileurl + '">' +
|
|
|
407
|
+ '<img layer-src="' + h.fileurl + '" alt="' + h.filename + '" src="' + h.filesmallurl + '" alt="" />' +
|
|
|
408
|
+ '<div class="info">' + h.filename + '</div>' +
|
|
|
409
|
+ '</div>').appendTo('#image_list0')
|
|
|
410
|
+ });
|
|
|
411
|
+
|
|
|
412
|
+ }
|
|
|
413
|
+ }
|
|
|
414
|
+ }
|
|
|
415
|
+ });
|
|
|
416
|
+
|
|
|
417
|
+ }
|
|
335
|
418
|
uploaderImg(0)
|
|
336
|
419
|
var imageArr0 = '';
|
|
337
|
420
|
//添加图片
|
|
|
@@ -500,46 +583,46 @@
|
|
500
|
583
|
|
|
501
|
584
|
}
|
|
502
|
585
|
})
|
|
503
|
|
-
|
|
|
586
|
+
|
|
504
|
587
|
//报修人
|
|
505
|
588
|
function darptSearch() {
|
|
506
|
|
- if ($('#formComplainedUnit').val() == '') {
|
|
507
|
|
- $(".selDpart1").css('display', 'none');
|
|
508
|
|
- } else {
|
|
509
|
|
- $(".selDpart1").css('display', 'block');
|
|
510
|
|
- getFormComplainedUnit();
|
|
511
|
|
- }
|
|
|
589
|
+ if ($('#formComplainedUnit').val() == '') {
|
|
|
590
|
+ $(".selDpart1").css('display', 'none');
|
|
|
591
|
+ } else {
|
|
|
592
|
+ $(".selDpart1").css('display', 'block');
|
|
|
593
|
+ getFormComplainedUnit();
|
|
|
594
|
+ }
|
|
512
|
595
|
}
|
|
513
|
596
|
$("#sponsor").on('click', 'li', function() {
|
|
514
|
597
|
$(".selDpart1").css('display', 'none');
|
|
515
|
598
|
$("#formComplainedUnit").val($(this).html());
|
|
516
|
599
|
})
|
|
517
|
|
-
|
|
|
600
|
+
|
|
518
|
601
|
function getFormComplainedUnit() {
|
|
519
|
602
|
$("#sponsor").empty();
|
|
520
|
|
- $.ajax({
|
|
521
|
|
- type: "get",
|
|
522
|
|
- url: huayi.config.callcenter_url + "testusertypeapi/api/TestUserType/getuserinfobycodename",
|
|
523
|
|
- dataType: 'json',
|
|
524
|
|
- async: true,
|
|
525
|
|
- data: {
|
|
526
|
|
-
|
|
527
|
|
- codename: $("#formComplainedUnit").val(),
|
|
528
|
|
-
|
|
529
|
|
- },
|
|
530
|
|
- success: function(data) {
|
|
531
|
|
- if (data.state.toLowerCase() == "success") {
|
|
532
|
|
- var content = data.data;
|
|
533
|
|
- if (content.length === 0) {
|
|
534
|
|
- $(".selDpart1").css('display', 'none');
|
|
535
|
|
- } else {
|
|
536
|
|
- $(content).each(function (i, n) {
|
|
537
|
|
- $("<li index='" + n.usercode + "' >" + n.usercode + '-'+n.username + "</li>").appendTo("#sponsor");
|
|
538
|
|
- })
|
|
539
|
|
- }
|
|
540
|
|
- }
|
|
541
|
|
- }
|
|
542
|
|
- });
|
|
|
603
|
+ $.ajax({
|
|
|
604
|
+ type: "get",
|
|
|
605
|
+ url: huayi.config.callcenter_url + "testusertypeapi/api/TestUserType/getuserinfobycodename",
|
|
|
606
|
+ dataType: 'json',
|
|
|
607
|
+ async: true,
|
|
|
608
|
+ data: {
|
|
|
609
|
+
|
|
|
610
|
+ codename: $("#formComplainedUnit").val(),
|
|
|
611
|
+
|
|
|
612
|
+ },
|
|
|
613
|
+ success: function(data) {
|
|
|
614
|
+ if (data.state.toLowerCase() == "success") {
|
|
|
615
|
+ var content = data.data;
|
|
|
616
|
+ if (content.length === 0) {
|
|
|
617
|
+ $(".selDpart1").css('display', 'none');
|
|
|
618
|
+ } else {
|
|
|
619
|
+ $(content).each(function(i, n) {
|
|
|
620
|
+ $("<li index='" + n.usercode + "' >" + n.usercode + '-' + n.username + "</li>").appendTo("#sponsor");
|
|
|
621
|
+ })
|
|
|
622
|
+ }
|
|
|
623
|
+ }
|
|
|
624
|
+ }
|
|
|
625
|
+ });
|
|
543
|
626
|
}
|
|
544
|
627
|
//添加
|
|
545
|
628
|
function addValue() {
|
|
|
@@ -566,7 +649,7 @@
|
|
566
|
649
|
return;
|
|
567
|
650
|
}
|
|
568
|
651
|
|
|
569
|
|
- if (! $("#formComplainedUnit").val()) {
|
|
|
652
|
+ if (!$("#formComplainedUnit").val()) {
|
|
570
|
653
|
layer.confirm('请输入报修人!', {
|
|
571
|
654
|
icon: 2,
|
|
572
|
655
|
btn: ['确定'] //按钮
|
|
|
@@ -592,10 +675,11 @@
|
|
592
|
675
|
// debugger
|
|
593
|
676
|
$.ajax({
|
|
594
|
677
|
type: "post",
|
|
595
|
|
- url: huayi.config.callcenter_url + "equipmentapi/api/worepairbase/add",
|
|
|
678
|
+ url: huayi.config.callcenter_url + ajaxUrl,
|
|
596
|
679
|
async: true,
|
|
597
|
680
|
dataType: 'json',
|
|
598
|
681
|
data: {
|
|
|
682
|
+ id: ids,
|
|
599
|
683
|
channel: $('#channel').val(), // 是 渠道来源 1表示PC 2表示安卓 3表示IOS 4表示微信
|
|
600
|
684
|
province: $('#province').val(), //省
|
|
601
|
685
|
city: $('#city').val(), //市
|
|
|
@@ -606,7 +690,7 @@
|
|
606
|
690
|
repairreplace: repairplaceStr, // 报修地点
|
|
607
|
691
|
repairoom: $('#repairoom').val(), // 房间号
|
|
608
|
692
|
repairtime: getFormatDate(), // 报修时间
|
|
609
|
|
- repairman: $("#formComplainedUnit").val(), // 是 string 报修人
|
|
|
693
|
+ repairman: $("#formComplainedUnit").val(), // 是 string 报修人
|
|
610
|
694
|
contactway: $('#contactway').val(), // 是 string 联系方式
|
|
611
|
695
|
faultdescripe: $(".selequipname").val(), // $('#faultdescripe').val(), // 否 string 故障说明
|
|
612
|
696
|
faultpic: imageArr0 // 故障图片,上传的json
|