瀏覽代碼

报修平台编辑

yangjunfeng 5 年之前
父節點
當前提交
97bf2f6efb

+ 16 - 14
WebUI/CallCenterWeb.UI/equipmentOperationManage/equipmentRepair.html

@@ -49,6 +49,15 @@
49 49
 			<div class="th-box">
50 50
 				<div class="form-inline th-bar clearfix">
51 51
 					<div class="form-group time-box">
52
+					    <select class="form-control selectpicker" id="channelSource" data-live-search="true">
53
+					    <option value="">请选择渠道来源</option>
54
+					    <option value="1">电话</option>
55
+							<option value="2">安卓</option>
56
+							<option value="3">IOS </option>
57
+							<option value="4">PC端</option>
58
+						</select>
59
+					</div>
60
+					<div class="form-group time-box">
52 61
 						<select class="form-control selectpicker" id="proname" data-live-search="true">
53 62
 							<option value="">请选择项目名称</option>
54 63
 						</select>
@@ -64,21 +73,13 @@
64 73
 					</div>
65 74
 					<div class="form-group time-box">
66 75
 						<i class="tub fa fa-search"></i>
67
-						<input class="form-control" type="text" id="phone" placeholder="请输入联系电话">
76
+						<input class="form-control" type="text" id="phone" placeholder="请输入关键字">
68 77
 					</div>
69
-					<div class="form-group time-box">
78
+					<!-- <div class="form-group time-box">
70 79
 						<i class="tub fa fa-search"></i>
71 80
 						<input class="form-control" type="text" id="wocode" placeholder="请输入工单编号">
72
-                    </div>
73
-                    <div class="form-group time-box">
74
-                        <select class="form-control selectpicker" id="channelSource" data-live-search="true">
75
-                        <option value="">请选择渠道来源</option>
76
-                        <option value="1">电话</option>
77
-							<option value="2">安卓</option>
78
-							<option value="3">IOS </option>
79
-							<option value="4">PC端</option>
80
-						</select>
81
-					</div>
81
+                    </div> -->
82
+                  
82 83
 					<div class="form-group tool_bars pull-right">
83 84
 						<input type="button" class="btn_gray" id="sc_btns" value="搜索" />
84 85
 						<input type="button" class="btn_gray" authorize="yes" id="HY_add" onclick="btn_add()" value="添加" />
@@ -132,7 +133,7 @@
132 133
 									<th data-field="wocode" data-align="center">工单编号</th>
133 134
 									<!--<th data-field="callid" data-align="center">通话标志ID</th>-->
134 135
 									<th data-field="channel" data-align="center" data-formatter="formatterChannel">渠道来源</th>
135
-									<th data-field="province" data-align="center" data-formatter="formatterLocation">省市</th>
136
+									<!-- <th data-field="province" data-align="center" data-formatter="formatterLocation">省市</th> -->
136 137
 									<th data-field="projectname" data-align="center">项目名称</th>
137 138
 									<!--<th data-field="protypename" data-align="center">项目类型</th>-->
138 139
 									<th data-field="repairreplace" data-formatter="formatterRepairPlace" data-align="center">报修科室</th>
@@ -146,8 +147,9 @@
146 147
 									<th data-field="faulttype" data-align="center">故障类型</th>-->
147 148
 									<th data-field="faultdescripe" data-align="center" data-formatter="formatterDescripe">设备名称</th>
148 149
 									<!--<th data-field="appointman" data-align="center">指定维修人</th>-->
149
-                                      <th data-field="" data-align="center" data-formatter="formatterToUser">接单人</th>
150
+                                      
150 151
 									<th data-field="Jwocode" data-align="center">接单班组</th>
152
+									<th data-field="" data-align="center" data-formatter="formatterToUser">接单人</th>
151 153
 									<th data-field="totime" data-align="center">接单时间</th>
152 154
 									<th data-field="dealtime" data-align="center">处理时间</th>
153 155
 									<th data-field="CLpeoplefrom" data-align="center">来源</th>

+ 16 - 0
WebUI/CallCenterWeb.UI/equipmentOperationManage/js/equipmentRepair.js

