Przeglądaj źródła

发货单创建bug修复(发货记录表中,存在bug期间未回填发货单号的问题--待处理)

klzhangweiya 2 lat temu
rodzic
commit
498923eaa0

+ 1 - 1
src_0nline/ShwasherSys/ShwasherSys.Application/OrderSendInfo/OrderSendBillsApplicationService.cs

@@ -213,7 +213,7 @@ namespace ShwasherSys.OrderSendInfo
             var osi = Array.ConvertAll<string, int>(orderSendIds.Split(','), int.Parse);
 			for (int i = 0; i < osi.Length; i++)
 			{
-                lcSql += $"update OrderSend set OrderSendBillNo='{input.Id}',SendBillSort=${i+1}  where OrderSendId = ${osi[i]};\r\n ";
+                lcSql += $"update OrderSend set OrderSendBillNo='{input.Id}',SendBillSort={i+1}  where OrderSendId = {osi[i]};\r\n ";
             }
 			var sCount = SqlExecuter.Execute(lcSql);
             //var oss =await  OrderSendRepository.GetAllListAsync(i => osi.Contains(i.Id));

+ 2 - 2
src_0nline/ShwasherSys/ShwasherSys.Core/OrderSendInfo/ViewOrderSend.cs

@@ -55,8 +55,8 @@ namespace ShwasherSys.OrderSendInfo
         public string CustomerName { get; set; }
         public string LinkName { get; set; }
 
-        public DateTime OrderDate { get; set; }
-        public int CustomerSendId { get; set; }
+        public DateTime? OrderDate { get; set; }
+        public int? CustomerSendId { get; set; }
 
         public string StockNo { get; set; }
 

+ 511 - 0
src_0nline/ShwasherSys/ShwasherSys.Web/Content/Plugins/jquery.media/jquery.media.js

