From 33d4089dc70abba2242db26d79bcd2a0c5134645 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期二, 15 八月 2023 14:28:38 +0800
Subject: [PATCH] 异常工时申请单:添加子表重复校验,子表做颜色区分,子表单元格根据宽度隐藏内容,取消分页,添加合计行,根据职员带出工作中,取消上一行下一行

---
 WebTM/views/工资管理/异常工时申请单/Pay_ErrWorkTimesRequestBill.html |  259 ++++++++++++++++++++++++++++++++++++++-------------
 WebTM/Properties/PublishProfiles/JFTM.pubxml.user         |   14 +-
 2 files changed, 199 insertions(+), 74 deletions(-)

diff --git a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
index bd20a6e..ba78030 100644
--- a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
+++ b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -18,10 +18,10 @@
       <publishTime>01/28/2016 14:22:24</publishTime>
     </File>
     <File Include="bin/WebTM.dll">
-      <publishTime>08/11/2023 08:37:49</publishTime>
+      <publishTime>08/14/2023 10:13:49</publishTime>
     </File>
     <File Include="bin/WebTM.pdb">
-      <publishTime>08/11/2023 08:37:49</publishTime>
+      <publishTime>08/14/2023 10:13:49</publishTime>
     </File>
     <File Include="HtmlPage1.html">
       <publishTime>04/11/2023 16:34:42</publishTime>
@@ -1779,7 +1779,7 @@
       <publishTime>04/11/2023 16:34:43</publishTime>
     </File>
     <File Include="views/浠撳瓨绠$悊/浠撳簱璋冩嫧/Kf_MoveStockBill_Fast.html">
-      <publishTime>07/11/2023 09:00:58</publishTime>
+      <publishTime>08/15/2023 08:12:01</publishTime>
     </File>
     <File Include="views/浠撳瓨绠$悊/浠撳簱璋冩嫧/Kf_MoveStockBill_FastList.html">
       <publishTime>06/29/2023 15:20:45</publishTime>
@@ -2769,7 +2769,7 @@
       <publishTime>04/11/2023 16:34:43</publishTime>
     </File>
     <File Include="views/宸ヨ祫绠$悊/寮傚父宸ユ椂鐢宠鍗�/Pay_ErrWorkTimesRequestBill.html">
-      <publishTime>08/11/2023 08:00:11</publishTime>
+      <publishTime>08/15/2023 14:17:05</publishTime>
     </File>
     <File Include="views/宸ヨ祫绠$悊/寮傚父宸ユ椂鐢宠鍗�/Pay_ErrWorkTimesRequestBillList.html">
       <publishTime>07/25/2023 10:31:59</publishTime>
@@ -4554,7 +4554,7 @@
       <publishTime>06/29/2023 15:20:45</publishTime>
     </File>
     <File Include="views/棰嗘枡鍙戣揣/閿�鍞嚭搴�/Kf_SellOutBill_Fast.html">
-      <publishTime>07/11/2023 09:00:58</publishTime>
+      <publishTime>08/15/2023 08:11:58</publishTime>
     </File>
     <File Include="views/棰嗘枡鍙戣揣/閿�鍞嚭搴�/Kf_SellOutBill_FastList.html">
       <publishTime>07/11/2023 09:00:58</publishTime>
@@ -4668,7 +4668,7 @@
       <publishTime>04/27/2023 11:05:26</publishTime>
     </File>
     <File Include="views/楠屾敹鍏ュ簱/澶栬喘鍏ュ簱/Kf_POStockInBill_Fast.html">
-      <publishTime>07/11/2023 09:00:58</publishTime>
+      <publishTime>08/15/2023 08:11:54</publishTime>
     </File>
     <File Include="views/楠屾敹鍏ュ簱/澶栬喘鍏ュ簱/Kf_POStockInBill_FastList.html">
       <publishTime>07/11/2023 09:00:58</publishTime>
@@ -4704,7 +4704,7 @@
       <publishTime>04/11/2023 16:34:43</publishTime>
     </File>
     <File Include="Web.config">
-      <publishTime>08/11/2023 08:38:01</publishTime>
+      <publishTime>08/14/2023 10:13:56</publishTime>
     </File>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git "a/WebTM/views/\345\267\245\350\265\204\347\256\241\347\220\206/\345\274\202\345\270\270\345\267\245\346\227\266\347\224\263\350\257\267\345\215\225/Pay_ErrWorkTimesRequestBill.html" "b/WebTM/views/\345\267\245\350\265\204\347\256\241\347\220\206/\345\274\202\345\270\270\345\267\245\346\227\266\347\224\263\350\257\267\345\215\225/Pay_ErrWorkTimesRequestBill.html"
index 15cd729..4bfb609 100644
--- "a/WebTM/views/\345\267\245\350\265\204\347\256\241\347\220\206/\345\274\202\345\270\270\345\267\245\346\227\266\347\224\263\350\257\267\345\215\225/Pay_ErrWorkTimesRequestBill.html"
+++ "b/WebTM/views/\345\267\245\350\265\204\347\256\241\347\220\206/\345\274\202\345\270\270\345\267\245\346\227\266\347\224\263\350\257\267\345\215\225/Pay_ErrWorkTimesRequestBill.html"
@@ -14,7 +14,7 @@
     <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
     <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
     <script src="../../../layuiadmin/PubCustom.js"></script>
