瀏覽代碼

导出文件、图片展示修改

liuzhen 6 年之前
父節點
當前提交
d8b9c20878

+ 8 - 1
CallCenterWeb.UI/WorkOrder/template/orderDetails.html

@@ -5,6 +5,9 @@
5 5
 		<title>工单详情</title>
6 6
 		<script src="../../Script/Common/huayi.load.js"></script>
7 7
 		<script src="../../Script/Common/huayi.config.js"></script>
8
+		<script src="../../js/mousewheel/jquery.mousewheel.js"></script>
9
+		<script src="../../js/WorkOrder/jquery.drag.js"></script>
10
+		<script src="../../js/download/download.js"></script>
8 11
 		<link href="../../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
9 12
 		<link href="../../css/WorkOrder/Search.css" rel="stylesheet">
10 13
 		<link href="../../css/init.css" rel="stylesheet" />
@@ -174,7 +177,7 @@
174 177
 					</thead>
175 178
 				</table>
176 179
 			</div>
177
-			<div id="print_foot">
180
+			<div id="print_foot" style="display: ;">
178 181
 				<a href="" class="print_foot">导出</a>
179 182
 			</div>
180 183
 		</div>
@@ -191,12 +194,16 @@
191 194
 					$(".gdxq").eq(tabindex).show();
192 195
 					if(tabindex === 0) {
193 196
 						getWorkOrderDetails(wid);
197
+						$('#print_foot').css('display','')
194 198
 					} else if(tabindex > 0 && tabindex < 4) {
195 199
 						getItemList(tabindex,wid);
200
+						$('#print_foot').css('display','none')
196 201
 					} else if(tabindex === 4) {
197 202
 						initTableLogs();
203
+						$('#print_foot').css('display','none')
198 204
 					} else if(tabindex === 5) {
199 205
 						getWorkOrderDe(wid);
206
+						$('#print_foot').css('display','none')
200 207
 					}
201 208
 				});
202 209
 				//如果是来电弹屏中的 工单详情不显示关闭按钮

+ 1 - 1
CallCenterWeb.UI/css/WorkOrder/Search.css