@@ -0,0 +1,511 @@
+/*
+ * jQuery Media Plugin for converting elements into rich media content.
+ *
+ * Examples and documentation at: http://malsup.com/jquery/media/
+ * Copyright (c) 2007-2010 M. Alsup
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * @author: M. Alsup
+ * @version: 0.99 (05-JUN-2013)
+ * @requires jQuery v1.1.2 or later
+ * $Id: jquery.media.js 2460 2007-07-23 02:53:15Z malsup $
+ *
+ * Supported Media Players:
+ *	- Flash
+ *	- Quicktime
+ *	- Real Player
+ *	- Silverlight
+ *	- Windows Media Player
+ *	- iframe
+ *
+ * Supported Media Formats:
+ *	 Any types supported by the above players, such as:
+ *	 Video: asf, avi, flv, mov, mpg, mpeg, mp4, qt, smil, swf, wmv, 3g2, 3gp
+ *	 Audio: aif, aac, au, gsm, mid, midi, mov, mp3, m4a, snd, rm, wav, wma
+ *	 Other: bmp, html, pdf, psd, qif, qtif, qti, tif, tiff, xaml
+ *
+ * Thanks to Mark Hicken and Brent Pedersen for helping me debug this on the Mac!
+ * Thanks to Dan Rossi for numerous bug reports and code bits!
+ * Thanks to Skye Giordano for several great suggestions!
+ * Thanks to Richard Connamacher for excellent improvements to the non-IE behavior!
+ */
+/*global SWFObject alert Sys */
+/*jshint forin:false */
+; (function ($) {
+	"use strict";
+
+	var mode = document.documentMode || 0;
+	var msie = /MSIE/.test(navigator.userAgent);
+	var lameIE = msie && (/MSIE (6|7|8)\.0/.test(navigator.userAgent) || mode < 9);
+
+	/**
+	 * Chainable method for converting elements into rich media.
+	 *
+	 * @param options
+	 * @param callback fn invoked for each matched element before conversion
+	 * @param callback fn invoked for each matched element after conversion
+	 */
+	$.fn.media = function (options, f1, f2) {
+		if (options == 'undo') {
+			return this.each(function () {
+				var $this = $(this);
+				var html = $this.data('media.origHTML');
+				if (html)
+					$this.replaceWith(html);
+			});
+		}
+
+		return this.each(function () {
+			if (typeof options == 'function') {
+				f2 = f1;
+				f1 = options;
+				options = {};
+			}
+			var o = getSettings(this, options);
+			// pre-conversion callback, passes original element and fully populated options
+			if (typeof f1 == 'function') f1(this, o);
+
+			var r = getTypesRegExp();
+			var m = r.exec(o.src.toLowerCase()) || [''];
+			var fn;
+
+			if (o.type)
+				m[0] = o.type;
+			else
+				m.shift();
+
+			for (var i = 0; i < m.length; i++) {
+				fn = m[i].toLowerCase();
+				if (isDigit(fn[0])) fn = 'fn' + fn; // fns can't begin with numbers
+				if (!$.fn.media[fn])
+					continue;  // unrecognized media type
+				// normalize autoplay settings
+				var player = $.fn.media[fn + '_player'];
+				if (!o.params) o.params = {};
+				if (player) {
+					var num = player.autoplayAttr == 'autostart';
+					o.params[player.autoplayAttr || 'autoplay'] = num ? (o.autoplay ? 1 : 0) : o.autoplay ? true : false;
+				}
+				var $div = $.fn.media[fn](this, o);
+
+				$div.css('backgroundColor', o.bgColor).width(o.width);
+
+				if (o.canUndo) {
+					var $temp = $('<div></div>').append(this);
+					$div.data('media.origHTML', $temp.html()); // store original markup
+				}
+
+				// post-conversion callback, passes original element, new div element and fully populated options
+				if (typeof f2 == 'function') f2(this, $div[0], o, player.name);
+				break;
+			}
+		});
+	};
+
+	/**
+	 * Non-chainable method for adding or changing file format / player mapping
+	 * @name mapFormat
+	 * @param String format File format extension (ie: mov, wav, mp3)
+	 * @param String player Player name to use for the format (one of: flash, quicktime, realplayer, winmedia, silverlight or iframe
+	 */
+	$.fn.media.mapFormat = function (format, player) {
+		if (!format || !player || !$.fn.media.defaults.players[player]) return; // invalid
+		format = format.toLowerCase();
+		if (isDigit(format[0])) format = 'fn' + format;
+		$.fn.media[format] = $.fn.media[player];
+		$.fn.media[format + '_player'] = $.fn.media.defaults.players[player];
+	};
+
+	// global defautls; override as needed
+	$.fn.media.defaults = {
+		standards: true,       // use object tags only (no embeds for non-IE browsers)
+		canUndo: true,       // tells plugin to store the original markup so it can be reverted via: $(sel).mediaUndo()
+		width: 400,
+		height: 400,
+		autoplay: 0,			// normalized cross-player setting
+		bgColor: '#ffffff',	// background color
+		params: { wmode: 'transparent' },	// added to object element as param elements; added to embed element as attrs
+		attrs: {},			// added to object and embed elements as attrs
+		flvKeyName: 'file',		// key used for object src param (thanks to Andrea Ercolino)
+		flashvars: {},			// added to flash content as flashvars param/attr
+		flashVersion: '7',	// required flash version
+		expressInstaller: null,	// src for express installer
+
+		// default flash video and mp3 player (@see: http://jeroenwijering.com/?item=Flash_Media_Player)
+		flvPlayer: 'mediaplayer.swf',
+		mp3Player: 'mediaplayer.swf',
+
+		// @see http://msdn2.microsoft.com/en-us/library/bb412401.aspx
+		silverlight: {
+			inplaceInstallPrompt: 'true', // display in-place install prompt?
+			isWindowless: 'true', // windowless mode (false for wrapping markup)
+			framerate: '24',	  // maximum framerate
+			version: '0.9',  // Silverlight version
+			onError: null,	  // onError callback
+			onLoad: null,   // onLoad callback
+			initParams: null,	  // object init params
+			userContext: null	  // callback arg passed to the load callback
+		}
+	};
+
+	// Media Players; think twice before overriding
+	$.fn.media.defaults.players = {
+		flash: {
+			name: 'flash',
+			title: 'Flash',
+			types: 'flv,mp3,swf',
+			mimetype: 'application/x-shockwave-flash',
+			pluginspage: 'http://www.adobe.com/go/getflashplayer',
+			ieAttrs: {
+				classid: 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
+				type: 'application/x-oleobject',
+				codebase: 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + $.fn.media.defaults.flashVersion
+			}
+		},
+		quicktime: {
+			name: 'quicktime',
+			title: 'QuickTime',
+			mimetype: 'video/quicktime',
+			pluginspage: 'http://www.apple.com/quicktime/download/',
+			types: 'aif,aiff,aac,au,bmp,gsm,mov,mid,midi,mpg,mpeg,mp4,m4a,psd,qt,qtif,qif,qti,snd,tif,tiff,wav,3g2,3gp',
+			ieAttrs: {
+				classid: 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
+				codebase: 'http://www.apple.com/qtactivex/qtplugin.cab'
+			}
+		},
+		realplayer: {
+			name: 'real',
+			title: 'RealPlayer',
+			types: 'ra,ram,rm,rpm,rv,smi,smil',
+			mimetype: 'audio/x-pn-realaudio-plugin',
+			pluginspage: 'http://www.real.com/player/',
+			autoplayAttr: 'autostart',
+			ieAttrs: {
+				classid: 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'
+			}
+		},
+		winmedia: {
+			name: 'winmedia',
+			title: 'Windows Media',
+			types: 'asx,asf,avi,wma,wmv',
+			mimetype: isFirefoxWMPPluginInstalled() ? 'application/x-ms-wmp' : 'application/x-mplayer2',
+			pluginspage: 'http://www.microsoft.com/Windows/MediaPlayer/',
+			autoplayAttr: 'autostart',
+			oUrl: 'url',
+			ieAttrs: {
+				classid: 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6',
+				type: 'application/x-oleobject'
+			}
+		},
+		// special cases
+		img: {
+			name: 'img',
+			title: 'Image',
+			types: 'gif,png,jpg'
+		},
+		iframe: {
+			name: 'iframe',
+			types: 'html,pdf'
+		},
+		silverlight: {
+			name: 'silverlight',
+			types: 'xaml'
+		}
+	};
+
+	//
+	//	everything below here is private
+	//
+
+
+	// detection script for FF WMP plugin (http://www.therossman.org/experiments/wmp_play.html)
+	// (hat tip to Mark Ross for this script)
+	function isFirefoxWMPPluginInstalled() {
+		var plugs = navigator.plugins || [];
+		for (var i = 0; i < plugs.length; i++) {
+			var plugin = plugs[i];
+			if (plugin['filename'] == 'np-mswmp.dll')
+				return true;
+		}
+		return false;
+	}
+
+	var counter = 1;
+
+	for (var player in $.fn.media.defaults.players) {
+		var types = $.fn.media.defaults.players[player].types;
+		$.each(types.split(','), function (i, o) {
+			if (isDigit(o[0])) o = 'fn' + o;
+			$.fn.media[o] = $.fn.media[player] = getGenerator(player);
+			$.fn.media[o + '_player'] = $.fn.media.defaults.players[player];
+		});
+	}
+
+	function getTypesRegExp() {
+		var types = '';
+		for (var player in $.fn.media.defaults.players) {
+			if (types.length) types += ',';
+			types += $.fn.media.defaults.players[player].types;
+		}
+		return new RegExp('\\.(' + types.replace(/,/ig, '|') + ')\\b');
+	}
+
+	function getGenerator(player) {
+		return function (el, options) {
+			return generate(el, options, player);
+		};
+	}
+
+	function isDigit(c) {
+		return '0123456789'.indexOf(c) > -1;
+	}
+
+	// flatten all possible options: global defaults, meta, option obj
+	function getSettings(el, options) {
+		options = options || {};
+		var a, n;
+		var $el = $(el);
+		var cls = el.className || '';
+		// support metadata plugin (v1.0 and v2.0)
+		var meta = $.metadata ? $el.metadata() : $.meta ? $el.data() : {};
+		meta = meta || {};
+		var w = meta.width || parseInt(((cls.match(/\bw:(\d+)/) || [])[1] || 0), 10) || parseInt(((cls.match(/\bwidth:(\d+)/) || [])[1] || 0), 10);
+		var h = meta.height || parseInt(((cls.match(/\bh:(\d+)/) || [])[1] || 0), 10) || parseInt(((cls.match(/\bheight:(\d+)/) || [])[1] || 0), 10);
+
+		if (w) meta.width = w;
+		if (h) meta.height = h;
+		if (cls) meta.cls = cls;
+
+		// crank html5 style data attributes
+		var dataName = 'data-';
+		for (var i = 0; i < el.attributes.length; i++) {
+			a = el.attributes[i], n = $.trim(a.name);
+			var index = n.indexOf(dataName);
+			if (index === 0) {
+				n = n.substring(dataName.length);
+				meta[n] = a.value;
+			}
+		}
+
+		a = $.fn.media.defaults;
+		var b = options;
+		var c = meta;
+
+		var p = { params: { bgColor: options.bgColor || $.fn.media.defaults.bgColor } };
+		var opts = $.extend({}, a, b, c);
+		$.each(['attrs', 'params', 'flashvars', 'silverlight'], function (i, o) {
+			opts[o] = $.extend({}, p[o] || {}, a[o] || {}, b[o] || {}, c[o] || {});
+		});
+
+		if (typeof opts.caption == 'undefined') opts.caption = $el.text();
+
+		// make sure we have a source!
+		opts.src = opts.src || $el.attr('href') || $el.attr('src') || 'unknown';
+		return opts;
+	}
+
+	//
+	//	Flash Player
+	//
+
+	// generate flash using SWFObject library if possible
+	$.fn.media.swf = function (el, opts) {
+		var f, p;
+		if (!window.SWFObject && !window.swfobject) {
+			// roll our own
+			if (opts.flashvars) {
+				var a = [];
+				for (f in opts.flashvars)
+					a.push(f + '=' + opts.flashvars[f]);
+				if (!opts.params) opts.params = {};
+				opts.params.flashvars = a.join('&');
+			}
+			return generate(el, opts, 'flash');
+		}
+
+		var id = el.id ? (' id="' + el.id + '"') : '';
+		var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
+		var $div = $('<div' + id + cls + '>');
+
+		// swfobject v2+
+		if (window.swfobject) {
+			$(el).after($div).appendTo($div);
+			if (!el.id) el.id = 'movie_player_' + counter++;
+
+			// replace el with swfobject content
+			window.swfobject.embedSWF(opts.src, el.id, opts.width, opts.height, opts.flashVersion,
+				opts.expressInstaller, opts.flashvars, opts.params, opts.attrs);
+		}
+		// swfobject < v2
+		else {
+			$(el).after($div).remove();
+			var so = new SWFObject(opts.src, 'movie_player_' + counter++, opts.width, opts.height, opts.flashVersion, opts.bgColor);
+			if (opts.expressInstaller) so.useExpressInstall(opts.expressInstaller);
+
+			for (p in opts.params)
+				if (p != 'bgColor') so.addParam(p, opts.params[p]);
+			for (f in opts.flashvars)
+				so.addVariable(f, opts.flashvars[f]);
+			so.write($div[0]);
+		}
+
+		if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
+		return $div;
+	};
+
+	// map flv and mp3 files to the swf player by default
+	$.fn.media.flv = $.fn.media.mp3 = function (el, opts) {
+		var src = opts.src;
+		var player = /\.mp3\b/i.test(src) ? opts.mp3Player : opts.flvPlayer;
+		var key = opts.flvKeyName;
+		src = encodeURIComponent(src);
+		opts.src = player;
+		opts.src = opts.src + '?' + key + '=' + (src);
+		var srcObj = {};
+		srcObj[key] = src;
+		opts.flashvars = $.extend({}, srcObj, opts.flashvars);
+		return $.fn.media.swf(el, opts);
+	};
+
+	//
+	//	Silverlight
+	//
+	$.fn.media.xaml = function (el, opts) {
+		if (!window.Sys || !window.Sys.Silverlight) {
+			if ($.fn.media.xaml.warning) return;
+			$.fn.media.xaml.warning = 1;
+			alert('You must include the Silverlight.js script.');
+			return;
+		}
+
+		var props = {
+			width: opts.width,
+			height: opts.height,
+			background: opts.bgColor,
+			inplaceInstallPrompt: opts.silverlight.inplaceInstallPrompt,
+			isWindowless: opts.silverlight.isWindowless,
+			framerate: opts.silverlight.framerate,
+			version: opts.silverlight.version
+		};
+		var events = {
+			onError: opts.silverlight.onError,
+			onLoad: opts.silverlight.onLoad
+		};
+
+		var id1 = el.id ? (' id="' + el.id + '"') : '';
+		var id2 = opts.id || 'AG' + counter++;
+		// convert element to div
+		var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
+		var $div = $('<div' + id1 + cls + '>');
+		$(el).after($div).remove();
+
+		Sys.Silverlight.createObjectEx({
+			source: opts.src,
+			initParams: opts.silverlight.initParams,
+			userContext: opts.silverlight.userContext,
+			id: id2,
+			parentElement: $div[0],
+			properties: props,
+			events: events
+		});
+
+		if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
+		return $div;
+	};
+
+	//
+	// generate object/embed markup
+	//
+	function generate(el, opts, player) {
+		var $el = $(el);
+		var o = $.fn.media.defaults.players[player];
+		var a, key, v;
+
+		if (player == 'iframe') {
+			o = $('<iframe' + ' width="' + opts.width + '" height="' + opts.height + '" >');
+			o.attr('src', opts.src);
+			o.css('backgroundColor', o.bgColor);
+		}
+		else if (player == 'img') {
+			o = $('<img>');
+			o.attr('src', opts.src);
+			if (opts.width)
+				o.attr('width', opts.width);
+			if (opts.height)
+				o.attr('height', opts.height);
+			o.css('backgroundColor', o.bgColor);
+		}
+		else if (lameIE) {
+			a = ['<object width="' + opts.width + '" height="' + opts.height + '" '];
+			for (key in opts.attrs)
+				a.push(key + '="' + opts.attrs[key] + '" ');
+			for (key in o.ieAttrs || {}) {
+				v = o.ieAttrs[key];
+				if (key == 'codebase' && window.location.protocol == 'https:')
+					v = v.replace('http', 'https');
+				a.push(key + '="' + v + '" ');
+			}
+			a.push('></ob' + 'ject' + '>');
+			var p = ['<param name="' + (o.oUrl || 'src') + '" value="' + opts.src + '">'];
+			for (key in opts.params)
+				p.push('<param name="' + key + '" value="' + opts.params[key] + '">');
+			o = document.createElement(a.join(''));
+			for (var i = 0; i < p.length; i++)
+				o.appendChild(document.createElement(p[i]));
+		}
+		else if (opts.standards) {
+			// Rewritten to be standards compliant by Richard Connamacher
+			a = ['<object type="' + o.mimetype + '" width="' + opts.width + '" height="' + opts.height + '"'];
+			if (opts.src) a.push(' data="' + opts.src + '" ');
+			if (msie) {
+				for (key in o.ieAttrs || {}) {
+					v = o.ieAttrs[key];
+					if (key == 'codebase' && window.location.protocol == 'https:')
+						v = v.replace('http', 'https');
+					a.push(key + '="' + v + '" ');
+				}
+			}
+			a.push('>');
+			a.push('<param name="' + (o.oUrl || 'src') + '" value="' + opts.src + '">');
+			for (key in opts.params) {
+				if (key == 'wmode' && player != 'flash') // FF3/Quicktime borks on wmode
+					continue;
+				a.push('<param name="' + key + '" value="' + opts.params[key] + '">');
+			}
+			// Alternate HTML
+			a.push('<div><p><strong>' + o.title + ' Required</strong></p><p>' + o.title + ' is required to view this media. <a href="' + o.pluginspage + '">Download Here</a>.</p></div>');
+			a.push('</ob' + 'ject' + '>');
+		}
+		else {
+			a = ['<embed width="' + opts.width + '" height="' + opts.height + '" style="display:block"'];
+			if (opts.src) a.push(' src="' + opts.src + '" ');
+			for (key in opts.attrs)
+				a.push(key + '="' + opts.attrs[key] + '" ');
+			for (key in o.eAttrs || {})
+				a.push(key + '="' + o.eAttrs[key] + '" ');
+			for (key in opts.params) {
+				if (key == 'wmode' && player != 'flash') // FF3/Quicktime borks on wmode
+					continue;
+				a.push(key + '="' + opts.params[key] + '" ');
+			}
+			a.push('></em' + 'bed' + '>');
+		}
+		// convert element to div
+		var id = el.id ? (' id="' + el.id + '"') : '';
+		var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
+		var $div = $('<div' + id + cls + '>');
+		$el.after($div).remove();
+		if (lameIE || player == 'iframe' || player == 'img')
+			$div.append(o);
+		else
+			$div.html(a.join(''));
+
+		if (opts.caption)
+			$('<div>').appendTo($div).html(opts.caption);
+		return $div;
+	}
+
+
+})(jQuery);

