From 3ed32b07e186ded864db245961399e95d4d869b6 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期三, 19 一月 2022 18:05:12 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MESWMS-LayUI

---
 WebTM/views/生产工序管理/工序计划单/Sc_ProcessPlanEdit.html                  |  846 ++++++++++++++++
 WebTM/views/生产管理/生产拆箱单/Sc_PackSplitBill_Fast.html                 |  354 +-----
 WebTM/views/生产工序管理/工序计划单/Sc_ProcessPlanList.html                  |  739 +++++++++----
 WebTM/views/IpadStepIndex.html                                    |    1 
 WebTM/views/生产管理/产量汇报单/Sc_Add_ProductReportBillList.html          |    2 
 WebTM/views/生产管理/报工台工序/产量汇报/Sc_ProductReportStepBillList.html     |    4 
 WebTM/views/生产管理/报工台工序/开工/Sc_MESBeginStepWorkBillList.html        |   10 
 WebTM/views/home/console.html                                     |   16 
 WebTM/views/模治具管理/器具维修派工单/Sc_MouldRepairSendWorkBillEdit.html     |   32 
 WebTM/views/生产管理/报工台工序/开工/Sc_Add_MESBeginStepWorkBillList.html    |   10 
 WebTM/views/基础资料/公用基础资料/Add_Edit_Gy_MouldType.html                |   10 
 WebTM/views/计划管理/工艺路线/Gy_RoutingBill.html                         |    4 
 WebTM/views/设备管理/设备维修派工单/Sb_EquipRepairSendWorkBillEdit.html      |  750 +++++++++++++++
 WebTM/views/设备管理/设备维修派工单/Sb_EquipRepairSendWorkBillList.html      |  116 ++
 WebTM/views/index.html                                            |    4 
 WebTM/views/生产管理/报工台工序/产量汇报/Sc_Add_ProductReportStepBillList.html |   41 
 WebTM/WebTM.csproj                                                |    4 
 17 files changed, 2,367 insertions(+), 576 deletions(-)

diff --git a/WebTM/WebTM.csproj b/WebTM/WebTM.csproj
index c5af988..b280d0d 100644
--- a/WebTM/WebTM.csproj
+++ b/WebTM/WebTM.csproj
@@ -753,6 +753,7 @@
     <Content Include="views\鐢熶骇宸ュ簭绠$悊\濮斿宸ュ簭璁″垝杞嚭鍗昞WW_EntrustProcessSendOutBill_PDA.html" />
     <Content Include="views\鐢熶骇宸ュ簭绠$悊\宸ュ簭姹囨姤鍗昞HBarPlanPrint.html" />
     <Content Include="views\鐢熶骇宸ュ簭绠$悊\宸ュ簭姹囨姤鍗昞xmlLBM_ProcessReport.aspx" />
+    <Content Include="views\鐢熶骇宸ュ簭绠$悊\宸ュ簭璁″垝鍗昞Sc_ProcessPlanEdit.html" />
     <Content Include="views\鐢熶骇绠$悊\涓婃枡闃查敊鍗昞Sc_Add_MaterToSourceBillList.html" />
     <Content Include="views\鐢熶骇绠$悊\浜ч噺姹囨姤鍗昞Sc_Add_ProductReportBillList.html" />
     <Content Include="views\鐢熶骇绠$悊\浜ч噺姹囨姤鍗昞Sc_ProductReportBillList.html" />
@@ -791,6 +792,7 @@
     <Content Include="views\鐢熶骇绠$悊\鐢熶骇寮�宸ュ崟\Sc_Add_MESBeginWorkBillList - 澶嶅埗.html" />
     <Content Include="views\鐢熶骇绠$悊\鐢熶骇寮�宸ュ崟\Sc_Add_MESBeginWorkBillList.html" />
     <Content Include="views\鐢熶骇绠$悊\鐢熶骇寮�宸ュ崟\Sc_MESBeginWorkBillList.html" />
+    <Content Include="views\鐢熶骇绠$悊\鐢熶骇鎷嗙鍗昞Sc_PackSplitBill_Fast.html" />
     <Content Include="views\鐢熶骇绠$悊\鐢熶骇姹囨姤鍗昞Sc_ICMOReportBill_FastNew.html" />
     <Content Include="views\鐢熶骇绠$悊\鐢熶骇姹囨姤鍗昞Sc_Add_ICMOReportBillList.html" />
     <Content Include="views\鐢熶骇绠$悊\鐢熶骇缁勮杩芥函鍗昞Sc_AssemblyBillList.html" />
@@ -838,6 +840,7 @@
     <Content Include="views\璁惧绠$悊\Sc_Add_MouldDotCheckBillList.html" />
     <Content Include="views\璁惧绠$悊\璁惧妗f\Gy_EquipFileMainEdit.html" />
     <Content Include="views\璁惧绠$悊\璁惧妗f\Gy_EquipFileMainList.html" />
+    <Content Include="views\璁惧绠$悊\璁惧缁翠慨娲惧伐鍗昞Sb_EquipRepairSendWorkBillEdit.html" />
     <Content Include="views\璁惧绠$悊\璁惧缁翠慨娲惧伐鍗昞Sb_EquipRepairSendWorkBillList.html" />
     <Content Include="views\璁惧绠$悊\璁惧瑙勭▼鍗昞Sb_EquipDotCheckRuleEdit.html" />
     <Content Include="views\璁惧绠$悊\璁惧瑙勭▼鍗昞Sb_EquipDotCheckRuleList.html" />
@@ -1178,7 +1181,6 @@
   <ItemGroup>
     <Folder Include="views\浠撳瓨绠$悊\璋冩嫧鍗曟牳瀵筡" />
     <Folder Include="views\浠撳瓨绠$悊\璋冩嫧鍗曠ń鏍竆" />
-    <Folder Include="views\鐢熶骇绠$悊\鐢熶骇鎷嗙鍗昞" />
   </ItemGroup>
   <PropertyGroup>
     <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
diff --git a/WebTM/views/IpadStepIndex.html b/WebTM/views/IpadStepIndex.html
index 74f9879..8488760 100644
--- a/WebTM/views/IpadStepIndex.html
+++ b/WebTM/views/IpadStepIndex.html
@@ -725,6 +725,7 @@
                         "HMaker": sessionStorage["HUserName"],    //sessionStorage["HUserName"]
                         "Czybm": sessionStorage["Czybm"],
                         //"HEmpID": "0",    //sessionStorage["HEmpID"]
+                        "HSourceInterID": HSourceInterID,
                         "HSourceBillType": HSourceBillType,
                         "HProcID": HProcID
                     });
diff --git a/WebTM/views/home/console.html b/WebTM/views/home/console.html
index e72d63d..1f8a8d6 100644
--- a/WebTM/views/home/console.html
+++ b/WebTM/views/home/console.html
@@ -99,12 +99,18 @@
                                                     <cite>濮斿宸ュ簭鍙戝嚭鍗�</cite>
                                                 </a>
                                             </li>
-                                            <!--<li class="layui-col-xs3">
-                                                <a lay-href="set/user/info.html">
-                                                    <i class="layui-icon layui-icon-set"></i>
-                                                    <cite>鎴戠殑璧勬枡</cite>
+                                            <li class="layui-col-xs3">
+                                                <a href="../鐢熶骇绠$悊/鐢熶骇鎷嗙鍗�/Sc_PackSplitBill_Fast.html" target="main_self_frame">
+                                                    <i class="layui-icon layui-icon-find-fill"></i>
+                                                    <cite>鐢熶骇鎷嗙鍗�</cite>
                                                 </a>
-                                            </li>-->
+                                            </li>
+                                            <!--<li class="layui-col-xs3">
+        <a lay-href="set/user/info.html">
+            <i class="layui-icon layui-icon-set"></i>
+            <cite>鎴戠殑璧勬枡</cite>
+        </a>
+    </li>-->
                                         </ul>
                                     </div>
                                     <div class="layui-carousel-ind"><ul><li class="layui-this"></li><li class=""></li></ul></div><button class="layui-icon layui-carousel-arrow" lay-type="sub">顦�</button><button class="layui-icon layui-carousel-arrow" lay-type="add">顦�</button>
diff --git a/WebTM/views/index.html b/WebTM/views/index.html
index f2f0284..b32e779 100644
--- a/WebTM/views/index.html
+++ b/WebTM/views/index.html
@@ -384,7 +384,7 @@
                                 <dd>
                                     <a>绂绘暎鍒堕��</a>
                                     <dl class="layui-nav-child">
-                                        <dd><a lay-href="">宸ュ簭璁″垝鍗昻ull</a></dd>
+                                        <dd><a lay-href="鐢熶骇宸ュ簭绠$悊/宸ュ簭璁″垝鍗�/Sc_ProcessPlanEdit.html">宸ュ簭璁″垝鍗�</a></dd>
                                         <dd><a lay-href="鐢熶骇宸ュ簭绠$悊/宸ュ簭璁″垝鍗�/Sc_ProcessPlanList.html">宸ュ簭璁″垝鍗曠淮鎶�</a></dd>
                                         <dd><a lay-href="鐢熶骇宸ュ簭绠$悊/宸ュ簭娲惧伐鍗�/Sc_Add_ProcessSendWork.html">宸ュ簭娲惧伐鍗�</a></dd>
                                         <dd><a lay-href="鐢熶骇宸ュ簭绠$悊/宸ュ簭娲惧伐鍗�/Sc_ProcessSendWorkList.html">宸ュ簭娲惧伐鍗曠淮鎶�</a></dd>
@@ -593,7 +593,7 @@
                                     <dl class="layui-nav-child">
                                         <dd><a lay-href="璁惧绠$悊/Sb_Add_EqpConkBookBillList.html">璁惧鏁呴殰鐧昏鍗�</a></dd>
                                         <dd><a lay-href="璁惧绠$悊/Sb_EqpConkBookBillList.html">璁惧鏁呴殰鐧昏鍗曠淮鎶�</a></dd>
-                                        <dd><a lay-href="">璁惧缁翠慨娲惧伐鍗昻</a></dd>
+                                        <dd><a lay-href="璁惧绠$悊/璁惧缁翠慨娲惧伐鍗�/Sb_EquipRepairSendWorkBillEdit.html">璁惧缁翠慨娲惧伐鍗�</a></dd>
                                         <dd><a lay-href="璁惧绠$悊/璁惧缁翠慨娲惧伐鍗�/Sb_EquipRepairSendWorkBillList.html">璁惧缁翠慨娲惧伐鍗曠淮鎶�</a></dd>
                                         <dd><a lay-href="璁惧绠$悊/Sb_Add_EqpMaintenanceBillList.html">璁惧缁翠慨璁板綍鍗�</a></dd>
                                         <dd><a lay-href="璁惧绠$悊/Sb_EqpMaintenanceBillList.html">璁惧缁翠慨璁板綍鍗曠淮鎶�</a></dd>
diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/Add_Edit_Gy_MouldType.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/Add_Edit_Gy_MouldType.html"
index fef38d4..a6f9310 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/Add_Edit_Gy_MouldType.html"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/Add_Edit_Gy_MouldType.html"
@@ -127,11 +127,11 @@
             //甯歌鐢ㄦ硶
 
             //鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