@@ -202,7 +202,7 @@ textarea {
202 202
 
203 203
 .ckxq {
204 204
 	padding: 5px;
205
-	border: 1px solid #e5e6e7;
205
+	/*border: 1px solid #e5e6e7;*/
206 206
 }
207 207
 
208 208
 .ckxq_ul {

+ 2 - 0
CallCenterWeb.UI/js/WorkOrder/AddWorkOrder.js

@@ -80,6 +80,7 @@ $(function() {
80 80
 
81 81
 //新建工单 保存
82 82
 function orderSave() {
83
+	var str=proimglist.toString();
83 84
 	if(!regexs.userNameReg.test($.trim($('#order_name').val()))) {
84 85
 		layer.confirm('请输入有效的客户姓名(2-20位汉字可以包含·•)!', {
85 86
 			icon: 2,
@@ -142,6 +143,7 @@ function orderSave() {
142 143
     note: $('#order_note').val(),//string 无效工单必填备注;
143 144
     clbm: order_transfer_dept,//int 接收部门;
144 145
     clid: order_receiveUser,//int 接收人;
146
+    files:str,//附件id
145 147
 		isover: $('#order_isover').find('input[type="radio"]:checked').val(), //int 是否立即处理(默认为0,立即处理为1,立即处理的工单无法指派接收人和接受部门)
146 148
 		token: $.cookie("token")
147 149
 	}, function(result) {

+ 47 - 41
CallCenterWeb.UI/js/WorkOrder/WorkOrder.js

@@ -838,48 +838,54 @@ function getWorkOrderDe(wid) {
838 838
 			var con = result;
839 839
 			if (con) {			
840 840
 				$("#fileList").empty();
841
-				var proimglist = con.data.ResultFileUrl;
842
-				if (proimglist && proimglist.length > 0) {
843
-					$(proimglist).each(function(i, n) {
844
-						var fileType = n.F_FileType;
845
-						var fileType1 = n.F_FileType.split("\/")[0];
846
-						if (fileType === '.jpg'||fileType === '.png'||fileType1==='image') {
847
-							$('<div class="img-box">' +
848
-								'<span class="img_mask"><span onclick=downloadFile("'+ n.F_FileUrl + '","' + n.F_FileName + '","' + n.F_FileType +
849
-								'") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
850
-								'<img layer-src="' + n.F_FileUrl + '" src="' + n.F_FileUrl + '" alt="' + n.F_FileName +
851
-								'" class="image-item" /><div>').appendTo("#fileList");
852
-						} else {
853
-							$('<div class="img-box">' +
854
-								'<span class="img_mask"><span href="javascript:;" onclick=downloadFile("' +  n.F_FileUrl + '","' + n.F_FileName +
855
-								'","' + n.F_FileType +
856
-								'") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
857
-								'<span class="img_filename">'+n.F_OriName + n.F_FileName.split(".")[1] + '</span><div>').appendTo("#fileList");
858
-						}
859
-					});
860
-					layer.photos({
861
-						photos: '#fileList',
862
-						anim: 5, //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
863
-						title: '查看图片',
864
-						move: '.layui-layer-title',
865
-						shadeClose: false,
866
-						closeBtn: 1,
867
-						area: ['80%', '90%'],
868
-						tab: function(pic, layero) {
869
-							$('.layui-layer-content').on("mousewheel", function(e, d) {
870
-								
871
-								helper.methods.zoomImg($('#layui-layer-photos').find('img[alt="' + pic.alt + '"]'), d);
872
-								$('#layui-layer-photos').find('img[alt="' + pic.alt + '"]').dragging({
873
-									move: "both", //拖动方向,x y both
874
-									randomPosition: false //初始位置是否随机
875
-								});
876
-								return false;
877
-								
841
+				var data=con.data
842
+				for(var i in data){
843
+					if(i=='FileUrl'||i=='ResultFileUrl'){
844
+						var proimglist = data[i];
845
+						if (proimglist && proimglist.length > 0) {
846
+							$(proimglist).each(function(i, n) {
847
+								var fileType = n.F_FileType;
848
+								var fileType1 = n.F_FileType.split("\/")[0];
849
+								if (fileType === '.jpg'||fileType === '.png'||fileType1==='image') {
850
+									$('<div class="img-box">' +
851
+										'<span class="img_mask"><span onclick=downloadFile("'+ n.F_FileUrl + '","' + n.F_FileName + '","' + n.F_FileType +
852
+										'") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
853
+										'<img layer-src="' + n.F_FileUrl + '" src="' + n.F_FileUrl + '" alt="' + n.F_FileName +
854
+										'" class="image-item" /><div>').appendTo("#fileList");
855
+								} else {
856
+									$('<div class="img-box">' +
857
+										'<span class="img_mask"><span href="javascript:;" onclick=downloadFile("' +  n.F_FileUrl + '","' + n.F_FileName +
858
+										'","' + n.F_FileType +
859
+										'") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
860
+										'<span class="img_filename">'+n.F_OriName + n.F_FileName.split(".")[1] + '</span><div>').appendTo("#fileList");
861
+								}
878 862
 							});
879
-							helper.methods.initLayerPhotos('#layui-layer-photos', pic, layero);
880
-						},
881
-					});
882
-				}
863
+							layer.photos({
864
+								photos: '#fileList',
865
+								anim: 5, //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
866
+								title: '查看图片',
867
+								move: '.layui-layer-title',
868
+								shadeClose: false,
869
+								closeBtn: 1,
870
+								area: ['80%', '90%'],
871
+								tab: function(pic, layero) {
872
+									$('.layui-layer-content').on("mousewheel", function(e, d) {
873
+										
874
+										helper.methods.zoomImg($('#layui-layer-photos').find('img[alt="' + pic.alt + '"]'), d);
875
+										$('#layui-layer-photos').find('img[alt="' + pic.alt + '"]').dragging({
876
+											move: "both", //拖动方向,x y both
877
+											randomPosition: false //初始位置是否随机
878
+										});
879
+										return false;
880
+										
881
+									});
882
+									helper.methods.initLayerPhotos('#layui-layer-photos', pic, layero);
883
+								},
884
+							});
885
+						}
886
+					}
887
+				};
888
+				
883 889
 				
884 890
 			}
885 891
 		}

+ 147 - 0
CallCenterWeb.UI/js/WorkOrder/jquery.drag.js

@@ -0,0 +1,147 @@
1
+
2
+$.fn.extend({
3
+		//---元素拖动插件
4
+    dragging:function(data){   
5
+		var $this = $(this);
6
+		var xPage;
7
+		var yPage;
8
+		var X;//
9
+		var Y;//
10
+		var xRand = 0;//
11
+		var yRand = 0;//
12
+		var father = $this.parent().parent();
13
+		var defaults = {
14
+			move : 'both',
15
+			randomPosition : true ,
16
+			hander:1
17
+		}
18
+		var opt = $.extend({},defaults,data);
19
+		var movePosition = opt.move;
20
+		var random = opt.randomPosition;
21
+		
22
+		var hander = opt.hander;
23
+		
24
+		if(hander === 1){
25
+			hander = $this; 
26
+		}else{
27
+			hander = $this.find(opt.hander);
28
+		}
29
+		
30
+			
31
+		//---初始化
32
+//		father.css({"position":"relative","overflow":"hidden"});
33
+		father.css({"position":"relative"});
34
+		$this.css({"position":"absolute"});
35
+		hander.css({"cursor":"move"});
36
+
37
+		var faWidth = father.width();
38
+		var faHeight = father.height();
39
+		var thisWidth = $this.width()+parseInt($this.css('padding-left'))+parseInt($this.css('padding-right'));
40
+		var thisHeight = $this.height()+parseInt($this.css('padding-top'))+parseInt($this.css('padding-bottom'));
41
+		
42
+		var mDown = false;//
43
+		var positionX;
44
+		var positionY;
45
+		var moveX ;
46
+		var moveY ;
47
+		
48
+		if(random){
49
+			$thisRandom();
50
+		}
51
+		function $thisRandom(){ //随机函数
52
+			$this.each(function(index){
53
+				var randY = parseInt(Math.random()*(faHeight-thisHeight));///
54
+				var randX = parseInt(Math.random()*(faWidth-thisWidth));///
55
+				if(movePosition.toLowerCase() == 'x'){
56
+					$(this).css({
57
+						left:randX
58
+					});
59
+				}else if(movePosition.toLowerCase() == 'y'){
60
+					$(this).css({
61
+						top:randY
62
+					});
63
+				}else if(movePosition.toLowerCase() == 'both'){
64
+					$(this).css({
65
+						top:randY,
66
+						left:randX
67
+					});
68
+				}
69
+				
70
+			});	
71
+		}
72
+		
73
+		hander.mousedown(function(e){
74
+			//father.children().css({"zIndex":"0"});
75
+			//$this.css({"zIndex":"6666"});
76
+			mDown = true;
77
+			X = e.pageX;
78
+			Y = e.pageY;
79
+			positionX = $this.position().left;
80
+			positionY = $this.position().top;
81
+			return false;
82
+		});
83
+			
84
+		$(document).mouseup(function(e){
85
+			mDown = false;
86
+		});
87
+			
88
+		$(document).mousemove(function(e){
89
+			xPage = e.pageX;//--
90
+			moveX = positionX+xPage-X;
91
+			
92
+			yPage = e.pageY;//--
93
+			moveY = positionY+yPage-Y;
94
+			
95
+			function thisXMove(){ //x轴移动
96
+				if(mDown == true){
97
+					$this.css({"left":moveX});
98
+				}else{
99
+					return;
100
+				}
101
+				if(moveX < 0){
102
+					$this.css({"left":"0"});
103
+				}
104
+				if(moveX > (faWidth-thisWidth)){
105
+					$this.css({"left":faWidth-thisWidth});
106
+				}
107
+				return moveX;
108
+			}
109
+			
110
+			function thisYMove(){ //y轴移动
111
+				if(mDown == true){
112
+					$this.css({"top":moveY});
113
+				}else{
114
+					return;
115
+				}
116
+				if(moveY < 0){
117
+					$this.css({"top":"0"});
118
+				}
119
+				if(moveY > (faHeight-thisHeight)){
120
+					$this.css({"top":faHeight-thisHeight});
121
+				}
122
+				return moveY;
123
+			}
124
+
125
+			function thisAllMove(){ //全部移动
126
+				if(mDown == true){
127
+					$this.css({"left":moveX,"top":moveY});
128
+				}else{
129
+					return;
130
+				}
131
+				if(moveX < 0){
132
+					$this.css({"left":"0"});
133
+				}
134
+				if(moveY < 0){
135
+					$this.css({"top":"0"});
136
+				}
137
+			}
138
+			if(movePosition.toLowerCase() == "x"){
139
+				thisXMove();
140
+			}else if(movePosition.toLowerCase() == "y"){
141
+				thisYMove();
142
+			}else if(movePosition.toLowerCase() == 'both'){
143
+				thisAllMove();
144
+			}
145
+		});
146
+    }
147
+}); 

+ 221 - 0
CallCenterWeb.UI/js/mousewheel/jquery.mousewheel.js

@@ -0,0 +1,221 @@
1
+/*!
2
+ * jQuery Mousewheel 3.1.13
3
+ *
4
+ * Copyright jQuery Foundation and other contributors
5
+ * Released under the MIT license
6
+ * http://jquery.org/license
7
+ */
8
+
9
+(function (factory) {
10
+    if ( typeof define === 'function' && define.amd ) {
11
+        // AMD. Register as an anonymous module.
12
+        define(['jquery'], factory);
13
+    } else if (typeof exports === 'object') {
14
+        // Node/CommonJS style for Browserify
15
+        module.exports = factory;
16
+    } else {
17
+        // Browser globals
18
+        factory(jQuery);
19
+    }
20
+}(function ($) {
21
+
22
+    var toFix  = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
23
+        toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
24
+                    ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
25
+        slice  = Array.prototype.slice,
26
+        nullLowestDeltaTimeout, lowestDelta;
27
+
28
+    if ( $.event.fixHooks ) {
29
+        for ( var i = toFix.length; i; ) {
30
+            $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
31
+        }
32
+    }
33
+
34
+    var special = $.event.special.mousewheel = {
35
+        version: '3.1.12',
36
+
37
+        setup: function() {
38
+            if ( this.addEventListener ) {
39
+                for ( var i = toBind.length; i; ) {
40
+                    this.addEventListener( toBind[--i], handler, false );
41
+                }
42
+            } else {
43
+                this.onmousewheel = handler;
44
+            }
45
+            // Store the line height and page height for this particular element
46
+            $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
47
+            $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
48
+        },
49
+
50
+        teardown: function() {
51
+            if ( this.removeEventListener ) {
52
+                for ( var i = toBind.length; i; ) {
53
+                    this.removeEventListener( toBind[--i], handler, false );
54
+                }
55
+            } else {
56
+                this.onmousewheel = null;
57
+            }
58
+            // Clean up the data we added to the element
59
+            $.removeData(this, 'mousewheel-line-height');
60
+            $.removeData(this, 'mousewheel-page-height');
61
+        },
62
+
63
+        getLineHeight: function(elem) {
64
+            var $elem = $(elem),
65
+                $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
66
+            if (!$parent.length) {
67
+                $parent = $('body');
68
+            }
69
+            return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
70
+        },
71
+
72
+        getPageHeight: function(elem) {
73
+            return $(elem).height();
74
+        },
75
+
76
+        settings: {
77
+            adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
78
+            normalizeOffset: true  // calls getBoundingClientRect for each event
79
+        }
80
+    };
81
+
82
+    $.fn.extend({
83
+        mousewheel: function(fn) {
84
+            return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
85
+        },
86
+
87
+        unmousewheel: function(fn) {
88
+            return this.unbind('mousewheel', fn);
89
+        }
90
+    });
91
+
92
+
93
+    function handler(event) {
94
+        var orgEvent   = event || window.event,
95
+            args       = slice.call(arguments, 1),
96
+            delta      = 0,
97
+            deltaX     = 0,
98
+            deltaY     = 0,
99
+            absDelta   = 0,
100
+            offsetX    = 0,
101
+            offsetY    = 0;
102
+        event = $.event.fix(orgEvent);
103
+        event.type = 'mousewheel';
104
+
105
+        // Old school scrollwheel delta
106
+        if ( 'detail'      in orgEvent ) { deltaY = orgEvent.detail * -1;      }
107
+        if ( 'wheelDelta'  in orgEvent ) { deltaY = orgEvent.wheelDelta;       }
108
+        if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY;      }
109
+        if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
110
+
111
+        // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
112
+        if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
113
+            deltaX = deltaY * -1;
114
+            deltaY = 0;
115
+        }
116
+
117
+        // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
118
+        delta = deltaY === 0 ? deltaX : deltaY;
119
+
120
+        // New school wheel delta (wheel event)
121
+        if ( 'deltaY' in orgEvent ) {
122
+            deltaY = orgEvent.deltaY * -1;
123
+            delta  = deltaY;
124
+        }
125
+        if ( 'deltaX' in orgEvent ) {
126
+            deltaX = orgEvent.deltaX;
127
+            if ( deltaY === 0 ) { delta  = deltaX * -1; }
128
+        }
129
+
130
+        // No change actually happened, no reason to go any further
131
+        if ( deltaY === 0 && deltaX === 0 ) { return; }
132
+
133
+        // Need to convert lines and pages to pixels if we aren't already in pixels
134
+        // There are three delta modes:
135
+        //   * deltaMode 0 is by pixels, nothing to do
136
+        //   * deltaMode 1 is by lines
137
+        //   * deltaMode 2 is by pages
138
+        if ( orgEvent.deltaMode === 1 ) {
139
+            var lineHeight = $.data(this, 'mousewheel-line-height');
140
+            delta  *= lineHeight;
141
+            deltaY *= lineHeight;
142
+            deltaX *= lineHeight;
143
+        } else if ( orgEvent.deltaMode === 2 ) {
144
+            var pageHeight = $.data(this, 'mousewheel-page-height');
145
+            delta  *= pageHeight;
146
+            deltaY *= pageHeight;
147
+            deltaX *= pageHeight;
148
+        }
149
+
150
+        // Store lowest absolute delta to normalize the delta values
151
+        absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
152
+
153
+        if ( !lowestDelta || absDelta < lowestDelta ) {
154
+            lowestDelta = absDelta;
155
+
156
+            // Adjust older deltas if necessary
157
+            if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
158
+                lowestDelta /= 40;
159
+            }
160
+        }
161
+
162
+        // Adjust older deltas if necessary
163
+        if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
164
+            // Divide all the things by 40!
165
+            delta  /= 40;
166
+            deltaX /= 40;
167
+            deltaY /= 40;
168
+        }
169
+
170
+        // Get a whole, normalized value for the deltas
171
+        delta  = Math[ delta  >= 1 ? 'floor' : 'ceil' ](delta  / lowestDelta);
172
+        deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
173
+        deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
174
+
175
+        // Normalise offsetX and offsetY properties
176
+        if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
177
+            var boundingRect = this.getBoundingClientRect();
178
+            offsetX = event.clientX - boundingRect.left;
179
+            offsetY = event.clientY - boundingRect.top;
180
+        }
181
+
182
+        // Add information to the event object
183
+        event.deltaX = deltaX;
184
+        event.deltaY = deltaY;
185
+        event.deltaFactor = lowestDelta;
186
+        event.offsetX = offsetX;
187
+        event.offsetY = offsetY;
188
+        // Go ahead and set deltaMode to 0 since we converted to pixels
189
+        // Although this is a little odd since we overwrite the deltaX/Y
190
+        // properties with normalized deltas.
191
+        event.deltaMode = 0;
192
+
193
+        // Add event and delta to the front of the arguments
194
+        args.unshift(event, delta, deltaX, deltaY);
195
+
196
+        // Clearout lowestDelta after sometime to better
197
+        // handle multiple device types that give different
198
+        // a different lowestDelta
199
+        // Ex: trackpad = 3 and mouse wheel = 120
200
+        if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
201
+        nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
202
+
203
+        return ($.event.dispatch || $.event.handle).apply(this, args);
204
+    }
205
+
206
+    function nullLowestDelta() {
207
+        lowestDelta = null;
208
+    }
209
+
210
+    function shouldAdjustOldDeltas(orgEvent, absDelta) {
211
+        // If this is an older event and the delta is divisable by 120,
212
+        // then we are assuming that the browser is treating this as an
213
+        // older mouse wheel event and that we should divide the deltas
214
+        // by 40 to try and get a more usable deltaFactor.
215
+        // Side note, this actually impacts the reported scroll distance
216
+        // in older browsers and can cause scrolling to be slower than native.
217
+        // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
218
+        return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
219
+    }
220
+
221
+}));

File diff suppressed because it is too large
+ 9 - 0
CallCenterWeb.UI/js/mousewheel/jquery.mousewheel.min.js