+ 3 - 1
src_0nline/ShwasherSys/ShwasherSys.Web/Content/Scripts/MyScript/UtilJs.js

@@ -1188,6 +1188,7 @@ function FileOpen(url, type, options) {
     };
     $.extend(defaultOption, options);
     if ($("#File-Modal").length <= 0) {
+        //$.metPageJs('/Content/Plugins/jquery.media/jquery.media.js', "dy-jquery-media");
         $("body").append(
             '    <section><div class="modal fade" id="File-Modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel"aria-hidden="true"><div class="modal-dialog  modal-dialog-centered" role="document" style="width: calc(100% - ' + defaultOption.gapWidth + 'px)") ;><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true"><span aria-hidden="true">&times;</span></button><h4 class="modal-title">文件预览</h4></div><div class="modal-body"  style="min-height: '+ defaultOption.height+'px; overflow: auto"></div><div class="modal-footer" style="text-align: center;"><button type="button" class="btn btn-success waves-effect" data-dismiss="modal" style="min-width: 100px;background: #F0985D;border: 1px solid #DDDDDD;">关闭窗口</button><button id="download" type="button" class="btn btn-success waves-effect"  style="min-width: 100px;background-color: #678ceb;border: 1px solid #678ceb;border: 1px solid #DDDDDD;" data-url="" onclick="DownloadFile(this)">下载文件</button></div></div></div></div></section>');
     }
