chenrj-PC\chenrj 8 жил өмнө
parent
commit
77732f3f0f

+ 672 - 0
VisualInspection/js/lib/jedate/jedate.js

@@ -0,0 +1,672 @@
+/**
+ @Name : jeDate v2.0 日期控件
+ @Author: chne guojun
+ @Date: 2015-12-28
+ @QQ群:516754269
+ @Site:https://github.com/singod/jeDate
+ @download by:www.sucaijiayuan.com
+ */
+(function(win) {
+    var jeDt = {}, doc = document, Cell = "#jedatebox";
+    /* (tag), (#id), (.className) ,(tag > .className) ,(tag > tag) ,(#id > tag.className) ,
+	   (.className tag) ,(tag, tag, #id) ,(tag#id.className) ,(span > * > b) ,(input[name=radio]) 
+	*/
+    var QD = jeDt.query =function(){function r(c,g){g=g||document;if(!/^[\w\-_#]+$/.test(c)&&g.querySelectorAll)return m(g.querySelectorAll(c));if(-1<c.indexOf(",")){for(var d=c.split(/,/g),a=[],b=0,e=d.length;b<e;++b)a=a.concat(r(d[b],g));return y(a)}var d=c.match(z),a=d.pop(),e=(a.match(t)||k)[1],f=!e&&(a.match(u)||k)[1],b=!e&&(a.match(v)||k)[1],a=c.match(/\[(?:[\w\-_][^=]+)=(?:[\'\[\]\w\-_]+)\]/g);if(f&&!a&&!b&&g.getElementsByClassName)b=m(g.getElementsByClassName(f));else{b=!e&&m(g.getElementsByTagName(b||"*"));f&&(b=w(b,"className",RegExp("(^|\\s)"+f+"(\\s|$)")));if(e)return(d=g.getElementById(e))?[d]:[];if(a)for(e=0;e<a.length;e++)var f=(a[e].match(x)||k)[1],h=(a[e].match(x)||k)[2],h=h.replace(/\'/g,"").replace(/\-/g,"\\-").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),b=w(b,f,RegExp("(^"+h+"$)"))}return d[0]&&b[0]?p(d,b):b}function m(c){try{return Array.prototype.slice.call(c)}catch(g){for(var d=[],a=0,b=c.length;a<b;++a)d[a]=c[a];return d}}function p(c,g,d){var a=c.pop();if("\x3e"===a)return p(c,g,!0);for(var b=[],e=-1,f=(a.match(t)||k)[1],h=!f&&(a.match(u)||k)[1],a=!f&&(a.match(v)||k)[1],m=-1,q,l,n,a=a&&a.toLowerCase();q=g[++m];){l=q.parentNode;do if(n=(n=(n=!a||"*"===a||a===l.nodeName.toLowerCase())&&(!f||l.id===f))&&(!h||RegExp("(^|\\s)"+h+"(\\s|$)").test(l.className)),d||n)break;while(l=l.parentNode);n&&(b[++e]=q)}return c[0]&&b[0]?p(c,b):b}function w(c,g,d){for(var a=-1,b,e=-1,f=[];b=c[++a];)d.test(b.getAttribute(g))&&(f[++e]=b);return f}var z=/(?:[\*\w\-\\.#]+)+(?:\[(?:[\w\-_][^=]+)=(?:[\'\[\]\w\-_]+)\])*|\*|>/gi,u=/^(?:[\w\-_]+)?\.([\w\-_]+)/,t=/^(?:[\w\-_]+)?#([\w\-_]+)/,v=/^([\w\*\-_]+)/,k=[null,null,null],x=/\[([\w\-_][^=]+)=([\'\[\]\w\-_]+)\]/,y=function(){var c=+new Date,g=function(){var d=1;return function(a){var b=a[c],e=d++;return b?!1:(a[c]=e,!0)}}();return function(d){for(var a=d.length,b=[],e=-1,f=0,h;f<a;++f)h=d[f],g(h)&&(b[++e]=h);c+=1;return b}}();return r}();
+	
+    jeDt.each = function(arr, fn) {
+        var i = 0, len = arr.length;
+        for (;i < len; i++) {
+            if (fn(i, arr[i]) === false) {
+                break;
+            }
+        }
+    };
+    jeDt.extend = function() {
+        var _extend = function me(dest, source) {
+            for (var name in dest) {
+                if (dest.hasOwnProperty(name)) {
+                    //当前属性是否为对象,如果为对象,则进行递归
+                    if (dest[name] instanceof Object && source[name] instanceof Object) {
+                        me(dest[name], source[name]);
+                    }
+                    //检测该属性是否存在
+                    if (source.hasOwnProperty(name)) {
+                        continue;
+                    } else {
+                        source[name] = dest[name];
+                    }
+                }
+            }
+        };
+        var _result = {}, arr = arguments;
+        //遍历属性,至后向前
+        if (!arr.length) return {};
+        for (var i = arr.length - 1; i >= 0; i--) {
+            _extend(arr[i], _result);
+        }
+        arr[0] = _result;
+        return _result;
+    };
+    jeDt.trim = function(str) {
+        str = str || "";
+        return str.replace(/^\s|\s$/g, "").replace(/\s+/g, " ");
+    };
+    jeDt.attr = function(elem, key, val) {
+        if (typeof key === "string" && typeof val === 'undefined') {
+            return elem.getAttribute(key);
+        } else {
+            elem.setAttribute(key, val);
+        }
+        return this;
+    };
+    jeDt.stopmp = function(e) {
+        e = e || win.event;
+        e.stopPropagation ? e.stopPropagation() :e.cancelBubble = true;
+        return this;
+    };
+    jeDt.getCss = function(obj, name) {
+        if (obj.currentStyle) {
+            return obj.currentStyle[name];
+        } else if (window.getComputedStyle) {
+            return document.defaultView.getComputedStyle(obj)[name];
+        }
+        return null;
+    };
+    //查询样式是否存在
+    jeDt.hasClass = function(elem, cls) {
+        elem = elem || {};
+        return new RegExp("\\b" + cls + "\\b").test(elem.className);
+    };
+    //添加样式
+    jeDt.addClass = function(elem, cls) {
+        elem = elem || {};
+        jeDt.hasClass(elem, cls) || (elem.className += " " + cls);
+        elem.className = jeDt.trim(elem.className);
+        return this;
+    };
+    //删除样式
+    jeDt.removeClass = function(elem, cls) {
+        elem = elem || {};
+        if (jeDt.hasClass(elem, cls)) {
+            elem.className = elem.className.replace(new RegExp("(\\s|^)" + cls + "(\\s|$)"), "");
+        }
+        return this;
+    };
+    //事件监听器
+    jeDt.on = function(obj, type, fn) {
+        if (obj.addEventListener) {
+            obj.addEventListener(type, fn, false);
+        } else if (obj.attachEvent) {
+            obj.attachEvent("on" + type, fn);
+        } else {
+            obj["on" + type] = fn;
+        }
+    };
+    //阻断mouseup
+    jeDt.stopMosup = function(evt, elem) {
+        if (evt !== "mouseup") {
+            jeDt.on(elem, "mouseup", function(ev) {
+                jeDt.stopmp(ev);
+            });
+        }
+    };
+    jeDt.html = function(elem, value) {
+        if (typeof value != "undefined" || value !== undefined && elem.nodeType === 1) {
+            elem.innerHTML = value;
+        } else {
+            return elem.innerHTML;
+        }
+        return this;
+    };
+    jeDt.text = function(elem, value) {
+        if (value !== undefined && elem.nodeType === 1) {
+            document.all ? elem.innerText = value :elem.textContent = value;
+        } else {
+            var emText = document.all ? elem.innerText :elem.textContent;
+            return emText;
+        }
+        return this;
+    };
+    jeDt.val = function(elem, value) {
+        if (value !== undefined && elem.nodeType === 1) {
+            elem.value = value;
+        } else {
+            return elem.value;
+        }
+        return this;
+    };
+    jeDt.scroll = function(type) {
+        type = type ? "scrollLeft" :"scrollTop";
+        return doc.body[type] | doc.documentElement[type];
+    };
+    jeDt.winarea = function(type) {
+        return doc.documentElement[type ? "clientWidth" :"clientHeight"];
+    };
+    //转换日期格式
+    jeDt.parse = function(ymd, hms, format) {
+        ymd = ymd.concat(hms);
+        var format = format, _this = this;
+        return format.replace(/YYYY|MM|DD|hh|mm|ss/g, function(str, index) {
+            ymd.index = ++ymd.index | 0;
+            return jeDt.digit(ymd[ymd.index]);
+        });
+    };
+    //初始化日期
+    jeDt.nowDate = function(timestamp, format) {
+        var De = new Date(timestamp | 0 ? function(tamp) {
+            return tamp < 864e5 ? +new Date() + tamp * 864e5 :tamp;
+        }(parseInt(timestamp)) :+new Date());
+        return jeDt.parse([ De.getFullYear(), De.getMonth() + 1, De.getDate() ], [ De.getHours(), De.getMinutes(), De.getSeconds() ], format);
+    };
+    jeDt.montharr = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ];
+    //判断元素类型
+    jeDt.isValHtml = function(that) {
+        return /textarea|input/.test(that.tagName.toLocaleLowerCase());
+    };
+    jeDt.weeks = [ "日", "一", "二", "三", "四", "五", "六" ];
+    //节日
+    jeDt.festival = function(md, n) {
+        var str = "";
+        switch (md) {
+          case "01.01": str = "元旦"; break;
+          case "02.14": str = "情人"; break;
+          case "03.08": str = "妇女"; break;
+          case "04.05": str = "清明"; break;
+          case "05.01": str = "劳动"; break;
+          case "06.01": str = "儿童"; break;
+          case "08.01": str = "建军"; break;
+          case "09.10": str = "教师"; break;
+          case "10.01": str = "国庆"; break;
+          case "12.24": str = "平安"; break;
+          case "12.25": str = "圣诞"; break;
+          default: str = n; break;
+        }
+        return str;
+    };
+    //补齐数位
+    jeDt.digit = function(num) {
+        return num < 10 ? "0" + (num | 0) :num;
+    };
+    //显示隐藏层
+    jeDt.shdeCell = function(type) {
+        type ? QD(Cell)[0].style.display = "none" :QD(Cell)[0].style.display = "block";
+    };
+
+    var config = {
+        dateCell:"#dateval",
+        format:"YYYY-MM-DD hh:mm:ss", //日期格式
+        minDate:"1900-01-01 00:00:00", //最小日期
+        maxDate:"2099-12-31 23:59:59", //最大日期
+        isinitVal:false, //是否初始化时间
+        isTime:false, //是否开启时间选择
+        isClear:true, //是否显示清空
+        festival:false, //是否显示节日
+        zIndex:999,  //弹出层的层级高度
+        choosefun:function(val) {},  //选中日期后的回调
+		clearfun:function(val) {},   //清除日期后的回调
+		okfun:function(val) {}       //点击确定后的回调
+    }, InitDate = function(options) {
+        var that = this, newConf = JSON.parse(JSON.stringify(config));
+        that.config = jeDt.extend(newConf, options);
+        that.init();
+    };
+    var jeDate = function(options) {
+        return new InitDate(options || {});
+    };
+    InitDate.prototype = {
+        init:function() {
+            var that = this, opts = that.config, self = QD(opts.dateCell)[0], elem, devt, even = window.event, target;
+            var dateDiv = doc.createElement("div");
+            if (!QD(Cell)[0]) {
+                dateDiv.className = dateDiv.id = Cell.replace("#", "");
+                dateDiv.style.zIndex = opts.zIndex;
+                doc.body.appendChild(dateDiv);
+            }
+            try {
+                target = even.target || even.srcElement || {};
+            } catch (e) {
+                target = {};
+            }
+            elem = opts.dateCell ? QD(opts.dateCell)[0] :target;
+            var nowDateVal = jeDt.nowDate(null, opts.format);
+            if (opts.isinitVal) {
+                (jeDt.val(self) || jeDt.text(self)) == "" ? jeDt.isValHtml(self) ? jeDt.val(self, nowDateVal) :jeDt.text(self, nowDateVal) :jeDt.isValHtml(self) ? jeDt.val(self) :jeDt.text(self);
+            }
+            if (even && target.tagName) {
+                if (!elem || elem === jeDt.elem) return;
+                jeDt.stopMosup(even.type, elem);
+                jeDt.stopmp(even);
+                that.setHtml(opts, self);
+            } else {
+                devt = opts.event || "click";
+                jeDt.each((elem.length | 0) > 0 ? elem :[ elem ], function(ii, cel) {
+                    jeDt.stopMosup(devt, that);
+                    jeDt.on(cel, devt, function(ev) {
+                        jeDt.stopmp(ev);
+                        if (cel !== jeDt.elem) that.setHtml(opts, self);
+                    });
+                });
+            }
+        },
+        setHtml:function(opts, self) {
+            var that = this, weekHtml = "", date = new Date(), nowDateVal = jeDt.nowDate(null, opts.format), isformat = opts.format.match(/\w+|d+/g).join("-") == "YYYY-MM" ? true :false;
+            var initVal = opts.isinitVal ? jeDt.isValHtml(self) ? jeDt.val(self) :jeDt.text(self) :(jeDt.val(self) || jeDt.text(self)) == "" ? nowDateVal :jeDt.isValHtml(self) ? jeDt.val(self) :jeDt.text(self);
+            if (jeDt.val(self) != "" || jeDt.text(self) != "") {
+                var arrTime = initVal.match(/\d+/g);
+            } else {
+                var arrTime = [ date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds() ];
+            }
+            var topymSty = !isformat ? '<div class="jedateym" style="width:50%;"><i class="prev triangle yearprev"></i><span class="jedateyy" data-ym="24"><em class="jedateyear"></em><em class="pndrop"></em></span><i class="next triangle yearnext"></i></div>' + '<div class="jedateym" style="width:50%;"><i class="prev triangle monthprev"></i><span class="jedatemm" data-ym="12"><em class="jedatemonth"></em><em class="pndrop"></em></span><i class="next triangle monthnext"></i></div>' :'<div class="jedateym" style="width:100%;"><i class="prev triangle ymprev"></i><span class="jedateyy"><em class="jedateyearmonth"></em></span><i class="next triangle ymnext"></i></div>';
+            var datetopStr = '<div class="jedatetop">' + topymSty + "</div>";
+            var dateymList = !isformat ? '<div class="jedatetopym" style="display: none;">' + '<ul class="ymdropul"></ul><p><span class="jedateymchle">&#8592;</span><span class="jedateymchri">&#8594;</span><span class="jedateymchok">关闭</span></p>' + "</div>" :'<ul class="jedaym"></ul>';
+            var dateriList = '<ol class="jedaol"></ol><ul class="jedaul"></ul>';
+            var bothmsStr = !isformat ? '<ul class="botflex jedatehms"><li><em data-hms="24"></em><i>:</i></li><li><em data-hms="60"></em><i>:</i></li><li><em data-hms="60"></em></li></ul>' + '<div class="botflex jedatebtn"><span class="jedateclear" style="width:31%;">清空</span><span class="jedatetodaymonth" style="width:31%;">今天</span><span class="jedateok" style="width:31%;">确认</span></div>' :'<div class="botflex jedatebtn"><span class="jedateclear" style="width:31%;">清空</span><span class="jedatetodaymonth" style="width:31%;">本月</span><span class="jedateok" style="width:31%;">确认</span></div>';
+            var datebotStr = '<div class="jedatebot">' + bothmsStr + "</div>";
+            var dateHtmStr = isformat ? datetopStr + dateymList + datebotStr :datetopStr + dateymList + dateriList + datebotStr + '<div class="jedateprophms"></div>';
+            jeDt.html(QD(Cell)[0], dateHtmStr);
+            opts.isClear ? "" :QD(Cell + " .jedatebot .jedateclear")[0].style.display = "none";
+            if (opts.isTime) {
+                var dhmsArr = jeDt.val(self) != "" || jeDt.text(self) != "" ? [ arrTime[3], arrTime[4], arrTime[5] ] :[ date.getHours(), date.getMinutes() + 1, date.getSeconds() ];
+                jeDt.each(QD(Cell + " .jedatebot .jedatehms em"), function(i, cls) {
+                    jeDt.html(cls, jeDt.digit(dhmsArr[i]));
+                });
+            } else {
+                if (!isformat) QD(Cell + " .jedatebot .jedatehms")[0].style.display = "none";
+                QD(Cell + " .jedatebot .jedatebtn")[0].style.width = "100%";
+            }
+            if (!isformat) {
+                for (var i = 0; i < jeDt.weeks.length; i++) {
+                    weekHtml += '<li class="weeks" data-week="' + jeDt.weeks[i] + '">' + jeDt.weeks[i] + "</li>";
+                }
+                jeDt.html(QD(Cell + " .jedaol")[0], weekHtml);
+                that.getDateStr(arrTime[0], arrTime[1], arrTime[2]);
+                that.YearAndMonth(that, opts, self, arrTime);
+            } else {
+                jeDt.html(QD(Cell + " .jedaym")[0], that.onlyYMStr(arrTime[0], arrTime[1]));
+                jeDt.text(QD(Cell + " .jedateym .jedateyearmonth")[0], arrTime[0] + "年" + jeDt.digit(arrTime[1]) + "月");
+                that.onlyYMevents(that, opts, self, arrTime);
+            }
+            jeDt.shdeCell(false);
+            that.orien(QD(Cell)[0], self);
+            that.events(that, opts, self, arrTime);
+        },
+        onlyYMStr:function(y, m) {
+            var onlyYM = "";
+            jeDt.each(jeDt.montharr, function(i, val) {
+                onlyYM += "<li " + (m == val ? 'class="action"' :"") + ' data-onym="' + y + "-" + jeDt.digit(val) + '">' + y + "年" + jeDt.digit(val) + "月</li>";
+            });
+            return onlyYM;
+        },
+        onlyYMevents:function(that, opts, self, arrTime) {
+            var ymPre = QD(Cell + " .jedateym .ymprev")[0], ymNext = QD(Cell + " .jedateym .ymnext")[0], ony = parseInt(arrTime[0]), onm = parseInt(arrTime[1]);
+            jeDt.each([ ymPre, ymNext ], function(i, cls) {
+                jeDt.on(cls, "click", function(ev) {
+                    jeDt.stopmp(ev);
+                    var ym = cls == ymPre ? ony -= 1 :ony += 1;
+                    jeDt.html(QD(Cell + " .jedaym")[0], that.onlyYMStr(ym, onm));
+                    that.events(that, opts, self, arrTime);
+                });
+            });
+        },
+        //方位辨别
+        orien:function(obj, self, pos) {
+            var tops, rect = self.getBoundingClientRect();
+            obj.style.left = rect.left + (pos ? 0 :jeDt.scroll(1)) + "px";
+            tops =  (rect.bottom + obj.offsetHeight / 1.5 <= jeDt.winarea()) ?
+                rect.bottom - 1 : rect.top > obj.offsetHeight / 1.5 ? rect.top - obj.offsetHeight + 1 :jeDt.winarea() - obj.offsetHeight;
+            obj.style.top = Math.max(tops + (pos ? 0 :jeDt.scroll()) + 1, 1) + "px";
+        },
+        getDateStr:function(y, m, d) {
+            var that = this, opts = that.config, dayStr = "", m = jeDt.digit(m);
+            jeDt.text(QD(Cell + " .jedateyear")[0], y + "年").attr(QD(Cell + " .jedateyear")[0], "data-year", y);
+            jeDt.text(QD(Cell + " .jedatemonth")[0], m + "月").attr(QD(Cell + " .jedatemonth")[0], "data-month", m);
+            //是否显示节日
+            var isfestival = function(day, n) {
+                return opts.festival ? jeDt.festival(day, n) :n;
+            };
+            var parseArr = function(str) {
+                var timeArr = str.split(" ");
+                return timeArr[0].split("-");
+            };
+            //先得到当前月第一天是星期几.
+            var date = setMonthDays(y, m), weekday = new Date(y, parseInt(m) - 1, 1).getDay();
+            //根据这个星期算前面几天的上个月最后几天.
+            var pervLastDay = weekday != 0 ? weekday :weekday + 7;
+            //得到上个月最后一天;
+            var pervMonthlastDay = getPervMonthLastDay(y, m), currentMonthDays = getPervMonthLastDay(y, parseInt(m) + 1);
+            //上月最后几天循环
+            var lastdays = pervMonthlastDay - pervLastDay;
+            //判断是否超出允许的日期范围	
+            var startDay = 1, minArr = parseArr(opts.minDate), maxArr = parseArr(opts.maxDate), endDay = currentMonthDays, thisDate = new Date(y, m, d), firstDate = new Date(y, m, 1), lastDate = new Date(y, m, currentMonthDays), minTime = new Date(minArr[0], minArr[1], minArr[2]), maxTime = new Date(maxArr[0], maxArr[1], maxArr[2]), minDateDay = minTime.getDate();
+            if (minTime > lastDate) {
+                startDay = parseInt(currentMonthDays) + 1;
+            } else if (minTime >= firstDate && minTime <= lastDate) {
+                startDay = minDateDay;
+            } else if (minTime >= firstDate) {}
+            if (maxTime) {
+                var maxDateDay = maxTime.getDate();
+                if (maxTime < firstDate) {
+                    endDay = startDay;
+                } else if (maxTime >= firstDate && maxTime <= lastDate) {
+                    endDay = maxDateDay;
+                }
+            }
+            //循环上月剩余的天数
+            for (var p = pervLastDay - 1; p >= 0; p--) {
+                var py, pm, preCls, preDays = jeDt.digit(pervMonthlastDay - p);
+                m == 1 ? (py = parseInt(y) - 1, pm = 13) :(py = y, pm = m);
+                var thatpretm = parseInt(py.toString() + jeDt.digit(parseInt(pm) - 1).toString() + preDays.toString()), minpretm = parseInt(minArr[0].toString() + jeDt.digit(minArr[1]).toString() + jeDt.digit(minArr[2]).toString()), maxnexttm = parseInt(maxArr[0].toString() + jeDt.digit(maxArr[1]).toString() + jeDt.digit(maxArr[2]).toString());
+                preCls = thatpretm >= minpretm && thatpretm <= maxnexttm ? "prevdate" :preCls = "disabled";
+                dayStr += "<li class='" + preCls + "' data-y='" + py + "' data-m='" + (parseInt(pm) - 1) + "' data-d='" + preDays + "'>" + isfestival(parseInt(pm) - 1 + "." + preDays, preDays) + "</li>";
+            }
+            //循环本月的天数,将日期按允许的范围分三段拼接
+            for (var i = 1; i < startDay; i++) {
+                i = jeDt.digit(i);
+                dayStr += '<li class="disabled" data-y="' + y + '" data-m="' + m + '" data-d="' + i + '">' + isfestival(m + "." + i, i) + "</li>";
+            }
+            for (var j = startDay; j <= endDay; j++) {
+                var current = "";
+                j = jeDt.digit(j);
+                if (/*y==value.year && m==value.month+1&& */ d == j) {
+                    current = "action";
+                }
+                dayStr += '<li class="' + current + '" data-y="' + y + '" data-m="' + m + '" data-d="' + j + '">' + isfestival(m + "." + j, j) + "</li>";
+            }
+            for (var k = endDay + 1; k <= currentMonthDays; k++) {
+                k = jeDt.digit(k);
+                dayStr += '<li class="disabled" data-y="' + y + '" data-m="' + m + '" data-d="' + k + '">' + isfestival(m + "." + k, k) + "</li>";
+            }
+            //循环补上下个月的开始几天
+            var nextDayArr = [], nextMonthStartDays = 42 - pervLastDay - setMonthDays(y, m);
+            for (var n = 1; n <= nextMonthStartDays; n++) {
+                var ny, nm, nextCls;
+                n = jeDt.digit(n);
+                m >= 12 ? (ny = parseInt(y) + 1, nm = 0) :(ny = y, nm = m);
+                var thatnexttm = parseInt(ny.toString() + jeDt.digit(parseInt(nm) + 1).toString() + jeDt.digit(n).toString()), minnexttm = parseInt(minArr[0].toString() + jeDt.digit(minArr[1]).toString() + jeDt.digit(minArr[2]).toString()), maxnexttm = parseInt(maxArr[0].toString() + jeDt.digit(maxArr[1]).toString() + jeDt.digit(maxArr[2]).toString());
+                nextCls = thatnexttm <= maxnexttm && thatnexttm >= minnexttm ? "nextdate" :nextCls = "disabled";
+                dayStr += "<li class='" + nextCls + "' data-y='" + ny + "' data-m='" + (parseInt(nm) + 1) + "' data-d='" + n + "'>" + isfestival(parseInt(nm) + 1 + "." + n, n) + "</li>";
+            }
+            jeDt.html(QD(Cell + " .jedaul")[0], dayStr);
+            jeDt.attr(QD(Cell + " .monthprev")[0], "data-y", jeDt.digit(parseInt(m) - 1));
+            jeDt.attr(QD(Cell + " .monthnext")[0], "data-y", jeDt.digit(parseInt(m) + 1));
+            //计算某年某月有多少天,如果是二月,闰年28天否则29天
+            function setMonthDays(year, month) {
+                var er = year % 4 == 0 && year % 100 != 0 || year % 400 == 0 ? 29 :28;
+                return [ 31, er, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ][month - 1];
+            }
+            //得到指定月的上个月最后一天传进来按 12月算
+            function getPervMonthLastDay(year, month) {
+                //当月就是  yue-1 也就是计算机里面的0-11月份,那么算上个月的最后一天就是当月的0天
+                return parseInt(new Date(year, month - 1, 0).getDate());
+            }
+        },
+        events:function(that, opts, self, arrTime) {
+            var yearPre = QD(Cell + " .yearprev")[0], yearNext = QD(Cell + " .yearnext")[0], monthPre = QD(Cell + " .monthprev")[0], monthNext = QD(Cell + " .monthnext")[0], newDate = new Date(), jedateyear = QD(Cell + " .jedateyear")[0], jedatemonth = QD(Cell + " .jedatemonth")[0], isformat = opts.format.match(/\w+|d+/g).join("-") == "YYYY-MM" ? true :false;
+            if (!isformat) {
+                //切换年
+                jeDt.each([ yearPre, yearNext ], function(i, cls) {
+                    jeDt.on(cls, "click", function(ev) {
+                        jeDt.stopmp(ev);
+                        var y = parseInt(jeDt.attr(jedateyear, "data-year")), m = parseInt(jeDt.attr(jedatemonth, "data-month"));
+                        cls == yearPre ? y -= 1 :y += 1;
+                        var d = newDate.toLocaleDateString() == y + "/" + m + "/" + newDate.getDate() ? arrTime[2] :1;
+                        that.getDateStr(y, m, d);
+                        that.clickLiDays(that, opts, self);
+                    });
+                });
+                //切换月
+                jeDt.each([ monthPre, monthNext ], function(i, cls) {
+                    jeDt.on(cls, "click", function(ev) {
+                        jeDt.stopmp(ev);
+                        var y = parseInt(jeDt.attr(jedateyear, "data-year")), m = parseInt(jeDt.attr(jedatemonth, "data-month"));
+                        if (cls == monthPre) {
+                            m == 1 ? (y -= 1, m = 12) :m -= 1;
+                        } else {
+                            m == 12 ? (y += 1, m = 1) :m += 1;
+                        }
+                        var d = newDate.toLocaleDateString() == y + "/" + m + "/" + newDate.getDate() ? arrTime[2] :1;
+                        that.getDateStr(y, m, d);
+                        that.clickLiDays(that, opts, self);
+                    });
+                });
+                //生成定位时分秒
+                jeDt.each(QD(Cell + " .jedatebot .jedatehms em"), function(i, cls) {
+                    jeDt.on(cls, "click", function() {
+                        var hmsStr = "", acton, hmscell = QD(Cell + " .jedateprophms")[0], hmslen = jeDt.attr(cls, "data-hms"), hmsstxt = [ "小时", "分钟", "秒数" ], removeEmpty = function() {
+                            jeDt.removeClass(hmscell, hmslen == 24 ? "jedateh" :"jedatems");
+                            jeDt.html(hmscell, "");
+                        };
+                        hmsStr += '<div class="jedatehmstitle">' + hmsstxt[i] + '<div class="jedatehmsclose">&times;</div></div>';
+                        for (var h = 0; h < hmslen; h++) {
+                            h = jeDt.digit(h);
+                            acton = jeDt.text(cls) == h ? "action" :"";
+                            hmsStr += '<p class="' + acton + '">' + h + "</p>";
+                        }
+                        jeDt.removeClass(hmscell, hmslen == 24 ? "jedatems" :"jedateh").addClass(hmscell, hmslen == 24 ? "jedateh" :"jedatems");
+                        jeDt.html(hmscell, hmsStr);
+                        jeDt.each(QD(Cell + " .jedateprophms p"), function(i, p) {
+                            jeDt.on(p, "click", function() {
+                                jeDt.html(cls, jeDt.digit(jeDt.text(p)));
+                                removeEmpty();
+                            });
+                        });
+                        jeDt.each(QD(Cell + " .jedateprophms .jedatehmstitle"), function(i, c) {
+                            jeDt.on(c, "click", function() {
+                                removeEmpty();
+                            });
+                        });
+                    });
+                });
+                //今天
+                jeDt.on(QD(Cell + " .jedatebot .jedatetodaymonth")[0], "click", function() {
+                    var toTime = [ newDate.getFullYear(), newDate.getMonth() + 1, newDate.getDate(), newDate.getHours(), newDate.getMinutes(), newDate.getSeconds() ];
+                    var gettoDate = jeDt.parse([ toTime[0], toTime[1], toTime[2] ], [ toTime[3], toTime[4], toTime[5] ], opts.format);
+                    that.getDateStr(toTime[0], toTime[1], toTime[2]);
+                    jeDt.isValHtml(self) ? jeDt.val(self, gettoDate) :jeDt.text(self, gettoDate);
+                    jeDt.html(QD(Cell)[0], "");
+                    jeDt.shdeCell(true);
+                    if (opts.choosefun === "function" || opts.choosefun != null) opts.choosefun(gettoDate);
+                });
+            } else {
+                jeDt.each(QD(Cell + " .jedaym li"), function(i, cls) {
+                    jeDt.on(cls, "click", function(ev) {
+                        jeDt.stopmp(ev);
+                        var atYM = jeDt.attr(cls, "data-onym").match(/\w+|d+/g);
+                        var getYMDate = jeDt.parse([ atYM[0], atYM[1], 1 ], [ 0, 0, 0 ], opts.format);
+                        jeDt.isValHtml(self) ? jeDt.val(self, getYMDate) :jeDt.text(self, getYMDate);
+                        jeDt.html(QD(Cell)[0], "");
+                        jeDt.shdeCell(true);
+                    });
+                });
+                //本月
+                jeDt.on(QD(Cell + " .jedatebot .jedatetodaymonth")[0], "click", function() {
+                    var ymTime = [ newDate.getFullYear(), newDate.getMonth() + 1, newDate.getDate()], 
+					thisYMDate = jeDt.parse([ ymTime[0], ymTime[1], 0 ], [ 0, 0, 0 ], opts.format);
+                    jeDt.isValHtml(self) ? jeDt.val(self, thisYMDate) :jeDt.text(self, thisYMDate);
+                    jeDt.html(QD(Cell)[0], "");
+                    jeDt.shdeCell(true);
+                    if (opts.choosefun === "function" || opts.choosefun != null) opts.choosefun(thisYMDate);
+                });
+            }
+            //清空
+            jeDt.on(QD(Cell + " .jedatebot .jedateclear")[0], "click", function() {
+				var clearVal = jeDt.isValHtml(self) ? jeDt.val(self) :jeDt.text(self);
+                jeDt.isValHtml(self) ? jeDt.val(self, "") :jeDt.text(self, "");
+                jeDt.html(QD(Cell)[0], "");
+                jeDt.shdeCell(true);
+				if(clearVal != ""){
+				    if (opts.clearfun === "function" || opts.clearfun != null) opts.clearfun(clearVal);
+				}
+            });
+            //确认
+            jeDt.on(QD(Cell + " .jedatebot .jedateok")[0], "click", function(ev) {
+                jeDt.stopmp(ev);
+				var jedCell = isformat ? QD(Cell + " .jedaym li") :QD(Cell + " .jedaul li")
+                if (!isformat) {
+                    var okTimeArr = [], okTime = [ parseInt(jeDt.attr(jedateyear, "data-year")), parseInt(jeDt.attr(jedatemonth, "data-month")), arrTime[2] ];
+                    jeDt.each(QD(Cell + " .jedatehms em"), function(l, tval) {
+                        okTimeArr.push(jeDt.text(tval));
+                    });
+                    var okVal = jeDt.val(self) != "" || jeDt.text(self) != "" ? jeDt.parse([ okTime[0], okTime[1], okTime[2] ], [ okTimeArr[0], okTimeArr[1], okTimeArr[2] ], opts.format) :"";
+                    that.getDateStr(okTime[0], okTime[1], okTime[2]);
+                }else{
+				    var jedYM = jeDt.val(self) != "" || jeDt.text(self) != "" ? jeDt.attr(QD(Cell + " .jedaym .action")[0], "data-onym").match(/\w+|d+/g) :"", 
+				    okVal = jeDt.val(self) != "" || jeDt.text(self) != "" ? jeDt.parse([ jedYM[0], jedYM[1], 1 ], [ 0, 0, 0 ], opts.format) :""
+				}
+                jeDt.each(jedCell, function(i, cls) {
+                    if (jeDt.attr(cls, "class") == "action") {
+                        jeDt.isValHtml(self) ? jeDt.val(self, okVal) :jeDt.text(self, okVal);
+                    }
+                });
+                jeDt.html(QD(Cell)[0], "");
+                jeDt.shdeCell(true);
+				if(okVal != ""){
+				    if (opts.okfun === "function" || opts.okfun != null) opts.okfun(okVal);
+				}
+            });
+            //点击空白处隐藏
+            jeDt.on(document, "click", function() {
+                jeDt.shdeCell(true);
+                jeDt.html(QD(Cell)[0], "");
+            });
+            jeDt.on(QD(Cell)[0], "click", function(ev) {
+                jeDt.stopmp(ev);
+            });
+            that.clickLiDays(that, opts, self);
+        },
+        //下拉选择年和月
+        YearAndMonth:function(that, opts, self, arrTime) {
+            var jetopym = QD(Cell + " .jedatetopym")[0], jedateyy = QD(Cell + " .jedateyy")[0], jedatemm = QD(Cell + " .jedatemm")[0], jedateyear = QD(Cell + " .jedateyy .jedateyear")[0], jedatemonth = QD(Cell + " .jedatemm .jedatemonth")[0], mchri = QD(Cell + " .jedateymchri")[0], mchle = QD(Cell + " .jedateymchle")[0];
+            function eachYears(YY) {
+                var eachStr = "";
+                jeDt.each(new Array(15), function(i) {
+                    if (i === 7) {
+                        var getyear = jeDt.attr(jedateyear, "data-year");
+                        eachStr += "<li " + (getyear == YY ? 'class="action"' :"") + ' data-y="' + YY + '">' + YY + "年</li>";
+                    } else {
+                        eachStr += '<li data-y="' + (YY - 7 + i) + '">' + (YY - 7 + i) + "年</li>";
+                    }
+                });
+                return eachStr;
+            }
+            function setYearMonth(YY, ymlen) {
+                var ymStr = "";
+                if (ymlen == 12) {
+                    jeDt.each(jeDt.montharr, function(i, val) {
+                        var getmonth = jeDt.attr(jedatemonth, "data-month"), val = jeDt.digit(val);
+                        ymStr += "<li " + (getmonth == val ? 'class="action"' :"") + ' data-m="' + val + '">' + val + "月</li>";
+                    });
+                    jeDt.each([ mchri, mchle ], function(c, cls) {
+                        cls.style.display = "none";
+                    });
+                } else {
+                    ymStr = eachYears(YY);
+                    jeDt.each([ mchri, mchle ], function(c, cls) {
+                        cls.style.display = "block";
+                    });
+                }
+                jeDt.removeClass(jetopym, ymlen == 12 ? "jedatesety" :"jedatesetm").addClass(jetopym, ymlen == 12 ? "jedatesetm" :"jedatesety");
+                jeDt.html(QD(Cell + " .jedatetopym .ymdropul")[0], ymStr);
+                jetopym.style.display = "block";
+            }
+            function clickLiYears(year) {
+                jeDt.each(QD(Cell + " .ymdropul li"), function(i, cls) {
+                    jeDt.on(cls, "click", function(ev) {
+                        var Years = jeDt.attr(this, "data-y"), Months = jeDt.attr(jedatemonth, "data-month");
+                        jeDt.attr(year, "data-year", Years);
+                        jeDt.html(year, Years);
+                        jetopym.style.display = "none";
+                        that.getDateStr(Years, Months, arrTime[2]);
+                        that.clickLiDays(that, opts, self);
+                    });
+                });
+            }
+            //下拉选择年
+            jeDt.on(jedateyy, "click", function() {
+                var YMlen = parseInt(jeDt.attr(jedateyy, "data-ym")), yearAttr = parseInt(jeDt.attr(jedateyear, "data-year"));
+                setYearMonth(yearAttr, YMlen);
+                clickLiYears(jedateyear);
+            });
+            //下拉选择月
+            jeDt.on(jedatemm, "click", function() {
+                var YMlen = parseInt(jeDt.attr(jedatemm, "data-ym")), yearAttr = parseInt(jeDt.attr(jedateyear, "data-year"));
+                setYearMonth(yearAttr, YMlen);
+                jeDt.each(QD(Cell + " .ymdropul li"), function(i, cls) {
+                    jeDt.on(cls, "click", function(ev) {
+                        var Years = jeDt.attr(jedateyear, "data-year"), Months = jeDt.attr(this, "data-m");
+                        jeDt.attr(jedatemonth, "data-month", Months);
+                        jeDt.html(jedatemonth, Months);
+                        jetopym.style.display = "none";
+                        that.getDateStr(Years, Months, arrTime[2]);
+                        that.clickLiDays(that, opts, self);
+                    });
+                });
+            });
+            //关闭下拉选择
+            jeDt.on(QD(Cell + " .jedateymchok")[0], "click", function(ev) {
+                jeDt.stopmp(ev);
+                jetopym.style.display = "none";
+            });
+            var yearMch = parseInt(jeDt.attr(jedateyear, "data-year"));
+            jeDt.each([ mchle, mchri ], function(lr, cls) {
+                jeDt.on(cls, "click", function(ev) {
+                    jeDt.stopmp(ev);
+                    lr == 0 ? yearMch -= 15 :yearMch += 15;
+                    var mchStr = eachYears(yearMch);
+                    jeDt.html(QD(Cell + " .jedatetopym .ymdropul")[0], mchStr);
+                    clickLiYears(jedateyear);
+                });
+            });
+        },
+        //选择日
+        clickLiDays:function(that, opts, self) {
+            jeDt.each(QD(Cell + " .jedaul li"), function(i, cls) {
+                jeDt.on(cls, "click", function(ev) {
+                    if (jeDt.hasClass(cls, "disabled")) return;
+                    jeDt.stopmp(ev);
+                    var liTms = [];
+                    jeDt.each(QD(Cell + " .jedatehms em"), function(l, tval) {
+                        liTms.push(jeDt.text(tval));
+                    });
+                    var aty = parseInt(jeDt.attr(cls, "data-y")) | 0, atm = parseInt(jeDt.attr(cls, "data-m")) | 0, atd = parseInt(jeDt.attr(cls, "data-d")) | 0;
+                    var getParDate = jeDt.parse([ aty, atm, atd ], [ liTms[0], liTms[1], liTms[2] ], opts.format);
+                    that.getDateStr(aty, atm, atd);
+                    jeDt.isValHtml(self) ? jeDt.val(self, getParDate) :jeDt.text(self, getParDate);
+                    jeDt.html(QD(Cell)[0], "");
+                    jeDt.shdeCell(true);
+                    if (opts.choosefun === "function" || opts.choosefun != null) {
+                        opts.choosefun(getParDate);
+                    }
+                });
+            });
+        }
+    };
+	jeDt.getPath = (function(){
+		var js = document.scripts, jsPath = js[js.length - 1].src;
+		return jsPath.substring(0, jsPath.lastIndexOf("/") + 1);
+	}());
+	jeDt.creatlink = function(lib){
+		var link = document.createElement('link');
+		link.type = 'text/css';
+		link.rel = 'stylesheet';
+		link.href = jeDt.getPath +'skin/'+ lib + '.css';
+		link.id = 'jeDateSkin';
+		QD('head')[0].appendChild(link);
+		link = null;
+	};
+	jeDt.creatlink('jedate');
+	jeDate.skin = function(lib){
+		QD('#jeDateSkin')[0].parentNode.removeChild(QD('#jeDateSkin')[0]);
+		jeDt.creatlink(lib);
+	};
+    //返回指定日期
+    jeDate.now = function(num) {
+        var dd = new Date();
+        dd.setDate(dd.getDate() + num);
+        var y = dd.getFullYear(), m = dd.getMonth() + 1, d = dd.getDate();
+        return y + "-" + m + "-" + d;
+    };
+    "function" === typeof define ? define(function() {
+        return jeDate;
+    }) :window.jeDate = jeDate;
+})(window);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 7 - 0
VisualInspection/js/lib/jedate/jedate.min.js


+ 69 - 0
VisualInspection/js/lib/jedate/skin/gray.css

@@ -0,0 +1,69 @@
+@charset "utf-8";
+/* CSS Document */
+*html{background-image:url(about:blank);background-attachment:fixed;}
+body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin: 0;padding: 0;border: 0;outline: 0;font-size: 100%;}
+article,aside,header,footer,nav,section,figure,figcaption,hgroup,progress,canvas{display:block}
+blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}
+body{font:14px Arial,"\5b8b\4f53", sans-serif;-webkit-text-size-adjust:100%;}
+h1,h2,h3,h4,h5,h6,button,input,select,textarea{font-size:100%; font-weight:normal; font-style:normal;}
+table{border-collapse:collapse;border-spacing:0;font-size:100%;empty-cells:show}
+*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
+*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
+fieldset,img{border:0;}
+address,caption,cite,code,dfn,th,var{font-style:normal; font-weight:normal;}
+button,input,select,textarea{font-family:Arial, Helvetica, sans-serif;text-decoration: none;outline:none;-moz-outline:none;font-size:100%;}
+input, select, label {vertical-align: middle;}
+button,input{line-height:normal}
+ul,ol,li,dl{list-style-type:none;}         i,em{font-style:normal}     svg:not(:root){overflow:hidden}
+img{vertical-align:middle;border:0;-ms-interpolation-mode:bicubic;-webkit-tap-highlight-color:rgba(0,0,0,0);}   
+
+.jedatebox{width:268px;height:auto; border:1px #ccc solid;position: absolute;background-color:#fff;font-family:'microsoft yahei',Verdana,"\u5fae\u8f6f\u96c5\u9ed1","\5b8b\4f53",Arial;font-size:14px; display:none; cursor:default;}
+.jedatebox.dateshow{display:block;}
+.jedatebox .jedatetop{width:100%;background: #F5F5F5; color:#333;border-bottom: 1px solid #ddd; overflow:hidden;text-align:center;font-family:'\5B8B\4F53';}
+.jedatebox .jedateym{float:left;height:40px; line-height:40px;}
+.jedateym span{width:70%;padding: 0;float:left;text-align: center;text-overflow: ellipsis; display:block;}
+.jedateym span input{width:100%;float:left;padding: 0;border:none;background-color:transparent;text-align: center;}
+.jedateym .prev,.jedateym .next{width:15%;height:40px; line-height:45px;float:left;display:block;text-align: center;}
+.jedateym .prev:before{width: 0;height: 0; display:inline-block;border-width: 7px; border-style: dashed;border-color: transparent;overflow: hidden;border-right-style:solid; border-right-color:#999;content: "";margin: 0 9px 0 0;}
+.jedateym .next:before{width: 0;height: 0; display:inline-block;border-width: 7px; border-style: dashed;border-color: transparent;overflow: hidden;border-left-style:solid; border-left-color:#999;content: "";margin: 0 0 0 6px;}
+.jedateym .pndrop{width:14px;height:14px; overflow:hidden;display: inline-block;position:relative;vertical-align: middle;}
+.jedateym .pndrop:before{width: 0;height: 0; display:inline-block;border-width:5px; border-style: dashed;border-color: transparent;overflow: hidden;border-top-style:solid; border-top-color:#999;content: ""; position:absolute; top:4px; left:2px;}
+
+.jedatesety,.jedatesetm{width: 100%; position:absolute;left:0; top:41px; bottom:1px;background-color: #fff;}
+.jedatesety .ymdropul,.jedatesetm .ymdropul{width:100%;height:209px;overflow:auto;}
+.jedatesety .ymdropul li{width:33.3%;float:left;text-align: center;height:40px; line-height:40px;}
+.jedatesetm .ymdropul li{width:33.3%;float:left;text-align: center;height:50px; line-height:50px;}
+.jedatesety .ymdropul li.action,.jedatesetm .ymdropul li.action{background: #B6E0FA;color:#333;}
+.jedatetopym p{overflow: hidden; padding-top:4px;}
+.jedatetopym p span{width:31%; margin:0 1.1%;background-color: #d9d9d9;color: #fff;display: block;height:28px;line-height:28px; border-radius:5px;text-align:center;font-family:'\5B8B\4F53';}
+.jedatetopym p span.jedateymchri{background-color: #efefef;color: #333;float:left;font-size: 16px;}
+.jedatetopym p span.jedateymchle{background-color: #efefef;color: #333;float:left;font-size: 16px;}
+.jedatetopym p span.jedateymchok{background-color: #efefef;color: #333; border:1px #d9d9d9 solid;float:right;font-size: 12px;}
+
+.jedatebox .jedaym{height:202px;overflow:auto; padding:5px;}
+.jedatebox .jedaym li{width:50%;float:left;text-align: center;height:32px; line-height:32px;}
+.jedatebox .jedaym li.action{background: #B6E0FA;color:#333;}
+.jedatebox .jedaol{width:100%;overflow:auto;}
+.jedatebox .jedaul{ padding:0 4px;overflow:auto;}
+.jedatebox .jedaol li,.jedatebox .jedaul li{width:14.28%; float:left; height:30px; line-height:30px; text-align:center;}
+.jedatebox .jedaul li{width:14.28%;float:left;}
+.jedatebox .jedaol li.weeks{background:#f5f5f5;border-bottom: 1px solid #ddd;}
+.jedatebox .jedaul li.action{background: #B6E0FA;color:#333;}
+.jedatebox .jedaul li.prevdate,.jedatebox .jedaul li.nextdate{color:#C0D8F3;}
+.jedatebox .jedaul li.disabled{ color:#bbb;}
+.jedatebox .jedaul li:nth-child(7n){border-right:none;}
+
+.jedatebot{height:34px;line-height:34px; padding:0 3px 0 5px;overflow:hidden;}
+.jedatebot .botflex{width:50%;float:left;display:block;margin:0;padding-top:3px; overflow:hidden;}
+.jedatebot .botflex li{width:33.33%; float:left;text-align:center;}
+.jedatebot .botflex li em{width:70%;float:left;padding: 0;border:none;border:1px #ddd solid;background-color: #fff;text-align: center;display:block;height:28px;line-height:28px;}
+.jedatebot .botflex li i{width:30%;float:left;height:28px;line-height:26px;font-style:normal;display:block;text-align: center;}
+.jedatebot .jedatebtn{text-align:center;font-size: 12px;font-family:'\5B8B\4F53';}
+.jedatebot .jedatebtn span{float:left; margin:0 1.1%;background-color: #efefef;color: #333; border:1px #d9d9d9 solid;display: block;height:28px;line-height:28px; border-radius:5px;text-align:center;}
+.jedateh,.jedatems{width: 100%; position:absolute;left:0; bottom:40px;background-color: #fff;border-top: 1px solid #ccc;}
+.jedatehmstitle{width:100%;height:35px;line-height:35px;background: #f5f5f5; color:#000;position: relative; overflow:hidden;text-align:center;font-size: 15px;}
+.jedateh p{width:20%;float:left;text-align: center;height:32px; line-height:32px;}
+.jedatems p{width:10%;float:left;text-align: center;height:32px; line-height:32px;}
+.jedateh p.action,.jedatems p.action{background: #B6E0FA;color:#333;}
+.jedatehmsclose{width:30px; height:30px; line-height:26px; text-align:center;position: absolute;top:50%;right:4px; margin-top:-15px;z-index:150;font-size:24px;}
+

+ 69 - 0
VisualInspection/js/lib/jedate/skin/green.css

@@ -0,0 +1,69 @@
+@charset "utf-8";
+/* CSS Document */
+*html{background-image:url(about:blank);background-attachment:fixed;}
+body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin: 0;padding: 0;border: 0;outline: 0;font-size: 100%;}
+article,aside,header,footer,nav,section,figure,figcaption,hgroup,progress,canvas{display:block}
+blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}
+body{font:14px Arial,"\5b8b\4f53", sans-serif;-webkit-text-size-adjust:100%;}
+h1,h2,h3,h4,h5,h6,button,input,select,textarea{font-size:100%; font-weight:normal; font-style:normal;}
+table{border-collapse:collapse;border-spacing:0;font-size:100%;empty-cells:show}
+*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
+*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
+fieldset,img{border:0;}
+address,caption,cite,code,dfn,th,var{font-style:normal; font-weight:normal;}
+button,input,select,textarea{font-family:Arial, Helvetica, sans-serif;text-decoration: none;outline:none;-moz-outline:none;font-size:100%;}
+input, select, label {vertical-align: middle;}
+button,input{line-height:normal}
+ul,ol,li,dl{list-style-type:none;}         i,em{font-style:normal}     svg:not(:root){overflow:hidden}
+img{vertical-align:middle;border:0;-ms-interpolation-mode:bicubic;-webkit-tap-highlight-color:rgba(0,0,0,0);}   
+
+.jedatebox{width:268px;height:auto; border:1px #78BA32 solid;position: absolute;background-color:#fff;font-family:'microsoft yahei',Verdana,"\u5fae\u8f6f\u96c5\u9ed1","\5b8b\4f53",Arial;font-size:14px; display:none; cursor:default;}
+.jedatebox.dateshow{display:block;}
+.jedatebox .jedatetop{width:100%;background: #78BA32; color:#fff; overflow:hidden;text-align:center;font-family:'\5B8B\4F53';}
+.jedatebox .jedateym{float:left;height:40px; line-height:40px;}
+.jedateym span{width:70%;padding: 0;float:left;text-align: center;text-overflow: ellipsis; display:block;}
+.jedateym span input{width:100%;float:left;padding: 0;border:none;background-color:transparent;text-align: center;}
+.jedateym .prev,.jedateym .next{width:15%;height:40px; line-height:45px;float:left;display:block;text-align: center;}
+.jedateym .prev:before{width: 0;height: 0; display:inline-block;border-width: 7px; border-style: dashed;border-color: transparent;overflow: hidden;border-right-style:solid; border-right-color:#fff;content: "";margin: 0 9px 0 0;}
+.jedateym .next:before{width: 0;height: 0; display:inline-block;border-width: 7px; border-style: dashed;border-color: transparent;overflow: hidden;border-left-style:solid; border-left-color:#fff;content: "";margin: 0 0 0 6px;}
+.jedateym .pndrop{width:14px;height:14px; overflow:hidden;display: inline-block;position:relative;vertical-align: middle;}
+.jedateym .pndrop:before{width: 0;height: 0; display:inline-block;border-width:5px; border-style: dashed;border-color: transparent;overflow: hidden;border-top-style:solid; border-top-color:#fff;content: ""; position:absolute; top:4px; left:2px;}
+
+.jedatesety,.jedatesetm{width: 100%; position:absolute;left:0; top:40px; bottom:0;background-color: #fff;}
+.jedatesety .ymdropul,.jedatesetm .ymdropul{width:100%;height:210px;overflow:auto;}
+.jedatesety .ymdropul li{width:33.3%;float:left;text-align: center;height:40px; line-height:40px;}
+.jedatesetm .ymdropul li{width:33.3%;float:left;text-align: center;height:50px; line-height:50px;}
+.jedatesety .ymdropul li.action,.jedatesetm .ymdropul li.action{background: #78BA32;color:#fff;}
+.jedatetopym p{overflow:auto; padding-top:4px;}
+.jedatetopym p span{width:31%; margin:0 1.1%;background-color: #78BA32;color: #fff;display: block;height:28px;line-height:28px; border-radius:5px;text-align:center;font-family:'\5B8B\4F53';}
+.jedatetopym p span.jedateymchri{background-color: #ECF4FB;color: #1F547E;float:left;font-size: 16px;}
+.jedatetopym p span.jedateymchle{background-color: #ECF4FB;color: #1F547E;float:left;font-size: 16px;}
+.jedatetopym p span.jedateymchok{background-color: #78BA32;color:#fff;float:right;font-size: 12px;}
+
+.jedatebox .jedaym{height:202px;overflow:auto; padding:5px;}
+.jedatebox .jedaym li{width:50%;float:left;text-align: center;height:32px; line-height:32px;}
+.jedatebox .jedaym li.action{background: #78BA32;color:#fff;}
+.jedatebox .jedaol{width:100%;overflow:auto;}
+.jedatebox .jedaul{ padding:0 4px;overflow:auto;}
+.jedatebox .jedaol li,.jedatebox .jedaul li{width:14.28%; float:left; height:30px; line-height:30px; text-align:center;}
+.jedatebox .jedaul li{width:14.28%;float:left;}
+.jedatebox .jedaol li.weeks{background:#f5f5f5;border-bottom: 1px solid #ddd;}
+.jedatebox .jedaul li.action{background: #78BA32;color:#fff;}
+.jedatebox .jedaul li.prevdate,.jedatebox .jedaul li.nextdate{color:#CAE8AA;}
+.jedatebox .jedaul li.disabled{ color:#bbb;}
+.jedatebox .jedaul li:nth-child(7n){border-right:none;}
+
+.jedatebot{height:34px;line-height:34px; padding:0 3px 0 5px;overflow:hidden; background:#f5f5f5;}
+.jedatebot .botflex{width:50%;float:left;display:block;margin:0;padding-top:3px; overflow:hidden;}
+.jedatebot .botflex li{width:33.33%; float:left;text-align:center;}
+.jedatebot .botflex li em{width:70%;float:left;padding: 0;border:none;border:1px #ddd solid;background-color: #fff;text-align: center;display:block;height:28px;line-height:28px;}
+.jedatebot .botflex li i{width:30%;float:left;height:28px;line-height:26px;font-style:normal;display:block;text-align: center;}
+.jedatebot .jedatebtn{text-align:center;font-size: 12px;font-family:'\5B8B\4F53';}
+.jedatebot .jedatebtn span{float:left; margin:0 1.1%;background-color: #78BA32;color: #fff;display: block;height:28px;line-height:28px; border-radius:5px;text-align:center;}
+.jedateh,.jedatems{width: 100%; position:absolute;left:0; bottom:40px;background-color: #fff;border-top: 1px solid #ccc;}
+.jedatehmstitle{width:100%;height:35px;line-height:35px;background: #f5f5f5; color:#000;position: relative; overflow:hidden;text-align:center;font-size: 15px;}
+.jedateh p{width:20%;float:left;text-align: center;height:32px; line-height:32px;}
+.jedatems p{width:10%;float:left;text-align: center;height:32px; line-height:32px;}
+.jedateh p.action,.jedatems p.action{background: #78BA32;color:#fff;}
+.jedatehmsclose{width:30px; height:30px; line-height:26px; text-align:center;position: absolute;top:50%;right:4px; margin-top:-15px;z-index:150;font-size:24px;}
+

+ 69 - 0
VisualInspection/js/lib/jedate/skin/jedate.css

@@ -0,0 +1,69 @@
+@charset "utf-8";
+/* CSS Document */
+*html{background-image:url(about:blank);background-attachment:fixed;}
+body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin: 0;padding: 0;border: 0;outline: 0;font-size: 100%;}
+article,aside,header,footer,nav,section,figure,figcaption,hgroup,progress,canvas{display:block}
+blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}
+body{font:14px Arial,"\5b8b\4f53", sans-serif;-webkit-text-size-adjust:100%;}
+h1,h2,h3,h4,h5,h6,button,input,select,textarea{font-size:100%; font-weight:normal; font-style:normal;}
+table{border-collapse:collapse;border-spacing:0;font-size:100%;empty-cells:show}
+*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
+*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
+fieldset,img{border:0;}
+address,caption,cite,code,dfn,th,var{font-style:normal; font-weight:normal;}
+button,input,select,textarea{font-family:Arial, Helvetica, sans-serif;text-decoration: none;outline:none;-moz-outline:none;font-size:100%;}
+input, select, label {vertical-align: middle;}
+button,input{line-height:normal}
+ul,ol,li,dl{list-style-type:none;}         i,em{font-style:normal}     svg:not(:root){overflow:hidden}
+img{vertical-align:middle;border:0;-ms-interpolation-mode:bicubic;-webkit-tap-highlight-color:rgba(0,0,0,0);}   
+
+.jedatebox{width:268px;height:auto; border:1px #00A1CB solid;position: absolute;background-color:#fff;font-family:'microsoft yahei',Verdana,"\u5fae\u8f6f\u96c5\u9ed1","\5b8b\4f53",Arial;font-size:14px; display:none; cursor:default;}
+.jedatebox.dateshow{display:block;}
+.jedatebox .jedatetop{width:100%;background: #00A1CB; color:#fff; overflow:hidden;text-align:center;font-family:'\5B8B\4F53';}
+.jedatebox .jedateym{float:left;height:40px; line-height:40px;}
+.jedateym span{width:70%;padding: 0;float:left;text-align: center;text-overflow: ellipsis; display:block;}
+.jedateym span input{width:100%;float:left;padding: 0;border:none;background-color:transparent;text-align: center;}
+.jedateym .prev,.jedateym .next{width:15%;height:40px; line-height:45px;float:left;display:block;text-align: center;}
+.jedateym .prev:before{width: 0;height: 0; display:inline-block;border-width: 7px; border-style: dashed;border-color: transparent;overflow: hidden;border-right-style:solid; border-right-color:#fff;content: "";margin: 0 9px 0 0;margin-top:12px!important;}
+.jedateym .next:before{width: 0;height: 0; display:inline-block;border-width: 7px; border-style: dashed;border-color: transparent;overflow: hidden;border-left-style:solid; border-left-color:#fff;content: "";margin: 0 0 0 6px;margin-top:12px!important;}
+.jedateym .pndrop{width:14px;height:14px; overflow:hidden;display: inline-block;position:relative;vertical-align: middle;}
+.jedateym .pndrop:before{width: 0;height: 0; display:inline-block;border-width:5px; border-style: dashed;border-color: transparent;overflow: hidden;border-top-style:solid; border-top-color:#fff;content: ""; position:absolute; top:4px; left:2px;}
+
+.jedatesety,.jedatesetm{width: 100%; position:absolute;left:0; top:40px; bottom:0;background-color: #fff;}
+.jedatesety .ymdropul,.jedatesetm .ymdropul{width:100%;height:210px;overflow:auto;}
+.jedatesety .ymdropul li{width:33.3%;float:left;text-align: center;height:40px; line-height:40px;}
+.jedatesetm .ymdropul li{width:33.3%;float:left;text-align: center;height:50px; line-height:50px;}
+.jedatesety .ymdropul li.action,.jedatesetm .ymdropul li.action{background: #00A1CB;color:#fff;}
+.jedatetopym p{overflow:auto; padding-top:4px;}
+.jedatetopym p span{width:31%; margin:0 1.1%;background-color: #00A1CB;color: #fff;display: block;height:28px;line-height:28px;text-align:center;font-family:'\5B8B\4F53';}
+.jedatetopym p span.jedateymchri{background-color: #ECF4FB;color: #1F547E;float:left;font-size: 16px;}
+.jedatetopym p span.jedateymchle{background-color: #ECF4FB;color: #1F547E;float:left;font-size: 16px;}
+.jedatetopym p span.jedateymchok{background-color: #00A1CB;color:#fff;float:right;font-size: 12px;}
+
+.jedatebox .jedaym{height:202px;overflow:auto; padding:5px;}
+.jedatebox .jedaym li{width:50%;float:left;text-align: center;height:32px; line-height:32px;}
+.jedatebox .jedaym li.action{background: #00A1CB;color:#fff;}
+.jedatebox .jedaol{width:100%;overflow:auto;}
+.jedatebox .jedaul{ padding:0 4px;overflow:auto;}
+.jedatebox .jedaol li,.jedatebox .jedaul li{width:14.28%; float:left; height:30px; line-height:30px; text-align:center;}
+.jedatebox .jedaul li{width:14.28%;float:left;}
+.jedatebox .jedaol li.weeks{background:#f5f5f5;border-bottom: 1px solid #ddd;}
+.jedatebox .jedaul li.action{background: #00A1CB;color:#fff;}
+.jedatebox .jedaul li.prevdate,.jedatebox .jedaul li.nextdate{color:#4DDBFF;}
+.jedatebox .jedaul li.disabled{ color:#bbb;}
+.jedatebox .jedaul li:nth-child(7n){border-right:none;}
+
+.jedatebot{height:34px;line-height:34px; padding:0 3px 0 5px;overflow:hidden;background:#f5f5f5;}
+.jedatebot .botflex{width:50%;float:left;display:block;margin:0;padding-top:3px; overflow:hidden;}
+.jedatebot .botflex li{width:33.33%; float:left;text-align:center;}
+.jedatebot .botflex li em{width:70%;float:left;padding: 0;border:none;border:1px #ddd solid;background-color: #fff;text-align: center;display:block;height:28px;line-height:28px;}
+.jedatebot .botflex li i{width:30%;float:left;height:28px;line-height:26px;font-style:normal;display:block;text-align: center;}
+.jedatebot .jedatebtn{text-align:center;font-size: 12px;font-family:'\5B8B\4F53';}
+.jedatebot .jedatebtn span{float:left; margin:0 1.1%;background-color: #00A1CB;color: #fff;display: block;height:28px;line-height:28px;text-align:center;}
+.jedateh,.jedatems{width: 100%; position:absolute;left:0; bottom:40px;background-color: #fff;border-top: 1px solid #ccc;}
+.jedatehmstitle{width:100%;height:35px;line-height:35px;background: #f5f5f5; color:#000;position: relative; overflow:hidden;text-align:center;font-size: 15px;}
+.jedateh p{width:20%;float:left;text-align: center;height:32px; line-height:32px;}
+.jedatems p{width:10%;float:left;text-align: center;height:32px; line-height:32px;margin:0;}
+.jedateh p.action,.jedatems p.action{background: #00A1CB;color:#fff;}
+.jedatehmsclose{width:30px; height:30px; line-height:26px; text-align:center;position: absolute;top:50%;right:4px; margin-top:-15px;z-index:150;font-size:24px;}
+

+ 69 - 0
VisualInspection/js/lib/jedate/skin/red.css

@@ -0,0 +1,69 @@
+@charset "utf-8";
+/* CSS Document */
+*html{background-image:url(about:blank);background-attachment:fixed;}
+body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin: 0;padding: 0;border: 0;outline: 0;font-size: 100%;}
+article,aside,header,footer,nav,section,figure,figcaption,hgroup,progress,canvas{display:block}
+blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}
+body{font:14px Arial,"\5b8b\4f53", sans-serif;-webkit-text-size-adjust:100%;}
+h1,h2,h3,h4,h5,h6,button,input,select,textarea{font-size:100%; font-weight:normal; font-style:normal;}
+table{border-collapse:collapse;border-spacing:0;font-size:100%;empty-cells:show}
+*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
+*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
+fieldset,img{border:0;}
+address,caption,cite,code,dfn,th,var{font-style:normal; font-weight:normal;}
+button,input,select,textarea{font-family:Arial, Helvetica, sans-serif;text-decoration: none;outline:none;-moz-outline:none;font-size:100%;}
+input, select, label {vertical-align: middle;}
+button,input{line-height:normal}
+ul,ol,li,dl{list-style-type:none;}         i,em{font-style:normal}     svg:not(:root){overflow:hidden}
+img{vertical-align:middle;border:0;-ms-interpolation-mode:bicubic;-webkit-tap-highlight-color:rgba(0,0,0,0);}   
+
+.jedatebox{width:268px;height:auto; border:1px #D91600 solid;position: absolute;background-color:#fff;font-family:'microsoft yahei',Verdana,"\u5fae\u8f6f\u96c5\u9ed1","\5b8b\4f53",Arial;font-size:14px; display:none; cursor:default;}
+.jedatebox.dateshow{display:block;}
+.jedatebox .jedatetop{width:100%;background: #D91600; color:#fff; overflow:hidden;text-align:center;font-family:'\5B8B\4F53';}
+.jedatebox .jedateym{float:left;height:40px; line-height:40px;}
+.jedateym span{width:70%;padding: 0;float:left;text-align: center;text-overflow: ellipsis; display:block;}
+.jedateym span input{width:100%;float:left;padding: 0;border:none;background-color:transparent;text-align: center;}
+.jedateym .prev,.jedateym .next{width:15%;height:40px; line-height:45px;float:left;display:block;text-align: center;}
+.jedateym .prev:before{width: 0;height: 0; display:inline-block;border-width: 7px; border-style: dashed;border-color: transparent;overflow: hidden;border-right-style:solid; border-right-color:#FFFF00;content: "";margin: 0 9px 0 0;}
+.jedateym .next:before{width: 0;height: 0; display:inline-block;border-width: 7px; border-style: dashed;border-color: transparent;overflow: hidden;border-left-style:solid; border-left-color:#FFFF00;content: "";margin: 0 0 0 6px;}
+.jedateym .pndrop{width:14px;height:14px; overflow:hidden;display: inline-block;position:relative;vertical-align: middle;}
+.jedateym .pndrop:before{width: 0;height: 0; display:inline-block;border-width:5px; border-style: dashed;border-color: transparent;overflow: hidden;border-top-style:solid; border-top-color:#FFFF00;content: ""; position:absolute; top:4px; left:2px;}
+
+.jedatesety,.jedatesetm{width: 100%; position:absolute;left:0; top:40px; bottom:0;background-color: #fff;}
+.jedatesety .ymdropul,.jedatesetm .ymdropul{width:100%;height:210px;overflow:auto;}
+.jedatesety .ymdropul li{width:33.3%;float:left;text-align: center;height:40px; line-height:40px;}
+.jedatesetm .ymdropul li{width:33.3%;float:left;text-align: center;height:50px; line-height:50px;}
+.jedatesety .ymdropul li.action,.jedatesetm .ymdropul li.action{background: #D91600;color:#FFFF00;}
+.jedatetopym p{overflow:auto; padding-top:4px;}
+.jedatetopym p span{width:31%; margin:0 1.1%;background-color: #D91600;color: #fff;display: block;height:28px;line-height:28px; border-radius:5px;text-align:center;font-family:'\5B8B\4F53';}
+.jedatetopym p span.jedateymchri{background-color: #ECF4FB;color: #1F547E;float:left;font-size: 16px;}
+.jedatetopym p span.jedateymchle{background-color: #ECF4FB;color: #1F547E;float:left;font-size: 16px;}
+.jedatetopym p span.jedateymchok{background-color: #D91600;color:#fff;float:right;font-size: 12px;}
+
+.jedatebox .jedaym{height:202px;overflow:auto; padding:5px;}
+.jedatebox .jedaym li{width:50%;float:left;text-align: center;height:32px; line-height:32px;}
+.jedatebox .jedaym li.action{background: #D91600;color:#FFFF00;}
+.jedatebox .jedaol{width:100%;overflow:auto;}
+.jedatebox .jedaul{ padding:0 4px;overflow:auto;}
+.jedatebox .jedaol li,.jedatebox .jedaul li{width:14.28%; float:left; height:30px; line-height:30px; text-align:center;}
+.jedatebox .jedaul li{width:14.28%;float:left;}
+.jedatebox .jedaol li.weeks{background:#f5f5f5;border-bottom: 1px solid #ddd;}
+.jedatebox .jedaul li.action{background: #D91600;color:#FFFF00;}
+.jedatebox .jedaul li.prevdate,.jedatebox .jedaul li.nextdate{color:#FFBAB3;}
+.jedatebox .jedaul li.disabled{ color:#bbb;}
+.jedatebox .jedaul li:nth-child(7n){border-right:none;}
+
+.jedatebot{height:34px;line-height:34px; padding:0 3px 0 5px;overflow:hidden;background:#f5f5f5;}
+.jedatebot .botflex{width:50%;float:left;display:block;margin:0;padding-top:3px; overflow:hidden;}
+.jedatebot .botflex li{width:33.33%; float:left;text-align:center;}
+.jedatebot .botflex li em{width:70%;float:left;padding: 0;border:none;border:1px #ddd solid;background-color: #fff;text-align: center;display:block;height:28px;line-height:28px;}
+.jedatebot .botflex li i{width:30%;float:left;height:28px;line-height:26px;font-style:normal;display:block;text-align: center;}
+.jedatebot .jedatebtn{text-align:center;font-size: 12px;font-family:'\5B8B\4F53';}
+.jedatebot .jedatebtn span{float:left; margin:0 1.1%;background-color: #D91600;color: #FFFF00;display: block;height:28px;line-height:28px; border-radius:5px;text-align:center;}
+.jedateh,.jedatems{width: 100%; position:absolute;left:0; bottom:40px;background-color: #fff;border-top: 1px solid #ccc;}
+.jedatehmstitle{width:100%;height:35px;line-height:35px;background: #f5f5f5; color:#000;position: relative; overflow:hidden;text-align:center;font-size: 15px;}
+.jedateh p{width:20%;float:left;text-align: center;height:32px; line-height:32px;}
+.jedatems p{width:10%;float:left;text-align: center;height:32px; line-height:32px;}
+.jedateh p.action,.jedatems p.action{background: #D91600;color:#fff;}
+.jedatehmsclose{width:30px; height:30px; line-height:26px; text-align:center;position: absolute;top:50%;right:4px; margin-top:-15px;z-index:150;font-size:24px;}
+

+ 121 - 70
VisualInspection/js/teamClass/charge_team_schedule.js

@@ -19,8 +19,6 @@
         // 日期游标
         var date_cursor = 0 ;
 
-       
-
         $('#calendar').calendar();
         var calendar = $('#calendar').data('zui.calendar');
        
@@ -225,7 +223,11 @@
                                 start_time =  date.Format("yyyy-MM-dd")+" "+classCode[j].start_time+":00";
                             }    
                             var end_time =  $("#save_user_class").data("work_date")+classCode[j].end_time+":00";
-                            var obj = { "work_date":work_date,"dept_id":cache.dept_id,"user_id": $(".tr-"+j+" td select").eq(i).val() , "class_type":j,"team_id":cache.team_id,"start_time":start_time, "end_time":end_time,"lane":$(".tr-"+j+" td select").eq(i).parent().attr('tag') };
+
+                            // 这边需要
+                            // console.log($(".tr-"+j+" td select").eq(i).data("data"));
+                            var list = $(".tr-"+j+" td select").eq(i).data("data");
+                            var obj = {"list":list , "work_date":work_date,"dept_id":cache.dept_id,"user_id": $(".tr-"+j+" td select").eq(i).val() , "class_type":j,"team_id":cache.team_id,"start_time":start_time, "end_time":end_time,"lane":$(".tr-"+j+" td select").eq(i).parent().attr('tag') };
                             dutyList.push(obj);
                         }
                     }
@@ -254,6 +256,107 @@
             })
         })
 
+         var cols = [{width: 60,text: '序号',type: 'number',flex: false,colClass: 'text-center'}, 
+                    { width: 130,text: '开始时间',type: 'string',flex: false,colClass: 'text-center'}, 
+                    { width: 130, text: '结束时间',type: 'string',flex: false,sort: 'down',colClass: 'text-center'}, 
+                    {width: 130,text: '人员姓名',type: 'string',flex: false,colClass: 'text-center'}, 
+                    {width: 230, text: '操作',type: 'string',flex: false,colClass: 'text-center'}
+                    ];
+        
+        $('.datatable').datatable({
+            checkable: false,
+            sortable: false,
+            data: {
+                cols: cols,
+                rows: []
+            }
+        });
+
+        var temp_data ;
+
+        // 更新表格数据
+        function updateTableData(obj){
+            var rowdata =[];
+            if (obj != null && obj.length > 0) {
+                for(var i=0;i<obj.length;i++){
+                    var userdata = {};
+                    userdata["checked"] = false;
+                    userdata["data"] = [i + 1, obj[i].start_time, obj[i].end_time, obj[i].user_name, ' <button class="btn btn-primary btn_remove"  value=' + i + ' ><i class="icon icon-remove-circle"></i>删除</button>'];
+                    rowdata.push(userdata);
+                }
+             }
+            $('.datatable').datatable('load', {
+                cols: cols,
+                rows: rowdata
+            });
+        }
+
+        $(".datatable").delegate(".btn_remove","click",function(){
+            var bind_data = temp_data;
+            // alert($(this).val())
+            if($(this).val()!=null && $(this).val()!=''){
+                bind_data.splice( $(this).val() ,1)
+                // $(".add-btn").data("data",bind_data);
+                temp_data = bind_data;
+                updateTableData(temp_data);
+            }
+
+        })
+
+
+
+        $(".table").delegate(".i-self","click",function(){
+            $("#team_info_ti").html($(this).prev().html());
+            $(".save_class_info").data("data",$(this).prev());
+            temp_data = $(this).prev().data("data") ;
+             $("#lists").show();
+            $("#add_update").hide();
+            updateTableData(temp_data);
+            showPopup4CommonBtns("添加顶班详情","720px","#add_detail_info","",function(){
+              
+            },function(){})
+        })
+        // 增加按钮
+        $(".add-btn").click(function(){
+            $("#team_info_ti").val("");
+            $("#lists").hide();
+            $("#add_update").show();
+        })
+
+        // 保存班组信息
+        $(".save_class_info").click(function(){
+            $(".save_class_info").data("data").data("data", temp_data);
+            layer.closeAll();
+        })
+
+        $(".return-btn").click(function(){
+            $("#lists").show();
+            $("#add_update").hide();
+        })
+
+        // 保存
+        $("#save_btn").click(function(){
+            var bind_data = temp_data;
+            if(bind_data == null){
+                bind_data = [] ;
+            }
+            var id = $("#team_info_ti").val();
+            var start_time = $("#start_time").val();
+            var end_time = $("#end_time").val() ;
+            var name = $("#team_info_ti").find("option:selected").text(); 
+            
+            if( id !="" && start_time !='' && end_time !=''){
+                bind_data.push({"user_name":name , "start_time":start_time , "end_time": end_time,"id":id});
+              
+                temp_data = bind_data;
+                $("#lists").show();
+                $("#add_update").hide();
+                updateTableData(temp_data);
+            }else{
+                tip("信息需填写完整");
+            }
+        })
+
         $('#calendar').calendar().on("clickEvent.zui.calendar", function(event) {
             // console.log(event。event.id);
             if(event.event.id == -1){
@@ -275,76 +378,23 @@
                     $(".tr-1,.tr-2,.tr-3").empty();
 
                     for(var i=0;i<data.length;i++){
-                        if(data[i].class_type == 1){
-                            $(".tr-1").data("cache",data[i]);
-                            // $(".tr-1").append("<td>早班 6:00 - 12:00</td>");
-                             $(".tr-1").append("<td>"+ classCode["1"].class_name +" "+classCode["1"].start_time+" - "+classCode["1"].end_time +"</td>");
-                            var selectv = "<select class='form-control'>"
-                                    // console.log(data[i]);
+                            var ct = data[i].class_type ;
+                            $(".tr-"+ct ).data("cache",data[i]);
+                            $(".tr-"+ct).append("<td>"+ classCode[ct].class_name +" "+classCode[ct].start_time+" - "+classCode[ct].end_time +"</td>");
+                            var selectv = "<select class='form-control select-self'>"
                             selectv += ("<option value=''>请选择</option>");
                             for(var j=0;j<data[i].users.length;j++){
                                     var obj = data[i].users[j];
                                     selectv += ("<option value='"+data[i].users[j].id+"'>"+ data[i].users[j].truename  +"</option>");
                             }
-                            selectv += "</select>";
-                            // for(var z=0;z<lans+1;z++){
-                            //      $(".tr-1").append("<td>"+ selectv +"</td>")
-                            // }
-                            $(".tr-1").append("<td class='c-1-0' tag='0'>"+ selectv +"</td>")
-                            for(var z=0;z<entrance_number;z++){
-                                $(".tr-1").append("<td class='c-1-"+(z+1)+"' tag='"+(z+1)+"'>"+ selectv +"</td>")
-                            }
-                            for(var z=0;z<exit_number;z++){
-                               $(".tr-1").append("<td class='c-1--"+(z+1)+"' tag='-"+(z+1)+"'>"+ selectv +"</td>")
-                            }
-
-
-                        }else if(data[i].class_type == 2){
-                            //  $(".tr-2").append("<td>中班 12:00 - 20:00</td>");
-                            $(".tr-2").append("<td>"+ classCode[2].class_name +" "+classCode[2].start_time+" - "+classCode[2].end_time +"</td>");
-                              $(".tr-2").data("cache",data[i]);
-                            var selectv2 = "<select class='form-control'>"
-                            selectv2 += ("<option value=''>请选择</option>");
-                            for(var j=0;j<data[i].users.length;j++){
-                                 if(data[i].users[j]!=null)
-                                selectv2 += ("<option value='"+data[i].users[j].id+"'>"+ data[i].users[j].truename  +"</option>")
-                            }
-                            selectv2 += "</select>";
-
-                            // for(var z=0;z<lans+1;z++){
-                            //      $(".tr-2").append("<td>"+ selectv2 +"</td>")
-                            // }
-                             $(".tr-2").append("<td class='c-2-0' tag='0'>"+ selectv2 +"</td>")
-                            for(var z=0;z<entrance_number;z++){
-                                $(".tr-2").append("<td class='c-2-"+(z+1)+"' tag='"+(z+1)+"'>"+ selectv2 +"</td>")
-                            }
-                            for(var z=0;z<exit_number;z++){
-                               $(".tr-2").append("<td class='c-2--"+(z+1)+"' tag='-"+(z+1)+"'>"+ selectv2 +"</td>")
-                            }
-                        }else if(data[i].class_type == 3){
-                            // $(".tr-3").append("<td>晚班 20:00 - 6:00</td>");
-                             $(".tr-3").append("<td>"+ classCode[3].class_name +" "+classCode[3].start_time+" - "+classCode[3].end_time +"</td>");
-                             $(".tr-3").data("cache",data[i]);
-                            var selectv3 = "<select class='form-control'>"
-                            selectv3 += ("<option value=''>请选择</option>");
-                            for(var j=0;j<data[i].users.length;j++){
-                                 if(data[i].users[j]!=null)
-                                selectv3 += "<option value='"+data[i].users[j].id+"'>"+ data[i].users[j].truename  +"</option>"
-                            }
-                            selectv3 += "</select>";
-
-                             $(".tr-3").append("<td class='c-3-0' tag='0'>"+ selectv3 +"</td>")
+                            selectv += "</select> <i title='顶班详情' alt='顶班详情' class='icon icon-tags i-self'></i>";
+                            $(".tr-"+ct).append("<td class='c-"+ct+"-0' tag='0'>"+ selectv +"</td>")
                             for(var z=0;z<entrance_number;z++){
-                                $(".tr-3").append("<td class='c-3-"+(z+1)+"' tag='"+(z+1)+"'>"+ selectv3 +"</td>")
+                                $(".tr-"+ct).append("<td class='c-"+ct+"-"+(z+1)+"' tag='"+(z+1)+"'>"+ selectv +"</td>")
                             }
                             for(var z=0;z<exit_number;z++){
-                               $(".tr-3").append("<td class='c-3--"+(z+1)+"' tag='-"+(z+1)+"'>"+ selectv3 +"</td>")
+                               $(".tr-"+ct).append("<td class='c-"+ct+"--"+(z+1)+"' tag='-"+(z+1)+"'>"+ selectv +"</td>")
                             }
-
-                            // for(var z=0;z<lans+1;z++){
-                            //      $(".tr-3").append("<td>"+ selectv3 +"</td>")
-                            // }
-                        }
                     }
                      if(data.length ==0){
                         $(".tr-1").append("<td>"+ classCode["1"].class_name +" "+classCode["1"].start_time+" - "+classCode["1"].end_time +"</td>");
@@ -363,7 +413,7 @@
 
                         post_common_service( "userClass/getList",param,function(data){
                                 // 这边将值班数据检索出来,初始化收费站车道排班中
-                                // console.log(data);
+                                console.log(data);
                                 if(data.length > 0){
                                     $("#save_user_class").data("modify_flag",true);
                                     $("#save_user_class").html("修改今日值班");
@@ -371,9 +421,10 @@
                                      $("#save_user_class").html("生成今日值班");
                                       $("#save_user_class").data("modify_flag",false);
                                 }
-                                // console.log(data);
                                 for(var i=0;i<data.length;i++){
-                                   
+                                    console.log(data[i].list)
+                                    if(data[i].list != null)
+                                        $(".c-"+data[i].class_type+"-"+data[i].lane+" select").data("data",data[i].list);
                                    $(".c-"+data[i].class_type+"-"+data[i].lane+" select").val(data[i].user_id);
                                     // $(".table .tr-"+data[i].class_type+" select").eq(i%(lans+1)).val(data[i].user_id);
                                 }
@@ -384,8 +435,6 @@
                 },function(error){
                     return "" ;
                 })
-
-
             }else{
                 click_function(event.event.start);
             }
@@ -538,4 +587,6 @@
 
    function setAddTermTitle(title){
        $(".modal-title").html("添加班组-"+title);
-   }
+   }
+
+   

+ 1 - 0
VisualInspection/view/main.html

@@ -11,6 +11,7 @@
         img.lightbox-img{width:600px;}
     </style>
     <script src="/js/mytask/check.js"></script>   
+    <script src="/js/lib/jedate/jedate.js"></script>
     <script src="/js/teamClass/charge_team_schedule.js"></script>
 </head>
 

+ 59 - 11
VisualInspection/view/term_management/charge_stuff_schedule.html

@@ -44,14 +44,6 @@
                             </select>
                         </div>
                     </div>
-                    <!--<div class="form-group">
-                        <label for="exampleInputAccount4" class="col-sm-offset-1 col-sm-2">全班</label>
-                        <div class="col-md-6 col-sm-8">
-                            <select id="all_term" type="text" class="form-control class_team_4" >
-                                <option value=''>请选择班组</option>
-                            </select>
-                        </div>
-                    </div>-->
                     <hr>
                     <div class="form-group">
                         <div class="col-sm-12">
@@ -70,7 +62,7 @@
 
 
 <div class="modal fade" id="add_fee_station">
-    <div class="modal-dialog modal-lg" style="width:1000px;" >
+    <div class="modal-dialog modal-lg" style="width:1200px;" >
         <div class="modal-content">
     <div class="modal-header">
         <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
@@ -111,10 +103,51 @@
     </div>
     </div>
 </div>
-</div>
 
+<div id="add_detail_info" style="width:700px;">
+    <div id="lists">
+         <div class="datatable" style="padding-left:20px;padding-top:10px;"></div>
+         <div class="form-group">
+            <div class="col-sm-12">
+                <button style="float:right;margin-right:10px;margin-bottom:30px; " class="btn btn-info add-btn">增加</button>
+                <button style="float:right;margin-right:10px;margin-bottom:30px; " class="btn btn-info save_class_info">确定</button>
+            </div>
+        </div>
+    </div>
+    <div id="add_update" style="display:none;" >
+        <div class="form-horizontal" style="margin-top:30px;">
+            <div class="form-group">
+                <label for="exampleInputAccount4" class="col-sm-offset-1 col-sm-2">班组人员</label>
+                <div class="col-md-6 col-sm-8">
+                    <select id="team_info_ti" type="text" class="form-control" >
+                        
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <label for="exampleInputAccount4" class="col-sm-offset-1 col-sm-2">开始时间</label>
+                <div class="col-md-6 col-sm-8">
+                    <input type="text" id="start_time" class="form-control form-date" placeholder="开始时间">
+                </div>
+            </div>
+            <div class="form-group">
+                <label for="exampleInputAccount4" class="col-sm-offset-1 col-sm-2">结束时间</label>
+                <div class="col-md-6 col-sm-8">
+                    <input type="text" id="end_time" class="form-control form-date" placeholder="结束时间">
+                </div>
+            </div>
+             <div class="form-group">
+                <div class="col-sm-12">
+                    <button  style="float:right;margin-right:10px;" class="btn return-btn">返回</button>
+                    <button  style="float:right;margin-right:10px;" id="save_btn" class="btn btn-info">保存</button>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
 
 
+</div>
 
 <!--<link rel="stylesheet" type="text/css" href="/node_modules/zui/dist/lib/calendar/zui.calendar.css">   
 <script src="/node_modules/zui/dist/lib/calendar/zui.calendar.js"></script>
@@ -130,9 +163,24 @@
     .content .events div:first-child{
         background-color:chocolate !important ;
     }
+    .select-self{
+        display: inline !important ;
+        width: 80% ;
+    }
+    .icon.icon-tags.i-self{
+        width: 20% ;
+        cursor: pointer;
+    }
+    /*.jedatebox{
+        z-index: 99999999 !important;
+    }*/
 </style>
 <script>
     $(document).ready(function() {
         initChargeTeamSchedule();
-   })
+
+        jeDate({ dateCell:"#start_time", format:"YYYY-MM-DD hh:mm:00", isTime:true,festival: true,isinitVal: true,zIndex:99999999});
+        jeDate({ dateCell:"#end_time", format:"YYYY-MM-DD hh:mm:00", isTime:true,festival: true,isinitVal: true,zIndex:99999999 });
+  
+    })
 </script>

+ 54 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/UnregularUserClass.java

@@ -0,0 +1,54 @@
+package com.xintong.visualinspection.bean;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.validation.constraints.NotNull;
+
+import org.hibernate.validator.constraints.NotEmpty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import lombok.Data;
+
+/**
+ * 文件名:ScoreDeducting
+ * 版本信息:日期:2017/4/18 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Data
+public class UnregularUserClass {
+    //编号
+    private Long id;
+    //上班日期
+    @NotNull
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")  
+    private Date work_date;
+    //上班时间
+    @NotNull
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")  
+    private Date start_time;
+    //下班时间
+    @NotNull
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")  
+    private Date end_time;
+    //班组id
+    private Long team_id;
+    //人员ids
+    private Long user_id;
+    //部门id
+    private Long dept_id;
+    //班次类型(早、中、晚、全天)
+    private Integer class_type;
+    
+    // 姓名
+    private String user_name ;
+    
+    private Integer lane;
+    // sys_user_class id
+    private Long class_id ;
+    
+}

+ 4 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/UserClass.java

@@ -46,4 +46,8 @@ public class UserClass {
     
     private Integer lane;
     
+    private Integer class_flag ;
+    
+    private List<UnregularUserClass> list ;
+    
 }

+ 15 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/BaseController.java

@@ -105,6 +105,21 @@ public class BaseController {
     }
     
     /**
+     * 返回前台结果结构体
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    public String returnSuccessResultTime(Object o){
+    	Map<String,Object> result = new HashMap<>();
+    	result.put("result_code", 0);
+    	result.put("result_desc", "success");
+    	result.put("result_data", o);
+        return JSON.toJSONStringWithDateFormat(result,"yyyy-MM-dd HH:mm:00");
+    }
+    
+    /**
      * 返回前台结果分页结构体
      * @return
      * String

+ 1 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/UserClassController.java

@@ -42,7 +42,7 @@ public class UserClassController extends BaseController {
     @RequestMapping(value = "/getList")
     public String getList(@RequestBody UserClass userClass){
     	List<UserClass> list = userClassService.selectList(userClass);
-    	return super.returnSuccessResult(list);
+    	return super.returnSuccessResultTime(list);
     }
     
     /**

+ 4 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/UserClassDao.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import org.apache.ibatis.annotations.Mapper;
 
+import com.xintong.visualinspection.bean.UnregularUserClass;
 import com.xintong.visualinspection.bean.UserClass;
 
 /**
@@ -16,4 +17,7 @@ public interface UserClassDao  {
     public void insert(UserClass userClass);
     public void delete(UserClass userClass);
     public String getUsersByTeamId(Integer user_class_id);
+    
+    public void insert_detail(List<UnregularUserClass> userClass);
+    public void deleteDetail(UserClass userClass);
 }

+ 43 - 5
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/UserClassMapper.xml

@@ -2,17 +2,48 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xintong.visualinspection.dao.master.UserClassDao" >
    
+   <resultMap type="com.xintong.visualinspection.bean.UserClass" id="userClassMap">
+   		<id property="id" column="id" />
+   		<result property="work_date" column="work_date" />
+   		<result property="dept_id" column="dept_id" />
+   		<result property="user_id" column="user_id" />
+   		<result property="class_type" column="class_type" />
+   		<result property="team_id" column="team_id" />
+   		<result property="start_time" column="start_time"/>
+   		<result property="end_time" column="end_time"/>
+   		<result property="lane" column="lane"/>
+   		<result property="class_flag" column="class_flag"/>
+   		<collection property="list" ofType="com.xintong.visualinspection.bean.UnregularUserClass">
+   			<id property="id" column="ids" />
+   			<result property="start_time" column="start_time_u"/>
+   			<result property="end_time" column="end_time_u"/>
+   			<result property="user_name" column="user_name"/>
+   			<result property="user_id" column="user_id_u"/>
+   		</collection>
+   </resultMap>
    
-   <insert id="insert" parameterType="com.xintong.visualinspection.bean.UserClass">
+   <insert id="insert" parameterType="com.xintong.visualinspection.bean.UserClass" useGeneratedKeys="true" keyProperty="id">
    		INSERT INTO
         sys_user_class
-        (work_date,dept_id,user_id,class_type,team_id,start_time,end_time,lane)
+        (work_date,dept_id,user_id,class_type,team_id,start_time,end_time,lane,class_flag)
         VALUES
-        (#{work_date},#{dept_id},#{user_id},#{class_type},#{team_id},#{start_time},#{end_time},#{lane})
+        (#{work_date},#{dept_id},#{user_id},#{class_type},#{team_id},#{start_time},#{end_time},#{lane},#{class_flag})
    </insert>
    
-   <select id="selectList" parameterType="com.xintong.visualinspection.bean.UserClass" resultType="com.xintong.visualinspection.bean.UserClass" >
-   		SELECT * from sys_user_class where work_date = #{work_date} and dept_id=#{dept_id} order by class_type asc , lane asc
+   
+   <insert id="insert_detail" parameterType="java.util.List" >
+   		INSERT INTO
+        sys_user_class_unregular
+        (work_date,dept_id,user_id,class_type,team_id,start_time,end_time,lane,class_id,user_name)
+        VALUES
+        <foreach collection="list" item="item" index="index" separator="," > 
+			(#{item.work_date},#{item.dept_id},#{item.user_id},#{item.class_type},#{item.team_id},#{item.start_time},#{item.end_time},#{item.lane},#{item.class_id},#{item.user_name})
+		</foreach> 
+   </insert>
+   
+   <select id="selectList" parameterType="com.xintong.visualinspection.bean.UserClass" resultMap="userClassMap" >
+   		SELECT su.*,t.start_time AS start_time_u,t.end_time AS end_time_u,t.user_name , t.user_id AS user_id_u , t.id AS ids FROM sys_user_class su LEFT JOIN sys_user_class_unregular t ON su.id = t.class_id 
+   		 WHERE su.work_date = #{work_date} AND su.dept_id=#{dept_id} order by class_type asc , lane asc
    </select>
    
    <delete id="delete" parameterType="com.xintong.visualinspection.bean.UserClass">
@@ -22,6 +53,13 @@
         work_date =#{work_date} and dept_id=#{dept_id}
    </delete>
    
+   <delete id="deleteDetail" parameterType="com.xintong.visualinspection.bean.UserClass">
+   		DELETE FROM 
+   		sys_user_class_unregular
+   		WHERE   work_date =#{work_date} and dept_id=#{dept_id}
+   </delete>
+   
+   
    <select id="getUsersByTeamId" parameterType="java.lang.Integer" resultType="String"  >
         SELECT user_ids
         FROM sys_team

+ 34 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/UserClassServiceImpl.java

@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.mysql.jdbc.StringUtils;
+import com.xintong.visualinspection.bean.UnregularUserClass;
 import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.bean.UserClass;
 import com.xintong.visualinspection.dao.master.UserClassDao;
@@ -31,15 +32,48 @@ public class UserClassServiceImpl extends BaseService implements UserClassServic
 	public void insertList(List<UserClass> list) {
 		// TODO Auto-generated method stub
 		for(int i=0;i<list.size();i++){
+			if(list.get(i).getList()!=null && list.get(i).getList().size()>0 )
+				list.get(i).setClass_flag(1);
 			userClassDao.insert(list.get(i));
+			List<UnregularUserClass> obj = list.get(i).getList() ;
+			if(obj!=null && obj.size()>0){
+				for(int j=0;j<obj.size();j++){
+					obj.get(j).setClass_type(list.get(i).getClass_type());
+					obj.get(j).setDept_id(list.get(i).getDept_id());
+					obj.get(j).setWork_date(list.get(i).getWork_date());
+					obj.get(j).setLane(list.get(i).getLane());
+					obj.get(j).setUser_id(obj.get(j).getId());
+					obj.get(j).setTeam_id(list.get(i).getTeam_id());
+					obj.get(j).setClass_id(list.get(i).getId());
+				}
+				userClassDao.insert_detail(obj);
+			}
 		}
 	}
 
 	@Override
 	public void updateList(List<UserClass> list) {
 		userClassDao.delete(list.get(0));
+		userClassDao.deleteDetail(list.get(0));
 		for(int i=0;i<list.size();i++){
+			if(list.get(i).getList()!=null && list.get(i).getList().size() >0 )
+				list.get(i).setClass_flag(1);
+			else
+				list.get(i).setClass_flag(0);
 			userClassDao.insert(list.get(i));
+			List<UnregularUserClass> obj = list.get(i).getList() ;
+			if(obj!=null && obj.size() > 0){
+				for(int j=0;j<obj.size();j++){
+					obj.get(j).setClass_type(list.get(i).getClass_type());
+					obj.get(j).setDept_id(list.get(i).getDept_id());
+					obj.get(j).setWork_date(list.get(i).getWork_date());
+					obj.get(j).setLane(list.get(i).getLane());
+					obj.get(j).setUser_id(obj.get(j).getId());
+					obj.get(j).setTeam_id(list.get(i).getTeam_id());
+					obj.get(j).setClass_id(list.get(i).getId());
+				}
+				userClassDao.insert_detail(obj);
+			}
 		}
 	}
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно