From 2e18256c630d0a12cf11e38f029b5d17c82950cc Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 21 一月 2025 13:50:02 +0800
Subject: [PATCH] 缝纫排产

---
 WebTM/views/生产管理/生产计划平台/JIT_DayPlanPlatForm_TK.html   |  323 +++++++++++++++++++++++++++++++++++++----------------
 WebTM/views/系统管理/快捷方式自定义/Xt_UserFastMenu_IconSet.html |   13 +
 2 files changed, 231 insertions(+), 105 deletions(-)

diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\350\256\241\345\210\222\345\271\263\345\217\260/JIT_DayPlanPlatForm_TK.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\350\256\241\345\210\222\345\271\263\345\217\260/JIT_DayPlanPlatForm_TK.html"
index a7eb017..b5d3706 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\350\256\241\345\210\222\345\271\263\345\217\260/JIT_DayPlanPlatForm_TK.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\350\256\241\345\210\222\345\271\263\345\217\260/JIT_DayPlanPlatForm_TK.html"
@@ -28,12 +28,14 @@
                             <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnUnlock" id="btnUnlock">瑙i攣</button>
                             <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnCompleteSetAnalysis" id="btnCompleteSetAnalysis">榻愬鍒嗘瀽</button>
                             <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnTLYS" id="btnTLYS">鎻愭枡杩愮畻</button>
-                            <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnICMOBill" id="btnICMOBill">鐢熶骇璁㈠崟閫夊崟</button>                           
+                            <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnICMOBill" id="btnICMOBill">鐢熶骇璁㈠崟閫夊崟</button>
                             <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnRoutEdit" id="btnRoutEdit">宸ヨ壓璺嚎</button>
                             <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnAddICMO" id="btnAddICMO">娣诲姞璁㈠崟</button>
                             <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnProZZPC" id="btnProZZPC">缁勮鎺掍骇</button>
                             <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnLockOrder" id="btnLockOrder">閿佸畾宸ュ崟</button>
                             <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnUnlockOrder" id="btnUnlockOrder">瑙i攣宸ュ崟</button>
+                            <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnGetCompletionDate" id="btnGetCompletionDate">鑾峰彇瀹屽伐鏃ユ湡</button>
+                            <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnGetEarlyDate" id="btnGetEarlyDate">鑾峰彇鏈�鏃╁紑宸ユ棩鏈�</button>
                         </div>
                         <div class="layui-collapse resizable-container">
                             <div class="layui-colla-item">
@@ -71,9 +73,7 @@
                                 </div>
                                 <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">鏌ヨ</button>
                                 <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch">閲嶇疆</button>
-                                <div class="layui-progress layui-progress-big" lay-showpercent="true" lay-filter="demo">
-                                    <div class="layui-progress-bar layui-bg-primary" lay-percent="0%"></div>
-                                </div>
+
                                 <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;">
                                     <div class="layui-row" style="margin-top:10px;">
                                         <div class="layui-inline">
@@ -251,7 +251,7 @@
                             <ul class="layui-tab-title">
                                 <li class="layui-this">鐢熶骇璁㈠崟</li>
                                 <li>缂烘枡鍒嗘瀽</li>
-                            </ul>                            
+                            </ul>
                             <div class="layui-tab-content">
                                 <div class="layui-tab-item layui-show">
                                     <div class="layui-inline">
@@ -287,7 +287,7 @@
                                     <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch_ICMO" id="btnSearch_ICMO">鏌ヨ</button>
                                     <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch_ICMO" id="btnReSearch_ICMO">閲嶇疆</button>
                                     <!--寰呮帓璁㈠崟-->
-                                    <table class="layui-hide" id="mainTable_ICMO" lay-filter="mainTable_ICMO"></table>                                    
+                                    <table class="layui-hide" id="mainTable_ICMO" lay-filter="mainTable_ICMO"></table>
                                 </div>
                                 <div class="layui-tab-item">
                                     <table class="layui-hide" id="mainTable_Material" lay-filter="mainTable_Material"></table>
@@ -297,7 +297,7 @@
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
                                 <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="set_BatchFill"><i class="layui-icon layui-icon-file-b"></i>鎵归噺濉厖</button>
-    <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>-->
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>-->
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>澶嶅埗琛�</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎琛�</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="set_MoverUp"><i class="layui-icon layui-icon-delete"></i>涓婄Щ</button>
@@ -581,7 +581,7 @@
                 //閫夋搷浣滃伐
                 case 'set_Emp':
                     set_Emp(data);
-                    break;                    
+                    break;
                 //鏌ョ湅宸ヨ壓璺嚎
                 case 'set_Routing':
                     set_Routing();
@@ -730,7 +730,7 @@
         //娣诲姞鐢熶骇璁㈠崟
         form.on('submit(btnAddICMO)', function (data) {
             get_btnAddICMO();
-        })        
+        })
 
         //鍑嗗
         form.on('submit(btnReady)', function (data) {
@@ -781,7 +781,7 @@
                     layer.close(index);
                 }, 1000)
             }
-        })        
+        })
 
         //宸ヨ壓璺嚎缂栬緫
         form.on('submit(btnRoutEdit)', function (data) {
@@ -811,6 +811,20 @@
                 });
             }
 
+            //鏈�鏃╁紑宸ユ棩鏈�
+            if (obj.event == 'HEarlyDate') {
+                var field = $(this).data('field');
+                laydate.render({
+                    elem: this.firstChild
+                    , show: true //鐩存帴鏄剧ず
+                    , closeStop: this
+                    , done: function (nowDate) {
+                        //鏃堕棿閫夋嫨瀹屾垚锛岃鏁版嵁鏇存柊
+                        data[field] = nowDate;
+                        obj.update(data);
+                    }
+                });
+            }
 
             //#endregion
         });