-    <style>
+    <!--<style>
         .main-btn { /*澶撮儴涓绘寜閽�*/
             padding: 0 2px; /*璋冩暣鎸夐挳宸﹀彸绌洪殭澶у皬*/
             height: 30px;
@@ -44,7 +44,7 @@
         .layui-form-label {
             width: 25%;
         }
-    </style>
+    </style>-->
 
 </head>
 <body>
@@ -75,14 +75,14 @@
                                 <div class="layui-form-item" style="padding-top: 10px;">
                                     <div class="layui-row">
                                         <div class="layui-inline" style="width:500px;">
-                                            <label class="layui-form-label" style="width: 85px;">鍗曟嵁鍙�</label>
+                                            <label class="layui-form-label" style="width: 85px;">鍗曟嵁鍙�<label style="color:red"> * </label></label>
                                             <div class="layui-input-block" style="margin-left: 120px; width: 180px;">
                                                 <input type="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
                                                 <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID">
                                             </div>
                                         </div>
                                         <div class="layui-inline" style="width:500px;">
-                                            <label class="layui-form-label" style="width: 85px;">鏃ユ湡</label>
+                                            <label class="layui-form-label" style="width: 85px;">鏃ユ湡<label style="color:red"> * </label></label>
                                             <div class="layui-input-block" style="margin-left: 120px; width:180px;">
                                                 <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 80px;">
                                             </div>
@@ -96,7 +96,7 @@
                                     </div>
                                     <div class="layui-row">
                                         <div class="layui-inline" style="width:500px;">
-                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">閮ㄩ棬</label>
+                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">閮ㄩ棬<label style="color:red"> * </label></label>
                                             <div class="layui-input-block" style="margin-left: 77px; width: 270px;">
                                                 <input type="text" class="layui-input" lay-verify="HDeptName" name="HDeptName" id="HDeptName" style="background-color: #efefef4d; width: 180px; display: inline-block;" readonly>
                                                 <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0">
@@ -106,7 +106,7 @@
                                             </div>
                                         </div>
                                         <div class="layui-inline" style="width:500px;">
-                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">鐝粍</label>
+                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">鐝粍<label style="color:red"> * </label></label>
                                             <div class="layui-input-block" style="margin-left: 77px; width: 270px;">
                                                 <input type="text" class="layui-input" lay-verify="HGroupName" name="HGroupName" id="HGroupName" style="background-color: #efefef4d; width: 180px; display: inline-block;" readonly>
                                                 <input type="hidden" name="HGroupID" id="HGroupID" lay-verify="HGroupID" value="0">
@@ -148,11 +148,11 @@
                                         <div class="layui-inline" style="width:500px;">
                                             <label class="layui-form-label" style="width: 85px;">棰勮宸ユ椂</label>
                                             <div class="layui-input-block" style="margin-left: 120px; width:180px;">
-                                                <input type="text" class="layui-input" lay-verify="HSumRequestTimes" name="HSumRequestTimes" id="HSumRequestTimes">
+                                                <input type="text" class="layui-input" lay-verify="HSumRequestTimes" name="HSumRequestTimes" id="HSumRequestTimes" value="0">
                                             </div>
                                         </div>
                                         <div class="layui-inline" style="width:500px;">
-                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">鐗╂枡鍚嶇О</label>
+                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">鐗╂枡鍚嶇О<label style="color:red"> * </label></label>
                                             <div class="layui-input-block" style="margin-left: 77px; width: 270px;">
                                                 <input type="text" class="layui-input" lay-verify="HMaterName" name="HMaterName" id="HMaterName" style="background-color: #efefef4d; width: 180px; display: inline-block;" readonly>
                                                 <input type="hidden" name="HMaterID" id="HMaterID" lay-verify="HMaterID" value="0">
@@ -162,7 +162,7 @@
                                             </div>
                                         </div>
                                         <div class="layui-inline" style="width:500px;">
-                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">璁¢噺鍗曚綅</label>
+                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">璁¢噺鍗曚綅<label style="color:red"> * </label></label>
                                             <div class="layui-input-block" style="margin-left: 77px; width: 270px;">
                                                 <input type="text" class="layui-input" lay-verify="HUnitName" name="HUnitName" id="HUnitName" style="background-color: #efefef4d; width: 180px; display: inline-block;" readonly>
                                                 <input type="hidden" name="HUnitID" id="HUnitID" lay-verify="HUnitID" value="0">
@@ -176,7 +176,7 @@
                                         <div class="layui-inline" style="width:500px;">
                                             <label class="layui-form-label" style="width: 85px;">璁″垝鏁伴噺</label>
                                             <div class="layui-input-block" style="margin-left: 120px; width: 180px;">
-                                                <input type="text" class="layui-input" lay-verify="HPlanQty" name="HPlanQty" id="HPlanQty">
+                                                <input type="text" class="layui-input" lay-verify="HPlanQty" name="HPlanQty" id="HPlanQty" value="0">
                                             </div>
                                         </div>
                                         <div class="layui-inline" style="width:500px;">
@@ -298,8 +298,8 @@
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><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_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
-                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_up"><i class="layui-icon layui-icon-form"></i>涓婁竴琛�</button>
-                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_under"><i class="layui-icon layui-icon-form"></i>涓嬩竴琛�</button>
+                            <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn_up"><i class="layui-icon layui-icon-form"></i>涓婁竴琛�</button>
+                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_under"><i class="layui-icon layui-icon-form"></i>涓嬩竴琛�</button>-->
                         </div>
                     </script>
                 </form>
@@ -433,9 +433,9 @@
             //#region 鎿嶄綔鎸夐挳瑙﹀彂浜嬩欢
             //#region 淇濆瓨鎻愪氦
             form.on('submit(btnSave)', function (data) {//鎻愪氦
-                //if (AllowLoadData(data)) {
+                if (AllowLoadData(data)) {
                     set_AddNew(data);
-                //}
+                }
             });
             //#endregion
 
@@ -622,7 +622,38 @@
             })
             //#endregion
 