@@ -1204,7 +1205,8 @@ function FileOpen(url, type, options) {
     }
     console.log(url2);
     $("#File-Modal").find('.modal-body')
-        .html('<iframe src="' + url2 + '" width="100%"; style="min-height:' + defaultOption.height+'px;" frameborder="0"></iframe>');
+	    //.media({ width: '100%', height: defaultOption.height + "px", autoplay: true, src: url });
+        .html('<iframe src="' + url2 + '" width="100%"; style="min-height:' + defaultOption.height +'px;" frameborder="0"></iframe>');
     $("#File-Modal").find('#download').data("url", url);
     $("#File-Modal").modal("show");
 }

+ 3 - 1
src_0nline/ShwasherSys/ShwasherSys.Web/ShwasherSys.Web.csproj

@@ -995,6 +995,7 @@
     <Content Include="Content\Plugins\jquery-treetable\screen.css" />
     <Content Include="Content\Plugins\jquery-ui\jquery-ui.js" />
     <Content Include="Content\Plugins\jquery.form\jquery.form.min.js" />
+    <Content Include="Content\Plugins\jquery.media\jquery.media.js" />
     <Content Include="Content\Plugins\jquery.validate\additional-methods.js" />
     <Content Include="Content\Plugins\jquery.validate\additional-methods.min.js" />
     <Content Include="Content\Plugins\jquery.validate\jquery.validate.js" />