-            //if (sessionStorage.login != "login") {
-            //    layer.confirm("鐧诲綍澶辨晥锛岃閲嶆柊鐧诲綍锛�", {
-            //        icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍']
-            //    }, function () { window.location.href = "../../user/login.html"; });
-            //}
+            if (sessionStorage.login != "login") {
+                layer.confirm("鐧诲綍澶辨晥锛岃閲嶆柊鐧诲綍锛�", {
+                    icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍']
+                }, function () { window.location.href = "../../user/login.html"; });
+            }
             //#region 宸ュ叿鎸夐挳
             //閫�鍑烘寜閽�
             form.on('submit(Exit)', function () {
diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\345\231\250\345\205\267\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sc_MouldRepairSendWorkBillEdit.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\345\231\250\345\205\267\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sc_MouldRepairSendWorkBillEdit.html"
index 2bef85f..d3f1bb2 100644
--- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\345\231\250\345\205\267\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sc_MouldRepairSendWorkBillEdit.html"
+++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\345\231\250\345\205\267\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sc_MouldRepairSendWorkBillEdit.html"
@@ -325,6 +325,7 @@
                 , toolbar: '#toolbarDemo'
                 , limit: 500 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
                 , cellMinWidth: 90
+                ,height:400
                 , cols: [[ //琛ㄥご
                     { type: 'checkbox', totalRowText: '鍚堣琛�' }
                     , { type: 'numbers', title: '搴忓彿', totalRow: true }
@@ -438,8 +439,15 @@
             //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶
             // 鍒濆鍖栫晫闈�
             function set_ClearBill() {
+                //鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
+                if (sessionStorage.login != "login") {
+                    layer.confirm("鐧诲綍澶辨晥锛岃閲嶆柊鐧诲綍锛�", {
+                        icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍']
+                    }, function () { window.location.href = "../../user/login.html"; });
+                }
                 //鍒跺崟浜�
                 $("#HMaker").val(sessionStorage["HUserName"]);
+                //淇敼浜�
                 $("#HUpDater").val(sessionStorage["HUserName"]);
                 //鍒濆鍖栨棩鏈�
                 $("#HRepairBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
@@ -806,6 +814,30 @@
                     layer.msg("鎴愬搧鍣ㄥ叿涓嶈兘涓虹┖");
                     return false;
                 }
+                if ($("#HRepairIDName").val() == "") {
+                    layer.msg("缁翠慨椤圭洰涓嶈兘涓虹┖");
+                    return false;
+                }
+                if ($("#HDeptIDName").val() == "") {
+                    layer.msg("缁翠慨閮ㄩ棬涓嶈兘涓虹┖");
+                    return false;
+                }
+                if ($("#HManagerIDName").val() == "") {
+                    layer.msg("涓荤涓嶈兘涓虹┖");
+                    return false;
+                }
+                if ($("#HEmpIDName").val() == "") {
+                    layer.msg("缁翠慨浜轰笉鑳戒负绌�");
+                    return false;
+                }
+                if ($("#HSupIDName").val() == "") {
+                    layer.msg("渚涘簲鍟嗕笉鑳戒负绌�");
+                    return false;
+                }
+                if ($("#HEquipIDName").val() == "") {
+                    layer.msg("璁惧涓嶈兘涓虹┖");
+                    return false;
+                }
                 return true;
             }
             //鑾峰彇鍙傛暟
diff --git "a/WebTM/views/\347\224\237\344\272\247\345\267\245\345\272\217\347\256\241\347\220\206/\345\267\245\345\272\217\350\256\241\345\210\222\345\215\225/Sc_ProcessPlanEdit.html" "b/WebTM/views/\347\224\237\344\272\247\345\267\245\345\272\217\347\256\241\347\220\206/\345\267\245\345\272\217\350\256\241\345\210\222\345\215\225/Sc_ProcessPlanEdit.html"
new file mode 100644
index 0000000..a4d71a5
--- /dev/null
+++ "b/WebTM/views/\347\224\237\344\272\247\345\267\245\345\272\217\347\256\241\347\220\206/\345\267\245\345\272\217\350\256\241\345\210\222\345\215\225/Sc_ProcessPlanEdit.html"
@@ -0,0 +1,846 @@
+锘�<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8" />
+    <title>宸ュ簭璁″垝鍗�</title>
+    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
+    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
+    <script src="../../../layuiadmin/layui/layui.js"></script>
+    <script src="../../../layuiadmin/Scripts/json2.js"></script>
+    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
+    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
+    <script src="../../../layuiadmin/PubCustom.js"></script>
+
+    <style>
+        .main-btn { /*澶撮儴涓绘寜閽�*/
+            padding: 0 2px; /*璋冩暣鎸夐挳宸﹀彸绌洪殭澶у皬*/
+            height: 30px;
+            line-height: 30px;
+        }
+
+        .btn-title {
+            font-size: 16px;
+        }
+    </style>
+</head>
+<body>
+    <div class="layui-fluid" style="padding: 0;">
+        <div class="layui-card" style="padding: 2px;background-color: #efefef;">
+            <div class="layui-card-body" style="padding: 1px;">
+                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
+                    <div style="padding: 10px;">
+                        <button class="layui-btn layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
+                            <i class="layui-icon layui-icon-print layuiadmin-button-btn"><span class="btn-title">棰勮</span></i>
+                        </button>
+                        <button class="layui-btn layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
+                            <i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"><span class="btn-title">鏂板</span></i>
+                        </button>
+                        <button class="layui-btn layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
+                            <i class="layui-icon layui-icon-edit layuiadmin-button-btn"><span class="btn-title">淇敼</span></i>
+                        </button>
+                        <button class="layui-btn layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">
+                            <i class="layui-icon layui-icon-delete layuiadmin-button-btn"><span class="btn-title">淇濆瓨</span></i>
+                        </button>
+                    </div>
+                    <div class="layui-tab" lay-filter="tab-POStockInBill">
+                        <ul class="layui-tab-title" lay-filter="tab-all">
+                            <li lay-id="1" style="padding:1px;" class="layui-this">鍩烘湰淇℃伅</li>
+                        </ul>
+                        <div class="layui-tab-content">
+                            <!--鍩烘湰淇℃伅-->
+                            <div class="layui-tab-item layui-show">
+                                <div class="layui-form-item" style="padding-top: 10px;">
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">鍗曟嵁鍙�</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <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">
+                                            <label class="layui-form-label" style="width: 85px;">鏃ユ湡</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 32px;">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">浠诲姟鍗曞彿</label>
+                                            <div class="layui-input-block" style="margin-left: 77px;">
+                                                <input type="text" class="layui-input" name="HICMOBillNo" lay-verify="HICMOBillNo" id="HICMOBillNo" style="width: 60%;display: inline-block;">
+                                                <!--<input type="hidden" class="layui-input" name="HRepairID" lay-verify="HRepairID" id="HRepairID" value="0">-->
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="" id="" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">浜у搧浠g爜</label>
+                                            <div class="layui-input-block"style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" lay-verify="HMaterNumber" name="HMaterNumber" id="HMaterNumber" style="background-color:#efefef4d;" readonly>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">浜у搧</label>
+                                            <div class="layui-input-block" style="margin-left: 77px;">
+                                                <input type="text" class="layui-input" name="HMaterIDName" lay-verify="HMaterIDName" id="HMaterIDName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <input type="hidden" class="layui-input" name="HMaterID" lay-verify="HMaterID" id="HMaterID" value="0">
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHMaterID" id="btnHMaterID" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 65px;">瑙勬牸鍨嬪彿</label>
+                                            <div class="layui-input-block" style="margin-left: 100px;">
+                                                <input type="text" class="layui-input" lay-verify="HMaterIDNum" name="HMaterIDNum" id="HMaterIDNum" style="background-color:#efefef4d;" readonly>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">鍗曚綅浠g爜</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" lay-verify="HUnitNumber" name="HUnitNumber" id="HUnitNumber" style="background-color:#efefef4d;" readonly>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">鍗曚綅</label>
+                                            <div class="layui-input-block" style="margin-left: 77px;">
+                                                <input type="text" class="layui-input" name="HUnitIDName" lay-verify="HUnitIDName" id="HUnitIDName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <input type="hidden" class="layui-input" name="HUnitID" lay-verify="HUnitID" id="HUnitID" value="0">
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHUnitID" id="btnHUnitID" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 70px;">鍐呴儴鍗曟嵁鍙�</label>
+                                            <div class="layui-input-block" style="margin-left: 100px;">
+                                                <input type="text" class="layui-input" lay-verify="HInnerBillNo" name="HInnerBillNo" id="HInnerBillNo">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">璁″垝寮�宸ユ棩鏈�</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="date" class="layui-input" lay-verify="HPlanBeginDate" name="HPlanBeginDate" id="HPlanBeginDate" style="padding-left: 32px;">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">璁″垝瀹屽伐鏃ユ湡</label>
+                                            <div class="layui-input-block" style="margin-left: 130px;">
+                                                <input type="date" class="layui-input" lay-verify="HPlanEndDate" name="HPlanEndDate" id="HPlanEndDate" style="padding-left: 32px;">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">鐢熶骇鏁伴噺</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" lay-verify="HPlanQty" name="HPlanQty" id="HPlanQty">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline" style="width: 56%;">
+                                            <label class="layui-form-label" style="width: 85px;">鎽樿</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" name="HExplanation" id="HExplanation" lay-verify="HExplanation" placeholder="璇疯緭鍏ュ唴瀹�" onmouseover="this.title=this.value">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline" style="width: 56%;">
+                                            <label class="layui-form-label" style="width: 85px;">澶囨敞</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="hidden" class="layui-input" name="HMaker" id="HMaker" lay-verify="HMaker" value="">
+                                                <input type="hidden" class="layui-input" name="HUpDater" id="HUpDater" lay-verify="HUpDater" value="">
+                                                <input type="text" class="layui-input" name="HRemark" id="HRemark" lay-verify="HRemark" placeholder="璇疯緭鍏ュ唴瀹�" onmouseover="this.title=this.value">
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
+                    <script type="text/html" id="toolbarDemo">
+                        <div class="layui-btn-container">
+                            <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>
+                        </div>
+                    </script>
+                </form>
+            </div>
+        </div>
+    </div>
+
+    <script type="text/html" id="barDemo">
+        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">缂栬緫</a>-->
+        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
+    </script>
+
+    <script>
+        layui.config({
+            base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
+        }).extend({
+            index: 'lib/index' //涓诲叆鍙fā鍧�
+        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
+
+            //#region 鍏叡鍙橀噺
+            var $ = layui.$
+                , admin = layui.admin
+                , layer = layui.layer
+                , table = layui.table
+                , form = layui.form
+                , element = layui.element;
+            //#endregion
+
+             //#region 杩涘叆椤甸潰鍗冲姞杞�
+
+            var params = getUrlVars();
+            var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷  娣诲姞 淇濆瓨
+            var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
+            var HSouceBillType = params[params[2]];  //浠庡崟鎹幏鍙� 婧愬崟绫诲瀷
+            var linteridSub = params[params[3]];  //浠庡弬鏁拌幏鍙� 瀛愯〃绾у埆
+
+            //鍒ゆ柇鏄惁鏂板
+            if (linterid == null || linterid == 0) {
+                OperationType = 1;
+                linteridSub = -1;
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    data: { "HBillType": '3715' },
+                    success: function (d) {
+                        //璧嬪��
+                        $("#HInterID").val(d.data[0].HInterID);
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                    }
+                });
+            }
+            else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
+                RoadBillMain(linterid, linteridSub);
+            }
+          
+            //鍒濆鍖栫晫闈�
+            set_ClearBill();
+
+            //瀛愯〃  鍒濆鍖栬〃鏍兼暟鎹�
+            var option = {
+                elem: '#mainTable'
+                , toolbar: '#toolbarDemo'
+                , limit: 500 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
+                , cellMinWidth: 120
+                , height: 400
+                , cols: [[ //琛ㄥご
+                    { type: 'checkbox', totalRowText: '鍚堣琛�' }
+                    , { type: 'numbers', title: '搴忓彿', totalRow: true }
+                    , { field: 'HProcNo', title: '宸ュ簭鍙�', edit: 'text' }
+                   
+                    , { field: '宸ュ簭浠g爜', title: '宸ュ簭浠g爜', edit: 'text', event:"hprocid" }//f7
+                    , { field: '宸ュ簭', title: '宸ュ簭'}
+                    , { field: 'hprocid', title: '宸ュ簭id', hide: true}// ,hide: true
+
+                    , { field: 'HWorkRemark', title: '鍔犲伐璇存槑', edit: 'text' }
+
+                    , { field: '宸ヤ綔涓績', title: '宸ヤ綔涓績', edit: 'text', event: "HCenterID"  }//f7
+                    , { field: 'HCenterID', title: '宸ヤ綔涓績id', hide: true}// hide: true
+
+                    , { field: '鍔犲伐杞﹂棿浠g爜', title: '鍔犲伐杞﹂棿浠g爜', edit: 'text', event: "HDeptID"  }//f7
+                    , { field: '鍔犲伐杞﹂棿', title: '鍔犲伐杞﹂棿'}
+                    , { field: 'HDeptID', title: '鍔犲伐杞﹂棿浠g爜id', hide: true}// hide: true
+
+                    , { field: '鐝粍浠g爜', title: '鐝粍浠g爜', edit: 'text', event: "HGroupID"  }//f7
+                    , { field: '鐝粍', title: '鐝粍' }
+                    , { field: 'HGroupID', title: '鐝粍浠g爜id', hide: true}// hide: true
+
+                    , { field: '鎿嶄綔鍛樹唬鐮�', title: '鎿嶄綔宸ヤ唬鐮�', edit: 'text', event: "HWorkerID"  }//f7
+                    , { field: '鎿嶄綔鍛�', title: '鎿嶄綔宸�' }
+                    , { field: 'HWorkerID', title: '鎿嶄綔宸ヤ唬鐮乮d', hide: true }// hide: true
+
+                    , { field: '鐢熶骇璧勬簮', title: '鐢熶骇璧勬簮', edit: 'text', event: "HSourceID"  }//f7
+                    , { field: 'HSourceID', title: '鐢熶骇璧勬簮id', hide: true }// hide: true
+
+                    , { field: 'HQty', title: '璁″垝鏁伴噺', edit: 'text' }
+                    , { field: 'HWorkingQty', title: '鍦ㄥ埗鍝佹暟閲�', edit: 'text' }
+                    , { field: 'HTimeUnit', title: '鏃堕棿鍗曚綅', edit: 'text' }
+                    , { field: 'HPlanWorkTimes', title: '璁″垝鍔犲伐鏃堕棿', edit: 'text' }
+                    , { field: 'hplanbegindate', title: '璁″垝寮�宸ユ椂闂�', edit: 'text' }
+                    , { field: 'hplanenddate', title: '璁″垝瀹屽伐鏃堕棿', edit: 'text' }
+                    , { field: 'HICMOInterID', title: '浠诲姟ID', edit: 'text' }
+                    , { field: 'HICMOBillNo', title: '浠诲姟鍗曞彿', edit: 'text' }
+                    , { field: 'HBeginDayQty', title: '寮�宸ヤ綑閲�(澶╂暟)', edit: 'text' }
+                    , { field: 'HBeginFixQty', title: '寮�宸ヤ綑閲�(鍥烘暟)', edit: 'text' }
+                    , { field: 'HFixWorkDays', title: '涓婇亾鍥哄畾澶╂暟', edit: 'text' }
+                    , { field: 'HTrunWorkDays', title: '涓婇亾寰幆鍛ㄦ湡', edit: 'text' }
+                    , { field: 'HReadyTimes', title: '鏈亾鍑嗗鏃堕棿', edit: 'text' }
+                    , { field: 'HReadyTime', title: '鍑嗗鏃堕棿', edit: 'text' }
+                    , { field: 'HQueueTime', title: '鎺掗槦鏃堕棿', edit: 'text' }
+                    , { field: 'HMoveTime', title: '杞Щ鏃堕棿', edit: 'text' }
+                    , { field: 'HSeOrderInterID', title: '閿�鍞鍗曚富ID', edit: 'text' }
+                    , { field: 'HSeOrderEntryID', title: '閿�鍞鍗曞瓙ID', edit: 'text' }
+                    , { field: 'HSeOrderBillNo', title: '閿�鍞鍗曞彿', edit: 'text' }
+                    , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
+                ]]
+            };
+            var rowdata = [{
+                "HProcNo": "", "宸ュ簭浠g爜": "", "宸ュ簭": "", "hprocid": 0, "HWorkRemark": "",
+                "宸ヤ綔涓績": "", "HCenterID": 0, "鍔犲伐杞﹂棿浠g爜": "", "鍔犲伐杞﹂棿": "", "HDeptID": 0,
+                "鐝粍浠g爜": "", "鐝粍": "", "HGroupID": 0, "鎿嶄綔鍛樹唬鐮�": "", "鎿嶄綔鍛�": "",
+                "HWorkerID": 0, "鐢熶骇璧勬簮": "", "HSourceID": 0, "HQty": "", "HWorkingQty": "",
+                "HTimeUnit": "", "HPlanWorkTimes": "", "hplanbegindate": null, "hplanenddate": null, "HICMOInterID": "",
+                "HICMOBillNo": "", "HBeginDayQty": "", "HBeginFixQty": "", "HFixWorkDays": "", "HTrunWorkDays": "",
+                "HReadyTimes": "", "HReadyTime": "", "HQueueTime": "", "HMoveTime": "", "HSeOrderInterID": "",
+                "HSeOrderEntryID": "", "HSeOrderBillNo": ""
+            }];
+            option.data = rowdata;
+            table.render(option);
+
+            //#endregion
+
+            //#region  瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+
+            //浜у搧鎸夐挳
+            form.on("submit(btnHMaterID)", function () {
+                CheckHMaterID();
+            })
+
+            //鍗曚綅鎸夐挳
+            form.on("submit(btnHUnitID)", function () {
+                CheckHUnitID();
+            })
+
+            //淇濆瓨鎻愪氦
+            form.on('submit(btnSave)', function (data) {//鎻愪氦
+                //涓虹┖楠岃瘉
+                if (AllowLoadData(data)) {
+                    set_AddNew(data);
+                }
+            });
+
+            //#region 瀛愯〃澶撮儴瑙﹀彂浜嬩欢
+
+            //澶村伐鍏锋爮浜嬩欢
+            table.on('toolbar(mainTable)', function (obj) {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                //鏂板琛岃〃鏍兼暟鎹�
+                var NewRow = {
+                    "HProcNo": "", "宸ュ簭浠g爜": "", "宸ュ簭": "", "hprocid": 0, "HWorkRemark": "",
+                    "宸ヤ綔涓績": "", "HCenterID": 0, "鍔犲伐杞﹂棿浠g爜": "", "鍔犲伐杞﹂棿": "", "HDeptID": 0,
+                    "鐝粍浠g爜": "", "鐝粍": "", "HGroupID": 0, "鎿嶄綔鍛樹唬鐮�": "", "鎿嶄綔鍛�": "",
+                    "HWorkerID": 0, "鐢熶骇璧勬簮": "", "HSourceID": 0, "HQty": "", "HWorkingQty": "",
+                    "HTimeUnit": "", "HPlanWorkTimes": "", "hplanbegindate": null, "hplanenddate": null, "HICMOInterID": "",
+                    "HICMOBillNo": "", "HBeginDayQty": "", "HBeginFixQty": "", "HFixWorkDays": "", "HTrunWorkDays": "",
+                    "HReadyTimes": "", "HReadyTime": "", "HQueueTime": "", "HMoveTime": "", "HSeOrderInterID": "",
+                    "HSeOrderEntryID": "", "HSeOrderBillNo": ""
+                };
+                switch (obj.event) {
+                    case 'btn-AddLine':
+                        table.cache["mainTable"].push(NewRow);
+                        option.data = table.cache["mainTable"];
+                        table.render(option);
+                        break;
+                    case 'btn-CopyLine':
+                        var copydata = JSON.stringify(data);
+                        if (data.length <= 0) {
+                            layer.msg("璇烽�夋嫨闇�瑕佸鍒剁殑涓�琛岋紒");
+                        }
+                        else if (data.length > 1) {
+                            layer.msg("鍙兘閫夋嫨澶嶅埗涓�琛岋紒");
+                        }
+                        else {
+                            var copydata2 = copydata.substring(1, copydata.length);//鍘婚櫎棣栬瀛楃'['
+                            var copyrow = copydata2.substring(0, copydata2.length - 1);//鍘婚櫎鏈熬瀛楃']'
+                            table.cache["mainTable"].push(JSON.parse(copyrow));//灏嗗鍒剁殑琛屽己杞垚json杩藉姞鍒拌〃鏍间笂
+                            option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓�
+                            table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
+                            //layer.alert(copyrow);
+                        }
+                        break;
+                }
+            });
+
+            //琛屽唴浜嬩欢
+            table.on('tool(mainTable)', function (obj) {
+                set_GridDelete(obj);   //琛屽唴鍒犻櫎
+                set_GridCellCheck(obj); //琛屽唴蹇嵎閿瓫閫�
+            });
+
+             //#endregion
+
+            //#endregion
+
+             //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶
+
+            // 鍒濆鍖栫晫闈�
+            function set_ClearBill() {
+                //鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
+                if (sessionStorage.login != "login") {
+                    layer.confirm("鐧诲綍澶辨晥锛岃閲嶆柊鐧诲綍锛�", {
+                        icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍']
+                    }, function () { window.location.href = "../../user/login.html"; });
+                }
+                //鍒跺崟浜�
+                $("#HMaker").val(sessionStorage["HUserName"]);
+                //淇敼浜�
+                $("#HUpDater").val(sessionStorage["HUserName"]);
+                //鍒濆鍖栨棩鏈�
+                $("#HPlanBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HPlanEndDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+            }
+
+            //浜у搧閫夋嫨椤甸潰
+            function CheckHMaterID() {
+                layer.open({
+                    type: 2 //寮圭獥绫诲瀷
+                    , skin: "layui-layer-rim"  //鍔犱笂杈规
+                    , title: "鐗╂枡琛�" //鏍囬
+                    , area: ["90%", "90%"] //澶у皬
+                    , shift: 2  //寮瑰嚭鍔ㄧ敾
+                    , content: ["../../Baseset/鍩虹璧勬枡/Gy_MaterialList.html", "yes"]
+                    , btn: ["纭畾", "鍙栨秷"]
+                    , btn1: function (index) {  //鎸夐挳涓� 鍥炶皟
+                        var iframeWindow = window['layui-layer-iframe' + index]; //鑾峰彇寮圭獥椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus("mainTable"); //鑾峰彇閫変腑琛屾暟鎹�
+
+                        if (checkStatus.data.length != 1) {
+                            return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+                        }
+
+                        //鑾峰彇鏁版嵁
+                        $("#HMaterNumber").val(checkStatus.data[0].HNumber);//浜у搧浠g爜
+                        $("#HMaterIDName").val(checkStatus.data[0].HName);//浜у搧鍚嶇О
+                        $("#HMaterID").val(checkStatus.data[0].HItemID);//浜у搧id
+                        $("#HMaterIDNum").val(checkStatus.data[0].HModel);//浜у搧瑙勬牸鍨嬪彿
+
+                        //鍏抽棴椤甸潰
+                        layer.close(index);
+                    }
+                })
+            }
+
+            //鍗曚綅閫夋嫨椤甸潰
+            function CheckHUnitID() {
+                layer.open({
+                    type: 2  //寮圭獥绫诲瀷
+                    , skin: "layui-layer-rim"  //鍔犱笂杈规
+                    , area: ["90%", "90%"]  //澶у皬
+                    , title:"鍗曚綅鍒楄〃"  //鏍囬
+                    , shift: 2 //寮瑰嚭鍔ㄧ敾
+                    , content: ["../../Baseset/鍩虹璧勬枡/Gy_UnitList.html"]
+                    , btn: ["纭畾", "鍙栨秷"]
+                    , btn1: function (index) {
+                        var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable'); //鑾峰彇閫変腑琛屾暟鎹�
+
+                        if (checkStatus.data.length != 1) {
+                            return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                        }
+                        else {
+                            //鑾峰彇鏁版嵁
+                            $("#HUnitNumber").val(checkStatus.data[0].HNumber);//鍗曚綅浠g爜
+                            $("#HUnitID").val(checkStatus.data[0].HItemID);//鍗曚綅id
+                            $("#HUnitIDName").val(checkStatus.data[0].HName);//鍗曚綅鍚嶇О
+
+                            //鍏抽棴椤甸潰
+                            layer.close(index);
+                        }
+                    }
+                })
+            }
+
+            //琛屽唴鍒犻櫎
+            function set_GridDelete(obj) {
+                var data = obj.data;
+                var rowIndex = $(obj.tr).attr("data-index");
+                if (obj.event === 'del') {
+                    layer.confirm('鐪熺殑鍒犻櫎琛屽悧锛�', function (index) {
+                        console.log("绱㈠紩涓�:" + rowIndex);
+                        if (rowIndex === '0') {
+                            layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
+                        } else {
+                            obj.del();
+                            option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓�
+                            table.reload(option);
+                            layer.close(index);
+                        }
+                    });
+                }
+            }
+
+            //琛屽唴蹇嵎閿�
+            function set_GridCellCheck(obj) {
+                $(document).off('keydown', ".layui-table-edit").on('keydown', ".layui-table-edit", function (e) {
+                    if (event.key == "F7") {
+                        //宸ュ簭
+                        if (obj.event == "hprocid") {
+                            layer.open({
+                                type: 2 //寮圭獥绫诲瀷
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "宸ュ簭琛�" //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙� 鍏抽棴鐨勬牱寮�
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆绐椾綋鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ["../../Baseset/鍩虹璧勬枡/Gy_ProcList.html", "yes"]
+                                , btn: ["纭畾", "鍙栨秷"]
+                                , btn1: function (index) {//鎸夐挳涓� 鍥炶皟
+                                    var iframeWindow = window["layui-layer-iframe" + index]; //鑾峰彇寮圭獥椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable"); //鑾峰彇閫変腑琛屾暟鎹�
+
+                                    if (checkStatus.data.length != 1) {
+                                        return layer.msg("璇烽�変腑涓�鏉℃暟鎹�!");
+                                    }
+
+                                    //鑾峰彇鏁版嵁/缁戝畾鏁版嵁
+                                    obj.update({
+                                        "宸ュ簭浠g爜": checkStatus.data[0].宸ュ簭浠g爜
+                                        , "宸ュ簭": checkStatus.data[0].宸ュ簭
+                                        , "hprocid": checkStatus.data[0].HItemID
+                                    })
+
+                                    //鍏抽棴椤甸潰
+                                    layer.close(index);
+                                }
+                            })
+                        }
+                        //宸ヤ綔涓績
+                        if (obj.event == "HCenterID") {
+                            layer.open({
+                                type: 2 //寮圭獥绫诲瀷
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "宸ヤ綔涓績琛�" //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙� 鍏抽棴鐨勬牱寮�
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆绐椾綋鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ["../../Baseset/鍩虹璧勬枡/Gy_WorkCenterList.html", "yes"]
+                                , btn: ["纭畾", "鍙栨秷"]
+                                , btn1: function (index) {//鎸夐挳涓� 鍥炶皟
+                                    var iframeWindow = window["layui-layer-iframe" + index]; //鑾峰彇寮圭獥椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable"); //鑾峰彇閫変腑琛屾暟鎹�
+
+                                    if (checkStatus.data.length != 1) {
+                                        return layer.msg("璇烽�変腑涓�鏉℃暟鎹�!");
+                                    }
+
+                                    //鑾峰彇鏁版嵁/缁戝畾鏁版嵁
+                                    obj.update({
+                                         "宸ヤ綔涓績": checkStatus.data[0].宸ヤ綔涓績
+                                        , "HCenterID": checkStatus.data[0].HItemID
+                                    })
+
+                                    //鍏抽棴椤甸潰
+                                    layer.close(index);
+                                }
+                            })
+                        }
+                        //鍔犲伐杞﹂棿
+                        if (obj.event == "HDeptID") {
+                            layer.open({
+                                type: 2 //寮圭獥绫诲瀷
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "閮ㄩ棬琛�" //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙� 鍏抽棴鐨勬牱寮�
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆绐椾綋鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ["../../Baseset/鍩虹璧勬枡/Gy_DepartmentList.html", "yes"]
+                                , btn: ["纭畾", "鍙栨秷"]
+                                , btn1: function (index) {//鎸夐挳涓� 鍥炶皟
+                                    var iframeWindow = window["layui-layer-iframe" + index]; //鑾峰彇寮圭獥椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable"); //鑾峰彇閫変腑琛屾暟鎹�
+
+                                    if (checkStatus.data.length != 1) {
+                                        return layer.msg("璇烽�変腑涓�鏉℃暟鎹�!");
+                                    }
+
+                                    //鑾峰彇鏁版嵁/缁戝畾鏁版嵁
+                                    obj.update({
+                                        "鍔犲伐杞﹂棿浠g爜": checkStatus.data[0].HNumber
+                                        , "鍔犲伐杞﹂棿": checkStatus.data[0].HName
+                                        , "HDeptID": checkStatus.data[0].HItemID
+                                    })
+
+                                    //鍏抽棴椤甸潰
+                                    layer.close(index);
+                                }
+                            })
+                        }
+                        //鐝粍
+                        if (obj.event == "HGroupID") {
+                            layer.open({
+                                type: 2 //寮圭獥绫诲瀷
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "鐝粍琛�" //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙� 鍏抽棴鐨勬牱寮�
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆绐椾綋鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ["../../鍩虹璧勬枡/宸ヨ祫鍩虹璧勬枡/Gy_Group.html", "yes"]
+                                , btn: ["纭畾", "鍙栨秷"]
+                                , btn1: function (index) {//鎸夐挳涓� 鍥炶皟
+                                    var iframeWindow = window["layui-layer-iframe" + index]; //鑾峰彇寮圭獥椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable"); //鑾峰彇閫変腑琛屾暟鎹�
+
+                                    if (checkStatus.data.length != 1) {
+                                        return layer.msg("璇烽�変腑涓�鏉℃暟鎹�!");
+                                    }
+
+                                    //鑾峰彇鏁版嵁/缁戝畾鏁版嵁
+                                    obj.update({
+                                        "鐝粍浠g爜": checkStatus.data[0].鐝粍浠g爜
+                                        , "鐝粍": checkStatus.data[0].鐝粍鍚嶇О
+                                        , "HGroupID": checkStatus.data[0].HItemID
+                                    })
+
+                                    //鍏抽棴椤甸潰
+                                    layer.close(index);
+                                }
+                            })
+                        }
+                        //鎿嶄綔宸�
+                        if (obj.event == "HWorkerID") {
+                            layer.open({
+                                type: 2 //寮圭獥绫诲瀷
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "浜哄憳琛�" //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙� 鍏抽棴鐨勬牱寮�
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆绐椾綋鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ["../../Baseset/鍩虹璧勬枡/Gy_EmployeeList.html", "yes"]
+                                , btn: ["纭畾", "鍙栨秷"]
+                                , btn1: function (index) {//鎸夐挳涓� 鍥炶皟
+                                    var iframeWindow = window["layui-layer-iframe" + index]; //鑾峰彇寮圭獥椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable"); //鑾峰彇閫変腑琛屾暟鎹�
+
+                                    if (checkStatus.data.length != 1) {
+                                        return layer.msg("璇烽�変腑涓�鏉℃暟鎹�!");
+                                    }
+
+                                    //鑾峰彇鏁版嵁/缁戝畾鏁版嵁
+                                    obj.update({
+                                        "鎿嶄綔鍛�": checkStatus.data[0].HName
+                                        , "鎿嶄綔鍛樹唬鐮�": checkStatus.data[0].HNumber
+                                        , "HWorkerID": checkStatus.data[0].HItemID
+                                    })
+
+                                    //鍏抽棴椤甸潰
+                                    layer.close(index);
+                                }
+                            })
+                        }
+                        //鐢熶骇璧勬簮
+                        if (obj.event == "HSourceID") {
+                            layer.open({
+                                type: 2 //寮圭獥绫诲瀷
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "鐢熶骇璧勬簮琛�" //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙� 鍏抽棴鐨勬牱寮�
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆绐椾綋鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ["../../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_Source.html", "yes"]
+                                , btn: ["纭畾", "鍙栨秷"]
+                                , btn1: function (index) {//鎸夐挳涓� 鍥炶皟
+                                    var iframeWindow = window["layui-layer-iframe" + index]; //鑾峰彇寮圭獥椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable"); //鑾峰彇閫変腑琛屾暟鎹�
+
+                                    if (checkStatus.data.length != 1) {
+                                        return layer.msg("璇烽�変腑涓�鏉℃暟鎹�!");
+                                    }
+
+                                    //鑾峰彇鏁版嵁/缁戝畾鏁版嵁
+                                    obj.update({
+                                        "鐢熶骇璧勬簮": checkStatus.data[0].鐢熶骇璧勬簮鍚嶇О
+                                        , "HSourceID": checkStatus.data[0].HItemID
+                                    })
+
+                                    //鍏抽棴椤甸潰
+                                    layer.close(index);
+                                }
+                            })
+                        }
+                    }
+                })
+            }
+
+            //淇濆瓨鏁版嵁
+            function set_AddNew(data) {
+                //杩囨护瀛愯〃鍒犻櫎涔嬪悗鐣欎笅鐨勭┖鏁版嵁
+                var num = [];
+                for (var i = 0; i < table.cache['mainTable'].length; i++) {
+                     //缁欎笉鑳戒负绌虹殑鏁版嵁 璧嬪��(瀛�)
+                    if (table.cache['mainTable'][i] != "") {
+                        if (table.cache['mainTable'][i].HProcNo == "") {
+                            table.cache['mainTable'][i].HProcNo = 0;
+                        }
+                        if (table.cache['mainTable'][i].HQty == "") {
+                            table.cache['mainTable'][i].HQty = 0;
+                        }
+                        if (table.cache['mainTable'][i].HWorkingQty == "") {
+                            table.cache['mainTable'][i].HWorkingQty = 0;
+                        }
+                        if (table.cache['mainTable'][i].HPlanWorkTimes == "") {
+                            table.cache['mainTable'][i].HPlanWorkTimes = 0;
+                        }
+                        if (table.cache['mainTable'][i].HICMOInterID == "") {
+                            table.cache['mainTable'][i].HICMOInterID = 0;
+                        }
+                        if (table.cache['mainTable'][i].HBeginDayQty == "") {
+                            table.cache['mainTable'][i].HBeginDayQty = 0;
+                        }
+                        if (table.cache['mainTable'][i].HBeginFixQty == "") {
+                            table.cache['mainTable'][i].HBeginFixQty = 0;
+                        }
+                        if (table.cache['mainTable'][i].HFixWorkDays == "") {
+                            table.cache['mainTable'][i].HFixWorkDays = 0;
+                        }
+                        if (table.cache['mainTable'][i].HTrunWorkDays == "") {
+                            table.cache['mainTable'][i].HTrunWorkDays = 0;
+                        }
+                        if (table.cache['mainTable'][i].HReadyTimes == "") {
+                            table.cache['mainTable'][i].HReadyTimes = 0;
+                        }
+                        if (table.cache['mainTable'][i].HReadyTime == "") {
+                            table.cache['mainTable'][i].HReadyTime = 0;
+                        }
+                        if (table.cache['mainTable'][i].HQueueTime == "") {
+                            table.cache['mainTable'][i].HQueueTime = 0;
+                        }
+                        if (table.cache['mainTable'][i].HMoveTime == "") {
+                            table.cache['mainTable'][i].HMoveTime = 0;
+                        }
+                        if (table.cache['mainTable'][i].HSeOrderInterID == "") {
+                            table.cache['mainTable'][i].HSeOrderInterID = 0;
+                        }
+                        if (table.cache['mainTable'][i].HSeOrderEntryID == "") {
+                            table.cache['mainTable'][i].HSeOrderEntryID = 0;
+                        }
+
+                        num.push(table.cache['mainTable'][i]);
+                    }
+                }
+
+                //缁欎笉鑳戒负绌虹殑鏁版嵁 璧嬪��(涓�)
+                if (data.field.HPlanQty == "") {
+                    data.field.HPlanQty = 0
+                }
+
+
+                var sMainStr = JSON.stringify(data.field);
+                var sSubStr = JSON.stringify(num);
+                var hentryid = linteridSub;//瀛愯〃 鎺掑簭id
+                var sMainSub = sMainStr + ';' + sSubStr + ';' + hentryid + ';' + OperationType;
+                var index = layer.load();
+
+                //console.log(JSON.stringify(table.cache['mainTable'][0]))
+                //return false;
+                $.ajax({
+                    type: "POST",
+                    url: GetWEBURL() + "/Sc_ProcessMangement/AddBill",
+                    async: true,
+                    data: { "sMainSub": sMainSub },
+                    dataType: "json",
+                    success: function (data) {
+                        if (data.count == 1) {
+                            layer.close(index);
+                            layer.msg("鎻愪氦鎴愬姛");
+                        }
+                        else {
+                            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.msg("閿欒:" + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                    }
+                });
+            }
+
+            //缂栬緫
+            function RoadBillMain(linterid, linteridSub) {
+                var sWhere = " and hmainid ='" + linterid + "' and hsubid='" + linteridSub + "' ";
+
+                $.ajax({
+                    url: GetWEBURL() + '/Sc_ProcessMangement/MES_Sc_ProcessPlanMain_Json',
+                    type: "GET",
+                    data: { "sWhere": sWhere },
+                    success: function (d) {
+                        //涓昏〃
+                        form.val("formData", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+                            "HBillNo": d.data[0].鍗曟嵁鍙�
+                            , "HInterID": d.data[0].hmainid
+                            , "HDate": Format(new Date(d.data[0].鏃ユ湡), "yyyy-MM-dd")
+                            , "HICMOBillNo": d.data[0].浠诲姟鍗曞彿
+                            , "HMaterNumber": d.data[0].鐗╂枡浠g爜
+                            , "HMaterIDName": d.data[0].鐗╂枡鍚嶇О
+                            , "HMaterID": d.data[0].HMaterID
+                            , "HMaterIDNum": d.data[0].瑙勬牸鍨嬪彿
+                            , "HUnitNumber": d.data[0].璁¢噺鍗曚綅浠g爜
+                            , "HUnitIDName": d.data[0].璁¢噺鍗曚綅
+                            , "HUnitID": d.data[0].hunitid
+                            , "HInnerBillNo": d.data[0].鍐呴儴鍗曟嵁鍙�
+                            , "HPlanBeginDate": Format(new Date(d.data[0].璁″垝寮�宸ユ棩鏈�), "yyyy-MM-dd")
+                            , "HPlanEndDate": Format(new Date(d.data[0].璁″垝瀹屽伐鏃ユ湡), "yyyy-MM-dd")
+                            , "HPlanQty": d.data[0].鐢熶骇鏁伴噺
+                            , "HExplanation": d.data[0].鎽樿
+                            , "HRemark": d.data[0].琛ㄥご澶囨敞
+                        });
+                        //瀛愯〃
+                        var rowdata = [{
+                            "HProcNo": d.data[0].宸ュ簭鍙�, "宸ュ簭浠g爜": d.data[0].宸ュ簭浠g爜, "宸ュ簭": d.data[0].宸ュ簭, "hprocid": d.data[0].hprocid, "HWorkRemark": d.data[0].鍔犲伐璇存槑,
+                            "宸ヤ綔涓績": d.data[0].宸ヤ綔涓績, "HCenterID": d.data[0].HCenterID, "鍔犲伐杞﹂棿浠g爜": d.data[0].鍔犲伐杞﹂棿浠g爜, "鍔犲伐杞﹂棿": d.data[0].鍔犲伐杞﹂棿, "HDeptID": d.data[0].HDeptID,
+                            "鐝粍浠g爜": d.data[0].鐝粍浠g爜, "鐝粍": d.data[0].鐝粍鍚嶇О, "HGroupID": d.data[0].HGroupID, "鎿嶄綔鍛樹唬鐮�": d.data[0].鎿嶄綔鍛樹唬鐮�, "鎿嶄綔鍛�": d.data[0].鎿嶄綔鍛�,
+                            "HWorkerID": d.data[0].HWorkerID, "鐢熶骇璧勬簮": d.data[0].鐢熶骇璧勬簮, "HSourceID": d.data[0].HSourceID, "HQty": d.data[0].璁″垝鏁伴噺, "HWorkingQty": d.data[0].鍦ㄥ埗鍝佹暟閲�,
+                            "HTimeUnit": d.data[0].鏃堕棿鍗曚綅, "HPlanWorkTimes": d.data[0].璁″垝鍔犲伐鏃堕棿, "hplanbegindate": (Format(new Date(d.data[0].宸ュ簭璁″垝寮�宸ユ棩鏈�), "yyyyMMdd") == "19000101" ? null : Format(new Date(d.data[0].宸ュ簭璁″垝寮�宸ユ棩鏈�), "yyyy-MM-dd")), "hplanenddate": (Format(new Date(d.data[0].宸ュ簭璁″垝瀹屽伐鏃ユ湡), "yyyyMMdd") == "19000101" ? null : Format(new Date(d.data[0].宸ュ簭璁″垝瀹屽伐鏃ユ湡), "yyyy-MM-dd")), "HICMOInterID": d.data[0].浠诲姟鍗曞彿id,
+                            "HICMOBillNo": d.data[0].瀛愪换鍔″崟鍙�, "HBeginDayQty": d.data[0].寮�宸ュ浐澶�, "HBeginFixQty": d.data[0].寮�宸ュ浐鏁�, "HFixWorkDays": d.data[0].涓婇亾鍥哄畾澶╂暟, "HTrunWorkDays": d.data[0].涓婇亾寰幆鍛ㄦ湡,
+                            "HReadyTimes": d.data[0].鏈亾鍑嗗鏃堕棿, "HReadyTime": d.data[0].鍑嗗鏃堕棿, "HQueueTime": d.data[0].鎺掗槦鏃堕棿, "HMoveTime": d.data[0].杞Щ鏃堕棿, "HSeOrderInterID": d.data[0].閿�鍞鍗曚富ID,
+                            "HSeOrderEntryID": d.data[0].閿�鍞鍗曞瓙ID, "HSeOrderBillNo": d.data[0].閿�鍞鍗曞彿
+                        }];
+                        option.data = rowdata;
+                        table.render(option);
+                    }
+                })
+            }
+
+            //鏁版嵁楠岃瘉
+            function AllowLoadData(data) {
+                var HMaterIDName = data.field.HMaterIDName;//浜у搧
+                var HUnitIDName = data.field.HUnitIDName;//鍗曚綅
+                if (HMaterIDName == "") {
+                    layer.msg("璇烽�夋嫨浜у搧!");
+                    return false;
+                }
+                if (HUnitIDName == "") {
+                    layer.msg("璇烽�夋嫨鍗曚綅!");
+                    return false;
+                }
+                return true;
+            }
+
+            //鑾峰彇鍙傛暟
+            function getUrlVars() {
+                var vars = [], hash;
+                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
+                for (var i = 0; i < hashes.length; i++) {
+                    hash = hashes[i].split('=');
+                    vars.push(hash[0]);
+                    vars[hash[0]] = hash[1];
+                }
+                return vars;
+            }
+            //#endregion
+
+        });
+    </script>
+</body>
+</html>
\ No newline at end of file
diff --git "a/WebTM/views/\347\224\237\344\272\247\345\267\245\345\272\217\347\256\241\347\220\206/\345\267\245\345\272\217\350\256\241\345\210\222\345\215\225/Sc_ProcessPlanList.html" "b/WebTM/views/\347\224\237\344\272\247\345\267\245\345\272\217\347\256\241\347\220\206/\345\267\245\345\272\217\350\256\241\345\210\222\345\215\225/Sc_ProcessPlanList.html"
index 4b31c9a..b332079 100644
--- "a/WebTM/views/\347\224\237\344\272\247\345\267\245\345\272\217\347\256\241\347\220\206/\345\267\245\345\272\217\350\256\241\345\210\222\345\215\225/Sc_ProcessPlanList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\345\267\245\345\272\217\347\256\241\347\220\206/\345\267\245\345\272\217\350\256\241\345\210\222\345\215\225/Sc_ProcessPlanList.html"
@@ -1,7 +1,7 @@
 锘�<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <title>鐢熶骇宸ュ簭璁″垝鍗曞垪琛�</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@@ -9,7 +9,12 @@
     <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
     <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
     <script src="../../../layuiadmin/layui/layui.js"></script>
-    
+    <script src="../../../layuiadmin/Scripts/json2.js"></script>
+    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
+    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
+    <script src="../../../layuiadmin/PubCustom.js"></script>
+    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
+
 </head>
 <body>
     <div class="layui-fluid">
@@ -27,36 +32,67 @@
                                 <div class="layui-inline">
                                     <label class="layui-form-label">寮�濮嬫棩鏈�</label>
                                     <div class="layui-input-block">
-                                        <input type="date" class="layui-input" id="HDate">
+                                        <input type="date" class="layui-input" id="HBeginDate" style="width:190px;">
                                     </div>
                                 </div>
                                 <div class="layui-inline">
                                     <label class="layui-form-label">缁撴潫鏃ユ湡</label>
                                     <div class="layui-input-block">
-                                        <input type="date" class="layui-input" id="HDate1">
+                                        <input type="date" class="layui-input" id="HEndDate" style="width:190px;">
                                     </div>
                                 </div>
-                                <!--<div class="layui-inline">
-                                    <label class="layui-form-label">璁㈠崟璺熻釜鍙�</label>
+                                <div class="layui-inline">
+                                    <label class="layui-form-label">鍗曟嵁鍙�</label>
                                     <div class="layui-input-block">
-                                        <input type="text" class="layui-input" name="HOrderProcNO" id="HOrderProcNO">
+                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="width:190px;">
                                     </div>
-                                </div>-->
+                                </div>
                                 <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                                     <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                 </button>
                                 <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">閲嶇疆</button>
-
                                 <div class="layui-colla-content">
                                     <div class="layui-inline">
-                                        <div class="layui-inline">
-                                            <span>鍏朵粬鏉′欢></span>
+                                        <label class="layui-form-label">閮ㄩ棬</label>
+                                        <div class="layui-input-block">
+                                            <input type="text" class="layui-input" name="HDeptID" id="HDeptID" style="width:190px;">
                                         </div>
                                     </div>
                                     <div class="layui-inline">
-                                        <label class="layui-form-label">鍗曟嵁鍙�</label>
+                                        <label class="layui-form-label">鐗╂枡浠g爜</label>
                                         <div class="layui-input-block">
-                                            <input type="text" class="layui-input" name="WorkCenter" id="WorkCenter">
+                                            <input type="text" class="layui-input" name="MaterialCode" id="MaterialCode" style="width:190px;">
+                                        </div>
+                                    </div>
+                                    <!--<hr />-->
+                                    <div class="layui-inline">
+                                        <label class="layui-form-label">鐗╂枡鍚嶇О</label>
+                                        <div class="layui-input-block">
+                                            <input type="text" class="layui-input" name="MaterialName" id="MaterialName" style="width:190px;">
+                                        </div>
+                                    </div>
+                                    <div class="layui-inline">
+                                        <label class="layui-form-label">瑙勬牸鍨嬪彿</label>
+                                        <div class="layui-input-block">
+                                            <input type="text" class="layui-input" name="SpecificationModel" id="SpecificationModel" style="width:190px;">
+                                        </div>
+                                    </div>
+                                    <div class="layui-inline">
+                                        <label class="layui-form-label">婧愬崟鍗曞彿</label>
+                                        <div class="layui-input-block">
+                                            <input type="text" class="layui-input" name="HSourceBillNo" id="HSourceBillNo" style="width:190px;">
+                                        </div>
+                                    </div>
+                                    <!--<div class="layui-inline">
+                                        <label class="layui-form-label">浠撳簱</label>
+                                        <div class="layui-input-block">
+                                            <input type="text" class="layui-input" name="Warehouse" id="Warehouse" style="width:190px;">
+                                        </div>
+                                    </div>-->
+                                    <div class="layui-inline">
+                                        <label class="layui-form-label">鍒跺崟浜�</label>
+                                        <div class="layui-input-block">
+                                            <input type="text" class="layui-input" name="Hmaker" id="Hmaker" style="width:190px;">
                                         </div>
                                     </div>
                                 </div>
@@ -65,11 +101,17 @@
                         <table class="" id="mainTable" lay-filter="mainTable"></table>
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
-                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>棰勮</button>-->
-                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>鍒锋柊</button>-->
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Pushdown"><i class="layui-icon layui-icon-form"></i>涓嬫帹娲惧伐鍗�</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-PushdownWWorder"><i class="layui-icon layui-icon-form"></i>涓嬫帹濮斿宸ュ崟</button>
-                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="add"><i class="layui-icon">&#xe608;</i>娣诲姞</button>-->
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit"><i class="layui-icon layui-icon-radio"></i>瀹℃牳</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeAudit"><i class="layui-icon layui-icon-circle"></i>鍙嶅鏍�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>棰勮</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>鎵撳嵃</button>
 
                             </div>
                         </script>
@@ -80,198 +122,119 @@
     </div>
 
     <script type="text/html" id="barDemo">
-  <a class="layui-btn layui-btn-xs" lay-event="edit">缂栬緫</a>
-  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
-</script>
-    <script src="../../../layuiadmin/layui/layui.js"></script>
-    <script src="../../../layuiadmin/Scripts/json2.js"></script>
-    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
-    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
+        <a class="layui-btn layui-btn-xs" lay-event="edit">缂栬緫</a>
+        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
+    </script>
     <script>
         layui.config({
             base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
         }).extend({
             index: 'lib/index', //涓诲叆鍙fā鍧�
-        }).use(['index', 'form', 'table', 'element', 'laypage','laydate'], function () {
+        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
+
+            //#region 鍏叡鍙橀噺
+
             var $ = layui.$
-            , admin = layui.admin
-            , layer = layui.layer
-            , table = layui.table
-            , form = layui.form
-            , element = layui.element
-            , laypage = layui.laypage
-            , laydate = layui.laydate
+                , admin = layui.admin
+                , layer = layui.layer
+                , table = layui.table
+                , form = layui.form
+                , element = layui.element
+                , laypage = layui.laypage
+                , laydate = layui.laydate
             //var sWhere = " 浜у搧浠g爜 = 'BX0002'";
             var sWhere = "";
+            var option = [];
+            //#endregion
 
-            var option = {
-                elem: '#mainTable'
-                , toolbar: '#toolbarDemo'
-                ,height: 'full-50' 
-                , page: true
-                ,cellMinWidth: 90
-                , cols: [[
-                    { type: 'checkbox' }
-                    //{ field: 'hmainid', title: 'hmainid', sort: true, width: 165 }
-                     , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
-                    ,{ field: '鏃ユ湡', title: '鏃ユ湡', sort: true, width: 120 }
-                    , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true, width: 170 }
-                    //, { field: 'HBillStatus ', title: '鍗曟嵁鐘舵��', width: 105 }
-                    , { field: 'HMaterID', title: 'HMaterID' }
-                    ////, { field: 'hunitid', title: 'hunitid' }
-                    , { field: '鐗╂枡浠g爜 ', title: '鐗╂枡浠g爜 ', width: 115 }
-                    , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О' }
-                    ////, { field: 'hempid', title: 'hempid' }
-                    , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 100 }
-                    , { field: 'HUnitNumber', title: '鍗曚綅浠g爜' }
-                    , { field: '鍗曚綅', title: '鍗曚綅' }
-                    , { field: 'hunitid', title: 'hunitid' }
-                    , { field: '璁¢噺鍗曚綅浠g爜', title: '璁¢噺鍗曚綅浠g爜' }
-                    ////, { field: 'HCenterID', title: 'HCenterID' }
-                    , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅' }
-                    , { field: '鐢熶骇鏁伴噺 ', title: '鐢熶骇鏁伴噺' }
-                    ////, { field: 'hbomid', title: 'hbomid' }
-                    , { field: '璁″垝寮�宸ユ棩鏈�', title: '璁″垝寮�宸ユ棩鏈�' }
-                    , { field: '璁″垝瀹屽伐鏃ユ湡', title: '璁″垝瀹屽伐鏃ユ湡' }
-                    , { field: '鎽樿', title: '鎽樿' }
-                    , { field: '琛ㄥご澶囨敞', title: '琛ㄥご澶囨敞' }
-                    , { field: '鍐呴儴鍗曟嵁鍙�', title: '鍐呴儴鍗曟嵁鍙�' }
-                    , { field: 'hicmointerid', title: 'hicmointerid' }
-                    , { field: '浠诲姟鍗曞彿', title: '浠诲姟鍗曞彿' }
-                    , { field: '鍒跺崟浜�', title: '鍒跺崟浜�' }
-                    , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡' }
-                    , { field: '瀹℃牳浜�', title: '瀹℃牳浜�' }
-                    , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡' }
-                    , { field: '淇敼浜�', title: '淇敼浜�' }
-                    , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡' }
-                    , { field: '鍏抽棴浜�', title: '鍏抽棴浜�' }
-                    ////, { field: 'hsubid', title: 'hsubid' }
-                    , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡' }
-                    , { field: '鍏抽棴绫诲瀷', title: '鍏抽棴绫诲瀷' }
-                    , { field: '浣滃簾浜�', title: '浣滃簾浜�' }
-                    , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡' }
-                    , { field: 'hsubid', title: 'hsubid'  , fixed: true, hide: true}
-                    , { field: '宸ュ簭璁″垝鍗曞彿', title: '宸ュ簭璁″垝鍗曞彿' }
-                    , { field: '宸ュ簭鍙�', title: '宸ュ簭鍙�' }
-                    , { field: 'hprocid', title: 'hprocid' }
-                    , { field: '宸ュ簭浠g爜', title: '宸ュ簭浠g爜' }
-                    , { field: '宸ュ簭', title: '宸ュ簭' }
-                    , { field: '鍔犲伐璇存槑', title: '鍔犲伐璇存槑' }
-                    , { field: '寮�宸ュ浐澶�', title: '寮�宸ュ浐澶�' }
-                    , { field: '寮�宸ュ浐鏁�', title: '寮�宸ュ浐鏁�' }
-                    , { field: 'HCenterID', title: 'HCenterID' }
-                    , { field: '宸ヤ綔涓績浠g爜', title: '宸ヤ綔涓績浠g爜' }
-                    , { field: '宸ヤ綔涓績', title: '宸ヤ綔涓績' }
-                    , { field: 'HDeptID', title: 'HDeptID' }
-                    , { field: '鍔犲伐杞﹂棿浠g爜', title: '鍔犲伐杞﹂棿浠g爜' }
-                    , { field: '鍔犲伐杞﹂棿', title: '鍔犲伐杞﹂棿' }
-                    , { field: 'HGroupID', title: 'HGroupID' }
-                    , { field: '鐝粍浠g爜', title: '鐝粍浠g爜' }
-                    , { field: '鐝粍鍚嶇О', title: '鐝粍鍚嶇О' }
-                    , { field: 'HWorkerID', title: 'HWorkerID' }
-                    , { field: '鎿嶄綔鍛樹唬鐮�', title: '鎿嶄綔鍛樹唬鐮�' }
-                    , { field: '鎿嶄綔鍛�', title: '鎿嶄綔鍛�' }
-                    , { field: 'HSourceID', title: 'HSourceID' }
-                    , { field: '璧勬簮浠g爜', title: '璧勬簮浠g爜' }
-                    , { field: '鐢熶骇璧勬簮', title: '鐢熶骇璧勬簮' }
-                    , { field: '璁″垝鏁伴噺', title: '璁″垝鏁伴噺' }
-                    , { field: '鍏宠仈鏁伴噺', title: '鍏宠仈鏁伴噺' }
-                    , { field: '鏃堕棿鍗曚綅', title: '鏃堕棿鍗曚綅' }
-                    , { field: '璁″垝鍔犲伐鏃堕棿', title: '璁″垝鍔犲伐鏃堕棿' }
-                    , { field: '宸ュ簭璁″垝寮�宸ユ棩鏈�', title: '宸ュ簭璁″垝寮�宸ユ棩鏈�' }
-                    , { field: '宸ュ簭璁″垝瀹屽伐鏃ユ湡', title: '宸ュ簭璁″垝瀹屽伐鏃ユ湡' }
-                    , { field: '鍑嗗鏃堕棿', title: '鍑嗗鏃堕棿' }
-                    , { field: '鎺掗槦鏃堕棿', title: '鎺掗槦鏃堕棿' }
-                    , { field: '杞Щ鏃堕棿', title: '杞Щ鏃堕棿' }
-                    , { field: '琛ㄤ綋澶囨敞', title: '琛ㄤ綋澶囨敞' }
-                    , { field: '鎵规', title: '鎵规' }
-                    , { field: '婧愬崟涓诲唴鐮�', title: '婧愬崟涓诲唴鐮�' }
-                    , { field: '婧愬崟瀛愬唴鐮�', title: '婧愬崟瀛愬唴鐮�' }
-                    , { field: '婧愬崟鍗曞彿', title: '婧愬崟鍗曞彿' }
-                    , { field: '婧愬崟绫诲瀷', title: '婧愬崟绫诲瀷' }
-                    , { field: '閿�鍞鍗曚富ID', title: '閿�鍞鍗曚富ID' }
-                    , { field: '閿�鍞鍗曞瓙ID', title: '閿�鍞鍗曞瓙ID' }
-                    , { field: '閿�鍞鍗曞彿', title: '閿�鍞鍗曞彿' }
-                    , { field: 'HBillType', title: 'HBillType' }
-                    , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷' }
-                    , { field: 'HBillSubType', title: 'HBillSubType' }
-                    , { field: 'HQtyDecimal', title: 'HQtyDecimal' }
-                    , { field: 'HPriceDecimal', title: 'HPriceDecimal' }
-                
-                     //,{fixed: 'right', title:'鎿嶄綔', toolbar: '#barDemo', width:150}
-                ]]
-            };
+            //#region 鍒濆鍖栫晫闈�
+            set_ClearBill();
+            //#endregion
 
-   
-//鐩戝惉琛屽伐鍏蜂簨浠�
-  //table.on('tool(mainTable)', function(obj){
-  //  var data = obj.data;
-  //  //console.log(obj)
-  //  if(obj.event == 'del'){
-  //    layer.confirm('鐪熺殑鍒犻櫎琛屼箞', function(index){
-  //      obj.del();
-  //      layer.close(index);
-  //    });
-  //  } else if(obj.event == 'edit'){
-  //    layer.prompt({
-  //      formType: 2
-  //      ,value: data.HDate
-  //    }, function(value, index){
-  //      obj.update({
-  //        HDate: value
-  //      });
-  //      layer.close(index);
-  //      });
-  //      //layer.alert('鎴戞槸缂栬緫涓�');
-  //  }
-  //});
+            //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+
             //澶村伐鍏锋爮浜嬩欢
             table.on('toolbar(mainTable)', function (obj) {
                 var checkStatus = table.checkStatus(obj.config.id);
                 switch (obj.event) {
+                    //涓嬫帹娲惧伐鍗�
                     case 'btn-Pushdown':
                         var checkStatus = table.checkStatus('mainTable')
-                        , data = checkStatus.data;
+                            , data = checkStatus.data;
                         ajaxLabelData = data;
                         var rows = '';
                         var HEntry = '';
-                          for (var i = 0; i < data.length; i++) {
-                                rows += data[i].hmainid.toString() + ',' ;
-                            
+                        for (var i = 0; i < data.length; i++) {
+                            rows += data[i].hmainid.toString() + ',';
                         }
 
-                        if (checkStatus.data.length < 1)
-                        {
+                        if (checkStatus.data.length < 1) {
                             layer.msg('璇烽�夋嫨涓�琛屾暟鎹笅鎺�');
-                        } else
-                        {
-                  
-				//椤甸潰灞�
-				layer.open({
-				               type: 2 //Page灞傜被鍨�
-				               ,area: ['100%', '100%']
-				               ,title: '鏂板娲惧伐鍗�'
-				               ,shade: 0.6 //閬僵閫忔槑搴�
-				               ,maxmin: false //鍏佽鍏ㄥ睆鏈�灏忓寲
-                    , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                    , content: ['../宸ュ簭娲惧伐鍗�/Sc_Add_ProcessSendWork.html?HInterID=' + data[0].hmainid.toString() + '&lentryid=' + rows.toString().substring(0, rows.length - 1), '&PlanBeginDate=' + data[0].璁″垝寮�宸ユ棩鏈�.toString(), '&PlanEndDate=' + data[0].璁″垝瀹屽伐鏃ユ湡.toString(), 'yes']
-                               , resize: false
-                             , cancel: function () {
-                                //$(".layui-btn").removeClass("layui-btn-disabled");
-                            }
-                             
-				           });
-  		
+                        } else {
+
+                            //椤甸潰灞�
+                            layer.open({
+                                type: 2 //Page灞傜被鍨�
+                                , area: ['100%', '100%']
+                                , title: '鏂板娲惧伐鍗�'
+                                , shade: 0.6 //閬僵閫忔槑搴�
+                                , maxmin: false //鍏佽鍏ㄥ睆鏈�灏忓寲
+                                , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                                , content: ['../宸ュ簭娲惧伐鍗�/Sc_Add_ProcessSendWork.html?HInterID=' + data[0].hmainid.toString() + '&lentryid=' + rows.toString().substring(0, rows.length - 1), '&PlanBeginDate=' + data[0].璁″垝寮�宸ユ棩鏈�.toString(), '&PlanEndDate=' + data[0].璁″垝瀹屽伐鏃ユ湡.toString(), 'yes']
+                                , resize: false
+                                , cancel: function () {
+                                    //$(".layui-btn").removeClass("layui-btn-disabled");
+                                }
+                            });
                         }
                         break;
-                    case 'add':
-                        var date = new Date();
-                        var day = date.getDate();
-                        var month = date.getMonth() + 1;
-                        var year = date.getFullYear();
-                        var shijian = year + "/" + month + "/" + day;
-                        layer.msg(shijian);
+                    //娣诲姞
+                    case 'btn-Add':
+                        //椤甸潰灞�-鑷畾涔�
+                        layer.open({
+                            type: 2,
+                            skin: 'layui-layer-rim', //鍔犱笂杈规
+                            title: '宸ュ簭璁″垝鍗�',
+                            closeBtn: 1,
+                            shift: 2,
+                            area: ['100%', '100%'],
+                            maxmin: true,
+                            content: '../../鐢熶骇宸ュ簭绠$悊/宸ュ簭璁″垝鍗�/Sc_ProcessPlanEdit.html?OperationType=1&linterid=0&HSouceBillType=0&linteridSub=-1',
+                            end: function () {
+                                //鍒锋柊椤甸潰,
+                                location.reload();
+                            },
+                            success: function (layero, index) {
+
+                            }
+                        });
                         break;
+                    //缂栬緫
+                    case 'btn-Edit':
+                        //鑾峰彇涓籭d浠ュ強瀛愰『搴廼d
+                        var linterid = checkStatus.data[0].hmainid;
+                        var linteridSub = checkStatus.data[0].hsubid;
+
+                        //椤甸潰灞�-鑷畾涔�
+                        layer.open({
+                            type: 2,
+                            skin: 'layui-layer-rim', //鍔犱笂杈规
+                            title: '宸ュ簭璁″垝鍗�',
+                            closeBtn: 1,
+                            shift: 2,
+                            area: ['100%', '100%'],
+                            maxmin: true,
+                            content: '../../鐢熶骇宸ュ簭绠$悊/宸ュ簭璁″垝鍗�/Sc_ProcessPlanEdit.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0&linteridSub=' + linteridSub,
+                            end: function () {
+                                //鍒锋柊椤甸潰,
+                                location.reload();
+                            },
+                            success: function (layero, index) {
+
+                            }
+                        });
+                        break;
+                    //涓嬫帹濮斿宸ュ崟
                     case 'btn-PushdownWWorder':
                         var checkStatus = table.checkStatus('mainTable')
                             , data = checkStatus.data;
@@ -280,9 +243,7 @@
                         var HEntry = '';
                         for (var i = 0; i < data.length; i++) {
                             rows += data[i].hmainid.toString() + ',';
-
                         }
-
                         if (checkStatus.data.length < 1) {
                             layer.msg('璇烽�夋嫨涓�琛屾暟鎹笅鎺�');
                         } else {
@@ -300,66 +261,151 @@
                                 , cancel: function () {
                                     //$(".layui-btn").removeClass("layui-btn-disabled");
                                 }
-
                             });
-
                         }
                         break;
-
+                    //瀹℃牳
+                    case 'btn-Audit': set_AuditBill();
+                        break;
+                    //鍙嶅鏍�
+                    case 'btn-DeAudit': set_DeAuditBill();
+                        break;
+                    //鍒犻櫎
+                    case 'btn-Delete': set_DeleteBill();
+                        break;
                 };
             });
 
-            //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
-            var index0 = layer.load(0, { shade: false });
-            $.ajax({
-                //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
-                url: GetWEBURL() + '/Sc_ProcessMangement/MES_Sc_ProcessPlanMain_Json',
-                type: "GET",
-                data: { "sWhere": sWhere },
-                success: function (data1) {
-                    if (data1.count == 1) {
-                        option.data = data1.data;
-                        table.render(option);
-                        layer.close(index0);
-                    } else {
-                        layer.close(index0);
-                        layer.alert(data1.code + data1.Message, { icon: 5 });
-                    }
-                }, error: function () {
-                    layer.close(index0);
-                    layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
-                }
-            }); 
-
             //閲嶇疆鎸夐挳
             form.on('submit(btnReSearch)', function (data) {
-                $("#HDate").val("");//寮�濮嬫棩鏈�
-                $("#HDate1").val("");//缁撴潫鏃ユ湡
-                $("#HOrderProcNO").val("");//璁㈠崟璺熻釜鍙�
-                $("#WorkCenter").val("");//鍗曟嵁鍙�
-                $("#btnSearch").click();
+                //娓呯┖杩囨护鏉′欢
+                set_ClearQuery();
             });
 
             //鏌ヨ鎸夐挳
-            form.on('submit(btnSearch)', function (data) {//閫夋嫨浠撲綅
-                var HDate = $("#HDate").val();//寮�濮嬫棩鏈�
-                var HDate1 = $("#HDate1").val();//缁撴潫鏃ユ湡
-                var HOrderProcNO = $("#HOrderProcNO").val();//璁㈠崟璺熻釜鍙�
-                var WorkCenter = $("#WorkCenter").val();//鍗曟嵁鍙�
-                if (HDate) {
-                    sWhere += " and HDate >= '" + HDate + "'";
-                }
-                if (HDate1) {
-                    sWhere += " and HDate <= '" + HDate1 + "'";
-                }
-                if (HOrderProcNO) {
-                    sWhere += " and 璁㈠崟璺熻釜鍙� like '%" + HOrderProcNO + "%'";
-                }
-                if (WorkCenter) {
-                    sWhere += " and HBillNo like '%" + WorkCenter + "%'";
-                }
-                var index = layer.load(0, { shade: false });
+            form.on('submit(btnSearch)', function (data) {
+                get_FastQuery();
+            });
+            //#endregion
+
+            //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶
+            // 鍒濆鍖栫晫闈�
+            function set_ClearBill() {
+                //鍒濆鍖栬〃鏍�
+                set_InitGrid();
+                //鏌ヨ
+                get_Display(sWhere);
+                //鍒濆鍖栨棩鏈�
+                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
+                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
+            }
+
+            //鍒濆鍖栬〃鏍�
+            function set_InitGrid() {
+                option = {
+                    elem: '#mainTable'
+                    , toolbar: '#toolbarDemo'
+                    , height: 'full-50'
+                    , page: true
+                    , cellMinWidth: 90
+                    , cols: [[
+                        { type: 'checkbox' }
+                        //{ field: 'hmainid', title: 'hmainid', sort: true, width: 165 }
+                        , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
+                        , { field: '鏃ユ湡', title: '鏃ユ湡', sort: true, width: 120, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
+                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true, width: 170 }
+                        //, { field: 'HBillStatus ', title: '鍗曟嵁鐘舵��', width: 105 }
+                        , { field: 'HMaterID', title: 'HMaterID' }
+                        ////, { field: 'hunitid', title: 'hunitid' }
+                        , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜 ', width: 115 }
+                        , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О' }
+                        ////, { field: 'hempid', title: 'hempid' }
+                        , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 100 }
+                        , { field: 'HUnitNumber', title: '鍗曚綅浠g爜' }
+                        , { field: '鍗曚綅', title: '鍗曚綅' }
+                        , { field: 'hunitid', title: 'hunitid' }
+                        , { field: '璁¢噺鍗曚綅浠g爜', title: '璁¢噺鍗曚綅浠g爜' }
+                        ////, { field: 'HCenterID', title: 'HCenterID' }
+                        , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅' }
+                        , { field: '鐢熶骇鏁伴噺', title: '鐢熶骇鏁伴噺' }
+                        ////, { field: 'hbomid', title: 'hbomid' }
+                        , { field: '璁″垝寮�宸ユ棩鏈�', title: '璁″垝寮�宸ユ棩鏈�' }
+                        , { field: '璁″垝瀹屽伐鏃ユ湡', title: '璁″垝瀹屽伐鏃ユ湡' }
+                        , { field: '鎽樿', title: '鎽樿' }
+                        , { field: '琛ㄥご澶囨敞', title: '琛ㄥご澶囨敞' }
+                        , { field: '鍐呴儴鍗曟嵁鍙�', title: '鍐呴儴鍗曟嵁鍙�' }
+                        , { field: 'hicmointerid', title: 'hicmointerid' }
+                        , { field: '浠诲姟鍗曞彿', title: '浠诲姟鍗曞彿' }
+                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�' }
+                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡' }
+                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�' }
+                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', templet: "<div>{{d.瀹℃牳鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹℃牳鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
+                        , { field: '淇敼浜�', title: '淇敼浜�' }
+                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡' }
+                        , { field: '鍏抽棴浜�', title: '鍏抽棴浜�' }
+                        ////, { field: 'hsubid', title: 'hsubid' }
+                        , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡' }
+                        , { field: '鍏抽棴绫诲瀷', title: '鍏抽棴绫诲瀷' }
+                        , { field: '浣滃簾浜�', title: '浣滃簾浜�' }
+                        , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡' }
+                        , { field: 'hsubid', title: 'hsubid', fixed: true, hide: true }
+                        , { field: '宸ュ簭璁″垝鍗曞彿', title: '宸ュ簭璁″垝鍗曞彿' }
+                        , { field: '宸ュ簭鍙�', title: '宸ュ簭鍙�' }
+                        , { field: 'hprocid', title: 'hprocid' }
+                        , { field: '宸ュ簭浠g爜', title: '宸ュ簭浠g爜' }
+                        , { field: '宸ュ簭', title: '宸ュ簭' }
+                        , { field: '鍔犲伐璇存槑', title: '鍔犲伐璇存槑' }
+                        , { field: '寮�宸ュ浐澶�', title: '寮�宸ュ浐澶�' }
+                        , { field: '寮�宸ュ浐鏁�', title: '寮�宸ュ浐鏁�' }
+                        , { field: 'HCenterID', title: 'HCenterID' }
+                        , { field: '宸ヤ綔涓績浠g爜', title: '宸ヤ綔涓績浠g爜' }
+                        , { field: '宸ヤ綔涓績', title: '宸ヤ綔涓績' }
+                        , { field: 'HDeptID', title: 'HDeptID' }
+                        , { field: '鍔犲伐杞﹂棿浠g爜', title: '鍔犲伐杞﹂棿浠g爜' }
+                        , { field: '鍔犲伐杞﹂棿', title: '鍔犲伐杞﹂棿' }
+                        , { field: 'HGroupID', title: 'HGroupID' }
+                        , { field: '鐝粍浠g爜', title: '鐝粍浠g爜' }
+                        , { field: '鐝粍鍚嶇О', title: '鐝粍鍚嶇О' }
+                        , { field: 'HWorkerID', title: 'HWorkerID' }
+                        , { field: '鎿嶄綔鍛樹唬鐮�', title: '鎿嶄綔鍛樹唬鐮�' }
+                        , { field: '鎿嶄綔鍛�', title: '鎿嶄綔鍛�' }
+                        , { field: 'HSourceID', title: 'HSourceID' }
+                        , { field: '璧勬簮浠g爜', title: '璧勬簮浠g爜' }
+                        , { field: '鐢熶骇璧勬簮', title: '鐢熶骇璧勬簮' }
+                        , { field: '璁″垝鏁伴噺', title: '璁″垝鏁伴噺' }
+                        , { field: '鍏宠仈鏁伴噺', title: '鍏宠仈鏁伴噺' }
+                        , { field: '鏃堕棿鍗曚綅', title: '鏃堕棿鍗曚綅' }
+                        , { field: '璁″垝鍔犲伐鏃堕棿', title: '璁″垝鍔犲伐鏃堕棿' }
+                        , { field: '宸ュ簭璁″垝寮�宸ユ棩鏈�', title: '宸ュ簭璁″垝寮�宸ユ棩鏈�' }
+                        , { field: '宸ュ簭璁″垝瀹屽伐鏃ユ湡', title: '宸ュ簭璁″垝瀹屽伐鏃ユ湡' }
+                        , { field: '鍑嗗鏃堕棿', title: '鍑嗗鏃堕棿' }
+                        , { field: '鎺掗槦鏃堕棿', title: '鎺掗槦鏃堕棿' }
+                        , { field: '杞Щ鏃堕棿', title: '杞Щ鏃堕棿' }
+                        , { field: '琛ㄤ綋澶囨敞', title: '琛ㄤ綋澶囨敞' }
+                        , { field: '鎵规', title: '鎵规' }
+                        , { field: '婧愬崟涓诲唴鐮�', title: '婧愬崟涓诲唴鐮�' }
+                        , { field: '婧愬崟瀛愬唴鐮�', title: '婧愬崟瀛愬唴鐮�' }
+                        , { field: '婧愬崟鍗曞彿', title: '婧愬崟鍗曞彿' }
+                        , { field: '婧愬崟绫诲瀷', title: '婧愬崟绫诲瀷' }
+                        , { field: '閿�鍞鍗曚富ID', title: '閿�鍞鍗曚富ID' }
+                        , { field: '閿�鍞鍗曞瓙ID', title: '閿�鍞鍗曞瓙ID' }
+                        , { field: '閿�鍞鍗曞彿', title: '閿�鍞鍗曞彿' }
+                        , { field: 'HBillType', title: 'HBillType' }
+                        , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷' }
+                        , { field: 'HBillSubType', title: 'HBillSubType' }
+                        , { field: 'HQtyDecimal', title: 'HQtyDecimal' }
+                        , { field: 'HPriceDecimal', title: 'HPriceDecimal' }
+
+                        //,{fixed: 'right', title:'鎿嶄綔', toolbar: '#barDemo', width:150}
+                    ]]
+                };
+            }
+
+            //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
+            function get_Display(sWhere) {
+                var index0 = layer.load(0, { shade: false });
                 $.ajax({
+                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                     url: GetWEBURL() + '/Sc_ProcessMangement/MES_Sc_ProcessPlanMain_Json',
                     type: "GET",
                     data: { "sWhere": sWhere },
@@ -367,35 +413,230 @@
                         if (data1.count == 1) {
                             option.data = data1.data;
                             table.render(option);
-                            layer.close(index);
-                            layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
+                            layer.close(index0);
                         } else {
-                            layer.close(index);
+                            layer.close(index0);
                             layer.alert(data1.code + data1.Message, { icon: 5 });
                         }
                     }, error: function () {
-                        layer.close(index);
+                        layer.close(index0);
                         layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
                     }
                 });
+            }
+
+            // 閲嶇疆杩囨护鏉′欢
+            function set_ClearQuery() {
+                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
+                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HBillNo").val("");//鍗曟嵁鍙�
+                $("#HDeptID").val("");//閮ㄩ棬
+                $("#MaterialCode").val("");//鐗╂枡浠g爜
+                $("#MaterialName").val("");//鐗╂枡鍚嶇О
+                $("#SpecificationModel").val("");//瑙勬牸鍨嬪彿
+                $("#HSourceBillNo").val("");//婧愬崟鍗曞彿
+                //$("#Warehouse").val("");//浠撳簱
+                $("#Hmaker").val("");//鍒跺崟浜�
+
+                sWhere = "";
+            }
+
+            // 蹇�熻繃婊�
+            function get_FastQuery() {
+                var HDate = $("#HBeginDate").val();//寮�濮嬫棩鏈�
+                var HDate1 = $("#HEndDate").val();//缁撴潫鏃ユ湡
+                var HBillNo = $("#HBillNo").val();//鍗曟嵁鍙�
+                var HDeptID = $("#HDeptID").val();//閮ㄩ棬
+                var MaterialCode = $("#MaterialCode").val();//鐗╂枡浠g爜
+                var MaterialName = $("#MaterialName").val();//鐗╂枡鍚嶇О
+                var SpecificationModel = $("#SpecificationModel").val();//瑙勬牸鍨嬪彿
+                var HSourceBillNo = $("#HSourceBillNo").val();//婧愬崟鍗曞彿
+                //var Warehouse = $("#Warehouse").val();//浠撳簱
+                var Hmaker = $("#Hmaker").val();//鍒跺崟浜�
+
+                if (HDate) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
+                }
+                if (HDate1) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + HDate1 + "'";
+                }
+                if (HBillNo) {
+                    sWhere += " and 鍗曟嵁鍙� like '%" + HBillNo + "%'";
+                }
+                if (HDeptID) {
+                    sWhere += " and 鍔犲伐杞﹂棿 like '%" + HDeptID + "%'";
+                }
+                if (MaterialCode) {
+                    sWhere += " and 鐗╂枡浠g爜 like '%" + MaterialCode + "%'";
+                }
+                if (MaterialName) {
+                    sWhere += " and 鐗╂枡鍚嶇О like '%" + MaterialName + "%'";
+                }
+                if (SpecificationModel) {
+                    sWhere += " and 瑙勬牸鍨嬪彿 like '%" + SpecificationModel + "%'";
+                }
+                if (HSourceBillNo) {
+                    sWhere += " and 婧愬崟鍗曞彿 like '%" + HSourceBillNo + "%'";
+                }
+                //if (Warehouse) {
+                //    sWhere += " and 鍙戣揣浠撳簱 like '%" + Warehouse + "%'";
+                //}
+                if (Hmaker) {
+                    sWhere += " and 鍒跺崟浜� like '%" + Hmaker + "%'";
+                }
+                get_Display(sWhere);
                 sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
-            });
+            }
 
+            //瀹℃牳
+            function set_AuditBill() {
+                var Checkstatus = table.checkStatus("mainTable");
 
-            //laydate.render({
-            //    elem: '#HDate'
-            //    , type: 'datetime'
-            //    , trigger: 'click'
-            //    , format:'yyyy-MM-dd HH:mm'
+                if (Checkstatus.data.length != 1) {
+                    return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+                }
+                else {
+                    var HInterID = Checkstatus.data[0].hmainid;//鑾峰彇id
+                    var HBillStatus = Checkstatus.data[0].HBillStatus;//鑾峰彇瀹℃牳鐘舵��
+
+                    if (HBillStatus != "1") {
+                        return layer.msg("褰撳墠鍗曟嵁涓嶄负鏈鏍哥姸鎬�!鏃犳硶瀹℃牳");
+                    }
+                    else {
+                        $.ajax({
+                            url: GetWEBURL() + "/Sc_ProcessMangement/CheckDeOAuditBill" //鏂规硶鎵�鍦ㄦ帶鍒跺櫒鍜屾柟娉曞悕
+                            , type: "GET"
+                            , data: { "HInterID": HInterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] }
+                            , success: function (result) {
+                                if (result.count == 1) {
+                                    layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
+                                        // 寰楀埌frame绱㈠紩
+                                        var index = layer.getFrameIndex(window.name);
+                                        //鍏抽棴褰撳墠frame
+                                        layer.close(index);
+                                        //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                        set_ClearBill();
+                                    });
+                                } else {
+                                    layer.alert(result.code + result.Message, { icon: 5 });
+                                }
+                            }, error: function () {
+                                layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                            }
+                        })
+                    }
+                }
+            }
+
+            //鍙嶅鏍�
+            function set_DeAuditBill() {
+                var Checkstatus = table.checkStatus("mainTable");
+
+                if (Checkstatus.data.length != 1) {
+                    return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+                }
+                else {
+                    var HInterID = Checkstatus.data[0].hmainid;//鑾峰彇id
+                    var HBillStatus = Checkstatus.data[0].HBillStatus;//鑾峰彇瀹℃牳鐘舵��
+
+                    if (HBillStatus == "1") {
+                        return layer.msg("褰撳墠鍗曟嵁涓烘湭瀹℃牳鐘舵��!鏃犳硶鍙嶅鏍�");
+                    }
+                    else {
+                        $.ajax({
+                            url: GetWEBURL() + "/Sc_ProcessMangement/CheckDeOAuditBill" //鏂规硶鎵�鍦ㄦ帶鍒跺櫒鍜屾柟娉曞悕
+                            , type: "GET"
+                            , data: { "HInterID": HInterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] }
+                            , success: function (result) {
+                                if (result.count == 1) {
+                                    layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
+                                        // 寰楀埌frame绱㈠紩
+                                        var index = layer.getFrameIndex(window.name);
+                                        //鍏抽棴褰撳墠frame
+                                        layer.close(index);
+                                        //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                        set_ClearBill();
+                                    });
+                                } else {
+                                    layer.alert(result.code + result.Message, { icon: 5 });
+                                }
+                            }, error: function () {
+                                layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                            }
+                        })
+                    }
+                }
+            }
+
+            //鍒犻櫎
+            function set_DeleteBill() {
+                var checkstatus = table.checkStatus("mainTable");
+
+                if (checkstatus.data.length != 1) {
+                    return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!")
+                }
+                else {
+                    layer.confirm("鏄惁纭鍒犻櫎?", {
+                        btn: ["纭畾", "鍙栨秷"]
+                        , btn1: function () {
+
+                            var ModRightNameDelete = "";//鍒犻櫎鏉冮檺
+                            var HInterID = checkstatus.data[0].hmainid;
+
+                            $.ajax({
+                                url: GetWEBURL() + '/Sc_ProcessMangement/DeleteProcessBill'
+                                , type: "GET"
+                                , data: { "HInterID": HInterID, "User": sessionStorage["HUserName"], "ModRightNameDelete": ModRightNameDelete }
+                                , success: function (result) {
+
+                                    if (result.count == 1) {
+                                        layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
+                                            // 寰楀埌frame绱㈠紩
+                                            var index = layer.getFrameIndex(window.name);
+                                            //鍏抽棴褰撳墠frame
+                                            layer.close(index);
+                                            //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                            window.location.reload();
+                                            ////閲嶈浇tree
+                                            //tree.reload('treeDepartment', {});
+                                        });
+                                    } else {
+                                        layer.alert(result.code + result.Message, { icon: 5 });
+                                    }
+                                }
+                            })
+
+                        }
+                    })
+                }
+            }
+
+            //#endregion
+
+            //鐩戝惉琛屽伐鍏蜂簨浠�
+            //table.on('tool(mainTable)', function(obj){
+            //  var data = obj.data;
+            //  //console.log(obj)
+            //  if(obj.event == 'del'){
+            //    layer.confirm('鐪熺殑鍒犻櫎琛屼箞', function(index){
+            //      obj.del();
+            //      layer.close(index);
+            //    });
+            //  } else if(obj.event == 'edit'){
+            //    layer.prompt({
+            //      formType: 2
+            //      ,value: data.HDate
+            //    }, function(value, index){
+            //      obj.update({
+            //        HDate: value
+            //      });
+            //      layer.close(index);
+            //      });
+            //      //layer.alert('鎴戞槸缂栬緫涓�');
+            //  }
             //});
 
-
-            //浠ヤ笂鏄痩ayui妯″潡
         });
-
-        
-
-
     </script>
 
 </body>
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\272\247\351\207\217\346\261\207\346\212\245\345\215\225/Sc_Add_ProductReportBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\272\247\351\207\217\346\261\207\346\212\245\345\215\225/Sc_Add_ProductReportBillList.html"
index d8f5c28..9685919 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\272\247\351\207\217\346\261\207\346\212\245\345\215\225/Sc_Add_ProductReportBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\272\247\351\207\217\346\261\207\346\212\245\345\215\225/Sc_Add_ProductReportBillList.html"
@@ -836,7 +836,7 @@
                     dataType: "json",//鏁版嵁绫诲瀷鍙互涓� text xml json  script  jsonp
                     async: false,
                     success: function (datas) {
-                        var LoadData = datas.data.Sc_ICMOBillWorkQtyStatus_Tmp;
+                        var LoadData = datas.data.Sc_ProcessReportSub;
                         var HQty = LoadData[0].HQty;
                         var HBadQty = LoadData[0].HBadQty;
                         var HWasterQty = LoadData[0].HWasterQty;
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_Add_ProductReportStepBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_Add_ProductReportStepBillList.html"
index 430b58f..a03bbf6 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_Add_ProductReportStepBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_Add_ProductReportStepBillList.html"
@@ -86,8 +86,7 @@
                     <form id="form0" class="layui-form" lay-filter="component-form-group" action="">
                         <div class="layui-card-header">
                             <div class="layui-btn-group">
-
-                                <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">淇濆瓨</button>
+                                <button type="button" id="Saver" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">淇濆瓨</button>
                                 <button type="button" id="VerIfySaver" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="VerIfySaver">瀹℃牳</button>
                                 <button type="button" id="ReVerIfySaver" class="layui-btn layui-btn-normal layui-btn-circle" lay-submit="" lay-filter="ReVerIfySaver">鍙嶅鏍�</button>
                                 <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">閫�鍑�</button>
@@ -347,7 +346,7 @@
     <script>
         //鑾峰彇鍙傛暟
         var HBillType = "";  //鍗曟嵁绫诲瀷
-        var HSourceInterID = ""; //婧愬崟涓诲唴鐮�
+        var HSourceInterID = ""; //婧愬崟涓诲唴鐮侊紙鐢熶骇鐘舵�佷复鏃惰〃涓诲唴鐮侊級
         var HSourceEntryID = "";  //婧愬崟瀛愬唴鐮�
         var HSourceBillNo = "";   //婧愬崟鍗曞彿
         var HSourceBillType = "";  //婧愬崟绫诲瀷
@@ -505,6 +504,7 @@
                                 $("#HSourceName").val(LoadData[0].HSourceName); //鐢熶骇璧勬簮
                                 $("#HSourceBillNo").val(LoadData[0].HICMOBillNo); //婧愬崟鍗曞彿锛堟殏鏃跺彇鍊艰鍗曠紪鍙凤級
                                 $("#HSourceInterID").val(LoadData[0].HSourceInterID); //婧愬崟涓诲唴鐮�(鍙栧�糎InterID)
+                                //$("#HSourceInterID").val(LoadData[0].HICMOInterID); //婧愬崟涓诲唴鐮�
                                 $("#HSourceEntryID").val(LoadData[0].HSourceEntryID); //婧愬崟瀛愬唴鐮�(婧愬崟琛屽彿)
                                 $("#HSourceBillType").val(HSourceBillType); //婧愬崟绫诲瀷
                                 $("#HGroupID").val(LoadData[0].HDeptID); //鐝粍ID
@@ -659,12 +659,12 @@
 
 
             //淇濆瓨鎻愪氦
-            form.on('submit(Saver)', function (data) {
+            form.on('submit(Saver)', function (objdata) {
                 if (!AllowLoadData())//鏁版嵁楠岃瘉
                 {
                     return false;
                 }
-                OverStepQty(data);
+                OverStepQty(objdata);
 
             });
 
@@ -846,7 +846,7 @@
 
 
             //楠岃瘉姹囨姤鏁伴噺鏄惁瓒呰繃璁″垝鏁伴噺
-            function OverStepQty(data) {
+            function OverStepQty(objdata) {
                 var sWhere = "";
                 if (OperationType == 3) //缂栬緫
                 {
@@ -855,7 +855,7 @@
                     HSourceBillNo = $("#HSourceBillNo").val();
                     HSourceBillType = $("#HSourceBillType").val();
                 }
-                sWhere = " where  HSourceID='" + $("#HSourceID").val() + "' and  HSourceInterID='" + HSourceInterID + "' and HSourceEntryID='" + HSourceEntryID + "' and HSourceBillNo='" + HSourceBillNo + "' and HSourceBillType='" + HSourceBillType + "' ";
+                sWhere = " where  HSourceID='" + $("#HSourceID").val() + "' and HProcID='" + $("#HProcID").val() + "' and  HSourceInterID='" + $("#HSourceInterID").val() + "' and HSourceEntryID='" + HSourceEntryID + "' and HSourceBillNo='" + HSourceBillNo + "' and HSourceBillType='" + HSourceBillType + "' ";
                 $.ajax({
                     url: GetWEBURL() + "/Sc_MESBeginStepWorkBill/GetMESOverStepQty",
                     type: "GET",
@@ -863,9 +863,9 @@
                     dataType: "json",//鏁版嵁绫诲瀷鍙互涓� text xml json  script  jsonp
                     async: false,
                     success: function (datas) {
-                        var LoadData = datas.data.Sc_ICMOBillWorkQtyStatus_Tmp;
+                        var LoadData = datas.data.Sc_ProcessReportSub;
                         var HQty = LoadData[0].HQty;
-                        var HBadCount = LoadData[0].HBadCount;
+                        var HBadCount = LoadData[0].HBadQty;
                         var HWasterQty = LoadData[0].HWasterQty;
                         var HWasterQty2 = LoadData[0].HWasterQty2;
                         var yessqty = HQty + HBadCount + HWasterQty + HWasterQty2;
@@ -882,7 +882,7 @@
                             });
                         }
                         else {
-                            Submit(data);
+                            Submit(objdata);
                         }
                     },
                     error: function (err) {
@@ -892,18 +892,19 @@
             }
 
             //鎻愪氦璇锋眰ajax
-            function Submit(data) {
-                if (data.field.HBadCount == "" || data.field.HBadCount == null) {
-                    data.field.HBadCount = 0;
+            function Submit(objdata) {
+                if (objdata.field.HBadCount == "" || objdata.field.HBadCount == null) {
+                    objdata.field.HBadCount = 0;
                 }
-                if (data.field.HWasterQty == "" || data.field.HWasterQty == null) {
-                    data.field.HWasterQty = 0;
+                if (objdata.field.HWasterQty == "" || objdata.field.HWasterQty == null) {
+                    objdata.field.HWasterQty = 0;
                 }
-                if (data.field.HWasterQty2 == "" || data.field.HWasterQty2 == null) {
-                    data.field.HWasterQty2 = 0;
+                if (objdata.field.HWasterQty2 == "" || objdata.field.HWasterQty2 == null) {
+                    objdata.field.HWasterQty2 = 0;
                 }
-                var sMainStr = JSON.stringify(data.field);
-                var sMainSub = sMainStr + ';' + refSav;
+                var sMainStr = JSON.stringify(objdata.field);
+                var sMainSub = sMainStr + ';'+ refSav;
+
 
                 $.ajax({
                     type: "POST",
@@ -1093,7 +1094,7 @@
                 layer.msg("浜у搧缂栫爜涓嶈兘涓虹┖锛�", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                 return Result = false;
             }
-            if ($("#HRelBeginDate").val() == '' || $("#HWorkBeginDate").val() == null) {
+            if ($("#HRelBeginDate").val() == '' || $("#HRelBeginDate").val() == null) {
                 layer.msg("寮�宸ユ椂闂翠笉鑳戒负绌猴紒", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                 return Result = false;
             }
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_ProductReportStepBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_ProductReportStepBillList.html"
index 71c0604..1a5d13f 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_ProductReportStepBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_ProductReportStepBillList.html"
@@ -125,6 +125,7 @@
         var HSourceID = ""; //璧勬簮ID
         var HICMOInterID = ""; //鐢熶骇璁㈠崟涓籌D
         var HICMOEntryID = ""; //鐢熶骇璁㈠崟瀛怚D
+        var HSourceInterID = ""; //鐢熶骇鐘舵�佷复鏃惰〃涓籌D
         var HSourceBillType = ""; //婧愬崟绫诲瀷
         var HProcID = ""; //宸ュ簭ID
         var SchWhere = ""; //鎸夐挳鏌ヨ鍙傛暟
@@ -136,6 +137,7 @@
             HICMOEntryID = data[0].HICMOEntryID;
             HMaker = data[0].HMaker;
             Czybm = data[0].Czybm;
+            HSourceInterID = data[0].HSourceInterID;
             HSourceBillType = data[0].HSourceBillType;
             HProcID = data[0].HProcID;
         }
@@ -237,7 +239,7 @@
             //鎶ュ伐骞冲彴杩涘叆(鏈夋簮鍗�)
             function set_AddNew()
             {
-                sWhere = " where b.HSourceID='" + HSourceID + "' and b.HSourceBillNo='" + workcode + "' and b.HSourceInterID='" + (HICMOInterID == "null" ? 0 : HICMOInterID) + "' and b.HSourceEntryID='" + (HICMOEntryID == "null" ? 0 : HICMOEntryID) + "' and a.HMaker='" + HMaker + "' ";
+                sWhere = " where b.HSourceID='" + HSourceID + "' and b.HSourceBillNo='" + workcode + "' and b.HSourceInterID='" + (HSourceInterID == "null" ? 0 : HSourceInterID) + "' and b.HSourceEntryID='" + (HICMOEntryID == "null" ? 0 : HICMOEntryID) + "' and a.HMaker='" + HMaker + "' ";
                 SchWhere = sWhere;
                 console.log(sWhere);
                 //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\345\274\200\345\267\245/Sc_Add_MESBeginStepWorkBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\345\274\200\345\267\245/Sc_Add_MESBeginStepWorkBillList.html"
index d6b32ca..0428426 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\345\274\200\345\267\245/Sc_Add_MESBeginStepWorkBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\345\274\200\345\267\245/Sc_Add_MESBeginStepWorkBillList.html"
@@ -89,8 +89,9 @@
                                 <button type="button" id="Saver" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">淇濆瓨</button>
                                 <button type="button" id="VerIfySaver" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="VerIfySaver">瀹℃牳</button>
                                 <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">閫�鍑�</button>
+                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="a_href" id="a_href">瀵煎嚭</button>
                             </div>
-
+                    
                         </div>
                         <div class="layui-card-body">
                             <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
@@ -584,6 +585,10 @@
                     success: function (d) {
                         $("#HBillNo").val(d.data[0].HBillNo);
                         $("#HInterID").val(0);
+                        //$("#HGroupID").val(sessionStorage["HGroupID"]); //榛樿鐝粍ID
+                        //$("#HGroupName").val(sessionStorage["HGroup"]); //榛樿鐝粍
+                        //$("#HEmpID").val(sessionStorage["HKeeperID"]);     //榛樿鎿嶄綔鍛業D
+                        //$("#HEmpName").val(sessionStorage["HKeeper"]);   //榛樿鎿嶄綔鍛�
                     }
                 });
             }
@@ -611,9 +616,6 @@
                     OperationType = 2;
                 }
             });
-
-
-          
 
 
             //淇濆瓨鎻愪氦
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\345\274\200\345\267\245/Sc_MESBeginStepWorkBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\345\274\200\345\267\245/Sc_MESBeginStepWorkBillList.html"
index ccfd4b6..1de5b21 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\345\274\200\345\267\245/Sc_MESBeginStepWorkBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\345\274\200\345\267\245/Sc_MESBeginStepWorkBillList.html"
@@ -194,7 +194,7 @@
                     sWhere += " and 璧勬簮浠g爜 like '%" + HSource + "%' or 璧勬簮鍚嶇О like '%" + HSource + "%'";
                 }
                 $.ajax({
-                    url: GetWEBURL() + '/Sc_MESBeginStepWorkBill/GetMESBeginStepWorkBillStaus',
+                    url: GetWEBURL() + '/Sc_MESBeginStepWorkBill/GetMESBeginStepWorkBill',
                     type: "GET",
                     data: { "sWhere": sWhere },
                     success: function (data1) {
@@ -293,6 +293,14 @@
             function get_Display()
             {
                 var ajaxLoad = layer.load();
+                var HDate = $("#HDate").val();//寮�濮嬫棩鏈�
+                var HDate1 = $("#HDate1").val();//缁撴潫鏃ユ湡
+                if (HDate) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
+                }
+                if (HDate1) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + HDate1 + "'";
+                }
                 //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
                 $.ajax({
                     url: GetWEBURL() + '/Sc_MESBeginStepWorkBill/GetMESBeginStepWorkBill',
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\346\213\206\347\256\261\345\215\225/Sc_PackSplitBill_Fast.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\346\213\206\347\256\261\345\215\225/Sc_PackSplitBill_Fast.html"
index ca5d05b..9f6edfe 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\346\213\206\347\256\261\345\215\225/Sc_PackSplitBill_Fast.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\346\213\206\347\256\261\345\215\225/Sc_PackSplitBill_Fast.html"
@@ -503,76 +503,24 @@
             var checkStatus = table.checkStatus('wl-table')
             , data = checkStatus.data;
             var sInterID = $('#HInterID').val()
-            var sMaterID = data[0].HMaterID
-            var sBillType = '1202'
-            var sAuxPropID = data[0].HAuxPropID
-            //var sMTONo = data[0].HMTONo
-            var sMTONo = ''
-            var sSourceInterID = data[0].HSourceInterID
-            var sSourceEntryID = data[0].HSourceEntryID
-            var HBillNo = $("#HBillNo").val()
-            var sMouldManagerCtl = 'N'
-            var sFIFOCtl = 'N'
+            var HBarCode = data[0].HBarCode
             $.ajax(
                {
                    type: "Get",
-                   //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/Delete_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                    url: GetWEBURL() + "/ProductIn/Delete_Json_AN",
+                    url: GetWEBURL() + "/PackSplit/Delete",
                    async: true,
-                   data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": sBillType, },
+                    data: { "HInterID": sInterID, "HBarCode": HBarCode, "HBillType": '3784'},
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜�
-                         //  table.render({
-                         //      elem: '#wl-table'
-                         //      //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Mate_Webs_Json'
-                         //      , url: GetWEBURL() + '/ProductIn/DisPlayBarCodeList_Json'
-                         //, cellMinWidth: 80
-                         //, toolbar: '#toolbarDemo'
-                         //      , where: { HBillID: sInterID, HBillNo: HBillNo, HBillType: '1202', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl}
-                         //, cols: [[
-                         //       { type: 'radio' }
-                         //       , { field: 'HQty', title: '鏁伴噺', width: 80 }
-                         //       , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 80 }
-                         //       , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 100 }
-                         //       , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
-                         //       , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 100 }
-                         //       , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 100 }
-                         //       , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 100 }
-                         //       , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 100 }
-                         //       , { field: 'HBatchNo', title: '鎵规', width: 100 }
-                         //       , { field: 'HAuxPropID', title: '杈呭姪灞炴��', width: 100 }
-                         //       , { field: 'HMTONo', title: '璁″垝璺熻釜鍙�', width: 100 }
-                         //       , { field: 'HMaterID', title: '鐗╂枡ID', width: 100 }
-                         //]]
-                         //, height: 500
-                         //  })
-                           table.render({
-                               elem: '#wl-table'
-                               //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
-                               , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
-                               , toolbar: '#toolbarDemo'
-                               , defaultToolbar: []
-                               , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
-                               , cols: [[
-                                   { type: 'radio' }
-                                   , { field: 'HQty', title: '鏁伴噺', width: 150 }
-                                   , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 150 }
-                                   , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
-                                   , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
-                                   , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
-                                   , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
-                                   , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
-                                   , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
-                                   , { field: 'HBatchNo', title: '鎵规', width: 150 }
-                               ]]
-                               // , data: [linterid]
-                               // , page: true
-                               , height: 500
-                               , done: function () {
-                                   layer.closeAll("loading");
-                               }
-                           })
+                           layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
+                               // 寰楀埌frame绱㈠紩
+                               var index = layer.getFrameIndex(window.name);
+                               //鍏抽棴褰撳墠frame
+                               layer.close(index);
+                               //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                               window.location.reload();
+                           });
                        }
                        else {
                            layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
@@ -586,37 +534,24 @@
 
         //鎻愪氦
         form.on('submit(Saver)', function (data) {//鎻愪氦
-            //debugger;
-            if ($("#HExplanation").val() == "") {
-                if ($("#HWHNAME").val() == "瀹藉箙鎴愬搧浠揘EW" || $("#HWHNAME").val() == "鏍锋湰浠揘EW") {
-                    $("#HWHNAME").val("");
-                    $("#HWHID").val("");
-                    layer.msg("璇锋壂MES搴撲綅鐮侊紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                    return;
-                }
-                else
-                {
-                    $("#HExplanation").val($("#HWHNAME").val());
-                }
-            }
-            var sMainStr = JSON.stringify(data.field);
-            var sSubStr = table.cache['wl-table'];
-            //var sSourceType = $("#HBillType").val();
-            var sSourceType = "3711";
+            var sInterID = $('#HInterID').val()
+            var sBillNo = $("#HBillNo").val()
+            var HTBarCode = $('#HTBarCode').val()
+            var HOrgID = sessionStorage["OrganizationID"]
+            var sMaker = sessionStorage["HUserName"]
             if (AllowLoadData(sSubStr) != false)//闈炵┖楠岃瘉
             {
                 layer.load(3);
                 $.ajax(
                 {
                     type: "POST",
-                    //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/set_SaveProductInBill_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                    url: GetWEBURL() + "/ProductIn/set_SaveProductInBill_Json",
+                        url: GetWEBURL() + "/PackSplit/set_SavePackSplitBill_Json",
                     async: true,
-                    data: { "oMain": sMainStr  },
-                    dataType: "json",
+                        data: { "sInterID": sInterID, "HBillType": '3784', "sBillNo": sBillNo, "HTBarCode": HTBarCode, "sMaker": sMaker, "HOWNERID": HOrgID },
+                    //dataType: "json",
                     success: function (data) {
                         if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜�
-                            layer.confirm("鐢熸垚浜у搧鍏ュ簱鍗�" + data.Message + $("#HBillNo").val(), {
+                            layer.confirm("鐢熸垚鎷嗙鍗�" + data.Message + $("#HBillNo").val(), {
                                 icon: 1, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['鏂板'],
                                 btn2: function () {
                                     //parent.layui.admin.events.closeThisTabs();鍏抽棴椤电
@@ -649,73 +584,13 @@
             }
         });
 
-        //鎵潯鐮�
-            $('#HBarCode').on('keydown', function (event) {  //鎵潯鐮�
-                var sOldBarCode = $('#HBarCode').val()
-                var HDeleteFlag = sOldBarCode.substring(0, 1);
-                var sBarCode = sOldBarCode.slice(1);
-                var sSubStr = table.cache['wl-table'];
+        //鎵弿鎷嗙鏉$爜
+            $('#HBarCode').on('keydown', function (event) {  //鎵弿鎷嗙鏉$爜
                 var sInterID = $("#HInterID").val()
                 var sBillNo = $("#HBillNo").val()
-                var sQty = $("#HQty").val()
-                var sHBillType = $("#HBillType").val()  //婧愬崟绫诲瀷
-                var sBillType = '1202'
-                var sHWHID = $("#HWHID").val()
-                var sHSPID = $("#HStockPlaceID").val()
-                var sSourceBillNo = $("#HSourceBillNo").val()
+                var HBarCode = $('#HBarCode').val()
+                var HTBarCode = $('#HTBarCode').val()
                 if (event.keyCode == 13) {
-                if (HDeleteFlag == "*")
-                {
-                    if (sBarCode != "") {
-                        $('#HBarCode').val("");
-                    }
-                    var sBarCode = sOldBarCode.slice(1);
-                    $.ajax(
-                        {
-                            type: "Get",
-                            url: GetWEBURL() + "/ProductIn/Delete_Json",
-                            async: true,
-                            data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": sBillType, "HBarCode": sBarCode},
-                            dataType: "json",
-                            success: function (data) {
-                                if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜�
-                                    table.render({
-                                        elem: '#wl-table'
-                                        //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
-                                        , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
-                                        , toolbar: '#toolbarDemo'
-                                        , defaultToolbar: []
-                                        , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
-                                        , cols: [[
-                                            { type: 'radio' }
-                                            , { field: 'HQty', title: '鏁伴噺', width: 150 }
-                                            , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 150 }
-                                            , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
-                                            , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
-                                            , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
-                                            , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
-                                            , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
-                                            , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
-                                            , { field: 'HBatchNo', title: '鎵规', width: 150 }
-                                        ]]
-                                        // , data: [linterid]
-                                        // , page: true
-                                        , height: 500
-                                        , done: function () {
-                                            layer.closeAll("loading");
-                                        }
-                                    })
-                                }
-                                else {
-                                    layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                                }
-                            },
-                            error: function (err) {
-                                layer.msg('閿欒' + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                            }
-                        });
-                }
-                else {
                     var sBarCode = $('#HBarCode').val()
                     //var Flag = sessionStorage["SourceFlag"];
                     if (sQty == "") {
@@ -730,110 +605,41 @@
                         if (sBarCode != "") {
                             $('#HBarCode').val("");
                         }
-                        if (sQty != "") {
-                            $('#HQty').val("");
-                        }
-                        if (sHWHID == "184154") {
-                            if (sHSPID == "0") {
-                                layer.msg("浠撲綅涓虹┖锛岃閫夋嫨浠撲綅锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                                return false;
-                            }
-                        }
-                        //if (AllowLoadData(sSubStr, 'HBarCode') != false) {//闈炵┖楠岃瘉
                         $.ajax({
-                            //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/get_CheckTypeByBarCode_Json",
-                            url: GetWEBURL() + "/ProductIn/get_CheckTypeByBarCode_Json",
+                            url: GetWEBURL() + "/PackSplit/get_CheckTypeByBarCode_Json",
                             type: "GET",
-                            data: { "sCode": sBarCode, "sInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": HSourceFlag, "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"] },
+                            data: { "HBarCode": HBarCode, "sInterID": sInterID, "HBillType": '3784', "sBillNo": sBillNo, "HTBarCode": HTBarCode, "sMaker": sessionStorage["HUserName"], "HOWNERID": sessionStorage["OrganizationID"] },
                             success: function (result) {
                                 //debugger;
                                 playSound1();
                                 if (result.count == 1) {
-                                    if (result.data.HBarType == '浠撳簱鏉$爜') {
-                                        $("#HWHNAME").val(result.data.HWhName);
-                                        $("#HWHID").val(result.data.HWhID);
-                                        $("#HStockPlaceName").val("");
-                                        $("#HNote").val(";涓�閿壂鐮佷粨搴撴潯鐮�");
-                                        element.tabChange('tab-ProductlnBill', '2');  //璺宠浆椤电
-                                    }
-                                    else if (result.data.HBarType == '浠撲綅鏉$爜') {
-                                        $("#HStockPlaceName").val(result.data.HSPName);
-                                        $("#HStockPlaceID").val(result.data.HSPID);
-                                        $("#HWHNAME").val(result.data.HWhName);
-                                        $("#HWHID").val(result.data.HWhID);
-                                        $("#HNote").val(";涓�閿壂鐮佷粨浣嶆潯鐮�");
-                                        element.tabChange('tab-ProductlnBill', '2');//璺宠浆椤电
-                                    }
-                                    else if (result.data.HBarType == '閮ㄩ棬鏉$爜') {
-                                        $("#HDeptName").val(result.data.HDeptName);
-                                        $("#HDeptID").val(result.data.HDeptID);
-                                        $("#HNote").val(";涓�閿壂鐮侀儴闂ㄦ潯鐮�");
-                                        element.tabChange('tab-ProductlnBill', '2');//璺宠浆椤电
-                                    }
-                                    else if (result.data.HBarType == '婧愬崟鏉$爜') {
-                                        $("#HSupName").val(result.data.HSupName);
-                                        $("#HSupID").val(result.data.HSupID);
-                                        $("#HDeptName").val(result.data.HDeptName);
-                                        $("#HDeptID").val(result.data.HDeptID);
-                                        $("#HSourceBillNo").val(result.data.HSourceBillNo);
-                                        HSourceFlag = true;
-                                        //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
-                                        //if (result.data.HSourceBillType == "3711") {
-                                        //    $("#HBillType").val("3711");
-                                        //}
-                                        //else {
-                                        //    $("#HBillType").val("-1");
-                                        //}
                                         $("#HNote").val(";涓�閿壂鐮佹簮鍗曟潯鐮�");
                                         element.tabChange('tab-ProductlnBill', '3');
                                     }
                                     else {
-                                        if (HSourceFlag == "true") {
-                                            element.tabChange('tab-ProductlnBill', '3');
-                                        }
-                                        else {
-                                            $("#HSupName").val(result.data.HSupName);
-                                            $("#HSupID").val(result.data.HSupID);
-                                            //$("#HDeptName").val(result.data.HDept);
-                                            //$("#HDeptID").val(result.data.HDeptID);
-                                            $("#HSourceBillNo").val(result.data.HSourceBillNo);
-                                            HSourceFlag = true;
-                                            //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
-                                            //if (result.data.HSourceBillType == "3711") {
-                                            //    $("#HBillType").val("3711");
-
-                                            //}
-
-                                            //else {
-                                            //    $("#HBillType").val("-1");
-                                            //}
                                             $("#HNote").val(";鐗╂枡鏉$爜");
                                             element.tabChange('tab-ProductlnBill', '3');
-                                        }
+                                        //}
                                     }
-                                    //$("#HSupID").val(result.data.HSupID);
-                                    //$("#HSupName").val(result.data.HSupName);
-                                    //$("#HDeptID").val(result.data.HDeptID);
-                                    //$("#HDeptName").val(result.data.HDeptName);
                                     layer.load(3)
                                     table.render({
                                         elem: '#wl-table'
-                                        //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
-                                        , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
+                                        , url: GetWEBURL() + '/PackSplitBill/GetBillEntry_TmpList_Pack'
                                         , toolbar: '#toolbarDemo'
                                         , defaultToolbar: []
-                                        , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
+                                        , where: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '3784', sWhere: '' }
                                         , cols: [[
                                             { type: 'radio' }
-                                            , { field: 'HQty', title: '鏁伴噺', width: 150 }
-                                            , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 150 }
+                                            , { field: 'HPieceQty', title: '浠舵暟', width: 150 }
+                                            , { field: 'HBarCode', title: '瀛愭潯鐮佺紪鍙�', width: 150 }
                                             , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
                                             , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
                                             , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
+                                            , { field: 'HMaterID', title: '鐗╂枡ID', width: 150 }
+                                            , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
                                             , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
                                             , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
-                                            , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
-                                            , { field: 'HBatchNo', title: '鎵规', width: 150 }
+                                            , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 150 }
                                         ]]
                                         // , data: [linterid]
                                         // , page: true
@@ -842,11 +648,6 @@
                                             layer.closeAll("loading");
                                         }
                                     });
-                                }
-                                else {
-                                    playSound();
-                                    layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                                }
                                 layer.closeAll("loading");
                             },
                             error: function (err) {
@@ -855,7 +656,6 @@
                                 console.log(err);
                             }
                         });
-                    }
                 }
             });
 
@@ -882,8 +682,8 @@
                 audio.play();
             }
 
-        //鎵簮鍗�
-            $('#HTBarCode').on('keydown', function (event) {   //鎵簮鍗�
+        //鎵嫋鏉$爜
+            $('#HTBarCode').on('keydown', function (event) {   
             var HTBarCode = $('#HTBarCode').val()
             var sInterID = $("#HInterID").val()
             var sBillNo = $("#HBillNo").val()
@@ -917,10 +717,10 @@
                                 , url: GetWEBURL() + '/PackSplitBill/GetBillEntry_TmpList_Pack'
                                 , toolbar: '#toolbarDemo'
                                 , defaultToolbar: []
-                              , where: { HBillID: sInterID, HBillType: '3784', sWhere: '' }
+                                , where: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '3784', sWhere: '' }
                               , cols: [[
                                   { type: 'radio' }
-                                , { field: 'HQty', title: '鏁伴噺', width: 150 }
+                                , { field: 'HPieceQty', title: '浠舵暟', width: 150 }
                                 , { field: 'HBarCode', title: '瀛愭潯鐮佺紪鍙�', width: 150 }
                                 , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
                                 , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
@@ -929,7 +729,7 @@
                                 , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
                                 , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
                                 , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
-                                , { field: 'HBarCodeQty', title: '鏉$爜鏁伴噺', width: 150 }
+                                , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 150 }
                               ]]
                                 // , data: [linterid]
                                 // , page: true
@@ -1059,19 +859,19 @@
         //    layer.msg("璇峰厛鎵簮鍗�!", { icon: 5 });
         //    return false;
         //}
-        if($("#HDeptName").val()=='')
-        {
-            layer.msg("閮ㄩ棬娌℃湁閫夋嫨", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-            return false;
-        }
-        if ($("#HSecManager").val() == '') {
-            layer.msg("楠屾敹浜烘病鏈夐�夋嫨", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-            return false;
-        }
-        if ($("#HKeeper").val() == '') {
-            layer.msg("淇濈浜烘病鏈夐�夋嫨", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-            return false;
-        }
+        //if($("#HDeptName").val()=='')
+        //{
+        //    layer.msg("閮ㄩ棬娌℃湁閫夋嫨", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+        //    return false;
+        //}
+        //if ($("#HSecManager").val() == '') {
+        //    layer.msg("楠屾敹浜烘病鏈夐�夋嫨", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+        //    return false;
+        //}
+        //if ($("#HKeeper").val() == '') {
+        //    layer.msg("淇濈浜烘病鏈夐�夋嫨", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+        //    return false;
+        //}
         //if ($("#HWHNAME").val() == '') {
         //    layer.msg("浠撳簱娌℃湁閫夋嫨!", { icon: 5 });
         //    return false;
@@ -1084,31 +884,31 @@
             layer.msg("閿欒鐨勫唴鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
             return false;
         }
-        if (typeof (sSubStr) == "undefined")
-        {
-            layer.msg("娌℃湁鐗╂枡鏄庣粏璁板綍", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-            return false;
-        }
-        if (!typeof (sSubStr) == "undefined") {
-            //for (var i = 0; i <= sSubStr.length - 1; i++) {  //鍒ゆ柇鎵爜鏁伴噺涓嶈兘澶т簬搴旀敹鏁伴噺
-            //    if (parseFloat(sSubStr[i].HQtyMust) > 0) {
-            //        if (parseFloat(sSubStr[i].HQty) > parseFloat(sSubStr[i].HQtyMust))
-            //        {
-            //            layer.msg("鏁伴噺涓嶈兘澶т簬搴旀敹鏁伴噺", { icon: 5, btn: ['纭畾'], time: 100000, offset: 't' }); 
-            //            return false;
-            //        }
-            //    }
-            //}
-            for (var i = 0; i <= sSubStr.length - 1; i++) {   //鍒ゆ柇鎵爜鏁伴噺涓嶈兘涓�0
-                if (parseFloat(sSubStr[i].HQty) > 0) {
-                    s = 1;
-                }
-            }
-            if (s == 0) {
-                layer.msg("浜у搧鍏ュ簱璁板綍鏈壂鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                return false;
-            }
-        }
+        //if (typeof (sSubStr) == "undefined")
+        //{
+        //    layer.msg("娌℃湁鐗╂枡鏄庣粏璁板綍", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+        //    return false;
+        //}
+        //if (!typeof (sSubStr) == "undefined") {
+        //    //for (var i = 0; i <= sSubStr.length - 1; i++) {  //鍒ゆ柇鎵爜鏁伴噺涓嶈兘澶т簬搴旀敹鏁伴噺
+        //    //    if (parseFloat(sSubStr[i].HQtyMust) > 0) {
+        //    //        if (parseFloat(sSubStr[i].HQty) > parseFloat(sSubStr[i].HQtyMust))
+        //    //        {
+        //    //            layer.msg("鏁伴噺涓嶈兘澶т簬搴旀敹鏁伴噺", { icon: 5, btn: ['纭畾'], time: 100000, offset: 't' }); 
+        //    //            return false;
+        //    //        }
+        //    //    }
+        //    //}
+        //    for (var i = 0; i <= sSubStr.length - 1; i++) {   //鍒ゆ柇鎵爜鏁伴噺涓嶈兘涓�0
+        //        if (parseFloat(sSubStr[i].HQty) > 0) {
+        //            s = 1;
+        //        }
+        //    }
+        //    if (s == 0) {
+        //        layer.msg("浜у搧鍏ュ簱璁板綍鏈壂鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+        //        return false;
+        //    }
+        //}
         else
         {
             return true;
diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html"
index de102f8..2194eb9 100644
--- "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html"
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html"
@@ -812,9 +812,9 @@
 
             //淇濆瓨鎻愪氦
             form.on('submit(btnSave)', function (data) {//鎻愪氦
-                //if (AllowLoadData(data)) {
+                if (AllowLoadData(data)) {
                 set_AddNew(data);
-                //}
+                }
             });
 
             //閫夋嫨涓嶈壇鍘熷洜
diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sb_EquipRepairSendWorkBillEdit.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sb_EquipRepairSendWorkBillEdit.html"
new file mode 100644
index 0000000..9e0cd26
--- /dev/null
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sb_EquipRepairSendWorkBillEdit.html"
@@ -0,0 +1,750 @@
+锘�<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8" />
+    <title>璁惧缁翠慨娲惧伐鍗�</title>
+    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
+    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
+    <script src="../../../layuiadmin/layui/layui.js"></script>
+    <script src="../../../layuiadmin/Scripts/json2.js"></script>
+    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
+    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
+    <script src="../../../layuiadmin/PubCustom.js"></script>
+    <style>
+        .main-btn { /*澶撮儴涓绘寜閽�*/
+            padding: 0 2px; /*璋冩暣鎸夐挳宸﹀彸绌洪殭澶у皬*/
+            height: 30px;
+            line-height: 30px;
+        }
+
+        .btn-title {
+            font-size: 16px;
+        }
+    </style>
+</head>
+<body>
+    <div class="layui-fluid" style="padding: 0;">
+        <div class="layui-card" style="padding: 2px;background-color: #efefef;">
+            <div class="layui-card-body" style="padding: 1px;">
+                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
+                    <div style="padding: 10px;">
+                        <button class="layui-btn layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
+                            <i class="layui-icon layui-icon-print layuiadmin-button-btn"><span class="btn-title">棰勮</span></i>
+                        </button>
+                        <button class="layui-btn layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
+                            <i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"><span class="btn-title">鏂板</span></i>
+                        </button>
+                        <button class="layui-btn layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
+                            <i class="layui-icon layui-icon-edit layuiadmin-button-btn"><span class="btn-title">淇敼</span></i>
+                        </button>
+                        <button class="layui-btn layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">
+                            <i class="layui-icon layui-icon-delete layuiadmin-button-btn"><span class="btn-title">淇濆瓨</span></i>
+                        </button>
+                    </div>
+                    <div class="layui-tab" lay-filter="tab-POStockInBill">
+                        <ul class="layui-tab-title" lay-filter="tab-all">
+                            <li lay-id="1" style="padding:1px;" class="layui-this">鍩烘湰淇℃伅</li>
+                        </ul>
+                        <div class="layui-tab-content">
+                            <!--鍩烘湰淇℃伅-->
+                            <div class="layui-tab-item layui-show">
+                                <div class="layui-form-item" style="padding-top: 10px;">
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">鍗曟嵁鍙�</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <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">
+                                            <label class="layui-form-label" style="width: 85px;">鏃ユ湡</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 32px;">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">鍐呴儴鍗曟嵁鍙�</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" lay-verify="HInnerBillNo" name="HInnerBillNo" id="HInnerBillNo">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">缁翠慨閮ㄩ棬</label>
+                                            <div class="layui-input-block" style="margin-left: 77px;">
+                                                <input type="text" class="layui-input" lay-verify="HDeptIDName" name="HDeptIDName" id="HDeptIDName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0">
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHDeptID" id="btnHDeptID" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">缁翠慨浜�</label>
+                                            <div class="layui-input-block" style="margin-left: 77px;">
+                                                <input type="text" class="layui-input" name="HEmpIDName" lay-verify="HEmpIDName" id="HEmpIDName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <input type="hidden" class="layui-input" name="HEmpID" lay-verify="HEmpID" id="HEmpID" value="0">
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHEmpID" id="btnHEmpID" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 70px;">璐熻矗浜�</label>
+                                            <div class="layui-input-block" style="margin-left: 57px;">
+                                                <input type="text" class="layui-input" name="HManagerIDName" lay-verify="HManagerIDName" id="HManagerIDName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <input type="hidden" class="layui-input" name="HManagerID" lay-verify="HManagerID" id="HManagerID" value="0">
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHManagerID" id="btnHManagerID" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">璁惧</label>
+                                            <div class="layui-input-block" style="margin-left: 87px;">
+                                                <input type="text" class="layui-input" name="HEquipIDName" lay-verify="HEquipIDName" id="HEquipIDName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <input type="hidden" class="layui-input" name="HEquipID" lay-verify="HEquipID" id="HEquipID" value="0">
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHEquipID" id="btnHEquipID" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 75px;">缁翠慨椤圭洰</label>
+                                            <div class="layui-input-block" style="margin-left: 67px;">
+                                                <input type="text" class="layui-input" name="HRepairIDName" lay-verify="HRepairIDName" id="HRepairIDName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <input type="hidden" class="layui-input" name="HRepairID" lay-verify="HRepairID" id="HRepairID" value="0">
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHRepairID" id="btnHRepairID" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 70px;">缁翠慨鍐呭</label>
+                                            <div class="layui-input-block" style="margin-left: 100px;">
+                                                <input type="text" class="layui-input" name="HRepairContent" lay-verify="HRepairContent" id="HRepairContent" value="" onmouseover="this.title=this.value">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">棰勮缁翠慨寮�濮嬫棩鏈�</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="date" class="layui-input" lay-verify="HRepairPlanBeginDate" name="HRepairPlanBeginDate" id="HRepairPlanBeginDate" style="padding-left: 32px;">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">棰勮缁翠慨缁撴潫鏃ユ湡</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="date" class="layui-input" lay-verify="HRepairPlanEndDate" name="HRepairPlanEndDate" id="HRepairPlanEndDate" style="padding-left: 32px;">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline" style="width:13%">
+                                            <label class="layui-form-label" style="width: 60px;">鏃堕棿鍗曚綅</label>
+                                            <div class="layui-input-block" style="margin-left: 95px;">
+                                                <input type="text" class="layui-input" name="HCycleUnit" lay-verify="HCycleUnit" style="width:100%" id="HCycleUnit" value="" onmouseover="this.title=this.value">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline" >
+                                            <label class="layui-form-label" style="width: 100px;">璁″垝缁翠慨宸ユ椂</label>
+                                            <div class="layui-input-block" style="margin-left: 130px;">
+                                                <input type="text" class="layui-input" name="HPlanTimes" lay-verify="HPlanTimes" style="width:30%" id="HPlanTimes" value="" onmouseover="this.title=this.value">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline" style="width: 56%;">
+                                            <label class="layui-form-label" style="width: 85px;">鎽樿</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" name="HExplanation" id="HExplanation" lay-verify="HExplanation" placeholder="璇疯緭鍏ュ唴瀹�" onmouseover="this.title=this.value">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline" style="width: 56%;">
+                                            <label class="layui-form-label" style="width: 85px;">澶囨敞</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="hidden" class="layui-input" name="HMaker" id="HMaker" lay-verify="HMaker" value="">
+                                                <input type="hidden" class="layui-input" name="HUpDater" id="HUpDater" lay-verify="HUpDater" value="">
+                                                <input type="text" class="layui-input" name="HRemark" id="HRemark" lay-verify="HRemark" placeholder="璇疯緭鍏ュ唴瀹�" onmouseover="this.title=this.value">
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
+                    <script type="text/html" id="toolbarDemo">
+                        <div class="layui-btn-container">
+                            <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>
+                        </div>
+                    </script>
+                </form>
+            </div>
+        </div>
+    </div>
+    <script type="text/html" id="barDemo">
+        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">缂栬緫</a>-->
+        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
+    </script>
+
+    <script>
+
+        layui.config({
+            base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
+        }).extend({
+            index: 'lib/index' //涓诲叆鍙fā鍧�
+        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
+
+            //#region 鍏叡鍙橀噺
+
+            var $ = layui.$
+                , admin = layui.admin
+                , layer = layui.layer
+                , table = layui.table
+                , form = layui.form
+                , element = layui.element;
+
+            var option = [];
+            //#endregion
+
+            //#region 杩涘叆椤甸潰鍗冲姞杞�
+
+            var params = getUrlVars();
+            var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷  娣诲姞 淇濆瓨
+            var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
+            var HSouceBillType = params[params[2]];  //浠庡崟鎹幏鍙� 婧愬崟绫诲瀷
+            var linteridSub = params[params[3]];  //浠庡弬鏁拌幏鍙� 瀛愯〃绾у埆
+
+            //鍒ゆ柇鏄惁鏂板
+            if (linterid == null || linterid == 0) {
+                OperationType = 1;
+                linteridSub = -1;
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    data: { "HBillType": '3909' },
+                    success: function (d) {
+                        //璧嬪��
+                        $("#HInterID").val(d.data[0].HInterID);
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                    }
+                });
+            }
+            else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
+                RoadBillMain(linterid, linteridSub);
+            }
+
+            //鍒濆鍖栫晫闈�
+            set_ClearBill();
+
+            //#endregion
+
+            //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+
+            //鐐瑰嚮缁翠慨閮ㄩ棬鎸夐挳
+            form.on("submit(btnHDeptID)", function () {
+                CheckHDeptID();
+            })
+
+            //鐐瑰嚮缁翠慨浜烘寜閽�
+            form.on("submit(btnHEmpID)", function () {
+                CheckHEmpID();
+            })
+            
+            //鐐瑰嚮璐熻矗浜烘寜閽�
+            form.on("submit(btnHManagerID)", function () {
+                CheckHManagerID();
+            })
+            
+            //鐐瑰嚮璁惧鎸夐挳
+            form.on("submit(btnHEquipID)", function () {
+                CheckHEquipID();
+            })
+
+            //鐐瑰嚮缁翠慨椤圭洰鎸夐挳
+            form.on("submit(btnHRepairID)", function () {
+                CheckHRepairID();
+            })
+
+            //淇濆瓨鎻愪氦
+            form.on('submit(btnSave)', function (data) {//鎻愪氦
+                //涓虹┖楠岃瘉
+                if (AllowLoadData(data)) {
+                    set_AddNew(data);
+                }
+            });
+
+            //#region 瀛愯〃浜嬩欢
+
+            //澶村伐鍏锋爮浜嬩欢
+            table.on('toolbar(mainTable)', function (obj) {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                //鏂板琛岃〃鏍兼暟鎹�
+                var NewRow = {
+                    "瀛愮淮淇」鐩�": "", "HRepairID": 0, "瀛愮淮淇」鐩唬鐮�": "", "HRepairExplanation": "",
+                    "瀛愯礋璐d汉浠g爜": "", "HManagerID": 0, "瀛愯礋璐d汉": "", "HRemark": ""
+                };
+                switch (obj.event) {
+                    case 'btn-AddLine':
+                        table.cache["mainTable"].push(NewRow);
+                        option.data = table.cache["mainTable"];
+                        table.render(option);
+                        break;
+                    case 'btn-CopyLine':
+                        var copydata = JSON.stringify(data);
+                        if (data.length <= 0) {
+                            layer.msg("璇烽�夋嫨闇�瑕佸鍒剁殑涓�琛岋紒");
+                        }
+                        else if (data.length > 1) {
+                            layer.msg("鍙兘閫夋嫨澶嶅埗涓�琛岋紒");
+                        }
+                        else {
+                            var copydata2 = copydata.substring(1, copydata.length);//鍘婚櫎棣栬瀛楃'['
+                            var copyrow = copydata2.substring(0, copydata2.length - 1);//鍘婚櫎鏈熬瀛楃']'
+                            table.cache["mainTable"].push(JSON.parse(copyrow));//灏嗗鍒剁殑琛屽己杞垚json杩藉姞鍒拌〃鏍间笂
+                            option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓�
+                            table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
+                            //layer.alert(copyrow);
+                        }
+                        break;
+                }
+            });
+
+            //琛屽唴浜嬩欢
+            table.on('tool(mainTable)', function (obj) {
+                set_GridDelete(obj);   //琛屽唴鍒犻櫎
+                set_GridCellCheck(obj); //琛屽唴蹇嵎閿瓫閫�
+            });
+
+            //#endregion
+
+            //#endregion
+
+            //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶
+
+            // 鍒濆鍖栫晫闈�
+            function set_ClearBill() {
+                //鍒跺崟浜�
+                $("#HMaker").val(sessionStorage["HUserName"]);
+                //淇敼浜�
+                $("#HUpDater").val(sessionStorage["HUserName"]);
+                //鍒濆鍖栬〃鏍�
+                set_InitGrid();
+                //鍒濆鍖栨棩鏈�
+                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HRepairPlanBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HRepairPlanEndDate").val(Format(new Date(), "yyyy-MM-dd"));
+            }
+
+            //鍒濆鍖栬〃鏍�
+            function set_InitGrid() {
+                 option = {
+                    elem: '#mainTable'
+                    , toolbar: '#toolbarDemo'
+                    , limit: 500 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
+                    , cellMinWidth: 90
+                    , height: 400
+                    , cols: [[ //琛ㄥご
+                        { type: 'checkbox', totalRowText: '鍚堣琛�' }
+                        , { type: 'numbers', title: '搴忓彿', totalRow: true }
+
+                        , { field: '瀛愮淮淇」鐩�', title: '缁翠慨椤圭洰', edit: 'text', event: "HRepairID" }
+                        , { field: 'HRepairID', title: '缁翠慨椤圭洰id', hide: true}//, hide: true
+                        , { field: '瀛愮淮淇」鐩唬鐮�', title: '缁翠慨椤圭洰浠g爜' }
+
+                        , { field: 'HRepairExplanation', title: '缁翠慨瑕佹眰', edit: 'text' }
+
+                        , { field: '瀛愯礋璐d汉浠g爜', title: '璐熻矗浜轰唬鐮�', edit: 'text', event: "HManagerID" }//, hide: true
+                        , { field: 'HManagerID', title: '璐熻矗浜篿d', width: 115, hide: true}//, hide: true
+                        , { field: '瀛愯礋璐d汉', title: '璐熻矗浜�', width: 115 }
+
+                        , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
+                        , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
+                    ]]
+                };
+                //鍒濆琛ㄦ牸鏁版嵁
+                var rowdata = [{
+                    "瀛愮淮淇」鐩�": "", "HRepairID": 0, "瀛愮淮淇」鐩唬鐮�": "", "HRepairExplanation": "",
+                    "瀛愯礋璐d汉浠g爜": "", "HManagerID": 0, "瀛愯礋璐d汉": "", "HRemark": ""
+                }];
+                option.data = rowdata;
+                table.render(option);
+            }
+
+            //缁翠慨閮ㄩ棬閫夋嫨椤甸潰
+            function CheckHDeptID() {
+                layer.open({
+                    type: 2 //寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ["90%", "90%"] //绐椾綋澶у皬
+                    , title: "閮ㄩ棬琛�"  //鏍囬
+                    , shift: 2 //寮瑰嚭鍔ㄧ敾
+                    , content: ["../../Baseset/鍩虹璧勬枡/Gy_DepartmentList.html", "yes"]
+                    , btn: ["纭畾", "鍙栨秷"]
+                    , btn1: function (index) { //鎸夐挳涓�鍥炶皟
+                        var iframeWindow = window["layui-layer-iframe" + index]; //鑾峰彇寮圭獥椤甸潰
+                        var CheckStatus = iframeWindow.layui.table.checkStatus("mainTable"); //鑾峰彇褰撳墠閫変腑 琛屾暟鎹�
+
+                        if (CheckStatus.data.length != 1) {
+                            return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                        }
+                        else {
+                            //鑾峰彇鏁版嵁
+                            $("#HDeptIDName").val(CheckStatus.data[0].HName); //閮ㄩ棬鍚嶇О
+                            $("#HDeptID").val(CheckStatus.data[0].HItemID); //閮ㄩ棬id
+
+                            //鍏抽棴椤甸潰
+                            layer.close(index);
+                        }
+                    }
+                })
+            }
+
+            //缁翠慨浜洪�夋嫨椤甸潰
+            function CheckHEmpID() {
+                layer.open({
+                    type: 2 //寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ["90%", "90%"] //绐椾綋澶у皬
+                    , title: "浜哄憳琛�"  //鏍囬
+                    , shift: 2 //寮瑰嚭鍔ㄧ敾
+                    , content: ["../../Baseset/鍩虹璧勬枡/Gy_EmployeeList.html", "yes"]
+                    , btn: ["纭畾", "鍙栨秷"]
+                    , btn1: function (index) { //鎸夐挳涓�鍥炶皟
+                        var iframeWindow = window["layui-layer-iframe" + index]; //鑾峰彇寮圭獥椤甸潰
+                        var CheckStatus = iframeWindow.layui.table.checkStatus("mainTable"); //鑾峰彇褰撳墠閫変腑 琛屾暟鎹�
+
+                        if (CheckStatus.data.length != 1) {
+                            return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                        }
+                        else {
+                            //鑾峰彇鏁版嵁
+                            $("#HEmpIDName").val(CheckStatus.data[0].HName); //鑱屽憳鍚嶇О
+                            $("#HEmpID").val(CheckStatus.data[0].HItemID); //鑱屽憳ID
+
+                            //鍏抽棴椤甸潰
+                            layer.close(index);
+                        }
+                    }
+                })
+            }
+
+            //璐熻矗浜洪�夋嫨椤甸潰
+            function CheckHManagerID() {
+                layer.open({
+                    type: 2 //寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ["90%", "90%"] //绐椾綋澶у皬
+                    , title: "浜哄憳琛�"  //鏍囬
+                    , shift: 2 //寮瑰嚭鍔ㄧ敾
+                    , content: ["../../Baseset/鍩虹璧勬枡/Gy_EmployeeList.html", "yes"]
+                    , btn: ["纭畾", "鍙栨秷"]
+                    , btn1: function (index) { //鎸夐挳涓�鍥炶皟
+                        var iframeWindow = window["layui-layer-iframe" + index]; //鑾峰彇寮圭獥椤甸潰
+                        var CheckStatus = iframeWindow.layui.table.checkStatus("mainTable"); //鑾峰彇褰撳墠閫変腑 琛屾暟鎹�
+
+                        if (CheckStatus.data.length != 1) {
+                            return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                        }
+                        else {
+                            //鑾峰彇鏁版嵁
+                            $("#HManagerIDName").val(CheckStatus.data[0].HName); //鑱屽憳鍚嶇О
+                            $("#HManagerID").val(CheckStatus.data[0].HItemID); //鑱屽憳ID
+
+                            //鍏抽棴椤甸潰
+                            layer.close(index);
+                        }
+                    }
+                })
+            }
+
+            //璁惧閫夋嫨椤甸潰
+            function CheckHEquipID() {
+                layer.open({
+                    type: 2 //寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ["90%", "90%"] //绐椾綋澶у皬
+                    , title: "璁惧琛�"  //鏍囬
+                    , shift: 2 //寮瑰嚭鍔ㄧ敾
+                    , content: ["../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EquipMent.html", "yes"]
+                    , btn: ["纭畾", "鍙栨秷"]
+                    , btn1: function (index) { //鎸夐挳涓�鍥炶皟
+                        var iframeWindow = window["layui-layer-iframe" + index]; //鑾峰彇寮圭獥椤甸潰
+                        var CheckStatus = iframeWindow.layui.table.checkStatus("mainTable"); //鑾峰彇褰撳墠閫変腑 琛屾暟鎹�
+
+                        if (CheckStatus.data.length != 1) {
+                            return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                        }
+                        else {
+                            //鑾峰彇鏁版嵁
+                            $("#HEquipIDName").val(CheckStatus.data[0].璁惧鍚嶇О); //璁惧鍚嶇О
+                            $("#HEquipID").val(CheckStatus.data[0].HItemID); //璁惧ID
+
+                            //鍏抽棴椤甸潰
+                            layer.close(index);
+                        }
+                    }
+                })
+            }
+            
+            //缁翠慨椤圭洰閫夋嫨椤甸潰
+            function CheckHRepairID() {
+                layer.open({
+                    type: 2 //寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ["90%", "90%"] //绐椾綋澶у皬
+                    , title: "缁翠慨椤圭洰琛�"  //鏍囬
+                    , shift: 2 //寮瑰嚭鍔ㄧ敾
+                    , content: ["../../Baseset/鍩虹璧勬枡/Gy_RepairList.html", "yes"]
+                    , btn: ["纭畾", "鍙栨秷"]
+                    , btn1: function (index) { //鎸夐挳涓�鍥炶皟
+                        var iframeWindow = window["layui-layer-iframe" + index]; //鑾峰彇寮圭獥椤甸潰
+                        var CheckStatus = iframeWindow.layui.table.checkStatus("mainTable"); //鑾峰彇褰撳墠閫変腑 琛屾暟鎹�
+
+                        if (CheckStatus.data.length != 1) {
+                            return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                        }
+                        else {
+                            //鑾峰彇鏁版嵁
+                            $("#HRepairIDName").val(CheckStatus.data[0].HName); //缁翠慨椤圭洰鍚嶇О
+                            $("#HRepairID").val(CheckStatus.data[0].HItemID); //缁翠慨椤圭洰ID
+
+                            //鍏抽棴椤甸潰
+                            layer.close(index);
+                        }
+                    }
+                })
+            }
+
+            //淇濆瓨鏁版嵁
+            function set_AddNew(data) {
+
+                //杩囨护瀛愯〃鍒犻櫎涔嬪悗鐣欎笅鐨勭┖鏁版嵁
+                var num = [];
+                for (var i = 0; i < table.cache['mainTable'].length; i++) {
+                    //缁欎笉鑳戒负绌虹殑鏁版嵁 璧嬪��(瀛�)
+                    if (table.cache['mainTable'][i] != "") {
+                        num.push(table.cache['mainTable'][i]);
+                    }
+                }
+                //缁欎笉鑳戒负绌虹殑鏁版嵁璧嬪��(涓�)
+                if (data.field.HPlanTimes == "") {
+                    data.field.HPlanTimes = 0
+                }
+
+                var sMainStr = JSON.stringify(data.field);
+                var sSubStr = JSON.stringify(num);
+                var hentryid = linteridSub;//瀛愯〃 鎺掑簭id
+                var sMainSub = sMainStr + ';' + sSubStr + ';' + hentryid + ';' + OperationType;
+                var index = layer.load();
+
+                $.ajax({
+                    type: "POST",
+                    url: GetWEBURL() + "/Sb_EquipRepairSendWorkBill/AddEquipRepairSendWorkBill",
+                    async: true,
+                    data: { "sMainSub": sMainSub },
+                    dataType: "json",
+                    success: function (data) {
+                        if (data.count == 1) {
+                            layer.close(index);
+                            layer.msg("鎻愪氦鎴愬姛");
+                        }
+                        else {
+                            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.msg("閿欒:" + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                    }
+                });
+            }
+
+            //缂栬緫
+            function RoadBillMain(linterid, linteridSub) {
+                var sWhere = " and hmainid ='" + linterid + "' and hsubid='" + linteridSub + "' ";
+
+                $.ajax({
+                    url: GetWEBURL() + '/Sb_EquipRepairSendWorkBill/GetEquipRepairSendWorkBillList',
+                    type: "GET",
+                    data: { "sWhere": sWhere },
+                    success: function (d) {
+                        //涓昏〃
+                        form.val("formData", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+                            "HBillNo": d.data[0].鍗曟嵁鍙�
+                            , "HInterID": d.data[0].hmainid
+                            , "HDate": Format(new Date(d.data[0].鏃ユ湡), "yyyy-MM-dd")
+                            , "HInnerBillNo": d.data[0].鍐呴儴鍗曟嵁鍙�
+                            , "HDeptID": d.data[0].HDeptID
+                            , "HDeptIDName": d.data[0].缁翠慨閮ㄩ棬
+                            , "HEmpID": d.data[0].HEmpID
+                            , "HEmpIDName": d.data[0].缁翠慨浜�
+                            , "HManagerIDName": d.data[0].璐熻矗浜�
+                            , "HManagerID": d.data[0].HManagerID
+                            , "HEquipIDName": d.data[0].璁惧
+                            , "HEquipID": d.data[0].HEquipID
+                            , "HRepairIDName": d.data[0].缁翠慨椤圭洰
+                            , "HRepairID": d.data[0].HRepairID
+                            , "HRepairContent": d.data[0].缁翠慨鍐呭
+                            , "HRepairPlanBeginDate": Format(new Date(d.data[0].棰勮缁翠慨寮�濮嬫棩鏈�), "yyyy-MM-dd")
+                            , "HRepairPlanEndDate": Format(new Date(d.data[0].棰勮缁翠慨缁撴潫鏃ユ湡), "yyyy-MM-dd")
+                            , "HCycleUnit": d.data[0].鏃堕棿鍗曚綅
+                            , "HPlanTimes": d.data[0].璁″垝缁翠慨宸ユ椂
+                            , "HExplanation": d.data[0].鎽樿
+                            , "HRemark": d.data[0].琛ㄥご澶囨敞
+                        });
+                        //瀛愯〃
+                        var rowdata = [{
+                            "瀛愮淮淇」鐩�": d.data[0].琛ㄤ綋缁翠慨椤圭洰, "HRepairID": d.data[0].hrepairid1, "瀛愮淮淇」鐩唬鐮�": d.data[0].琛ㄤ綋缁翠慨椤圭洰浠g爜, "HRepairExplanation": d.data[0].缁翠慨瑕佹眰,
+                            "瀛愯礋璐d汉浠g爜": d.data[0].琛ㄤ綋璐熻矗浜轰唬鐮�, "HManagerID": d.data[0].HManagerID1, "瀛愯礋璐d汉": d.data[0].琛ㄤ綋璐熻矗浜�, "HRemark": d.data[0].琛ㄤ綋澶囨敞
+                        }];
+                        option.data = rowdata;
+                        table.render(option);
+                    }
+                })
+            }
+
+            //琛屽唴蹇嵎閿�
+            function set_GridCellCheck(obj) {
+                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
+                    if (event.key == "F7") {
+                        //缁翠慨椤圭洰
+                        if (obj.event == "HRepairID") {
+                            //鎵撳紑缁翠慨椤圭洰灏忕獥浣�
+                            layer.open({
+                                type: 2
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "缁翠慨椤圭洰鍒楄〃"  //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ["../../Baseset/鍩虹璧勬枡/Gy_RepairList.html", "yes"]
+                                , btn: ["纭畾", "鍙栨秷"]
+                                , btn1: function (index, laero) {
+                                    //鎸夐挳涓�  鐨勫洖璋�
+                                    var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹�
+
+                                    if (checkStatus.data.length != 1) {
+                                        return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+                                    }
+                                    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                    obj.update({
+                                        "瀛愮淮淇」鐩�": checkStatus.data[0].HName
+                                        , "HRepairID": checkStatus.data[0].HItemID
+                                        , "瀛愮淮淇」鐩唬鐮�": checkStatus.data[0].HNumber
+                                    })
+                                    layer.close(index);//鍏抽棴寮圭獥
+                                }
+                            })
+                        }
+                        //缁翠慨浜�
+                        if (obj.event == "HManagerID") {
+                            //鎵撳紑浜哄憳琛�  灏忕獥浣�
+                            layer.open({
+                                type: 2
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "浜哄憳鍒楄〃"  //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ["../../Baseset/鍩虹璧勬枡/Gy_EmployeeList.html", "yes"]
+                                , btn: ["纭畾", "鍙栨秷"]
+                                , btn1: function (index, laero) {
+                                    //鎸夐挳涓�  鐨勫洖璋�
+                                    var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹�
+
+                                    if (checkStatus.data.length != 1) {
+                                        return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+                                    }
+                                    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                    obj.update({
+                                        "瀛愯礋璐d汉": checkStatus.data[0].HName
+                                        , "HManagerID": checkStatus.data[0].HItemID
+                                        , "瀛愯礋璐d汉浠g爜": checkStatus.data[0].HNumber
+                                    })
+                                    layer.close(index);//鍏抽棴寮圭獥
+                                }
+                            })
+                        }
+                        obj.event = "";
+                        return false;
+                    }
+
+                })
+            }
+
+            //琛屽唴鍒犻櫎
+            function set_GridDelete(obj) {
+                var data = obj.data;
+                var rowIndex = $(obj.tr).attr("data-index");
+                if (obj.event === 'del') {
+                    layer.confirm('鐪熺殑鍒犻櫎琛屽悧锛�', function (index) {
+                        console.log("绱㈠紩涓�:" + rowIndex);
+                        if (rowIndex === '0') {
+                            layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
+                        } else {
+                            obj.del();
+                            option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓�
+                            table.reload(option);
+                            layer.close(index);
+                        }
+                    });
+                }
+            }
+
+            //鑾峰彇鍙傛暟
+            function getUrlVars() {
+                var vars = [], hash;
+                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
+                for (var i = 0; i < hashes.length; i++) {
+                    hash = hashes[i].split('=');
+                    vars.push(hash[0]);
+                    vars[hash[0]] = hash[1];
+                }
+                return vars;
+            }
+
+            //鏁版嵁楠岃瘉
+            function AllowLoadData(data) {
+                if (data.field.HDeptIDName == "") {
+                    layer.msg("缁翠慨閮ㄩ棬涓嶈兘涓虹┖!")
+                    return false;
+                }
+                if (data.field.HEmpIDName == "") {
+                    layer.msg("缁翠慨浜轰笉鑳戒负绌�!")
+                    return false;
+                }
+                if (data.field.HManagerIDName == "") {
+                    layer.msg("璐熻矗浜轰笉鑳戒负绌�!")
+                    return false;
+                }
+                if (data.field.HEquipIDName == "") {
+                    layer.msg("璁惧涓嶈兘涓虹┖!")
+                    return false;
+                }
+                if (data.field.HRepairIDName == "") {
+                    layer.msg("缁翠慨椤圭洰涓嶈兘涓虹┖!")
+                    return false;
+                }
+                return true;
+            }
+            //#endregion
+           
+        });
+    </script>
+</body>
+</html>
\ No newline at end of file
diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sb_EquipRepairSendWorkBillList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sb_EquipRepairSendWorkBillList.html"
index 46e0275..67e3157 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sb_EquipRepairSendWorkBillList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sb_EquipRepairSendWorkBillList.html"
@@ -159,6 +159,66 @@
                 //娓呯┖杩囨护鏉′欢
                 set_ClearQuery();
             });
+
+            //澶村伐鍏锋爮浜嬩欢
+            table.on("toolbar(mainTable)", function (obj) {
+                var checkStatus = table.checkStatus(obj.config.id);
+                switch (obj.event) {
+                    //鏂板
+                    case "btn-Add":
+                        //椤甸潰灞�-鑷畾涔�
+                        layer.open({
+                            type: 2,
+                            skin: 'layui-layer-rim', //鍔犱笂杈规
+                            title: '璁惧缁翠慨娲惧伐鍗�',
+                            closeBtn: 1,
+                            shift: 2,
+                            area: ['100%', '100%'],
+                            maxmin: true,
+                            content: '../../璁惧绠$悊/璁惧缁翠慨娲惧伐鍗�/Sb_EquipRepairSendWorkBillEdit.html?OperationType=1&linterid=0&HSouceBillType=0&linteridSub=-1',
+                            end: function () {
+                                //鍒锋柊椤甸潰,
+                                location.reload();
+                            },
+                            success: function (layero, index) {
+
+                            }
+                        });
+                        break;
+                    //缂栬緫
+                    case "btn-Edit":
+                        if (checkStatus.data.length != 1) {
+                            return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                        }
+                        else {
+                            var linterid = checkStatus.data[0].hmainid;
+                            var linteridSub = checkStatus.data[0].hsubid;
+                            //椤甸潰灞�-鑷畾涔�
+                            layer.open({
+                                type: 2,
+                                skin: 'layui-layer-rim', //鍔犱笂杈规
+                                title: '璁惧缁翠慨娲惧伐鍗�',
+                                closeBtn: 1,
+                                shift: 2,
+                                area: ['100%', '100%'],
+                                maxmin: true,
+                                content: '../../璁惧绠$悊/璁惧缁翠慨娲惧伐鍗�/Sb_EquipRepairSendWorkBillEdit.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0&linteridSub=' + linteridSub,
+                                end: function () {
+                                    //鍒锋柊椤甸潰,
+                                    location.reload();
+                                },
+                                success: function (layero, index) {
+
+                                }
+                            });
+                        }
+                        break;
+                    //鍒犻櫎
+                    case "btn-Delete":
+                        set_DeleteBill();
+                        break;
+                }
+            })
           
 
             //#endregion
@@ -193,8 +253,8 @@
                         , { field: '缁翠慨閮ㄩ棬', title: '缁翠慨閮ㄩ棬' }
                         , { field: '缁翠慨椤圭洰浠g爜', title: '缁翠慨椤圭洰浠g爜' }
                         , { field: '缁翠慨椤圭洰', title: '缁翠慨椤圭洰' }
-                        , { field: '棰勮缁翠慨寮�濮嬫棩鏈�', title: '棰勮缁翠慨寮�濮嬫棩鏈�', width: 120, templet: "<div>{{d.缁翠慨寮�濮嬫棩鏈� ==null ?'':layui.util.toDateString(d.缁翠慨寮�濮嬫棩鏈�, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '棰勮缁翠慨缁撴潫鏃ユ湡', title: '棰勮缁翠慨缁撴潫鏃ユ湡', width: 120, templet: "<div>{{d.缁翠慨缁撴潫鏃ユ湡 ==null ?'':layui.util.toDateString(d.缁翠慨缁撴潫鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
+                        , { field: '棰勮缁翠慨寮�濮嬫棩鏈�', title: '棰勮缁翠慨寮�濮嬫棩鏈�', width: 120, templet: "<div>{{d.棰勮缁翠慨寮�濮嬫棩鏈� ==null ?'':layui.util.toDateString(d.棰勮缁翠慨寮�濮嬫棩鏈�, 'yyyy-MM-dd')}}</div>" }
+                        , { field: '棰勮缁翠慨缁撴潫鏃ユ湡', title: '棰勮缁翠慨缁撴潫鏃ユ湡', width: 120, templet: "<div>{{d.棰勮缁翠慨缁撴潫鏃ユ湡 ==null ?'':layui.util.toDateString(d.棰勮缁翠慨缁撴潫鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
                         , { field: '鏃堕棿鍗曚綅', title: '鏃堕棿鍗曚綅' }
                         , { field: '璁″垝缁翠慨宸ユ椂', title: '璁″垝缁翠慨宸ユ椂' }
                         , { field: '缁翠慨浜轰唬鐮�', title: '缁翠慨浜轰唬鐮�' }
@@ -209,16 +269,16 @@
                         , { field: '琛ㄥご澶囨敞', title: '琛ㄥご澶囨敞' }
                         , { field: '鍐呴儴鍗曟嵁鍙�', title: '鍐呴儴鍗曟嵁鍙�' }
                         , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 125 }
-                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 120, templet: "<div>{{d.鍒跺崟鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍒跺崟鏃ユ湡, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
+                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 120, templet: "<div>{{d.鍒跺崟鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍒跺崟鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
                         , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', width: 125 }
-                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 120, templet: "<div>{{d.瀹℃牳鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹℃牳鏃ユ湡, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
+                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 120, templet: "<div>{{d.瀹℃牳鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹℃牳鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
                         , { field: '淇敼浜�', title: '淇敼浜�', width: 125 }
-                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', width: 200, templet: "<div>{{d.淇敼鏃ユ湡 ==null ?'':layui.util.toDateString(d.淇敼鏃ユ湡, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
+                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', width: 200, templet: "<div>{{d.淇敼鏃ユ湡 ==null ?'':layui.util.toDateString(d.淇敼鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
                         , { field: '鍏抽棴浜�', title: '鍏抽棴浜�', width: 125 }
-                        , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', width: 120, templet: "<div>{{d.鍏抽棴鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍏抽棴鏃ユ湡, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
+                        , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', width: 120, templet: "<div>{{d.鍏抽棴鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍏抽棴鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
                         , { field: '鍏抽棴绫诲瀷', title: '鍏抽棴绫诲瀷' }
                         , { field: '浣滃簾浜�', title: '浣滃簾浜�', width: 125 }
-                        , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', width: 120, templet: "<div>{{d.浣滃簾鏃ユ湡 ==null ?'':layui.util.toDateString(d.浣滃簾鏃ユ湡, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
+                        , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', width: 120, templet: "<div>{{d.浣滃簾鏃ユ湡 ==null ?'':layui.util.toDateString(d.浣滃簾鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
                     ]]
                 };
             }
@@ -231,7 +291,7 @@
                     type: "GET",
                     data: { "sWhere": sWhere },
                     success: function (data1) {
-                        if (data1.count == 1) {
+                        if (data1.count > 0) {
                             option.data = data1.data;
                             table.render(option);
                             layer.close(ajaxLoad);
@@ -246,6 +306,46 @@
                 });
             }
 
+            //鍒犻櫎
+            function set_DeleteBill() {
+                var checkstatus = table.checkStatus("mainTable");
+
+                if (checkstatus.data.length != 1) {
+                    return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                }
+                else {
+                    layer.confirm('鎮ㄧ‘瀹氳鍒犻櫎鍚楋紵', {
+                        btn: ['纭畾', '鍙栨秷'] //鎸夐挳
+                        , btn1: function () {
+                            var HInterID = checkstatus.data[0].hmainid; //鑾峰彇缂栧彿
+                            var ModRightNameDelete = ""; //鍒犻櫎鏉冮檺
+
+                            $.ajax({
+                                url: GetWEBURL() + '/Sb_EquipRepairSendWorkBill/DeleteWorkBill'
+                                , type: "GET"
+                                , data: { "HInterID": HInterID, "User": sessionStorage["HUserName"], "ModRightNameDelete": ModRightNameDelete}
+                                , success: function (result) {
+                                    if (result.count == 1) {
+                                        layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
+                                            // 寰楀埌frame绱㈠紩
+                                            var index = layer.getFrameIndex(window.name);
+                                            //鍏抽棴褰撳墠frame
+                                            layer.close(index);
+                                            //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                            window.location.reload();
+                                            ////閲嶈浇tree
+                                            //tree.reload('treeDepartment', {});
+                                        });
+                                    } else {
+                                        layer.alert(result.code + result.Message, { icon: 5 });
+                                    }
+                                }
+                            })
+                        }
+                    })
+                }
+            }
+
             // 蹇�熻繃婊�
             function get_FastQuery() {
                 var HDate = $("#HBeginDate").val();//寮�濮嬫棩鏈�

--
Gitblit v1.9.1