@@ -835,7 +849,7 @@
                 get_btnUnlock(HWorkShopID);
             }
         })
-        
+
         //閿佸畾宸ュ崟
         form.on('submit(btnLockOrder)', function (data) {
             get_btnLockOrder();
@@ -845,6 +859,16 @@
         form.on('submit(btnUnlockOrder)', function (data) {
             get_btnUnlockOrder();
         })
+
+        //鑾峰彇瀹屽伐鏃ユ湡 
+        form.on('submit(btnGetCompletionDate)', function (data) {
+            get_btnGetCompletionDate();
+        })
+
+        //鑾峰彇鏈�鏃╁紑宸ユ棩鏈�
+        form.on('submit(btnGetCompletionDate)', function (data) {
+            get_btnGetEarlyDate();
+        })        
 
         //#endregion
 
@@ -899,7 +923,7 @@
             var myDate = new Date();
             var oneday = 1000 * 60 * 60 * 24;
 
-            columns.push({ type: 'checkbox', fixed: 'left', sort: true });
+             columns.push({ type: 'checkbox', fixed: 'left', sort: true });
             columns.push({ type: 'numbers', field: '搴忓彿', title: '搴忓彿', sort: true, filter: true });
             columns.push({ field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', hide: true, sort: true, filter: true});
             columns.push({ field: '閿�鍞鍗曞彿', title: '閿�鍞鍗曞彿', width: 150, sort: true, filter: true });
@@ -912,171 +936,192 @@
             columns.push({ field: '灏忔椂浜ц兘', title: '灏忔椂浜ц兘', width: 150, sort: true, edit: 'text', filter: true });
             columns.push({ field: '璁″垝鏁伴噺', title: '鐢熶骇璁㈠崟鏁伴噺', width: 150, sort: true, filter: true });//0
             columns.push({ field: '鏃ヨ鍒掓暟閲忔�婚噺', title: '鏃ヨ鍒掓暟閲忔�婚噺', width: 150, sort: true, filter: true});//0
-            columns.push({ field: '浠婃棩涔嬪墠鏃ヨ鍒掓暟閲�', title: '浠婃棩涔嬪墠鏃ヨ鍒掓暟閲�', width: 150, sort: true, filter: true });//0
-            columns.push({ field: '璁″垝寮�濮嬫棩鏈�', title: '棰勮寮�宸ユ棩鏈�', width: 150, templet: "<div>{{d.璁″垝寮�濮嬫棩鏈� ==null ?'':layui.util.toDateString(d.璁″垝寮�濮嬫棩鏈�, 'yyyy-MM-dd')}}</div>", sort: true, filter: { type: 'date[yyyy-MM-dd HH:mm:ss]' } });
-            columns.push({ field: '璁″垝缁撴潫鏃ユ湡', title: '璁″垝缁撴潫鏃ユ湡', width: 150, templet: "<div>{{d.璁″垝缁撴潫鏃ユ湡 ==null ?'':layui.util.toDateString(d.璁″垝缁撴潫鏃ユ湡, 'yyyy-MM-dd')}}</div>", event: "HPlanEndDate", sort: true, filter: { type: 'date[yyyy-MM-dd HH:mm:ss]' } });
             columns.push({ field: '璁㈠崟鍙帓鏁伴噺', title: '璁㈠崟鍙帓鏁伴噺', width: 150, filter: true});
             columns.push({ field: '鎷嗗崟鏁伴噺', title: '鎷嗗崟鏁伴噺', width: 150, edit: 'text', filter: true});
             columns.push({ field: '鏄ㄦ棩鏁伴噺', title: '鏄ㄦ棩鏁伴噺', filter: true});
             columns.push({ field: '浼樺厛绾�', title: '浼樺厛绾�', width: 150, edit: 'text', sort: true, filter: true });
             columns.push({ field: '鐢熶骇璧勬簮', title: '鐢熶骇璧勬簮', width: 150, edit: 'text', event: "HSourceID", filter: true });
-            columns.push({ field: '鏈�鏃╁紑宸ユ棩鏈�', title: '鏈�鏃╁紑宸ユ棩鏈�', width: 150, templet: "<div>{{d.鏈�鏃╁紑宸ユ棩鏈� ==null ?'':layui.util.toDateString(d.鏈�鏃╁紑宸ユ棩鏈�, 'yyyy-MM-dd')}}</div>", sort: true, filter: { type: 'date[yyyy-MM-dd HH:mm:ss]' } });
+            columns.push({ field: '鏈�鏃╁紑宸ユ棩鏈�', title: '鏈�鏃╁紑宸ユ棩鏈�', width: 150, templet: "<div>{{d.鏈�鏃╁紑宸ユ棩鏈� ==null ?'':layui.util.toDateString(d.鏈�鏃╁紑宸ユ棩鏈�, 'yyyy-MM-dd')}}</div>", event: "HEarlyDate", sort: true, filter: { type: 'date[yyyy-MM-dd HH:mm:ss]' } });
 
             columns.push({
-                field: Format(myDate.getTime() + 0 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 0 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + (-3) * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + (-3) * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
+                    return DayColor(d[Format(myDate.getTime() + (-3) * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + (-3) * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + (-3) * oneday, 'yyyy-MM-dd'));
+                }
+            })//0
+            columns.push({
+                field: Format(myDate.getTime() + (-2) * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + (-2) * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
+                    return DayColor(d[Format(myDate.getTime() + (-2) * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + (-2) * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + (-2) * oneday, 'yyyy-MM-dd'));
+                }
+            })//0
+            columns.push({
+                field: Format(myDate.getTime() + (-1) * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + (-1) * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
+                    return DayColor(d[Format(myDate.getTime() + (-1) * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + (-1) * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + (-1) * oneday, 'yyyy-MM-dd'));
+                }
+            })//0
+            columns.push({
+                field: Format(myDate.getTime() + 0 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 0 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 0 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 0 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 0 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 1 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 1 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 1 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 1 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 1 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 1 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 1 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 2 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 2 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 2 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 2 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 2 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 2 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 2 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 3 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 3 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 3 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 3 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 3 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 3 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 3 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 4 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 4 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 4 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 4 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 4 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 4 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 4 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 5 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 5 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 5 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 5 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 5 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 5 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 5 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 6 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 6 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 6 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 6 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 6 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 6 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 6 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 7 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 7 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 7 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 7 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 7 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 7 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 7 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 8 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 8 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 8 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 8 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 8 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 8 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 8 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 9 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 9 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 9 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 9 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 9 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 9 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 9 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 10 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 10 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 10 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 10 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 10 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 10 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 10 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 11 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 11 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 11 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 11 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 11 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 11 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 11 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 12 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 12 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 12 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 12 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 12 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 12 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 12 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 13 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 13 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 13 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 13 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 13 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 13 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 13 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 14 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 14 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 14 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 14 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 14 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 14 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 14 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 15 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 15 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 15 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 15 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 15 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 15 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 15 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 16 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 16 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 16 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 16 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 16 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 16 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 16 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 17 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 17 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 17 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 17 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 17 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 17 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 17 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 18 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 18 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 18 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 18 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 18 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 18 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 18 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 19 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 19 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 19 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 19 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 19 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 19 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 19 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 20 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 20 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 20 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 20 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 20 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 20 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 20 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 21 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 21 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 21 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 21 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 21 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 21 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 21 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 22 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 22 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 22 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 22 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 22 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 22 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 22 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 23 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 23 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 23 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 23 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 23 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 23 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 23 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 24 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 24 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 24 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 24 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 24 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 24 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 24 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 25 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 25 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 25 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 25 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 25 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 25 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 25 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 26 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 26 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 26 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 26 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 26 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 26 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 26 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 27 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 27 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 27 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 27 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 27 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 27 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 27 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 28 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 28 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 28 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 28 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 28 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 28 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 28 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 29 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 29 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 29 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 29 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 29 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 29 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 29 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
             columns.push({
-                field: Format(myDate.getTime() + 30 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 30 * oneday, 'MM.dd'), edit: 'text', width: 70, filter: true, templet: function (d) {
+                field: Format(myDate.getTime() + 30 * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + 30 * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
                     return DayColor(d[Format(myDate.getTime() + 30 * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + 30 * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + 30 * oneday, 'yyyy-MM-dd'));
                 }
             })//0
+
+            for (var i = 31; i < 180;i++) {
+                columns.push({
+                    field: Format(myDate.getTime() + i * oneday, 'yyyy-MM-dd'), title: Format(myDate.getTime() + i * oneday, 'MM.dd'), edit: 'text', width: 90, filter: true, templet: function (d) {
+                        return DayColor(d[Format(myDate.getTime() + i * oneday, 'yyyy/MM/dd')], d[Format(myDate.getTime() + i * oneday, 'yyyy-MM-dd')], d, Format(myDate.getTime() + i * oneday, 'yyyy-MM-dd'));
+                    }
+                })//0
+            }
+
             columns.push({ field: '鐢熶骇璁㈠崟鏄庣粏琛屽彿', title: '鐢熶骇璁㈠崟鏄庣粏琛屽彿', width: 150, sort: true, filter: true });
             columns.push({ field: 'T31', title: 'T31', width: 70, filter: true});//0
             columns.push({ field: '璁㈠崟绫诲瀷', title: '璁㈠崟绫诲瀷', width: 150, sort: true, filter: true });
@@ -1111,6 +1156,10 @@
             columns.push({ field: 'HEmpID', title: 'HEmpID', hide: true });
             columns.push({ field: '鎷嗗崟姹囨姤鏁伴噺', title: '鎷嗗崟姹囨姤鏁伴噺', width: 150, edit: 'text', sort: true });
             columns.push({ field: '閿�鍞鍗曟暟閲�', title: '閿�鍞鍗曟暟閲�', width: 150, sort: true, filter: true });//0
+            columns.push({ field: '浠婃棩涔嬪墠鏃ヨ鍒掓暟閲�', title: '浠婃棩涔嬪墠鏃ヨ鍒掓暟閲�', width: 150, sort: true, filter: true });//0
+            columns.push({ field: '璁″垝寮�濮嬫棩鏈�', title: '棰勮寮�宸ユ棩鏈�', width: 150, templet: "<div>{{d.璁″垝寮�濮嬫棩鏈� ==null ?'':layui.util.toDateString(d.璁″垝寮�濮嬫棩鏈�, 'yyyy-MM-dd')}}</div>", sort: true, filter: { type: 'date[yyyy-MM-dd HH:mm:ss]' } });
+            columns.push({ field: '璁″垝缁撴潫鏃ユ湡', title: '璁″垝缁撴潫鏃ユ湡', width: 150, templet: "<div>{{d.璁″垝缁撴潫鏃ユ湡 ==null ?'':layui.util.toDateString(d.璁″垝缁撴潫鏃ユ湡, 'yyyy-MM-dd')}}</div>", event: "HPlanEndDate", sort: true, filter: { type: 'date[yyyy-MM-dd HH:mm:ss]' } });
+            columns.push({ field: '閿�鍞鍗曞鏍告棩鏈�', title: '閿�鍞鍗曞鏍告棩鏈�', width: 150, templet: "<div>{{d.閿�鍞鍗曞鏍告棩鏈� ==null ?'':layui.util.toDateString(d.閿�鍞鍗曞鏍告棩鏈�, 'yyyy-MM-dd')}}</div>",sort: true, filter: { type: 'date[yyyy-MM-dd HH:mm:ss]' } });
             columns.push({ field: '鎿嶄綔宸�', title: '鎿嶄綔宸�', width: 150, edit: 'text', event: "HEmpID" });
             columns.push({ fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' });
             option_columns = columns;
@@ -1124,7 +1173,7 @@
                 , limit: 500//榛樿鏄剧ず鍏ㄩ儴
                 , limits: [500,1000,1500,3000,5000,10000,20000]
                 , done: function (res, page, count) {
-                   
+
                     $('.layui-table thead').on('click', 'th', function () {
                         // 鑾峰彇鐐瑰嚮鐨勮〃澶寸殑 field 鍊�
                         var field = $(this).data('field');
@@ -1164,7 +1213,7 @@
 
                     //for (var i = 0; i < HBackgroundColorIndex.length;i++) {
                     //    $("tr[data-index='" + i + "']").attr({ "style": "background:#F74848;color:black;" });
-                    //}     
+                    //}
                     soulTable.render(this)
                 }
             }
@@ -1686,7 +1735,7 @@
             $("#ColName2").val("0");
             $("#Comparator2").val("0");
             form.render('select');
-            sWhere = "";           
+            sWhere = "";
         }
 
         //閲嶇疆
@@ -1799,7 +1848,7 @@
                 , btn2: function (index, layero) { }
             })
         }
-        
+
         //娣诲姞鐢熶骇璁㈠崟
         function get_btnAddICMO() {
             var HDeptID = $("#HWorkShopID").val() == "" ? 0 : $("#HWorkShopID").val();
@@ -2361,7 +2410,7 @@
         }
 
         //缁勮鎺掍骇
-        function get_btnProZZPC(HWorkShopID) {           
+        function get_btnProZZPC(HWorkShopID) {
             var JDTLen = 0;
             var lMainID = 0;
             var sICMOBillNo = "";
@@ -2389,7 +2438,7 @@
             var HDelData = 0;
             JDTLen = (100 / option.data.length).toFixed(2);
             var HJDLen = 0;
-            var HReportQty = 0;            
+            var HReportQty = 0;
 
             //濡傛灉閿佸畾璁″垝锛屽垯涓嶉渶瑕佸啀鎺掔▼
             //鏌ヨ鏈溅闂存槸鍚︽湁閿佸畾璁″垝鐨勬暟鎹�
@@ -2449,8 +2498,10 @@
             //get_FastQuery(2);
 
             //涓洪槻姝㈢敤鎴锋墜鍔ㄧ鏀逛紭鍏堢骇锛岄噸鏂版牴鎹紭鍏堢骇鎺掑簭鏁扮粍
-            option.data.sort(function (a, b) { return a.浼樺厛绾� - b.浼樺厛绾� });
-            
+            option.data.sort(function (a, b) {
+                return a.浼樺厛绾� - b.浼樺厛绾�
+            });
+
             window.HPCDate = Format(new Date().toLocaleDateString().replaceAll('/', '-'), 'yyyy/MM/dd') //褰撳墠鎺掍骇鏃ユ湡
             window.HArrIndex = []; //鐢ㄤ簬瀛樺偍鍥犱负褰撳墠鏃ユ湡涓嶆弧瓒虫渶鏃╁紑宸ユ棩鏈熻�屾湭鑳芥帓浜х殑璁㈠崟涓嬫爣
             window.HArrIndex_PC = [];//鐢ㄤ簬瀛樺偍宸茬粡鎺掍骇鐨勮鍗曚笅鏍�
@@ -2458,29 +2509,28 @@
             var HDataLen = option.data.length;//鎬绘帓浜ц鍗曢暱搴�
 
             var HProgress = parseInt(100 / HDataLen);
-
+            var HCount = 0;
             //鎸変换鍔″崟浼樺厛绾� 寰幆
-            for (var i = 0; i < HDataLen; i++) {                
-                var timer = setInterval(function () {
-                    if ((i + 1) * HProgress > 100) {
-                        clearInterval(timer);
-                    }
-                    element.progress('demo', Math.round(Math.random() * 100) + '%')
-                },  500);
+            for (var i = 0; i < HDataLen; i++) {
+                HCount++;
+                if (HCount > 50000) {
+                    break;
+                }
+                var old_date = new Date();
+
                 //element.progress('demo', (i + 1) * HProgress + '%')
                 //鍒ゆ柇鏁扮粍闀垮害鏄惁鍙戠敓鍙樺寲锛屾槸鍒欓噸缃暟缁勯暱搴�
                 if (HDataLen != option.data.length) {
                     HDataLen = option.data.length;
                     if (i == option.data.length) {
                         i = option.data.length - 1;
-                    }                   
-                }              
-                //console.log("1.寮�濮嬫帓浜х" + (i + 1) + "琛岃鍗曪細" + option.data[i].鐢熶骇璁㈠崟鍙� + "锛屽綋鍓嶆帓浜ф棩鏈燂細" + HPCDate + ",鏈�鏃╁紑宸ユ棩鏈�:" + option.data[i].鏈�鏃╁紑宸ユ棩鏈�);
-
+                    }
+                }
+                console.log("1.寮�濮嬫帓浜х" + (i + 1) + "琛岃鍗曪細" + option.data[i].鐢熶骇璁㈠崟鍙� + "锛屽綋鍓嶆帓浜ф棩鏈燂細" + HPCDate + ",鏈�鏃╁紑宸ユ棩鏈�:" + option.data[i].鏈�鏃╁紑宸ユ棩鏈�);
                 //鎺掍骇鏈�鍚庝竴绗旇鍗曪紙鑻ユ湰娆′负鏈�鍚庝竴绗旇鍗曟帓浜э紝浣嗗綋鍓嶆帓浜ф棩鏈熻繕涓嶆弧瓒虫渶鏃╁紑宸ユ棩鏈燂紝鍒欏綋鍓嶆棩鏈熻繘琛岀疮鍔狅紝鐩村埌婊¤冻鏈�鏃╁紑宸ユ棩鏈熶负姝級
                 if (HArrIndex_PC.length == option.data.length - 1 && HArrIndex.length > 0 && Format(option.data[HArrIndex[0]].鏈�鏃╁紑宸ユ棩鏈�, 'yyyy/MM/dd') > HPCDate) {
                     for (var k = 0; k < 100; k++) {
-                        //鎺掍骇鏃ユ湡寰�鍚庢帹涓�澶�                       
+                        //鎺掍骇鏃ユ湡寰�鍚庢帹涓�澶�
                         var dateTime = new Date(HPCDate);
                         HPCDate = Format(new Date(dateTime.setDate(dateTime.getDate() + 1)), 'yyyy/MM/dd');
                         //褰撳墠鎺掍骇鏃ユ湡婊¤冻鏈�鏃╁紑宸ユ棩鏈燂紝缁堟绱姞
@@ -2491,16 +2541,16 @@
                 }
 
                 //鍒ゆ柇鏄惁鏈夋湭鎺掍骇鐨勮鍗曪紝鑻ユ湁鍒欒ˉ鎺�
-                if (HArrIndex.length > 0 && HIsPriority == false) {//(HIsPriority == false || HArrIndex.length >= 2)
+               if (HArrIndex.length > 0 && (HIsPriority == false || HArrIndex.length + HArrIndex_PC.length == option.data.length)){//(HIsPriority == false || HArrIndex.length >= 2)
                     //鑾峰彇涔嬪墠鎺掍骇鏃舵湭鑳芥帓浜х殑璁㈠崟
                     i = HArrIndex[0];
 
                     var index = 0;
                     //濡傛灉瀛樺湪澶氫釜涔嬪墠鏈兘鎺掍骇鐨勮鍗曪紝鍒欑湅鍝釜璁㈠崟鑳藉浼樺厛婊¤冻鏈�鏃╁紑宸ユ棩鏈燂紝浼樺厛鎺掍骇
                     if (HArrIndex.length > 1) {
-                        //鎺掍骇鏃ユ湡寰�鍚庢帹涓�澶�                       
+                        //鎺掍骇鏃ユ湡寰�鍚庢帹涓�澶�
                         var dateTime = new Date(HPCDate);
-                        HPCDate = Format(new Date(dateTime.setDate(dateTime.getDate() + 1)), 'yyyy/MM/dd');                        
+                        HPCDate = Format(new Date(dateTime.setDate(dateTime.getDate() + 1)), 'yyyy/MM/dd');
                         for (var j = 0; j < HArrIndex.length; j++) {
                             //鍖归厤鍒版弧瓒虫渶鏃╁紑宸ユ棩鏈熺殑璁㈠崟锛屾妸杩欎釜璁㈠崟浼樺厛鎷垮幓鎺掍骇锛屽苟缁堟寰幆鍖归厤
                             if (Format(option.data[HArrIndex[j]].鏈�鏃╁紑宸ユ棩鏈�, 'yyyy/MM/dd') <= HPCDate) {
@@ -2516,7 +2566,7 @@
                     HArrIndex.splice(index, 1)
                 }
 
-                //濡傛灉褰撳墠璁㈠崟鐨勬渶鏃╁紑宸ユ棩鏈熶笉婊¤冻褰撳墠鎺掍骇鏃ユ湡锛堟渶鏃╁紑宸ユ棩鏈� > 褰撳墠鎺掍骇鏃ユ湡锛夛紝鍒欒烦鍑哄綋鍓嶈鍗曠殑鎺掍骇锛屽厛鎺掍笅涓�涓鍗�               
+                //濡傛灉褰撳墠璁㈠崟鐨勬渶鏃╁紑宸ユ棩鏈熶笉婊¤冻褰撳墠鎺掍骇鏃ユ湡锛堟渶鏃╁紑宸ユ棩鏈� > 褰撳墠鎺掍骇鏃ユ湡锛夛紝鍒欒烦鍑哄綋鍓嶈鍗曠殑鎺掍骇锛屽厛鎺掍笅涓�涓鍗�
                 if (Format(option.data[i].鏈�鏃╁紑宸ユ棩鏈�, 'yyyy/MM/dd') > HPCDate) {
 
                     if (HArrIndex.indexOf(i) == -1) {
@@ -2527,7 +2577,6 @@
                     if (HArrIndex.length > 0 && i == HDataLen - 1) {
                         HDataLen = HDataLen + 1;
                     }
-
                     continue;
                 }
                 //濡傛灉褰撳墠琛岃鍗曞凡缁忔帓浜ц繃锛屽垯璺冲嚭褰撳墠璁㈠崟鎺掍骇锛屾帴鐫�涓嬩竴琛岃鍗曠殑鎺掍骇
@@ -2536,6 +2585,7 @@
                 }
                 //璁板綍宸茬粡鎺掍骇鐨勮鍗曚笅鏍�
                 HArrIndex_PC.push(i);
+
                 //console.log("2.寮�濮嬫帓浜х" + (i + 1) + "琛岃鍗曪細" + option.data[i].鐢熶骇璁㈠崟鍙� + "锛屽綋鍓嶆帓浜ф棩鏈燂細" + HPCDate + ",鏈�鏃╁紑宸ユ棩鏈�:" + option.data[i].鏈�鏃╁紑宸ユ棩鏈�);
 
                 //濡傛灉鏈鏈�鍚庝竴绗旇鍗曟帓浜э紝浣嗚繕瀛樺湪鍥犳渶鏃╁紑宸ユ棩鏈熶笉婊¤冻鐨勮�屾帓浜т笉浜嗙殑璁㈠崟鍒欏姞闀垮惊鐜暱搴�
@@ -2577,7 +2627,7 @@
                 }
                 else {
                     sLeftProdTimes = iLeftQty / sWorkQty;
-                }                
+                }
                 //鑻ユ湰浠诲姟鍗曞凡鏈夊畨鎺掕祫婧愶紙涓婃鎺掔▼鎴栬�呮墜宸ユ帓绋嬶級 鍒欎笉鍐嶅鎵捐祫婧愶紝鐩存帴鎺掔▼
                 if (option.data[i]["HSourceID"] != 0 && option.data[i]["鐢熶骇璧勬簮"] != "") {
                     //鑾峰彇璇ョ敓浜ц祫婧愮殑鍓╀綑宸ユ椂杩涜鎺掔▼銆�
@@ -2603,9 +2653,9 @@
                     });
                 }
                 else //娌℃湁璧勬簮鍒� 鑷姩鎵惧埌璧勬簮
-                {                   
+                {
                     //鏌ヨ鐢熶骇璧勬簮鐨勫墿浣欏伐鏃惰繘琛屾帓绋嬨��
-                    var sql = "exec h_p_Sc_ICMOGetWorkSource_TK " + lMaterID + ",'" + dEndDate + "'," + sProdTimes;                   
+                    var sql = "exec h_p_Sc_ICMOGetWorkSource_TK " + lMaterID + ",'" + dEndDate + "'," + sProdTimes;
                     $.ajax({
                         url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList',
                         type: "GET",
@@ -2613,7 +2663,7 @@
                         data: { "sWhere": sql },
                         success: function (data1) {
                             if (data1.count == 1) {
-                                ds = data1.data                               
+                                ds = data1.data
                             } else {
                                 layer.alert(data1.code + data1.Message, { icon: 5 });
                             }
@@ -2669,13 +2719,11 @@
                                 });
 
                                 if (dsSub == null || dsSub.length == 0) {
-                                    console.log("i鍊�1锛氾細锛�" + (i + 1));
                                     get_HFData(1, i);
                                     continue;//濡傛灉娌℃湁鍓╀綑鍒� 鎵ц涓嬩竴涓敓浜ц鍗�
                                 }
                                 if (dsSub != null)//涓嶅姞鐝帓绋�
                                 {
-                                    console.log("i鍊�2锛氾細锛�" + (i + 1));
                                     iRow = i + 1;
                                     //灏嗘暟鎹帓鍒扮綉鏍间腑
                                     SetInfoToGrid(option, dsSub, null, (iRow - 1), iLeftQty, sWorkQty, false, HPlanDay);
@@ -2689,8 +2737,16 @@
                         } else {
                             get_HFData(1, i);
                         }
-                    }              
-                }               
+                    }
+                }
+                var new_date = new Date();
+                var difftime = (new_date - old_date) / 1000; //璁$畻鏃堕棿宸�,骞舵妸姣杞崲鎴愮
+
+                var days = parseInt(difftime / 86400); // 澶�  24*60*60*1000 
+                var hours = parseInt(difftime / 3600) - 24 * days;    // 灏忔椂 60*60 鎬诲皬鏃舵暟-杩囧幓鐨勫皬鏃舵暟=鐜板湪鐨勫皬鏃舵暟 
+                var minutes = parseInt(difftime % 3600 / 60); // 鍒嗛挓 -(day*24) 浠�60绉掍负涓�鏁翠唤 鍙栦綑 鍓╀笅绉掓暟 绉掓暟/60 灏辨槸鍒嗛挓鏁�
+                var seconds = parseInt(difftime % 60);  // 浠�60绉掍负涓�鏁翠唤 鍙栦綑 鍓╀笅绉掓暟
+                console.log("鏃堕棿宸槸: " + days + "澶�, " + hours + "灏忔椂, " + minutes + "鍒嗛挓, " + seconds + "绉�");
             }
             table.render(option);
             get_FastQuery(2);
@@ -2713,19 +2769,25 @@
             //鍒ゆ柇褰撳墠鐢熶骇璧勬簮宸茬粡鎺掍骇鍒板摢涓棩鏈熶簡锛屽綋鍓嶇敓浜ц祫婧愯繕鏈変骇鑳界殑鏈�杩戞棩鏈熶笌褰撳墠璁㈠崟鐨勬帓浜ф棩鏈熶笉绗︼紝鍒欓噸缃綋鍓嶆帓浜ф棩鏈�
             if (Format(ds[0]["鏃ユ湡"], 'yyyy/MM/dd') != Format(HPCDate, 'yyyy/MM/dd')) {
                 //褰撳墠鐢熶骇璧勬簮鍓╀綑浜ц兘鏈�杩戠殑鏃ユ湡婊¤冻鏈�鏃╁紑宸ユ棩鏈燂紝鍒欓噸缃帓浜ф棩鏈熶负褰撳墠鐢熶骇璧勬簮鍓╀綑浜ц兘鏈�杩戠殑鏃ユ湡
-                if (Format(ds[0]["鏃ユ湡"], 'yyyy/MM/dd') >= Format(grd.data[iRow]['鏈�鏃╁紑宸ユ棩鏈�'], 'yyyy/MM/dd') || HArrIndex_PC.length == option.data.length) {
-                    HPCDate = Format(ds[0]["鏃ユ湡"], 'yyyy/MM/dd');
+                if (Format(ds[0]["鏃ユ湡"], 'yyyy/MM/dd') >= Format(grd.data[iRow]['鏈�鏃╁紑宸ユ棩鏈�'], 'yyyy/MM/dd') || HArrIndex_PC.length == option.data.length || HArrIndex.length + HArrIndex_PC.length == option.data.length) {
+
+                    if (HArrIndex.length + HArrIndex_PC.length == option.data.length) {
+                        HPCDate = Format(grd.data[iRow]['鏈�鏃╁紑宸ユ棩鏈�'], 'yyyy/MM/dd');
+                    } else {
+                        HPCDate = Format(ds[0]["鏃ユ湡"], 'yyyy/MM/dd');
+                    }
+
                     //濡傛灉鏄渶鍚庝竴绗旇鍗曞湪鎺掍骇锛屽垯閲嶇疆鎺掍骇鏃ユ湡涓烘渶鏃╁紑宸ユ棩鏈燂紙涓嬫柟浼氬垽鏂紝涓嶄細瓒呬骇鑳芥帓浜э級
                     if (HArrIndex_PC.length == option.data.length) {
                         HPCDate = Format(grd.data[iRow]['鏈�鏃╁紑宸ユ棩鏈�'], 'yyyy/MM/dd');
                     }
                 } else { //褰撳墠鏃ユ湡涓嶇鍚堣鍗曠殑鏈�鏃╁紑宸ユ棩鏈燂紝鍒欐妸璁㈠崟閲嶆柊鍔犲叆寰呮帓浜у垪琛�
-                   
+
                     //灏嗕笅鏍囧姞鍏ユ湭鎺掍骇璁㈠崟鏁扮粍
                     if (HArrIndex.indexOf(iRow) == -1) {
                         HArrIndex.push(iRow);
                     }
-                    
+
                     //浠庡凡鎺掍骇璁㈠崟鏁扮粍涓Щ闄ゆ湰娆¤鍗曚笅鏍�
                     var index = HArrIndex_PC.indexOf(iRow);
                     if (index !== -1) {
@@ -2846,12 +2908,12 @@
             else {
                 for (var i = 0; i < ds.length; i++) {
                     //鎵惧埌瀵瑰簲鐨勫垪
-                    for (var j = 22; j < 53; j++) {
+                    for (var j = 22; j < 201; j++) {
                         //濡傛灉璁㈠崟鐨勫墿浣欐帓浜ф暟閲忓ぇ浜�0锛屽垯鎺ョ潃杩涜鎺掍骇
                         if (sLeftQty > 0) {
                             //鎺掍骇鏃ユ湡婊¤冻鏈�鏃╁紑宸ユ棩鏈熸墠鑳借繘琛屾帓浜�
                             if (ds[i]["鏃ユ湡"] == grd.cols[0][j].field && Format(grd.cols[0][j].field, 'yyyy/MM/dd') >= Format(grd.data[iRow]['鏈�鏃╁紑宸ユ棩鏈�'], 'yyyy/MM/dd')) {
-                               
+
                                 //濡傛灉鏃堕棿琚� 涓婇亾浣欓噺鍗犵敤 鍒� 璺宠繃
                                 b = false;
                                 //if (dsPre != null && dsPre.Tables[0].Rows.Count > 0) {
@@ -2915,7 +2977,7 @@
                                             dayWorkQty = parseInt(Numzu[0]);
                                         }
                                         //璁㈠崟鍓╀綑鏈帓浜ф暟閲� > 褰撴棩鍓╀綑浜ц兘
-                                        if (sLeftQty > dayWorkQty) {                                         
+                                        if (sLeftQty > dayWorkQty) {
                                             grd.data[iRow][grd.cols[0][j].field] = dayWorkQty;
                                             sLeftQty = sLeftQty - dayWorkQty;
                                             //oSub = new ClsGridValues();
@@ -2955,7 +3017,6 @@
                 }
 
             }
-            console.log("i鍊�3锛氾細锛�" + (iRow + 1));
         }
 
         //鏌ヨ鐢熶骇璁㈠崟
@@ -3163,8 +3224,29 @@
         function set_Priority() {
             var data = table.cache["mainTable"];
 
-            //鏍规嵁璁″垝寮�宸ユ棩鏈熸帓搴忔暟缁�
-            data.sort(function (a, b) { return Format(a.璁″垝寮�濮嬫棩鏈�, 'yyyy/MM/dd') - Format(b.璁″垝寮�濮嬫棩鏈�, 'yyyy/MM/dd') });
+
+            if ($("#HWorkShopIDName").val().indexOf("缁勮") !== -1) {
+                //鏍规嵁璁″垝寮�宸ユ棩鏈熸帓搴忔暟缁�
+                data.sort(function (a, b) {
+                    // 榛樿鏍规嵁鏈�鏃╁紑宸ユ棩鏈熸帓搴忥紝鏈�鏃╁紑宸ユ棩鏈熺浉鍚屽垯鎸夌収閿�鍞鍗曞鏍告棩鏈熸帓搴�
+                    if (Format(a.鏈�鏃╁紑宸ユ棩鏈�, 'yyyy/MM/dd') == Format(b.鏈�鏃╁紑宸ユ棩鏈�, 'yyyy/MM/dd')) {
+                        return Format(a.閿�鍞鍗曞鏍告棩鏈�, 'yyyy/MM/dd') - Format(b.閿�鍞鍗曞鏍告棩鏈�, 'yyyy/MM/dd')
+                    }
+                    return Format(a.鏈�鏃╁紑宸ユ棩鏈�, 'yyyy/MM/dd') - Format(b.鏈�鏃╁紑宸ユ棩鏈�, 'yyyy/MM/dd')
+                });
+            } else {
+                //鏍规嵁璁″垝缁撴潫鏃ユ湡鎺掑簭鏁扮粍
+                data.sort(function (a, b) {
+                    // 榛樿鏍规嵁璁″垝缁撴潫鏃ユ湡鎺掑簭锛岃鍒掔粨鏉熸棩鏈熺浉鍚屽垯鎸夌収閿�鍞鍗曞鏍告棩鏈熸帓搴�
+                    if (Format(a.璁″垝缁撴潫鏃ユ湡, 'yyyy/MM/dd') == Format(b.璁″垝缁撴潫鏃ユ湡, 'yyyy/MM/dd')) {
+                        return Format(a.閿�鍞鍗曞鏍告棩鏈�, 'yyyy/MM/dd') - Format(b.閿�鍞鍗曞鏍告棩鏈�, 'yyyy/MM/dd')
+                    }
+                    return Format(a.璁″垝缁撴潫鏃ユ湡, 'yyyy/MM/dd') - Format(b.璁″垝缁撴潫鏃ユ湡, 'yyyy/MM/dd')
+                });
+            }
+
+
+            
 
             for (var i = 0; i < data.length; i++) {
                 data[i]["浼樺厛绾�"] = ((i + 1) * 5);
@@ -3266,7 +3348,7 @@
                 return layer.msg("璇烽�夋嫨鏁版嵁!")
             }
         }
-        
+
         //閫夋搷浣滃伐
         function set_Emp(data) {
             if (data != 0) {
@@ -3372,7 +3454,7 @@
             var sSubStr = "["+JSON.stringify(num)+"]";
             var sMainSub = sSubStr + "&鍜�" + sessionStorage["HUserName"];
 
-            var index = layer.load();
+            //var index = layer.load();
             $.ajax({
                 type: "POST",
                 url: GetWEBURL() + "/JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBill_btnSave",
@@ -3381,20 +3463,19 @@
                 dataType: "json",
                 success: function (data) {
                     if (data.count == 1) {
-                        layer.msg("淇濆瓨鎴愬姛");
-                        layer.close(index);
+                        //layer.msg("淇濆瓨鎴愬姛");
+                        //layer.close(index);
                     }
                     else {
-                        layer.close(index);
+                        //layer.close(index);
                         layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                     }
                 },
                 error: function (err) {
-                    layer.close(index);
+                    //layer.close(index);
                     layer.msg("閿欒:" + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                 }
             });
-            console.log("i鍊�4锛氾細锛�");
         }
 
         //琛屽唴蹇嵎閿�
@@ -3584,7 +3665,7 @@
                 });
             }
         }
-        
+
         //閿佸畾宸ュ崟
         function get_btnLockOrder() {
             var checkStatus = table.checkStatus('mainTable')
@@ -3621,7 +3702,7 @@
                 layer.msg('璇烽�夋嫨浣犺閿佸畾鐨勫伐鍗曪紒');
             }
         }
-        
+
         //瑙i攣宸ュ崟
         function get_btnUnlockOrder() {
             var checkStatus = table.checkStatus('mainTable')
@@ -3659,6 +3740,48 @@
             }
         }
 
+        //鑾峰彇瀹屽伐鏃ユ湡
+        function get_btnGetCompletionDate() {
+            var HDeptID = $("#HWorkShopID").val() == "" ? 0 : $("#HWorkShopID").val();
+
+            $.ajax({
+                url: GetWEBURL() + '/JIT_DayPlanPlatFormBill/GetICMOCompletionDate',
+                type: "GET",
+                data: { "HDeptID": HDeptID },
+                success: function (data1) {
+                    if (data1.count == 1) {
+                        //鍒锋柊琛ㄦ牸鏁版嵁
+                        get_Display();
+                    } else {
+                        layer.alert(data1.Message, { icon: 5 });
+                    }
+                }, error: function () {
+                    layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                }
+            });
+        }
+
+        //鑾峰彇鏈�鏃╁紑宸ユ棩鏈�        
+        function get_btnGetEarlyDate() {
+            var HDeptID = $("#HWorkShopID").val() == "" ? 0 : $("#HWorkShopID").val();
+
+            $.ajax({
+                url: GetWEBURL() + '/JIT_DayPlanPlatFormBill/GetICMOEarlyDate',
+                type: "GET",
+                data: { "HDeptID": HDeptID },
+                success: function (data1) {
+                    if (data1.count == 1) {
+                        //鍒锋柊琛ㄦ牸鏁版嵁
+                        get_Display();
+                    } else {
+                        layer.alert(data1.Message, { icon: 5 });
+                    }
+                }, error: function () {
+                    layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                }
+            });
+        }
+
         //鏌ヨ鏈帓浜х殑鐢熶骇璁㈠崟
         function get_Display2(sWhere_ICMO) {
             var ajaxLoad = layer.load();
diff --git "a/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\345\277\253\346\215\267\346\226\271\345\274\217\350\207\252\345\256\232\344\271\211/Xt_UserFastMenu_IconSet.html" "b/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\345\277\253\346\215\267\346\226\271\345\274\217\350\207\252\345\256\232\344\271\211/Xt_UserFastMenu_IconSet.html"
index 26ccca6..bcc22d3 100644
--- "a/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\345\277\253\346\215\267\346\226\271\345\274\217\350\207\252\345\256\232\344\271\211/Xt_UserFastMenu_IconSet.html"
+++ "b/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\345\277\253\346\215\267\346\226\271\345\274\217\350\207\252\345\256\232\344\271\211/Xt_UserFastMenu_IconSet.html"
@@ -199,13 +199,16 @@
                     table.render(option);
 
                     //椤甸潰澶氶�夋 閲嶆柊娓叉煋
-                    for (var i = 0; i < IconList.length; i++) {
-                        if (IconList[i] == data1.data[0]["HPicNum"]) {
-                            $("#selected" + (i + 1)).attr("checked", true);
-                            table.cache["mainTable"][i].selected = true;
-                            break;
+                    if (data1.data.length > 0) {
+                        for (var i = 0; i < IconList.length; i++) {
+                            if (IconList[i] == data1.data[0]["HPicNum"]) {
+                                $("#selected" + (i + 1)).attr("checked", true);
+                                table.cache["mainTable"][i].selected = true;
+                                break;
+                            }
                         }
                     }
+                   
                     form.render('checkbox');
                     layer.close(ajaxLoad);
                 }, error: function () {

--
Gitblit v1.9.1