+            //#region 瀛愯〃锛氬崟鍏冩牸缂栬緫鐩戝惉
+            table.on('edit(mainTable)', function (obj) {
+                // 鍗曞厓鏍肩紪杈戜箣鍓嶇殑鍊�
+                var oldText = $(this).prev().text();
+                var value = obj.value //寰楀埌淇敼鍚庣殑鍊�
+                    , data = obj.data //寰楀埌鎵�鍦ㄨ鎵�鏈夐敭鍊�
+                    , field = obj.field; //寰楀埌瀛楁
+                //姝e垯琛ㄨ揪寮�-鏍¢獙闈炶礋娴偣鏁�
+                var ref = /^\d+(\.\d+)?$/;
 
+                switch (field) {
+                    case "HRelTimes":                                            //鏁伴噺
+                        if (!ref.test(value)) {                             //鑻ヨ緭鍏ュ�兼牸寮忎笉姝g‘锛屽垯鍙樺洖鍘熸潵鐨勫��
+                            obj.update({
+                                HRelTimes: oldText
+                            });
+                            table.render(option);
+                            layer.msg("瀹為檯鏃堕棿锛氭暟鎹敊璇紝璇疯緭鍏ラ潪璐熷皬鏁�")
+                        } else {
+                            var HRelTimes = value;
+                            var HPayMoney = data.HPayMoney;
+                            var HRelPay = HRelTimes * HPayMoney;
+
+                            obj.update({
+                                HRelPay: HRelPay       //搴斾粯宸ヨ祫=灏忔椂宸ヨ祫*瀹為檯鏃堕棿
+                            });
+                        }
+                        break;
+                    default:
+                }
+            });
+            //#endregion
             //
             form.on('submit(Cancel)', function () {
                 //sessionStorage["SourceFlag"] = false;
@@ -685,36 +716,37 @@
                 option = {
                     elem: '#mainTable'
                     , toolbar: '#toolbarDemo'
-                    , page: true
-                    , limit: 500
-                    , limits: [50, 500, 5000, 50000]
+                    //, page: true
+                    //, limit: 500
+                    //, limits: [50, 500, 5000, 50000]
+                    , totalRow: true
                     , cellMinWidth: 120
                     , height: 400
                     , cols: [[
                         { type: 'checkbox', totalRowText: '鍚堣琛�' }
-                        , { type: 'numbers', title: '搴忓彿', totalRow: true }
-                        , { field: 'RowID', title: '琛屽彿', hide: true }                                                   //琛屾爣璇嗭紝鐢ㄤ簬涓嬩竴琛屻�佷笂涓�琛岃瘑鍒墍鍦ㄨ
-                        , { field: 'HEmpID', title: '鑱屽憳ID', hide: true }
+                        , { type: 'numbers', title: '搴忓彿', style: 'background-color: #f9f9f9;' }
+                        , { field: 'RowID', title: '琛屽彿', hide: true, style: 'background-color: #f9f9f9;' }                                                   //琛屾爣璇嗭紝鐢ㄤ簬涓嬩竴琛屻�佷笂涓�琛岃瘑鍒墍鍦ㄨ
+                        , { field: 'HEmpID', title: '鑱屽憳ID', hide: true, style: 'background-color: #f9f9f9;' }
                         , { field: 'HEmpNumber', title: '鑱屽憳浠g爜', edit: 'text', event: "HEmpNumber" }     //f7
-                        , { field: 'HEmpName', title: '鑱屽憳鍚嶇О' }
-                        , { field: 'HWorkTypeID', title: '宸ョID', hide: true }
-                        , { field: 'HWorkTypeNumber', title: '宸ョ浠g爜', edit: 'text', event: "HWorkTypeNumber" }     //f7
-                        , { field: 'HWorkTypeName', title: '宸ョ鍚嶇О' }
-                        , { field: 'HPayMoney', title: '灏忔椂宸ヨ祫' }
-                        , { field: 'HBTimes', title: '寮�濮嬫椂闂�', event: "HBTimes" }
-                        , { field: 'HETimes', title: '缁撴潫鏃堕棿', event: "HETimes" }
-                        , { field: 'HTimes', title: '鍔犵彮鏃堕棿' }
-                        , { field: 'HRelTimes', title: '瀹為檯鏃堕棿' }
-                        , { field: 'HRelPay', title: '搴斿彂宸ヨ祫' }
+                        , { field: 'HEmpName', title: '鑱屽憳鍚嶇О', style: 'background-color: #f9f9f9;' }
+                        , { field: 'HWorkTypeID', title: '宸ョID', hide: true, style: 'background-color: #f9f9f9;' }
+                        , { field: 'HWorkTypeNumber', title: '宸ョ浠g爜', style: 'background-color: #f9f9f9;' }     //f7
+                        , { field: 'HWorkTypeName', title: '宸ョ鍚嶇О', style: 'background-color: #f9f9f9;' }
+                        , { field: 'HPayMoney', title: '灏忔椂宸ヨ祫', style: 'background-color: #f9f9f9;' }
+                        , { field: 'HBTimes', title: '寮�濮嬫椂闂�', event: "HBTimes", hide: true }
+                        , { field: 'HETimes', title: '缁撴潫鏃堕棿', event: "HETimes", hide: true }
+                        , { field: 'HTimes', title: '鍔犵彮鏃堕棿', totalRow: true, edit: 'text' }
+                        , { field: 'HRelTimes', title: '瀹為檯鏃堕棿', totalRow: true, edit: 'text' }
+                        , { field: 'HRelPay', title: '搴斿彂宸ヨ祫', totalRow: true, style: 'background-color: #f9f9f9;' }
                         , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
-                        , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�' }
-                        , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�' }
-                        , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿' }
-                        , { field: 'HSourceBillType', title: '婧愬崟绫诲瀷' }
-                        , { field: 'HRelationQty', title: '鍏宠仈鏁伴噺' }
-                        , { field: 'HRelationMoney', title: '鍏宠仈閲戦' }
-                        , { field: 'HCloseMan', title: '琛屽叧闂汉' }
-                        , { field: 'HEntryCloseDate', title: '琛屽叧闂椂闂�' }
+                        , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', hide: true }
+                        , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', hide: true }
+                        , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', hide: true }
+                        , { field: 'HSourceBillType', title: '婧愬崟绫诲瀷', hide: true }
+                        , { field: 'HRelationQty', title: '鍏宠仈鏁伴噺', hide: true }
+                        , { field: 'HRelationMoney', title: '鍏宠仈閲戦', hide: true }
+                        , { field: 'HCloseMan', title: '琛屽叧闂汉', hide: true }
+                        , { field: 'HEntryCloseDate', title: '琛屽叧闂椂闂�', hide: true }
                         , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
                     ]]
                 }
@@ -1131,49 +1163,68 @@
 
             //#region 鏁版嵁鏍¢獙
             function AllowLoadData(data) {
+                var temp;                               //璁板綍闇�瑕佹楠岀殑灞炴�х殑鍊硷紝鐢ㄤ簬妫�楠�
+                var ref = /^\d+(\.\d+)?$/;          //鍒ゆ柇鏄惁鏄潪璐熸诞鐐规暟
+                var ref1 = /^\d+$/;            //鍒ゆ柇鏄惁鏄潪璐熸暣鏁�
+                var value1 = ["HPayMoney", "HTimes", "HRelTimes", "HRelPay"];  //瀛愯〃闇�瑕佽繘琛屾诞鐐规暟楠岃瘉鐨勫睘鎬ф竻鍗�
+                var value1_ = ["灏忔椂宸ヨ祫", "鍔犵彮鏃堕棿", "瀹為檯鏃堕棿", "搴斿彂宸ヨ祫"];  ////瀛愯〃闇�瑕佽繘琛屾诞鐐规暟楠岃瘉鐨勫睘鎬ф竻鍗曞搴旂殑鍒楀悕娓呭崟
+                var value2 = [];  //瀛愯〃闇�瑕佹暣鏁版楠岀殑灞炴�ф竻鍗�
+                var value2_ = []; //瀛愯〃闇�瑕佹暣鏁版楠岀殑灞炴�ф竻鍗曞搴旂殑鍒楀悕娓呭崟
+                var value3 = ["HEmpID", "HWorkTypeID"];       //瀛愯〃闇�瑕佽繘琛岄潪绌烘楠岀殑灞炴�ф竻鍗�
+                var value3_ = ["鑱屽憳", "宸ョ"];                                 //瀛愯〃闇�瑕佽繘琛岄潪绌烘楠岀殑灞炴�ф竻鍗曞搴旂殑鍒楀悕娓呭崟
+
+
                 //#region 琛ㄥご鏁版嵁妫�楠�
                 if ($("#HBillNo").val() == "") {
                     layer.msg("鍗曟嵁鍙蜂笉鑳戒负绌�!");
                     return false;
                 }
-                if ($("#HInnerBillNo").val() == "") {
-                    layer.msg("鍐呴儴鍗曟嵁鍙蜂笉鑳戒负绌�!");
+                if ($("#HDate").val() == "") {
+                    layer.msg("鏃ユ湡涓嶈兘涓虹┖!");
                     return false;
                 }
-                if ($("#HGroupName").val() == "") {
+                if ($("#HGroupID").val() == "0") {
                     layer.msg("鐝粍鏈�夋嫨!");
                     return false;
                 }
-                if ($("#HDeptName").val() == "") {
+                if ($("#HDeptID").val() == "0") {
                     layer.msg("閮ㄩ棬鏈�夋嫨!");
                     return false;
                 }
-                if ($("#HEmpName").val() == "") {
-                    layer.msg("涓荤鏈�夋嫨!");
+                if ($("#HMaterID").val() == "0") {
+                    layer.msg("鐗╂枡鏈�夋嫨!");
                     return false;
                 }
-                if ($("#HPayTypeName").val() == "") {
-                    layer.msg("宸ヨ祫绫诲瀷鏈�夋嫨!");
+                if ($("#HUnitID").val() == "0") {
+                    layer.msg("璁¢噺鍗曚綅鏈�夋嫨!");
+                    return false;
+                }
+                temp = $("#HSumRequestTimes").val();
+                if (temp == "") {
+                    layer.msg("棰勮宸ユ椂涓嶈兘涓虹┖!");
+                    return false;
+                } else if (!ref.test(temp)) {
+                    layer.msg("棰勮宸ユ椂璇疯緭鍏ラ潪璐熸暟!");
+                    return false;
+                }
+                temp = $("#HPlanQty").val();
+                if (temp == "") {
+                    layer.msg("璁″垝鏁伴噺涓嶈兘涓虹┖!");
+                    return false;
+                } else if (!ref.test(temp)) {
+                    layer.msg("棰勮鏁伴噺璇疯緭鍏ラ潪璐熸暟!");
                     return false;
                 }
                 //#endregion
 
                 //#region 瀛愯〃鏁版嵁妫�楠�
-                var temp;                               //璁板綍闇�瑕佹楠岀殑灞炴�х殑鍊硷紝鐢ㄤ簬妫�楠�
-                var ref = /^\d+(\.\d+)?$/;          //鍒ゆ柇鏄惁鏄潪璐熸诞鐐规暟
-                var ref1 = /^\d+$/;            //鍒ゆ柇鏄惁鏄潪璐熸暣鏁�
-                var value1 = ["HTimes", "HQty", "HPrice", "HPriceRate", "HSubsidyQty", "HSubsidyMoney", "HSubsidyTotal", "HDeuctTotal", "HPackQty", "HPackPrice", "HPackMoney", "HMoney"];  //瀛愯〃闇�瑕佽繘琛屾诞鐐规暟楠岃瘉鐨勫睘鎬ф竻鍗�
-                var value1_ = ["宸ユ椂", "鏁伴噺", "宸ヤ环", "瀹氶娴姩姣旂巼", "琛ヨ创鏁伴噺", "琛ヨ创閲戦", "琛ヨ创鍚堣", "鎵f灏忚", "鍖呰鏁伴噺", "鍖呰鍗曚环", "鍖呰閲戦", "閲戦"];  ////瀛愯〃闇�瑕佽繘琛屾诞鐐规暟楠岃瘉鐨勫睘鎬ф竻鍗曞搴旂殑鍒楀悕娓呭崟
-                var value2 = ["HICMOInterID", "HProcReportInterID", "HProcReportEntryID", "HProcPlanInterID", "HProcPlanEntryID"];  //瀛愯〃闇�瑕佹暣鏁版楠岀殑灞炴�ф竻鍗�
-                var value2_ = ["鐢熶骇浠诲姟鍗旾D", "宸ュ簭姹囨姤鍗旾D", "宸ュ簭姹囨姤鍗曞瓙ID", "宸ュ簭璁″垝鍗旾D", "宸ュ簭璁″垝鍗曞瓙ID"]; //瀛愯〃闇�瑕佹暣鏁版楠岀殑灞炴�ф竻鍗曞搴旂殑鍒楀悕娓呭崟
-                var value3 = ["HMaterNumber", "HProcNumber", "HEmpNumber", "HPackMaterName"];       //瀛愯〃闇�瑕佽繘琛岄潪绌烘楠岀殑灞炴�ф竻鍗�
-                var value3_ = ["鐗╂枡", "宸ュ簭", "鑱屽憳", "鍖呰鏂瑰紡"];                                 //瀛愯〃闇�瑕佽繘琛岄潪绌烘楠岀殑灞炴�ф竻鍗曞搴旂殑鍒楀悕娓呭崟
+                
                 for (var i = 0; i < option.data.length; i++) {
                     if (option.data[i] != "") {
                         //闈炵┖妫�楠�
                         for (var j = 0; j < value3.length; j++) {
                             temp = option.data[i][value3[j]] + "";
-                            if (temp == "") {
+                            if (temp == "0") {
                                 layer.msg("绗�" + (i + 1) + "琛�:" + value3_[j] + "鏈�夋嫨!");
                                 return false;
                             }
@@ -1200,7 +1251,40 @@
                                 return false;
                             }
                         }
+
+                        //鐗规畩鏍¢獙
+                        temp = option.data[i]["HTimes"] + "";
+                        if (temp == "0") {
+                            layer.msg("绗�" + (i + 1) + "琛�:鍔犵彮鏃堕棿涓嶈兘涓�0!");
+                            return false;
+                        }
+                        temp = option.data[i]["HRelTimes"] + "";
+                        if (temp == "0") {
+                            layer.msg("绗�" + (i + 1) + "琛�:瀹為檯鏃堕棿涓嶈兘涓�0!");
+                            return false;
+                        }
+                        temp = option.data[i]["HRelPay"] + "";
+                        if (temp == "0") {
+                            layer.msg("绗�" + (i + 1) + "琛�:搴斾粯宸ヨ祫涓嶈兘涓�0!");
+                            return false;
+                        }
+                        if (option.data[i]["HRelTimes"] * option.data[i]["HPayMoney"] != option.data[i]["HRelPay"] * 1) {
+                            layer.msg("绗�" + (i + 1) + "琛�:灏忔椂宸ヨ祫*瀹為檯鏃堕棿涓嶇瓑浜庡簲浠樺伐璧�!");
+                            return false;
+                        }
                     }
+                }
+                //#endregion
+
+                //#region 瀛愯〃鍏抽敭瀛楁閲嶅妫�楠�
+                var num = [];
+                for (var i = 0; i < option.data.length; i++) {
+                    temp = option.data[i]["HEmpID"];
+                    if ($.inArray(temp, num) != -1) {
+                        layer.msg("绗�" + (i + 1) + "琛岋細鑱屽憳閲嶅锛岃閲嶆柊閫夋嫨锛�");
+                        return false;
+                    }
+                    num.push(temp);
                 }
                 //#endregion
                 return true;
@@ -1298,12 +1382,52 @@
                                     if (checkStatus.data.length != 1) {
                                         return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
                                     }
-                                    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
-                                    obj.update({
-                                        "HEmpID": checkStatus.data[0].HItemID
-                                        , "HEmpNumber": checkStatus.data[0].HNumber
-                                        , "HEmpName": checkStatus.data[0].HName
-                                    })
+
+                                    var HEmpID = checkStatus.data[0].HItemID;
+                                    $.ajax({
+                                        url: GetWEBURL() + "HR_EmpDimissionBill/getInfoByHEmpID",
+                                        type: "GET",
+                                        data: {
+                                            "HEmpID": HEmpID
+                                        },
+                                        success: function (result) {
+                                            if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                                var HEmpID = checkStatus.data[0].HItemID;
+                                                var HEmpNumber = checkStatus.data[0].HNumber;
+                                                var HEmpName = checkStatus.data[0].HName;
+                                                var HWorkTypeID = result.data[0]["HWorkTypeID"];
+                                                var HWorkTypeNumber = result.data[0]["HWorkTypeNumber"];
+                                                var HWorkTypeName = result.data[0]["HWorkTypeName"];
+                                                var HPayMoney = result.data[0]["HPayMoney"];
+                                                var HRelTimes = obj.data.HRelTimes;
+                                                var HRelPay = HPayMoney * HRelTimes;
+
+                                                if (HWorkTypeID == null) {
+                                                    layer.alert("宸ョ鏈缃垨宸ョ宸插け鏁堬紒锛�", { icon: 5 });
+                                                    return false;
+                                                } else if (HPayMoney == null) {
+                                                    layer.alert("灏忔椂宸ヨ祫鏈缃紒锛�", { icon: 5 });
+                                                    return false;
+                                                }
+
+                                                //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                                obj.update({
+                                                    "HEmpID": checkStatus.data[0].HItemID
+                                                    , "HEmpNumber": checkStatus.data[0].HNumber
+                                                    , "HEmpName": checkStatus.data[0].HName
+                                                    , "HWorkTypeID": HWorkTypeID
+                                                    , "HWorkTypeNumber": HWorkTypeNumber
+                                                    , "HWorkTypeName": HWorkTypeName
+                                                    , "HPayMoney": HPayMoney
+                                                    , "HRelPay": HRelPay
+                                                })
+                                            } else {
+                                                layer.alert(result.code + result.Message, { icon: 5 });
+                                            }
+                                        }, error: function () {
+                                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                                        }
+                                    });
                                     layer.close(index);//鍏抽棴寮圭獥
                                 }
                             })
@@ -1340,8 +1464,9 @@
                                     var hours = parseInt(time / (1000 * 60 * 60));                              //鐩稿樊灏忔椂鏁�
                                     var minutes = parseInt((time / (1000 * 60))) % 60;                          //鐩稿樊鍒嗛挓鏁�
                                     var HTimes = (hours * 1 + minutes / 60).toFixed(2);                         //鍔犵彮鏃堕棿
-                                    var HPayMoney = data["HPayMoney"];
-                                    var HRelPay = (HTimes * HPayMoney).toFixed(2);                              //搴斾粯宸ヨ祫 = 瀹為檯瀹為檯*灏忔椂宸ヨ祫
+                                    var HRelTimes = data["HRelTimes"];
+                                    var HPayMoney = checkStatus.data[0].灏忔椂宸ヨ祫;
+                                    var HRelPay = (HRelTimes * HPayMoney).toFixed(2);                              //搴斾粯宸ヨ祫 = 瀹為檯鏃堕棿*灏忔椂宸ヨ祫
 
 
 
@@ -1410,7 +1535,7 @@
                     success: function (data1) {
                         if (data1.data.length != 0) {
                             var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
-                            var titleData = ["琛屽彿", "鑱屽憳ID", "宸ョID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+                            var titleData = ["琛屽彿", "鑱屽憳ID", "宸ョID", "寮�濮嬫椂闂�", "缁撴潫鏃堕棿", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "婧愬崟鍗曞彿", "婧愬崟绫诲瀷", "鍏宠仈鏁伴噺", "鍏宠仈閲戦", "琛屽叧闂汉", "琛屽叧闂椂闂�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
 
                             dataCol = data1.data[0].HGridString.split(',');
 
@@ -1426,9 +1551,9 @@
                                 }
                                 //璁剧疆鍐呭瀛椾綋澶у皬
                                 if (data1.data[0].HFontSize != 0) {
-                                    option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
+                                    option.cols[0][i + 1]["style"] += "font-size:" + data1.data[0].HFontSize + "px;";
                                 } else {
-                                    option.cols[0][i + 1]["style"] = "font-size:100%";
+                                    option.cols[0][i + 1]["style"] += "font-size:100%";
                                 }
                                 //璁剧疆鍒楀
                                 //if (data1.data[0].HColumnWidth != 0) {

--
Gitblit v1.9.1