@@ -193,6 +193,8 @@ function formatterOperate(val, row) {
193 193
 				'\')"><i class="fa icon-qiangdan tub"></i>抢单</a><li>' +
194 194
 				'<li><a class="aBtn" authorize="yes" id="HY_details_' + row.id + '" onclick="btn_details(\'' + row.id +
195 195
 				'\')"><i class="fa icon-detail tub"></i>详情</a><li>' +
196
+				'<li><a class="aBtn" authorize="yes" id="HY_edit_' + row.id + '" onclick="btn_edit(\'' + row.id +
197
+				'\')"><i class="fa icon-edit tub"></i>编辑</a><li>' +
196 198
 				'<li><a class="aBtn" authorize="yes" id="HY_delete_' + row.id + '" onclick="btn_delete(\'' + row.id +
197 199
 				'\')"><i class="fa icon-delete tub"></i>删除</a><li>'
198 200
 			break;
@@ -203,6 +205,7 @@ function formatterOperate(val, row) {
203 205
 				row.floorid + '\')"><i class="fa icon-msnui-audit tub"></i>处理</a><li>' +
204 206
 				'<li><a class="aBtn" authorize="yes" id="HY_details_' + row.id + '" onclick="btn_details(\'' + row.id +
205 207
 				'\')"><i class="fa icon-detail tub"></i>详情</a><li>' +
208
+				
206 209
 				'<li><a class="aBtn" authorize="yes" id="HY_delete_' + row.id + '" onclick="btn_delete(\'' + row.id +
207 210
 				'\')"><i class="fa icon-delete tub"></i>删除</a><li>'
208 211
 			break;
@@ -211,12 +214,14 @@ function formatterOperate(val, row) {
211 214
 				'\')"><i class="fa icon-zan tub"></i>评价</a><li>' +
212 215
 				'<li><a class="aBtn" authorize="yes" id="HY_details_' + row.id + '" onclick="btn_details(\'' + row.id +
213 216
 				'\')"><i class="fa icon-detail tub"></i>详情</a><li>' +
217
+				
214 218
 				'<li><a class="aBtn" authorize="yes" id="HY_delete_' + row.id + '" onclick="btn_delete(\'' + row.id +
215 219
 				'\')"><i class="fa icon-delete tub"></i>删除</a><li>'
216 220
 			break;
217 221
 		case '3':
218 222
 			str += '<li><a class="aBtn" authorize="yes" id="HY_details_' + row.id + '" onclick="btn_details(\'' + row.id +
219 223
 				'\')"><i class="fa icon-detail tub"></i>详情</a><li>' +
224
+				
220 225
 				'<li><a class="aBtn" authorize="yes" id="HY_delete_' + row.id + '" onclick="btn_delete(\'' + row.id +
221 226
 				'\')"><i class="fa icon-delete tub"></i>删除</a><li>'
222 227
 			break;
@@ -225,12 +230,14 @@ function formatterOperate(val, row) {
225 230
 				'\',\'' + row.wocode + '\')"><i class="fa icon-paidan tub"></i>派单</a><li>' +
226 231
 				'<li><a class="aBtn" authorize="yes" id="HY_details_' + row.id + '" onclick="btn_details(\'' + row.id +
227 232
 				'\')"><i class="fa icon-detail tub"></i>详情</a><li>' +
233
+				
228 234
 				'<li><a class="aBtn" authorize="yes" id="HY_delete_' + row.id + '" onclick="btn_delete(\'' + row.id +
229 235
 				'\')"><i class="fa icon-delete tub"></i>删除</a><li>'
230 236
 			break;
231 237
 		case '8':
232 238
 			str += '<li><a class="aBtn" authorize="yes" id="HY_details_' + row.id + '" onclick="btn_details(\'' + row.id +
233 239
 				'\')"><i class="fa icon-detail tub"></i>详情</a><li>' +
240
+				
234 241
 				'<li><a class="aBtn" authorize="yes" id="HY_delete_' + row.id + '" onclick="btn_delete(\'' + row.id +
235 242
 				'\')"><i class="fa icon-delete tub"></i>删除</a><li>'
236 243
 			break;
@@ -406,6 +413,15 @@ function btn_add() {
406 413
 		area: ['70%', '80%'], //宽高
407 414
 	});
408 415
 }
416
+//编辑
417
+function btn_edit(ids) {
418
+	layer.open({
419
+		type: 2,
420
+		content: "template/addEquipmentRepair.html?ids=" + ids,
421
+		title: '修改设备维修',
422
+		area: ['70%', '80%'], //宽高
423
+	});
424
+}
409 425
 
410 426
 //处理
411 427
 function btn_handle(code, floorId, sysId) {

+ 120 - 36
WebUI/CallCenterWeb.UI/equipmentOperationManage/template/addEquipmentRepair.html

@@ -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

+ 12 - 19
WebUI/CallCenterWeb.UI/widgets.html

@@ -70,27 +70,20 @@
70 70
 
71 71
 		function newOreder() {
72 72
 			$.ajax({
73
-				type: "post",
74
-				url: huayi.config.callcenter_url + "equipmentapi/api/WoRepairBase/getnopjwocode",
75
-				async: true,
76
-				dataType: 'json',
77
-				success: function(data) {
78
-					if (data.state.toLowerCase() == 'success') {
73
+					type: "post",
74
+					url: huayi.config.callcenter_url + "equipmentapi/api/WoRepairBase/getnopjwocode",
75
+					async: true,
76
+					dataType: 'json',
77
+					success: function(data) {
78
+						if (data.state.toLowerCase() == 'success') {
79 79
 
80
-						if (data.data.total > 0) {
81
-							layer.confirm('你有待评价工单', {
82
-								icon: 7,
83
-								closeBtn: 0,
84
-								btn: ['确定', '取消'], //按钮
85
-								yes: function(index, layero) {
86
-									if ($storages.getItem('roleCode') == "YWYG") {
87
-										self.location = './equipmentOperationManage/notSingleRepair.html'; //确定按钮跳转地址
88
-									} else {
89
-										self.location = './equipmentOperationManage/equipmentRepair.html'; //确定按钮跳转地址
90
-									}
80
+							if (data.data.total > 0) {
81
+								layer.confirm('你有待评价工单请尽快处理', {
82
+									icon: 7,
83
+									closeBtn: 0,
84
+									btn: ['确定', '取消'], //按钮
91 85
 
92
-								},
93
-							});
86
+								});
94 87
 						}
95 88
 					}
96 89