@@ -2014,8 +2015,9 @@
     <Content Include="Content\Scripts\Jquery\jquery-3.3.1.slim.min.map" />
     <Content Include="Scripts\jquery.signalR-2.4.0.js" />
     <Content Include="Scripts\jquery.signalR-2.4.0.min.js" />
-    <Content Include="Views\Home\home.css" />
     <Content Include="Views\Home\home.js" />
+    <Content Include="Views\Home\home.css" />
+    <Content Include="Views\Home\home2.js" />
     <Content Include="Views\OrderInfo\css\OrderMg.css" />
     <Content Include="Views\OrderInfo\css\OrderStatusMg.css" />
     <Content Include="Views\OrderInfo\js\OrderMg.js" />

+ 3 - 1
src_0nline/ShwasherSys/ShwasherSys.Web/Views/Home/home.js

@@ -151,7 +151,8 @@ function initCharts() {
 					2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
 				],
 				itemStyle: {
-					borderRadius:[0,0,0,0]
+					borderRadius: [0, 0, 0, 0],
+					color: 'rgba(220,20,60, 0.6)'
 				},
 				animation:true
 			},
@@ -192,6 +193,7 @@ function loadOrderStatusChart() {
 		success: function (res) {
 			console.log(res);
 			let yearArr = [], orderArr = [], notOrderArr = [];
+			
 			let arrMap = new Map();
 			res.forEach(function (v, i) {
 				//默认年份

+ 487 - 0
src_0nline/ShwasherSys/ShwasherSys.Web/Views/Home/home2.js

@@ -0,0 +1,487 @@
+let $totalHeaderbox = $('.totalHeaderbox');
+var _orderStatusChart = document.getElementById('orderStatusChart');
+var _productionStatusChart = document.getElementById('productionStatusChart');
+var orderStatusChart = echarts.init(_orderStatusChart);
+var productionStatusChart = echarts.init(_productionStatusChart);
+$(function () {
+	RenderHeaderAlert();
+
+	initCharts();
+	$(".order-info-box .box-tools input[type='radio']").on('click', function () {
+		loadOrderStatusChart();
+	});
+	$(".production-info-box .box-tools input[type='radio']").on('click', function () {
+		loadProductionStatusChart();
+	});
+});
+
+function RenderHeaderAlert() {
+	SaveAjax({
+		url: window.appUrl + "Common/GetIndexAlertSum",
+		dataType: "json",
+		isAlert: false,
+		isValidate: false,
+		success: function (res) {
+			$totalHeaderbox.empty();
+			if (res && res.length > 0) {
+				res.forEach(function (v, i) {
+					let color = v.sumType == "1"
+						? "aqua"
+						: v.sumType == "2"
+						? "red"
+						: v.sumType == "3"
+						? "green"
+						: "aqua";
+					$totalHeaderbox.append(`
+									 <div class="col-md-4 col-sm-6 col-xs-12 totalHeaderItem" data-sumtype="${v.sumType}">
+										<div class="info-box">
+											<span class="info-box-icon bg-${color}"><img src="/Content/Images/index/${v
+						.tipName}.png" /></span>
+											<div class="info-box-content">
+												<span class="info-box-text" >${v.sumName}</span>
+												<span class="info-box-number">${v.quantity}</span>
+											</div>
+										</div>
+									</div>`);
+				});
+				BindItemEvent();
+			}
+		}
+	});
+}
+
+function BindItemEvent() {
+	$('.totalHeaderItem').on('click',
+		function (e) {
+			let st = $(e.target).closest('.totalHeaderItem').data('sumtype');
+			$('.alertContent > .row').css("display", "none");
+			if (st == 1) {
+
+				//GetOrderAlert();
+			} else if (st == 2) {
+
+				//GetProductionOrderAlert();
+			} else if (st == 3) {
+
+				//GetPackageApplyAlert();
+			}
+		});
+}
+
+var option1={},option2={};
+function initCharts() {
+	var option = {
+		tooltip: {
+			trigger: 'axis',
+			axisPointer: {
+				type: 'cross',
+				crossStyle: {
+					color: '#999'
+				}
+			}
+		},
+		toolbox: {
+			feature: {
+				dataView: { show: false, readOnly: false },
+				magicType: { show: true, type: ['line', 'bar'] },
+				restore: { show: false },
+				saveAsImage: { show: true }
+			},
+			iconStyle: {
+				//color:'rgb(255,255,255)'
+				borderColor: 'rgb(255,255,255)'
+			}
+		},
+		legend: {
+			//data: ['Evaporation', 'Precipitation'],
+			backgroundColor: 'rgb(255,255,255)',
+			textStyle: {
+				color: '#0087ED',
+				fontSize: '12px',
+				fontWeight: 200
+			}
+		},
+		xAxis: [
+			{
+				type: 'category',
+				data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+				axisPointer: {
+					type: 'shadow'
+				},
+				axisLine: {
+					lineStyle: {
+						color: '#0087ED',
+						width:2
+					}
+				}
+			}
+		],
+		yAxis: [
+			{
+				type: 'value',
+				name: '',
+				min: 0,
+				//max: 250,
+				interval: 50,
+				//axisLabel: {
+				//	formatter: '{value} ml'
+				//}
+				axisLine: {
+					lineStyle: {
+						color: '#0087ED',
+						width: 1
+					}
+				}
+			}
+		],
+		series: [
+//			{
+//				name: 'Evaporation',
+//				type: 'bar',
+//				label: {
+//					show: true
+//				},
+//				color:'rgba(220,20,60, 0.6)',
+//				data: [
+//					2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
+//				],
+//				itemStyle: {
+//					borderRadius: [0, 0, 0, 0],
+//					color: 'rgba(220,20,60, 0.6)'
+//				},
+//				animation:true
+//			},
+//			{
+//				name: 'Precipitation',
+//				type: 'bar',
+//				tooltip: {
+//					valueFormatter: function (value) {
+//						return value;
+//					}
+//				},
+//				label: {
+//					show: true
+//				},
+//				data: [
+//					2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6
+//				],
+//				itemStyle: {
+//					borderRadius: [8, 8, 0, 0]
+//				},
+//				animation: true
+//			}
+		]
+	};
+	$.extend(true, option1, option);
+	$.extend(true, option2, option);
+	loadOrderStatusChart();
+	loadProductionStatusChart();
+}
+
+function loadOrderStatusChart() {
+	var qt = $('input[name="orderQt"]:checked').val();
+	SaveAjax({
+		url: window.appUrl + "Common/GetHomeStatusCharts?ct=1&qt="+qt,
+		dataType: "json",
+		isAlert: false,
+		isValidate: false,
+		success: function (res) {
+			console.log(res);
+			let yearArr = [], orderArr = [], notOrderArr = [];
+			let q_orderArr = [[],[],[],[]];
+			let q_notOrderArr = [[], [], [], []];
+			let arrMap = new Map();
+			res.forEach(function (v, i) {
+				//默认年份
+				//let ev = qt == "1" ? `${v.year.substr(2,2)}-Q${v.quarterly}` : v.year;
+				let ev = v.year;
+				if (!yearArr.some(ele => ele === ev)) {
+					yearArr.push(ev);
+				}
+				if (qt == "1") {
+					if (v.statusId == 2 || v.statusId == 15 || v.statusId == 9) {
+						if (!arrMap.has(ev + "@" + v.quarterly+ "@0")) {
+							arrMap.set(ev + "@" + v.quarterly + "@0", v.count ? v.count : Number(!!v.count));
+
+						} else {
+							let preV = arrMap.get(ev + "@" + v.quarterly + "@0");
+							arrMap.set(ev + "@" + v.quarterly + "@0", Number(preV) + v.count ? v.count:Number(!!v.count));
+						}
+
+					} else {
+						if (!arrMap.has(ev + "@" + v.quarterly + "@1")) {
+							arrMap.set(ev + "@" + v.quarterly + "@1", v.count ? v.count : Number(!!v.count));
+						} else {
+							let preV = arrMap.get(ev + "@" + v.quarterly + "@1");
+							arrMap.set(ev + "@" + v.quarterly + "@1", Number(preV) + v.count ? v.count : Number(!!v.count));
+						}
+					}
+					
+				} else {
+					//非完成状态的
+					if (v.statusId == 2 || v.statusId == 15 || v.statusId == 9) {
+						if (!arrMap.has(ev + "@0")) {
+							arrMap.set(ev + "@0", v.count);
+
+						} else {
+							let preV = arrMap.get(ev + "@0");
+							arrMap.set(ev + "@0", preV + v.count);
+						}
+
+					} else {
+						if (!arrMap.has(ev + "@1")) {
+							arrMap.set(ev + "@1", v.count);
+						} else {
+							let preV = arrMap.get(ev + "@1");
+							arrMap.set(ev + "@1", preV + v.count);
+						}
+					}
+					
+				}
+				
+			});
+			let q_order_all = [], q_not_order_all = [];
+			if (qt == "1") {
+				yearArr.forEach(function (y, i) {
+					let a0 = 0, a1 = 0; //4个季度的值汇总之和
+					for (let j = 1; j <= 4; j++) {
+						let tmp1 = arrMap.get(y + "@" + j + "@1");
+						tmp1 = tmp1 ? tmp1 : Number(!!tmp1);
+						let tmp0 = arrMap.get(y + "@" + j + "@0");
+						tmp0 = tmp0 ? tmp0 : Number(!!tmp0);
+						q_orderArr[j - 1].push(tmp1);
+						q_notOrderArr[j - 1].push(tmp0);
+						a0 += tmp0;
+						a1 += tmp1;
+					}
+					q_order_all.push(a1);
+					q_not_order_all.push(a0);
+				});
+			} else {
+				yearArr.forEach(function (y, i) {
+					orderArr.push(arrMap.get(y + "@1"));
+					notOrderArr.push(arrMap.get(y + "@0"));
+				});
+			}
+//			console.log('yearArr', yearArr)
+//			console.log('orderArr', orderArr)
+//			console.log('notOrderArr', notOrderArr)
+			option1.xAxis[0].data = yearArr;
+			option1.yAxis[0].interval = 1000;
+
+			if (qt == "1") {
+				console.log('yearArr', yearArr)
+				console.log('q_orderArr', q_orderArr)
+				console.log('q_notOrderArr', q_notOrderArr)
+				console.log('q_order_all', q_order_all)
+				console.log('q_not_order_all', q_not_order_all)
+				option1.series = [];
+				option1.legend.width = 600;
+				option1.legend.padding = 10;
+				option1.legend.data = [];
+				option1.grid= {
+					top:'15%'
+				}
+				q_orderArr.forEach((v, i) => {
+					option1.legend.data.push(`Q${i + 1}完成订单`);
+					option1.series.push(
+						{
+							type: 'bar',
+							label: {
+								show: true
+							},
+							data: v,
+							name: `Q${i + 1}完成订单`,
+							stack: 'one',
+							itemStyle: {
+								//							borderRadius: [8, 8, 0, 0],
+								//							color: 'rgba(220,20,60, 0.6)'
+							
+							},
+							animation: true
+						}
+					);
+				});
+				q_notOrderArr.forEach((v, i) => {
+					option1.legend.data.push(`Q${i + 1}未完成订单`);
+					option1.series.push(
+						{
+							type: 'bar',
+							label: {
+								show: true
+							},
+							data: v,
+							name: `Q${i + 1}未完成订单`,
+							stack: 'two',
+							itemStyle: {
+								//							borderRadius: [8, 8, 0, 0],
+								//							color: 'rgba(220,20,60, 0.6)'
+
+							},
+							animation: true
+						}
+					);
+				});
+				option1.legend.data.push(`完成订单`);
+				option1.legend.data.push(`未完成订单`);
+				console.log("option1.legend.data", option1.legend.data)
+				option1.series.push(
+					{
+						type: 'line',
+						label: {
+							show: true
+						},
+						data: q_order_all,
+						name: `完成订单`,
+						itemStyle: {
+							//							borderRadius: [8, 8, 0, 0],
+							//							color: 'rgba(220,20,60, 0.6)'
+						
+						},
+						animation: true
+					}
+				);
+				option1.series.push(
+					{
+						type: 'line',
+						label: {
+							show: true
+						},
+						data: q_not_order_all,
+						name: `未完成订单`,
+						itemStyle: {
+							//							borderRadius: [8, 8, 0, 0],
+							//							color: 'rgba(220,20,60, 0.6)'
+
+						},
+						animation: true
+					}
+				)
+			} else {
+				option1.legend.data = ["未完成订单明细", "完成订单明细"];
+				option1.series = [];
+				option1.series = [
+					{
+						type: 'bar',
+						label: {
+							show: true
+						},
+						data: notOrderArr,
+						name: "未完成订单明细",
+						stack: 'one',
+						itemStyle: {
+							//							borderRadius: [8, 8, 0, 0],
+							//							color: 'rgba(220,20,60, 0.6)'
+						},
+						animation: true
+					},
+					{
+						type: 'bar',
+						label: {
+							show: true
+						},
+						data: orderArr,
+						name: "完成订单明细",
+						stack: 'one',
+						itemStyle: {
+//							borderRadius: [8, 8, 0, 0],
+//							color: 'rgba(220,20,60, 0.6)'
+						},
+						animation: true
+					}
+				];
+				
+			}
+			
+			orderStatusChart.setOption(option1,true);
+		}
+	});
+
+}
+
+function loadProductionStatusChart() {
+	var qt = $('input[name="productionQt"]:checked').val();
+	SaveAjax({
+		url: window.appUrl + "Common/GetHomeStatusCharts?ct=2&qt=" + qt,
+		dataType: "json",
+		isAlert: false,
+		isValidate: false,
+		success: function (res) {
+			console.log(res);
+			//1(新建),2(生产中),3(入库中),7(已经审核)   已入库/完成 4,5
+			let yearArr = [], storeArr = [], notStoreArr = [];
+			let arrMap = new Map();
+			res.forEach(function (v, i) {
+				//默认年份
+				let ev = qt == "1" ? `${v.year.substr(2, 2)}-Q${v.quarterly}` : v.year;
+				if (!yearArr.some(ele => ele === ev)) {
+					yearArr.push(ev);
+				}
+				//非完成状态的
+				if (v.statusId == 1 || v.statusId == 2 || v.statusId == 3 || v.statusId == 7) {
+					if (!arrMap.has(ev + "@0")) {
+						arrMap.set(ev + "@0", v.count);
+					} else {
+						let preV = arrMap.get(ev + "@0");
+						arrMap.set(ev + "@0", preV + v.count);
+					}
+				} else if (v.statusId == 4 || v.statusId == 5) {//已入库 / 完成 4, 5
+					if (!arrMap.has(ev + "@1")) {
+						arrMap.set(ev + "@1", v.count);
+					} else {
+						let preV = arrMap.get(ev + "@1");
+						arrMap.set(ev + "@1", preV + v.count);
+					}
+				}
+			});
+			yearArr.forEach(function (y, i) {
+				storeArr.push(arrMap.get(y + "@1"));
+				notStoreArr.push(arrMap.get(y + "@0"));
+			});
+			console.log('yearArr', yearArr)
+			console.log('storeArr', storeArr)
+			console.log('notStoreArr', notStoreArr)
+			option2.xAxis[0].data = yearArr;
+			
+			option2.yAxis[0].interval = qt == "1"?500: 1000;
+			option2.legend.data = ["未完成排产单", "已入库/已完成的排产单"];
+//			option2.series[0].data = notStoreArr;
+//			option2.series[0].stack = 'one';
+//			option2.series[0].name = "未完成排产单";
+//			option2.series[1].data = storeArr;
+//			option2.series[1].stack = 'one';
+//			option2.series[1].name = "已入库/已完成的排产单";
+			option2.series = [
+				{
+					type: 'bar',
+					label: {
+						show: true
+					},
+					data: notStoreArr,
+					name: "未完成排产单",
+					stack: 'one',
+					itemStyle: {
+													//borderRadius: [8, 8, 0, 0],
+													color: 'rgba(220,20,60, 0.6)'
+					},
+					animation: true
+				},
+				{
+					type: 'bar',
+					label: {
+						show: true
+					},
+					data: storeArr,
+					name: "已入库/已完成的排产单",
+					stack: 'one',
+					itemStyle: {
+													borderRadius: [8, 8, 0, 0],
+					},
+					animation: true
+				}
+			];
+			productionStatusChart.setOption(option2);
+		}
+	});
+}
+