From 5703dbc0bff6fb45c4fbb4318a23e50bbf993e57 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 27 十月 2023 20:18:51 +0800
Subject: [PATCH] 销售订单变更单

---
 WebTM/Properties/PublishProfiles/JFTM.pubxml.user      |   10 
 WebTM/views/销售管理/销售订单变更单/Xs_SeOrderChangeBillList.html |  775 +++++++++++++++++++
 WebTM/views/销售管理/销售订单变更单/Xs_SeOrderChangeBill.html     | 1583 +++++++++++++++++++++++++++++++++++++++
 WebTM/WebTM.csproj                                     |    2 
 4 files changed, 2,368 insertions(+), 2 deletions(-)

diff --git a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
index 47dbb6a..2af211b 100644
--- a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
+++ b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -18,10 +18,10 @@
       <publishTime>01/28/2016 14:22:24</publishTime>
     </File>
     <File Include="bin/WebTM.dll">
-      <publishTime>10/27/2023 09:31:53</publishTime>
+      <publishTime>10/27/2023 15:03:40</publishTime>
     </File>
     <File Include="bin/WebTM.pdb">
-      <publishTime>10/27/2023 09:31:53</publishTime>
+      <publishTime>10/27/2023 15:03:40</publishTime>
     </File>
     <File Include="HtmlPage1.html">
       <publishTime>04/11/2023 16:34:42</publishTime>
@@ -4634,6 +4634,12 @@
     <File Include="views/閿�鍞鐞�/閿�鍞鍗�/Xs_SeOrderBillList.html">
       <publishTime>10/24/2023 11:30:33</publishTime>
     </File>
+    <File Include="views/閿�鍞鐞�/閿�鍞鍗曞彉鏇村崟/Xs_SeOrderChangeBill.html">
+      <publishTime>10/27/2023 20:09:52</publishTime>
+    </File>
+    <File Include="views/閿�鍞鐞�/閿�鍞鍗曞彉鏇村崟/Xs_SeOrderChangeBillList.html">
+      <publishTime>10/27/2023 20:17:34</publishTime>
+    </File>
     <File Include="views/閿�鍞鐞�/閿�鍞��璐у崟/Add_Edit_Kf_ICStockBillMainList.html">
       <publishTime>04/11/2023 16:34:43</publishTime>
     </File>
diff --git a/WebTM/WebTM.csproj b/WebTM/WebTM.csproj
index 1548a54..e426f42 100644
--- a/WebTM/WebTM.csproj
+++ b/WebTM/WebTM.csproj
@@ -1362,6 +1362,8 @@
     <Content Include="views\閿�鍞鐞哱鐗规壒鐢宠鍗昞Xs_ExceptiveCheckRequestBillList.html" />
     <Content Include="views\閿�鍞鐞哱閫�璐ч�氱煡鍗昞Xs_SeOutStockBackBill.html" />
     <Content Include="views\閿�鍞鐞哱閿�鍞鍗昞Xs_SeOrderBillDyColList.html" />
+    <Content Include="views\閿�鍞鐞哱閿�鍞鍗曞彉鏇村崟\Xs_SeOrderChangeBill.html" />
+    <Content Include="views\閿�鍞鐞哱閿�鍞鍗曞彉鏇村崟\Xs_SeOrderChangeBillList.html" />
     <Content Include="views\閿�鍞鐞哱閿�鍞��璐у崟\Add_Edit_Kf_ICStockBillMainList.html" />
     <Content Include="views\閿�鍞鐞哱閿�鍞��璐у崟\Kf_ICStockBillMainList.html" />
     <Content Include="views\閿�鍞鐞哱閿�鍞鍗昞Add_Edit_Xs_SeOrderBillList.html" />
diff --git "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225\345\217\230\346\233\264\345\215\225/Xs_SeOrderChangeBill.html" "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225\345\217\230\346\233\264\345\215\225/Xs_SeOrderChangeBill.html"
new file mode 100644
index 0000000..9a7a446
--- /dev/null
+++ "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225\345\217\230\346\233\264\345\215\225/Xs_SeOrderChangeBill.html"
@@ -0,0 +1,1583 @@
+锘�<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8" />
+    <title>閿�鍞鍗曞彉鏇村崟缂栬緫</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <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/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>
+    <style type="text/css">
+        .layui-form-item .layui-inline {
+            margin-right: 0;
+        }
+
+        html {
+            background-color: white;
+            color: white;
+        }
+
+        .layui-table-cell {
+            overflow: visible !important;
+        }
+
+        td .layui-form-select {
+            margin-top: -10px;
+            margin-left: -15px;
+            margin-right: -15px;
+        }
+    </style>
+</head>
+<body>
+
+    <div class="layui-fluid" style="padding: 0;">
+        <div class="layui-card" style="padding: 15px;">
+            <div class="layui-card-body" style="padding: 1px;">
+                <form 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="set_SaveBill">淇濆瓨</button>
+                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">閫�鍑�</button>
+                        </div>
+                    </div>
+                    <div class="layui-tab" lay-filter="tab-POStockInBill">
+                        <h1 style="text-align: center; padding: 10px 0;"><b>閿�鍞鍗曞彉鏇村崟</b></h1>
+                        <ul class="layui-tab-title" lay-filter="tab-all">
+                            <li lay-id="1" style="padding:1px;" class="layui-this">鍩烘湰淇℃伅</li>
+                            <li lay-id="2" style="padding:1px;">鍒跺崟淇℃伅</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">鍗曟嵁缂栧彿</label>
+                                            <div class="layui-input-inline">
+                                                <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
+                                                <input type="hidden" name="HInterID" id="HInterID" value="0">
+                                                <input type="hidden" name="HSTOCKORGID" id="HSTOCKORGID" lay-verify="HSTOCKORGID">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">鏃ユ湡</label>
+                                            <div class="layui-input-inline">
+                                                <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 80px;">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">閿�鍞儴闂�</label>
+                                            <div class="layui-input-inline">
+                                                <input type="text" name="HDeptName" id="HDeptName" class="layui-input" value="" style="float:left;width:150px;">
+                                                <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value="0" style="float:left;width:150px;">
+                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HDeptList" style="width:40px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">閿�鍞憳</label>
+                                            <div class="layui-input-inline">
+                                                <input type="text" name="HEmpName" id="HEmpName" " class="layui-input" value="" style="float:left;width:150px;">
+                                                <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="0" style="float:left;width:150px;">
+                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HEmpList" style="width:40px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">閿�鍞竵鍒�</label>
+                                            <div class="layui-input-inline">
+                                                <input type="text" name="HCurName" id="HCurName" class="layui-input" value="" style="float:left;width:150px;">
+                                                <input type="hidden" name="HCurID" id="HCurID" class="layui-input" value="0" style="float:left;width:150px;">
+                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HCurList" style="width:40px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">姹囩巼</label>
+                                            <div class="layui-input-inline">
+                                                <input class="layui-input" name="HExRate" id="HExRate" autocomplete="off" value="0" readonly>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline" style="width:900px;">
+                                            <label class="layui-form-label">瀹㈡埛</label>
+                                            <div class="layui-input-inline" style="width:700px;">
+                                                <input type="text" name="HCusName" id="HCusName" class="layui-input" value="" style="float:left;width:465px;">
+                                                <input type="hidden" name="HCusID" id="HCusID" class="layui-input" value="0" style="float:left;width:150px;">
+                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HCusList" style="width:40px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">缁撶畻鏂瑰紡</label>
+                                            <div class="layui-input-inline">
+                                                <input type="text" name="HSSName" id="HSSName" class="layui-input" value="" style="float:left;width:150px;">
+                                                <input type="hidden" name="HSSID" id="HSSID" class="layui-input" value="0" style="float:left;width:150px;">
+                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HSSList" style="width:40px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">閿�鍞柟寮�</label>
+                                            <div class="layui-input-inline">
+                                                <input type="text" name="HSellSName" id="HSellSName" class="layui-input" value="" style="float:left;width:150px;">
+                                                <input type="hidden" name="HSellSID" id="HSellSID" class="layui-input" value="0" style="float:left;width:150px;">
+                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HSellSList" style="width:40px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">鍙樻洿鍘熷洜</label>
+                                            <div class="layui-input-inline">
+                                                <input class="layui-input" name="HExplanation" id="HExplanation" autocomplete="off" style="width: 501px;">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">澶囨敞</label>
+                                            <div class="layui-input-block">
+                                                <input class="layui-input" name="HRemark" id="HRemark" autocomplete="off" style="width: 1135px;">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row" style="margin-top:10px;">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">缁勭粐<label style="color:red"> * </label></label>
+                                            <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
+                                                <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
+                                                    <!--鍔ㄦ�佹覆鏌撶粍缁�-->
+                                                </select>
+                                            </div>
+                                        </div>
+                                    </div>
+
+                                    <!--闅愯棌瀛楁-->
+                                    <div class="layui-row" style="display:none;">
+                                        <div class="layui-inline">
+                                            <div class="layui-input-block">
+                                                <input class="layui-input" name="HMainSourceInterID" id="HMainSourceInterID" value="0" autocomplete="off">
+                                                <input class="layui-input" name="HMainSourceEntryID" id="HMainSourceEntryID" value="0" autocomplete="off">
+                                                <input class="layui-input" name="HMainSourceBillNo" id="HMainSourceBillNo" value="" autocomplete="off">
+                                                <input class="layui-input" name="HMainSourceBillType" id="HMainSourceBillType" value="" autocomplete="off">
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+
+                            <!--鍒跺崟淇℃伅-->
+                            <div class="layui-tab-item">
+                                <div class="layui-form-item">
+                                    <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="HMaker" id="HMaker" 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: 120px;">
+                                                <input type="text" class="layui-input" name="HUpDater" id="HUpDater" 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: 120px;">
+                                                <input type="text" class="layui-input" name="HChecker" id="HChecker" style="background-color:#efefef4d;" readonly>
+                                            </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="text" class="layui-input" name="HMakeDate" id="HMakeDate" 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: 120px;">
+                                                <input type="text" class="layui-input" name="HUpDateDate" id="HUpDateDate" 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: 120px;">
+                                                <input type="text" class="layui-input" name="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" readonly>
+                                            </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="text" class="layui-input" name="HCloseMan" id="HCloseMan" 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: 120px;">
+                                                <input type="text" class="layui-input" name="HDeleteMan" id="HDeleteMan" style="background-color:#efefef4d;" readonly>
+                                            </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="text" class="layui-input" name="HCloseDate" id="HCloseDate" 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: 120px;">
+                                                <input type="text" class="layui-input" name="HDeleteDate" id="HDeleteDate" style="background-color:#efefef4d;" readonly>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <!--瀛愯〃1-->
+                    <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-InsertLine"><i class="layui-icon layui-icon-form"></i>鎻掑叆涓�琛�</button>
+                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>澶嶅埗涓�琛�</button>
+                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Up"><i class="layui-icon layui-icon-form"></i>涓婄Щ</button>
+                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Under"><i class="layui-icon layui-icon-form"></i>涓嬬Щ</button>
+                            <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
+                        </div>
+                    </script>
+
+                    <script type="text/html" id="xuhao">
+                        {{d.LAY_TABLE_INDEX+1}}
+                    </script>
+                </form>
+            </div>
+        </div>
+    </div>
+    <script type="text/html" id="barDemo">
+        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
+    </script>
+
+    <script>
+        //#region 鎶樺彔娉ㄩ噴
+        //#endregion
+        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
+                , laydate = layui.laydate
+                , element = layui.element;
+
+            //瀛愯〃娓叉煋鍙傛暟
+            var option = {};
+
+            //璁板綍缁勭粐鐨勫��
+            var HOrgIDBar = 0;
+
+            //妯″潡鍚�
+            var HModName = "Xs_SeOrderChangeBill";
+            var HBillType = "1425";
+
+            //鑾峰彇椤甸潰璺宠浆鍙傛暟
+            var params = get_UrlVars();
+            var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷  1娣诲姞 淇濆瓨  2澶嶅埗  3 缂栬緫
+            var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
+            //#endregion
+
+
+            //#region 杩涘叆椤甸潰鍗冲姞杞�
+
+            //#region 鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
+            get_LoginIs();
+            //#endregion
+
+            //#region 鍒ゆ柇骞惰缃搷浣滅被鍨嬨�侀〉闈㈠垵濮嬪寲
+            if (OperationType == null || OperationType == 1) {                            //鏂板
+                //鏂板椤甸潰鍒濆鍖�
+                Init_setAdd();
+            }
+            else if (OperationType == 3) {                                                 //缂栬緫
+                $("#HInterID").val(linterid);
+                //瀛愯〃鍒濆鍖�
+                set_InitGrid();
+                //鍔犺浇琛ㄤ綋鍜岃〃浣撴暟鎹�
+                RoadBillMain(linterid);
+            }
+            //#endregion
+
+            //#region 鍒濆鍖栫粍缁�
+            Organ();
+            //#endregion
+
+            //#region 鍒楄缃細瀛愯〃1
+            //DisPlay_HideColumn();
+            //#endregion
+            //#endregion
+
+            //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+            //#region 寮圭獥閫夋嫨瑙﹀彂浜嬩欢
+            //#region 閫夋嫨閿�鍞儴闂ㄦ寜閽�
+            form.on('submit(HDeptList)', function () {
+                get_checkDept();
+            });
+            //#endregion
+
+            //#region 閫夋嫨閿�鍞憳鎸夐挳
+            form.on('submit(HEmpList)', function () {
+                get_checkEmp();
+            });
+            //#endregion
+
+            //#region 閫夋嫨閿�鍞竵鍒寜閽�
+            form.on('submit(HCurList)', function () {
+                get_checkCur();
+            });
+            //#endregion
+
+            //#region 閫夋嫨瀹㈡埛鎸夐挳
+            form.on('submit(HCusList)', function () {
+                get_checkCus();
+            });
+            //#endregion
+
+            //#region 閫夋嫨缁撶畻鏂瑰紡鎸夐挳
+            form.on('submit(HSSList)', function () {
+                get_checkSS();
+            });
+            //#endregion
+
+            //#region 閫夋嫨閿�鍞柟寮忔寜閽�
+            form.on('submit(HSellSList)', function () {
+                get_checkSellS();
+            });
+            //#endregion
+
+            //#region 閫夋嫨閿�鍞富绠℃寜閽�
+            form.on('submit(HManagerList)', function () {
+                get_checkManager();
+            });
+            //#endregion
+            //#endregion
+
+            //#region 琛ㄥご鎸夐挳瑙﹀彂浜嬩欢
+            //#region 淇濆瓨鎸夐挳
+            form.on('submit(set_SaveBill)', function (data) {
+                //if (AllowLoadData(data)) {
+                    set_SaveBill(data);
+                //}
+            });
+            //#endregion
+
+            //#region 閫�鍑烘寜閽�
+            form.on('submit(Exit)', function () {
+                if (params[1] != null) {
+                    Pub_Close(1);
+                } else if (params[1] == null) {
+                    Pub_Close(2);
+                }
+            })
+            //#endregion
+            //#endregion
+
+            //#region 瀛愯〃鐩稿叧鐩戝惉浜嬩欢
+            //#region 瀛愯〃1锛氬ご宸ュ叿鏍忔寜閽Е鍙戜簨浠�
+            table.on('toolbar(mainTable)', function (obj) {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;;
+
+                //鏂板琛岃〃鏍兼暟鎹�
+                var NewRow = {
+                    "HMaterID": "0",
+                    "鐗╂枡浠g爜": "",
+                    "鐗╂枡鍚嶇О": "",
+                    "瑙勬牸鍨嬪彿": "",
+                    "HUnitID": "0",
+                    "璁¢噺鍗曚綅": "",
+                    "HQty_Old": "0",
+                    "HQty_New": "0",
+                    "HTaxPrice_Old": "0",
+                    "HTaxPrice_New": "0",
+                    "HDate_Old": "",
+                    "HDate_New": "",
+
+                    "HRemark": "",
+                    "HSourceInterID": "0",
+                    "HSourceEntryID": "0",
+                    "HSourceBillNo": "",
+                    "HSourceBillType": ""
+                };
+                switch (obj.event) {
+                    //鏂板涓�琛�
+                    case 'btn-AddLine': btnAddLine(NewRow);
+                        break;
+                    //澶嶅埗涓�琛�
+                    case 'btn-CopyLine': btnCopyLine(data);
+                        break;
+                    //鎸囧畾浣嶇疆涓嬫彃鍏ヤ竴琛�
+                    case 'btn-InsertLine': btnInsertLine(NewRow)
+                        break;
+                    //涓婄Щ
+                    case 'btn-Up': btn_up();
+                        break;
+                    //涓嬬Щ
+                    case 'btn-Under': btn_under();
+                        break;
+                    //鍒楄缃�
+                    case 'set_HideColumn':
+                        get_HideColumn();
+                        break;
+                }
+            });
+            //#endregion
+
+            //#region 琛屽唴浜嬩欢
+            table.on('tool(mainTable)', function (obj) {
+                set_GridDelete(obj);   //琛屽唴鍒犻櫎
+                set_GridCellCheck(obj); //琛屽唴蹇嵎閿瓫閫�
+                //璁剧疆 鏂板彂璐ф椂闂�
+                if (obj.event == 'HDate_New') {
+                    var data = obj.data;
+                    var field = $(this).data('field');
+                    laydate.render({
+                        elem: this.firstChild
+                        , show: true //鐩存帴鏄剧ず
+                        , closeStop: this
+                        , done: function (nowDate) {
+                            //鏃堕棿閫夋嫨瀹屾垚锛岃鏁版嵁鏇存柊
+                            data[field] = nowDate;
+                            obj.update(data);
+                        }
+                    });
+                }
+            });
+            //#endregion
+
+            //#region 鐩戝惉鍗曞厓鏍肩紪杈�  鍗曞厓鏍肩紪杈戝悗 鍙樻洿
+            table.on('edit(mainTable)', function (obj) {
+                // 鍗曞厓鏍肩紪杈戜箣鍓嶇殑鍊�
+                var oldText = $(this).prev().text();
+                var value = obj.value //寰楀埌淇敼鍚庣殑鍊�
+                    , data = obj.data //寰楀埌鎵�鍦ㄨ鎵�鏈夐敭鍊�
+                    , field = obj.field; //寰楀埌瀛楁
+                //layer.msg('[ID: ' + data.id + '] ' + field + ' 瀛楁鏇存敼涓猴細' + value);
+
+                switch (field) {
+                    case "HRate":     //鐢ㄩ噺
+                        //value = (value * 1).toFixed(6);
+
+                        //var HWeight = $("#HWeight").val();
+                        //var HWaterQty = $("#HWaterQty").val();
+                        //var HRate = value;
+                        //var HQty = 0;
+                        //var HMaterRuleType = obj.data.HMaterRuleType;
+                        //if (HMaterRuleType == "鏌撴枡") {
+                        //    HQty = HRate * HWeight;
+                        //} else if (HMaterRuleType == "鍔╁墏") {
+                        //    HQty = HRate * HWaterQty;
+                        //}
+                        ////鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+                        //obj.update({
+                        //    HRate: value,
+                        //    HQty: HQty
+                        //});
+                        //table.render(option);
+                        break;
+                    default:
+                }
+            });
+            //#endregion
+            //#endregion
+            //#endregion
+
+
+            //#region 鏈〉闈㈡墍鏈夎璋冪敤鐨勬柟娉�
+            //#region 鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
+            function get_LoginIs() {
+                if (sessionStorage.login != "login") {
+                    layer.confirm("鐧诲綍澶辨晥锛岃閲嶆柊鐧诲綍锛�", {
+                        icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍']
+                    }, function () { window.location.href = "../../user/login.html"; });
+                }
+            }
+            //#endregion
+
+            //#region  鏃堕棿杞崲
+            function formatDate(date) {
+                var d = new Date(date),
+                    month = '' + (d.getMonth() + 1),
+                    day = '' + d.getDate(),
+                    year = d.getFullYear();
+
+                if (month.length < 2) {
+                    month = '0' + month;
+                }
+                if (day.length < 2) {
+                    day = '0' + day;
+                }
+
+                return [year, month, day].join('-');
+            }
+            //#endregion
+
+            //#region 鑾峰彇缁勭粐
+            function Organ() {
+                //鑾峰彇鐧诲綍椤电粍缁囧垪
+                var Organization = '';
+                $.ajax({
+                    type: "get",
+                    url: GetWEBURL() + "/Web/GetOrganizations",
+                    success: function (result) {
+                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data;
+                            for (var i = 0; i < data.length; i++) {
+                                Organization += '<option  style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
+                            }
+                            $("#HOrgID").append(Organization);
+                            if (OperationType == 1 || OperationType == 4) {
+                                HOrgIDBar = sessionStorage["OrganizationID"];
+                            }
+                            $("#HOrgID").val(HOrgIDBar);
+                            form.render('select');
+                        }
+                        layer.closeAll("loading");
+                    }
+                })
+            }
+            //#endregion
+
+            //#region 鐢熸垚鍗曟嵁鍙�
+            function createBillNo() {
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    data: { "HBillType": HBillType },
+                    success: function (d) {
+                        $("#HInterID").val(d.data[0].HInterID);
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                    }
+                });
+            }
+            //#endregion
+
+            //#region 瀛愯〃1鍒濆鍖�
+            function set_InitGrid() {
+                option = {
+                    elem: '#mainTable'
+                    , toolbar: '#toolbarDemo'
+                    , limit: 500
+                    , height: 500
+                    , loading: false
+                    , cols: [[ //瀛愯〃
+                        { type: 'checkbox', totalRowText: '鍚堣琛�' }
+                        , { type: 'numbers', title: '搴忓彿', width: 100, totalRow: true }
+                        , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true }
+                        , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', width: 150, edit: 'text', event: "HMaterID" }//f7
+                        , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', width: 150, }
+                        , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 100, }
+                        , { field: 'HUnitID', title: 'HUnitID', width: 100, hide: true }
+                        , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', width: 100 }//f7
+                        , { field: 'HQty_Old', title: '鍘熸暟閲�', width: 100}
+                        , { field: 'HQty_New', title: '鏂版暟閲�', width: 100, edit: 'text' }
+                        , { field: 'HTaxPrice_Old', title: '鍘熷惈绋庡崟浠�', width: 100 }
+                        , { field: 'HTaxPrice_New', title: '鏂板惈绋庡崟浠�', width: 100, edit: 'text' }
+                        , { field: 'HDate_Old', title: '鍘熶氦璐ф棩鏈�', edit: 'text', width: 120 }
+                        , { field: 'HDate_New', title: '鏂颁氦璐ф棩鏈�', event: "HDate_New", width: 120 }
+                        , { field: 'HRemark', title: '澶囨敞', width: 100, edit: 'text' }
+
+                        , { field: 'HSourceInterID', title: '婧愬崟鍐呯爜', edit: 'text', hide: true, style: 'background-color: #f9f9f9;' }     //f7
+                        , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', edit: 'text', hide: true, style: 'background-color: #f9f9f9;' }     //f7
+                        , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', edit: 'text', hide: true, style: 'background-color: #f9f9f9;' }     //f7
+                        , { field: 'HSourceBillType', title: '婧愬崟绫诲瀷', edit: 'text', hide: true, style: 'background-color: #f9f9f9;' }     //f7
+
+                        , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 70 }
+                    ]]
+                }
+
+                var rowdata = [{
+                    "HMaterID": "0",
+                    "鐗╂枡浠g爜": "",
+                    "鐗╂枡鍚嶇О": "",
+                    "瑙勬牸鍨嬪彿": "",
+                    "HUnitID": "0",
+                    "璁¢噺鍗曚綅": "",
+                    "HQty_Old": "0",
+                    "HQty_New": "0",
+                    "HTaxPrice_Old": "0",
+                    "HTaxPrice_New": "0",
+                    "HDate_Old": "",
+                    "HDate_New": "",
+
+                    "HRemark": "",
+                    "HSourceInterID": "0",
+                    "HSourceEntryID": "0",
+                    "HSourceBillNo": "",
+                    "HSourceBillType": ""
+                }];
+
+                option.data = rowdata;
+                table.render(option);
+            }
+            //#endregion
+
+            //#region 鏂板椤甸潰鍒濆鍖�
+            function Init_setAdd() {
+                //璁剧疆鎿嶄綔绫诲瀷涓� 鏂板
+                OperationType = 1;
+
+                //鐢熸垚骞惰缃富琛ㄧ殑鍐呯爜鍜屽崟鎹彿
+                createBillNo();
+
+                //鐩稿叧鏂囨湰妗嗕俊鎭垵濮嬪寲
+                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HMaker").val(sessionStorage["HUserName"]);
+                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
+
+                //鍒濆鍖栧苟鍒楄缃細瀛愯〃1
+                set_InitGrid();
+                DisPlay_HideColumn();
+            }
+            //#endregion
+
+            //#region 缂栬緫椤甸潰鍒濆鍖�
+            function RoadBillMain(linterid) {
+                //鏌ヨ妫�楠屾柟妗堝崟鏄惁瀛樺湪
+                var ajaxLoad = layer.load();
+                $.ajax({
+                    url: GetWEBURL() + "/Xs_SeOrderChangeBill/cx",
+                    async: false,
+                    type: "GET",
+                    data: {
+                        "HInterID": linterid
+                    },
+                    success: function (result) {
+                        if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data[0];
+
+                            form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+                                "HBillNo": data.鍗曟嵁鍙�
+                                , "HDate": formatDate(data.鏃ユ湡)
+                                , "HDeptID": data.HDeptID
+                                , "HDeptName": data.閿�鍞儴闂�
+                                , "HEmpID": data.HEmpID
+                                , "HEmpName": data.閿�鍞憳
+                                , "HCurID": data.HCurID
+                                , "HCurName": data.甯佸埆
+                                , "HExRate": data.姹囩巼
+                                , "HCusID": data.HCusID
+                                , "HCusName": data.涓氬姟瀹㈡埛
+                                , "HSSID": data.HSSID
+                                , "HSSName": data.缁撶畻鏂瑰紡
+                                , "HSellSID": data.HSellSID
+                                , "HSellSName": data.閿�鍞柟寮�
+                                , "HExplanation": data.鍙樻洿鍘熷洜
+                                , "HRemark": data.琛ㄥご澶囨敞
+
+                                , "HMainSourceInterID": data.HMainSourceInterID
+                                , "HMainSourceEntryID": data.HMainSourceEntryID
+                                , "HMainSourceBillNo": data.HMainSourceBillNo
+                                , "HMainSourceBillType": data.HMainSourceBillType
+                                
+                                , "HMaker": data.鍒跺崟浜�
+                                , "HMakeDate": data.鍒跺崟浜� == "" ? "" :formatDate(data.鍒跺崟鏃ユ湡)
+                                , "HUpDater": data.淇敼浜�
+                                , "HUpDateDate": data.淇敼浜� == ""?"":formatDate(data.淇敼鏃ユ湡)
+                                , "HChecker": data.瀹℃牳浜�
+                                , "HCheckDate": data.瀹℃牳浜� == "" ? "" :formatDate(data.瀹℃牳鏃ユ湡)
+                                , "HCloseMan": data.鍏抽棴浜�
+                                , "HCloseDate": data.鍏抽棴浜� == "" ? "" :formatDate(data.鍏抽棴鏃ユ湡)
+                                , "HDeleteMan": data.浣滃簾浜�
+                                , "HDeleteDate": data.浣滃簾浜� == "" ? "" :formatDate(data.浣滃簾鏃ユ湡)
+                            });
+
+                            //缁勭粐鐨勫�糎OrgID鍙樺寲锛岄噸鏂版覆鏌�
+                            HOrgIDBar = data.HOrgID;
+
+                            //瀛愯〃  璧嬪��
+                            var rowdata = [];
+                            for (var i = 0; i < result.data.length; i++) {
+                                rowdata.push(
+                                    {
+                                        "HMaterID": result.data[i]["HMaterID"],
+                                        "鐗╂枡浠g爜": result.data[i]["鐗╂枡浠g爜"],
+                                        "鐗╂枡鍚嶇О": result.data[i]["鐗╂枡鍚嶇О"],
+                                        "瑙勬牸鍨嬪彿": result.data[i]["瑙勬牸鍨嬪彿"],
+                                        "HUnitID": result.data[i]["HUnitID"],
+                                        "璁¢噺鍗曚綅": result.data[i]["璁¢噺鍗曚綅"],
+                                        "HQty_Old": result.data[i]["鍘熸暟閲�"],
+                                        "HQty_New": result.data[i]["鏂版暟閲�"],
+                                        "HTaxPrice_Old": result.data[i]["鍘熷惈绋庡崟浠�"],
+                                        "HTaxPrice_New": result.data[i]["鏂板惈绋庡崟浠�"],
+                                        "HDate_Old": formatDate(result.data[i]["鍘熶氦璐ф棩鏈�"]),
+                                        "HDate_New": formatDate(result.data[i]["鏂颁氦璐ф棩鏈�"]),
+                                        "HRemark": result.data[i]["琛ㄤ綋澶囨敞"],
+                                        "HSourceInterID": result.data[i]["HSourceInterID"],
+                                        "HSourceEntryID": result.data[i]["HSourceEntryID"],
+                                        "HSourceBillNo": result.data[i]["HSourceBillNo"],
+                                        "HSourceBillType": result.data[i]["HSourceBillType"]
+                                    }
+                                );
+                            }
+                            option.data = rowdata;
+
+                            table.render(option);
+                            layer.close(ajaxLoad);
+                        } else {
+                            layer.close(ajaxLoad);
+                            layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                        }
+                    }, error: function () {
+                        layer.close(ajaxLoad);
+                        layer.alert("鍙戠敓閿欒!", { icon: 5 });
+                    }
+                });
+            }
+            //#endregion
+
+            //#region 寮圭獥閫夋嫨鏂规硶
+            //#region 閿�鍞儴闂ㄩ�夋嫨椤甸潰
+            function get_checkDept() {
+                layer.open({
+                    type: 2//寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['90%', '90%']//澶у皬
+                    , title: '閿�鍞儴闂ㄥ垪琛�'//鏍囬
+                    , shift: 2//寮瑰嚭鍔ㄧ敾
+                    , content: ['../../Baseset/鍩虹璧勬枡/Gy_DepartmentList.html', 'yes']
+                    , btn: ['纭畾', '鍙栨秷']
+                    , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                        var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                        if (checkStatus.data.length === 0) {
+                            return layer.msg('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HDeptName").val(checkStatus.data[0].HName);
+                        $("#HDeptID").val(checkStatus.data[0].HItemID);
+                        layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) { }
+                })
+            }
+            //#endregion
+
+            //#region 閿�鍞憳閫夋嫨椤甸潰
+            function get_checkEmp() {
+                layer.open({
+                    type: 2//寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['90%', '90%']//澶у皬
+                    , title: '閿�鍞憳鍒楄〃'//鏍囬
+                    , shift: 2//寮瑰嚭鍔ㄧ敾
+                    , content: ['../../Baseset/鍩虹璧勬枡/Gy_EmployeeList.html?Type=HEmp', 'yes']
+                    , btn: ['纭畾', '鍙栨秷']
+                    , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                        var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                        if (checkStatus.data.length === 0) {
+                            return layer.msg('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HEmpName").val(checkStatus.data[0].HName);
+                        $("#HEmpID").val(checkStatus.data[0].HItemID);
+                        layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) { }
+                })
+            }
+            //#endregion
+
+            //#region 閿�鍞竵鍒�夋嫨椤甸潰
+            function get_checkCur() {
+                layer.open({
+                    type: 2//寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['90%', '90%']//澶у皬
+                    , title: '閿�鍞竵鍒垪琛�'//鏍囬
+                    , shift: 2//寮瑰嚭鍔ㄧ敾
+                    , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Currency.html', 'yes']
+                    , btn: ['纭畾', '鍙栨秷']
+                    , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                        var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                        if (checkStatus.data.length === 0) {
+                            return layer.msg('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HCurName").val(checkStatus.data[0].璐у竵鍚嶇О);
+                        $("#HCurID").val(checkStatus.data[0].HItemID);
+                        $("#HExRate").val(checkStatus.data[0].姹囩巼)
+                        layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) { }
+                })
+            }
+            //#endregion
+
+            //#region 瀹㈡埛閫夋嫨椤甸潰
+            function get_checkCus() {
+                layer.open({
+                    type: 2//寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['90%', '90%']//澶у皬
+                    , title: '瀹㈡埛鍒楄〃'//鏍囬
+                    , shift: 2//寮瑰嚭鍔ㄧ敾
+                    , content: ['../../Baseset/鍩虹璧勬枡/Gy_CustomerList.html', 'yes']
+                    , btn: ['纭畾', '鍙栨秷']
+                    , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                        var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                        if (checkStatus.data.length === 0) {
+                            return layer.msg('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HCusName").val(checkStatus.data[0].HName);
+                        $("#HCusID").val(checkStatus.data[0].HItemID);
+                        layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) { }
+                })
+            }
+            //#endregion
+
+            //#region 缁撶畻鏂瑰紡閫夋嫨椤甸潰
+            function get_checkSS() {
+                layer.open({
+                    type: 2//寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['90%', '90%']//澶у皬
+                    , title: '缁撶畻鏂瑰紡鍒楄〃'//鏍囬
+                    , shift: 2//寮瑰嚭鍔ㄧ敾
+                    , content: ['../../Baseset/鍩虹璧勬枡/Gy_SettleStyle.html', 'yes']
+                    , btn: ['纭畾', '鍙栨秷']
+                    , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                        var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                        if (checkStatus.data.length === 0) {
+                            return layer.msg('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HSSName").val(checkStatus.data[0].HName);
+                        $("#HSSID").val(checkStatus.data[0].HItemID);
+                        layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) { }
+                })
+            }
+            //#endregion
+
+            //#region 閿�鍞柟寮忛�夋嫨椤甸潰
+            function get_checkSellS() {
+                layer.open({
+                    type: 2//寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['90%', '90%']//澶у皬
+                    , title: '閿�鍞柟寮忓垪琛�'//鏍囬
+                    , shift: 2//寮瑰嚭鍔ㄧ敾
+                    , content: ['../../Baseset/鍩虹璧勬枡/Gy_SellStyle.html', 'yes']
+                    , btn: ['纭畾', '鍙栨秷']
+                    , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                        var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                        if (checkStatus.data.length === 0) {
+                            return layer.msg('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HSellSName").val(checkStatus.data[0].HName);
+                        $("#HSellSID").val(checkStatus.data[0].HItemID);
+                        layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) { }
+                })
+            }
+            //#endregion
+
+            //#region 閿�鍞富绠¢�夋嫨椤甸潰
+            function get_checkManager() {
+                layer.open({
+                    type: 2//寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['90%', '90%']//澶у皬
+                    , title: '閿�鍞富绠″垪琛�'//鏍囬
+                    , shift: 2//寮瑰嚭鍔ㄧ敾
+                    , content: ['../../Baseset/鍩虹璧勬枡/Gy_EmployeeList.html?Type=HManager', 'yes']
+                    , btn: ['纭畾', '鍙栨秷']
+                    , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                        var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                        if (checkStatus.data.length === 0) {
+                            return layer.msg('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HManagerName").val(checkStatus.data[0].HName);
+                        $("#HManagerID").val(checkStatus.data[0].HItemID);
+                        layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) { }
+                })
+            }
+            //#endregion
+            //#endregion
+
+            //#region 淇濆瓨鏂规硶
+            function set_SaveBill(data) {
+                //璁板綍鎿嶄綔绫诲瀷
+                var refSav = "";
+                if (OperationType == 1 || OperationType == 2) {
+                    refSav = "Add";
+                    data.field.HChangeDate = new Date();
+                }
+                if (OperationType == 3) {
+                    refSav = "Update";
+                    data.field.HChangeDate = new Date();
+                }
+
+                //鑻ヤ负缂栬緫-淇濆瓨锛屽垯鏇存柊淇敼浜哄拰淇敼鏃堕棿
+                if (OperationType == 3) {
+                    data.field.HUpDater = sessionStorage["HUserName"];
+                    data.field.HUpDateDate = Format(new Date(), "yyyy-MM-dd");
+                    $("#HUpDater").val(sessionStorage["HUserName"]);
+                    $("#HUpDateDate").val(Format(new Date(), "yyyy-MM-dd"));
+                }
+                //搴忓垪鍖栬〃澶翠俊鎭拰瀛愯〃淇℃伅
+                var sMainStr = JSON.stringify(data.field);
+                var sSubStr = JSON.stringify(option.data);
+                //鎷兼帴鍙傛暟
+                var sMainSub = sMainStr + ';' + sSubStr + ';' + refSav + ";" + sessionStorage["HUserName"];
+
+                var index = layer.load();
+                $.ajax({
+                    type: "POST",
+                    url: GetWEBURL() + "/Xs_SeOrderChangeBill/SaveXs_SeOrderChangeBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                    async: true,
+                    data: { "msg": sMainSub },
+                    dataType: "json",
+                    success: function (data) {
+                        if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            layer.msg(data.Message, { icon: 1 });
+                            $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
+                            layer.close(index);
+                        }
+                        else {
+                            layer.alert(data.Message, { icon: 5 });
+                            layer.close(index);
+                        }
+                    },
+                    error: function (err) {
+                        layer.alert("閿欒:" + err, { icon: 5 });
+                        layer.close(index);
+                    }
+                });
+            }
+            //#endregion
+
+            //#region 鏁版嵁鏍¢獙
+            function AllowLoadData(data) {
+                //鏁板�兼牸寮忔牎楠屽伐鍏�
+                var ref = /^\d+(\.\d+)?$/;          //闈炶礋鏁版鍒欒〃杈惧紡
+                var temp = "";
+
+                //#region 琛ㄥご鏁版嵁妫�楠�
+                if ($("#HBillNo").val() == "") {
+                    layer.msg("鍗曟嵁缂栧彿涓嶈兘涓虹┖!");
+                    return false;
+                }
+
+                if ($("#HDate").val() == "") {
+                    layer.msg("鏃ユ湡涓嶈兘涓虹┖!");
+                    return false;
+                }
+
+                if ($("#HDeptID").val() == "0") {
+                    layer.msg("閿�鍞儴闂ㄦ湭閫夋嫨!");
+                    return false;
+                }
+
+                if ($("#HCusID").val() == "0") {
+                    layer.msg("瀹㈡埛鏈�夋嫨!");
+                    return false;
+                }
+
+                if ($("#HEmpID").val() == "0") {
+                    layer.msg("閿�鍞憳鏈�夋嫨!");
+                    return false;
+                }
+
+                if ($("#HCurID").val() == "0") {
+                    layer.msg("閿�鍞竵鍒湭閫夋嫨!");
+                    return false;
+                }
+
+                if ($("#HMangerID").val() == "0") {
+                    layer.msg("閿�鍞富绠℃湭閫夋嫨!");
+                    return false;
+                }
+
+                if ($("#HSSID").val() == "0") {
+                    layer.msg("缁撶畻鏂瑰紡鏈�夋嫨!");
+                    return false;
+                }
+
+                //if ($("#HPayCusID").val() == "0") {
+                //    layer.msg("缁撶畻鏂规湭閫夋嫨!");
+                //    return false;
+                //}
+
+                //if ($("#HSSDate").val() == "") {
+                //    layer.msg("缁撶畻鏃ユ湡鏈缃�!");
+                //    return false;
+                //}
+
+                temp = $("HExRate").val() + "";
+                if (temp == 0 || temp == "") {
+                    layer.msg("姹囩巼涓嶈兘涓�0鎴栫┖!");
+                    return false;
+                } else if (!ref.test(temp)){
+                    layer.msg("姹囩巼璇疯緭鍏ュぇ浜�0鐨勬暟瀛�!");
+                    return false;
+                }
+                //#endregion
+
+                //#region 瀛愯〃 鏁版嵁妫�楠�
+                for (var i = 0; i < option.data.length; i++) {
+                    if (option.data[i]["HMaterID"] == "0") {
+                        layer.msg("绗�" + i + "琛岋細鐗╂枡鏈�夋嫨锛�");
+                        return false;
+                    }
+
+                    if (option.data[i]["HUnitID"] == "0") {
+                        layer.msg("绗�" + i + "琛岋細璁¢噺鍗曚綅鏈�夋嫨锛�");
+                        return false;
+                    }
+
+                    if (option.data[i]["HDate"] == "") {
+                        layer.msg("绗�" + i + "琛岋細浜よ揣鏃ユ湡涓嶈兘涓虹┖锛�");
+                        return false;
+                    }
+
+                    //鏁伴噺鏍煎紡鏍¢獙
+                    temp = option.data[i]["HQty"] + "";
+                    if (temp == "0") {
+                        layer.msg("绗�" + i + "琛岋細鏁伴噺涓嶈兘涓�0锛�");
+                        return false;
+                    } else if (!ref.test(temp)) {
+                        layer.msg("绗�" + i + "琛岋細鏁伴噺璇疯緭鍏ュぇ浜�0鐨勬暟瀛楋紒");
+                        return false;
+                    }
+
+                    //鍗曚环鏍煎紡鏍¢獙
+                    temp = option.data[i]["HPrice"] + "";
+                    if (temp == "0") {
+                        layer.msg("绗�" + i + "琛岋細鍗曚环涓嶈兘涓�0锛�");
+                        return false;
+                    } else if (!ref.test(temp)) {
+                        layer.msg("绗�" + i + "琛岋細鍗曚环璇疯緭鍏ュぇ浜�0鐨勬暟瀛楋紒");
+                        return false;
+                    }
+
+                    //鍚◣鍗曚环鏍煎紡鏍¢獙
+                    temp = option.data[i]["HTaxPrice"] + "";
+                    if (temp == "0") {
+                        layer.msg("绗�" + i + "琛岋細鍚◣鍗曚环涓嶈兘涓�0锛�");
+                        return false;
+                    } else if (!ref.test(temp)) {
+                        layer.msg("绗�" + i + "琛岋細鍚◣鍗曚环璇疯緭鍏ュぇ浜�0鐨勬暟瀛楋紒");
+                        return false;
+                    }
+
+                    //閲戦鏍煎紡鏍¢獙
+                    temp = option.data[i]["HMoney"] + "";
+                    if (temp == "0") {
+                        layer.msg("绗�" + i + "琛岋細閲戦涓嶈兘涓�0锛�");
+                        return false;
+                    } else if (!ref.test(temp)) {
+                        layer.msg("绗�" + i + "琛岋細閲戦璇疯緭鍏ュぇ浜�0鐨勬暟瀛楋紒");
+                        return false;
+                    }
+
+                    ////鎶樻墸鐜囨牸寮忔牎楠�
+                    //temp = option.data[i]["HDiscountRate"] + "";
+                    //if (temp == "0") {
+                    //    layer.msg("绗�" + i + "琛岋細鎶樻墸鐜囦笉鑳戒负0锛�");
+                    //    return false;
+                    //} else if (!ref.test(temp)) {
+                    //    layer.msg("绗�" + i + "琛岋細鎶樻墸鐜囪杈撳叆澶т簬0鐨勬暟瀛楋紒");
+                    //    return false;
+                    //}
+
+                    ////瀹為檯鍚◣鍗曚环鏍煎紡鏍¢獙
+                    //temp = option.data[i]["HRelTaxPrice"] + "";
+                    //if (temp == "0") {
+                    //    layer.msg("绗�" + i + "琛岋細瀹為檯鍚◣鍗曚环涓嶈兘涓�0锛�");
+                    //    return false;
+                    //} else if (!ref.test(temp)) {
+                    //    layer.msg("绗�" + i + "琛岋細瀹為檯鍚◣鍗曚环璇疯緭鍏ュぇ浜�0鐨勬暟瀛楋紒");
+                    //    return false;
+                    //}
+
+                    //绋庣巼鏍煎紡鏍¢獙
+                    temp = option.data[i]["HTaxRate"] + "";
+                    if (temp == "0") {
+                        layer.msg("绗�" + i + "琛岋細绋庣巼涓嶈兘涓�0锛�");
+                        return false;
+                    } else if (!ref.test(temp)) {
+                        layer.msg("绗�" + i + "琛岋細绋庣巼璇疯緭鍏ュぇ浜�0鐨勬暟瀛楋紒");
+                        return false;
+                    }
+
+                    //绋庨鏍煎紡鏍¢獙
+                    temp = option.data[i]["HTaxMoney"] + "";
+                    if (temp == "0") {
+                        layer.msg("绗�" + i + "琛岋細绋庨涓嶈兘涓�0锛�");
+                        return false;
+                    } else if (!ref.test(temp)) {
+                        layer.msg("绗�" + i + "琛岋細绋庨璇疯緭鍏ュぇ浜�0鐨勬暟瀛楋紒");
+                        return false;
+                    }
+
+                    //浠风◣鍚堣鏍煎紡鏍¢獙
+                    temp = option.data[i]["HlineTotal"] + "";
+                    if (temp == "0") {
+                        layer.msg("绗�" + i + "琛岋細浠风◣鍚堣涓嶈兘涓�0锛�");
+                        return false;
+                    } else if (!ref.test(temp)) {
+                        layer.msg("绗�" + i + "琛岋細浠风◣鍚堣璇疯緭鍏ュぇ浜�0鐨勬暟瀛楋紒");
+                        return false;
+                    }
+
+                    ////鏈綅甯佷环绋庡悎璁℃牸寮忔牎楠�
+                    //temp = option.data[i]["HlineTotalBB"] + "";
+                    //if (temp == "0") {
+                    //    layer.msg("绗�" + i + "琛岋細鏈綅甯佷环绋庡悎璁′笉鑳戒负0锛�");
+                    //    return false;
+                    //} else if (!ref.test(temp)) {
+                    //    layer.msg("绗�" + i + "琛岋細鏈綅甯佷环绋庡悎璁¤杈撳叆澶т簬0鐨勬暟瀛楋紒");
+                    //    return false;
+                    //}
+
+                    ////鍑哄簱鏁伴噺鏍煎紡鏍¢獙
+                    //temp = option.data[i]["HOutStockQty"] + "";
+                    //if (!ref.test(temp)) {
+                    //    layer.msg("绗�" + i + "琛岋細鍑哄簱鏁伴噺璇疯緭鍏ュぇ浜�0鐨勬暟瀛楋紒");
+                    //    return false;
+                    //}
+
+                    ////寮�绁ㄦ暟閲忔牸寮忔牎楠�
+                    //temp = option.data[i]["HInvoiceQty"] + "";
+                    //if (!ref.test(temp)) {
+                    //    layer.msg("绗�" + i + "琛岋細寮�绁ㄦ暟閲忚杈撳叆澶т簬0鐨勬暟瀛楋紒");
+                    //    return false;
+                    //}
+                }
+                //#endregion
+
+                //#region 瀛愯〃 鍏抽敭瀛楅噸澶嶆牎楠�
+                var num = [];
+                for (var i = 0; i < option.data.length; i++) {
+                    if ($.inArray(option.data[i]["HMaterID"], num) == -1) {
+                        num.push(option.data[i]["HMaterID"]);
+                    } else {
+                        layer.msg("绗�" + (i + 1) + "琛�,鐗╂枡:" + option.data[i]["HMaterID"] + "閲嶅!");
+                        return false;
+                    }
+                }
+                //#endregion
+                return true;
+            }
+            //#endregion
+
+            //#region 鍦ㄦ湯灏惧鍔犱竴琛�
+            function btnAddLine(NewRow) {
+                table.cache["mainTable"].push(NewRow);
+                option.data = table.cache["mainTable"];
+                table.render(option);
+                //rows++;
+                layer.msg('澧炲姞涓�琛屾寜閽紒')
+            }
+            //#endregion
+
+            //#region 鍦ㄦ寚瀹氳涓嬫彃鍏ヤ竴琛�
+            function btnInsertLine(NewRow) {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var tables = [];                                    //瀛樺偍鎻掑叆涓�琛屽悗鐨勮〃鏍兼暟鎹�
+                    //鑾峰彇琛ㄦ牸鐨勫叏閮ㄨ
+                    var rowList = table.cache['mainTable'];
+                    for (var i = 0; i < rowList.length; i++) {          //閬嶅巻琛ㄦ牸鐨勮
+                        tables.push(option.data[i]);
+                        if (rowList[i].LAY_CHECKED == true) {           //鑾峰彇閫変腑琛岀殑浣嶇疆
+                            tables.push(NewRow);
+                        }
+                    }
+                    option.data = tables;
+                    table.render(option);
+                } else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
+                }
+            }
+            //#endregion
+
+            //#region 澶嶅埗涓�琛�
+            function btnCopyLine(data) {
+                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涓�
+                    //璁剧疆澶嶅埗寰楀埌鐨勮褰曠殑瀹為檯绉伴噸涓�0
+                    option.data[option.data.length - 1].HWeight = "0";
+
+                    table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
+                }
+            }
+            //#endregion
+
+            //#region 涓婄Щ
+            function btn_up() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (data.length == 1) {
+                    var tables = [];
+                    //鑾峰彇琛ㄦ牸鐨勫叏閮ㄨ
+                    var rowList = table.cache['mainTable'];
+                    for (var i = 0; i < rowList.length; i++) {          //閬嶅巻琛ㄦ牸鐨勮
+                        if (rowList[i].LAY_CHECKED == true) {           //鑾峰彇閫変腑琛岀殑浣嶇疆
+                            //濡傛灉鏄涓�琛屼笂绉伙紝鍒欏け璐ュ苟鎻愰啋
+                            if (i == 0) {
+                                layer.msg("绗竴琛屾暟鎹棤娉曚笂绉伙紒");
+                                return;
+                            }
+                            tables.push(option.data[i - 1]);
+                            data[0].LAY_CHECKED = true;
+                            option.data[i - 1] = data[0];
+                            option.data[i] = tables[0];
+                            table.render(option);
+                            break;
+                        }
+                    }
+                } else {
+                    layer.msg("璇烽�夋嫨涓�琛屾暟鎹紒");
+                }
+            }
+            //#endregion
+
+            //#region 涓嬬Щ
+            function btn_under() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (data.length == 1) {
+                    var tables = [];
+                    //鑾峰彇琛ㄦ牸鐨勫叏閮ㄨ
+                    var rowList = table.cache['mainTable'];
+                    for (var i = 0; i < rowList.length; i++) {          //閬嶅巻琛ㄦ牸鐨勮
+                        if (rowList[i].LAY_CHECKED == true) {           //鑾峰彇閫変腑琛岀殑浣嶇疆
+                            //濡傛灉鏄渶鍚庝竴琛屼笅绉伙紝鍒欏け璐ュ苟鎻愰啋
+                            if (i == option.data.length - 1) {
+                                layer.msg("鏈�鍚庝竴琛屾暟鎹棤娉曚笅绉伙紒");
+                                return;
+                            }
+
+
+                            tables.push(option.data[i + 1]);
+                            data[0].LAY_CHECKED = true;
+                            option.data[i + 1] = data[0];
+                            option.data[i] = tables[0];
+                            table.render(option);
+                            break;
+                        }
+                    }
+                } else {
+                    layer.msg("璇烽�夋嫨涓�琛屾暟鎹紒");
+                }
+            }
+            //#endregion
+
+            //#region 琛ㄦ牸琛屽唴浜嬩欢鍒犻櫎
+            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();
+                            //layer.close(index);
+                            var oldData = table.cache["mainTable"];
+                            oldData.splice(obj.tr.data('index'), 1);
+                            option.data = oldData;
+                            table.render(option);
+                            layer.close(index);
+                        }
+                    });
+                }
+            }
+            //#endregion
+
+            //#region 琛屽唴蹇嵎閿瓫閫�
+            function set_GridCellCheck(obj) {
+                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
+                    if (event.key == "F7") {
+                        //鐗╂枡
+                        if (obj.event == "HMaterID") {
+                            layer.open({
+                                type: 2
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "鐗╂枡鍒楄〃"  //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ['../../Baseset/鍩虹璧勬枡/Gy_MaterialList.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({
+                                        "HMaterID": checkStatus.data[0].HItemID
+                                        , "鐗╂枡浠g爜": checkStatus.data[0].HNumber
+                                        , "鐗╂枡鍚嶇О": checkStatus.data[0].HName
+                                        , "瑙勬牸鍨嬪彿": checkStatus.data[0].HModel
+                                        , "HUnitID": checkStatus.data[0].HUnitID
+                                        , "璁¢噺鍗曚綅": checkStatus.data[0].HUnitName
+                                    })
+                                    layer.close(index);//鍏抽棴寮圭獥
+                                }
+                            })
+                        }
+                        //璁¢噺鍗曚綅
+                        if (obj.event == "HUnitID") {
+                            layer.open({
+                                type: 2
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "璁¢噺鍗曚綅鍒楄〃"  //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ['../../Baseset/鍩虹璧勬枡/Gy_UnitList.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
+                                        , "HUnitID": checkStatus.data[0].HItemID
+                                    })
+                                    layer.close(index);//鍏抽棴寮圭獥
+                                }
+                            })
+                        }
+                        obj.event = "";
+                        return false;
+                    }
+                })
+            }
+            //#endregion
+
+            //#region 瀛愯〃1锛氶殣钘忓垪璁剧疆
+            function get_HideColumn() {
+                var colName = "";
+                var contentUrl = "";
+                for (var i = 1; i < option.cols[0].length - 1; i++) {
+                    colName += option.cols[0][i]["title"] + ",";
+                }
+                var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞
+                var urlLen = urlStr.split('/');
+                for (var i = 0; i < urlLen.length - 4; i++) {
+                    contentUrl += "../";
+                }
+                colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜
+
+                contentUrl += '鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
+
+                layer.open({
+                    type: 2
+                    , skin: "layui-layer-rim" //鍔犱笂杈规
+                    , title: "闅愯棌鍒楄缃�"  //鏍囬
+                    , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                    , shift: 2 //寮瑰嚭鍔ㄧ敾
+                    , area: ["50%", "90%"] //绐椾綋澶у皬
+                    , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                    , content: [contentUrl, "yes"]
+                    , btn: ["纭畾", "鍙栨秷"]
+                    , btn1: function (index, laero) {
+                        //鍒锋柊琛ㄦ牸鏁版嵁
+                        DisPlay_HideColumn();
+                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                        layer.close(index);//鍏抽棴寮圭獥
+                    }
+                })
+            }
+            //#endregion
+            //#region 瀛愯〃1锛氭樉绀哄垪鏁版嵁
+            function DisPlay_HideColumn() {
+                $.ajax({
+                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
+                    type: "GET",
+                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
+                    async: false,
+                    success: function (data1) {
+                        if (data1.data.length != 0) {
+                            var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
+                            var titleData = ["HMaterID", "HUnitID", "婧愬崟鍐呯爜", "婧愬崟瀛愬唴鐮�", "婧愬崟鍗曞彿", "婧愬崟绫诲瀷"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+                            //titleData = [];
+
+                            dataCol = data1.data[0].HGridString.split(',');
+
+                            for (var i = 0; i < option.cols[0].length - 2; i++) {
+                                var dataCols = dataCol[i].split('|');
+                                //闅愯棌鍒�
+                                if (dataCols[1] == 1) {
+                                    option.cols[0][i + 1]["hide"] = true;
+                                }
+                                //璁剧疆鍒楀
+                                if (dataCols[3] > 0) {
+                                    option.cols[0][i + 1]["width"] = dataCols[3];
+                                }
+                                //璁剧疆鍐呭瀛椾綋澶у皬
+                                if (data1.data[0].HFontSize != 0) {
+                                    option.cols[0][i + 1]["style"] += "font-size:" + data1.data[0].HFontSize + "px;";
+                                } else {
+                                    option.cols[0][i + 1]["style"] += "font-size:100%";
+                                }
+                                //璁剧疆鍒楀
+                                //if (data1.data[0].HColumnWidth != 0) {
+                                //    option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
+                                //} else {
+                                //    option.cols[0][i + 1]["width"] = "";
+                                //}
+                                //鏄剧ず鍒�
+                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
+                                    option.cols[0][i + 1]["hide"] = false;
+                                }
+                                //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�)
+                                switch (dataCols[2]) {
+                                    case "L":
+                                        option.cols[0][i + 1]["align"] = "left";
+                                        break;
+                                    case "M":
+                                        option.cols[0][i + 1]["align"] = "center";
+                                        break;
+                                    case "R":
+                                        option.cols[0][i + 1]["align"] = "right";
+                                        break;
+                                }
+                            }
+
+                            //鍙栨秷鍐荤粨鍒�
+                            for (var i = 1; i < option.cols[0].length - 1; i++) {
+                                if (option.cols[0][i]["fixed"] != null) {
+                                    option.cols[0][i]["fixed"] = null;
+                                }
+                                else {
+                                    break;
+                                }
+                            }
+                            //鍐荤粨鍒�
+                            if (data1.data[0].HFixCols != 0) {
+                                for (var i = 0; i < data1.data[0].HFixCols; i++) {
+                                    if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
+                                        data1.data[0].HFixCols += 1;
+                                    }
+                                    option.cols[0][i + 1]["fixed"] = "left";
+                                }
+                            }
+                            table.render(option);
+                        } else {
+                            table.render(option);
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                })
+            }
+            //#endregion
+
+
+            //#region 淇濆瓨鍚庢祻瑙堟柟娉�
+            function ReRoadBillMain() {
+                location.replace('Add_Edit_Cg_POInStockBillList.html?OperationType=4&linterid=' + linterid + '&HSouceBillType=');
+                //document.location.href('Add_Edit_Gy_Source.html ? OperationType = 4 & linterid=' + linterid + ' & HSouceBillType=');
+                $('#set_SaveBill').addClass("layui-btn-disabled").attr("disabled", true);//淇濆瓨鍚庡姞杞芥暟鎹椂淇濆瓨鎸夐挳绂佺敤
+            }
+            //#endregion
+
+            //#endregion
+
+
+            //浠ヤ笂鏄痩ayui妯″潡
+        });
+        // 鍩虹璧勬枡杩斿洖鏁版嵁
+        function GetHEmpValue(obj)  //杩斿洖閿�鍞憳
+        {
+            $("#HEmpName").val(obj[0].HName);
+            $("#HEmpID").val(obj[0].HItemID);
+        }
+
+        function GetHSupValue(obj)  //杩斿洖瀹㈡埛
+        {
+            $("#HCusName").val(obj[0].HName);
+            $("#HCusID").val(obj[0].HItemID);
+        }
+
+        function GetHManagerValue(obj)  //杩斿洖閿�鍞富绠�
+        {
+            $("#HManagerName").val(obj[0].HName);
+            $("#HManagerID").val(obj[0].HItemID);
+        }
+
+        function GetHDeptNameValue(obj)  //杩斿洖閿�鍞儴闂�
+        {
+            $("#HDeptName").val(obj[0].HName);
+            $("#HDeptID").val(obj[0].HItemID);
+        }
+    </script>
+</body>
+</html>
\ No newline at end of file
diff --git "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225\345\217\230\346\233\264\345\215\225/Xs_SeOrderChangeBillList.html" "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225\345\217\230\346\233\264\345\215\225/Xs_SeOrderChangeBillList.html"
new file mode 100644
index 0000000..213d8fd
--- /dev/null
+++ "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225\345\217\230\346\233\264\345\215\225/Xs_SeOrderChangeBillList.html"
@@ -0,0 +1,775 @@
+锘�<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <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">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <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/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/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">
+        <div class="layui-col-md12">
+            <div class="layui-card" style="padding: 1px">
+                <div class="layui-card-body" style="padding: 1px;">
+                    <form class="layui-form" action="" lay-filter="component-form-group">
+                        <div class="layui-collapse">
+                            <div class="layui-colla-item">
+                                <div class="layui-colla-title layui-inline">
+                                    <div class="layui-inline">
+                                        <span>鏇村</span>
+                                    </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" name="HBillNo" id="HBillNo">
+                                    </div>
+                                </div>
+                                <div class="layui-inline">
+                                    <label class="layui-form-label">寮�濮嬫棩鏈�</label>
+                                    <div class="layui-input-block">
+                                        <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="HEndDate" style="width:190px;">
+                                    </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" style="padding: 0px; margin-left: 6%;">
+                                    <div class="layui-row" style="margin-top:5px">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">杩囨护</label>
+                                            <div class="layui-input-block">
+                                                <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;">
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;">
+                                                <option value="0" selected="selected"></option>
+                                                <option value="=">=</option>
+                                                <option value=">=">>=</option>
+                                                <option value=">">></option>
+                                                <option value="<="><=</option>
+                                                <option value="<"><</option>
+                                                <option value="<>"><></option>
+                                                <option value="7">鍖呭惈</option>
+                                                <option value="8">宸﹀寘鍚�</option>
+                                                <option value="9">鍙冲寘鍚�</option>
+                                                <option value="10">涓嶅寘鍚�</option>
+                                            </select>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <input type="text" class="layui-input" value="" name="ColContent" id="ColContent">
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                        <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="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>
+                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="get_view"><i class="layui-icon layui-icon-form"></i>娴忚</button>-->
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></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-Close"><i class="layui-icon layui-icon-radio"></i>鍏抽棴</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeClose"><i class="layui-icon layui-icon-radio"></i>鍙嶅叧闂�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Drop"><i class="layui-icon layui-icon-radio"></i>浣滃簾</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeDrop"><i class="layui-icon layui-icon-radio"></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="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
+                            </div>
+                        </script>
+                    </form>
+                </div>
+            </div>
+        </div>
+    </div>
+    <script>
+        layui.config({
+            base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
+        }).extend({
+            index: 'lib/index', //涓诲叆鍙fā鍧�
+        }).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
+            var option = [];
+            var sWhere = "";
+            var HModName = "Xs_SeOrderChangeBillList";
+            //涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+            var titleData = ["hmainid","HDeptID","HEmpID","HCurID","HCusID","HSSID","HSellSID","HMainSourceInterID","HMainSourceEntryID","HMainSourceBillNo","HMainSourceBillType","HOrgID","HMaterID","HUnitID","HSourceInterID","HSourceEntryID","HSourceBillNo","HSourceBillType"];
+            //#endregion
+
+            //#region 杩涘叆椤甸潰鍗冲姞杞�
+
+            //鍒濆鍖栫晫闈�
+            set_ClearBill();
+
+            //#endregion
+
+            //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+
+            //#region 澶村伐鍏锋爮浜嬩欢
+
+            table.on('toolbar(mainTable)', function (obj) {
+                switch (obj.event) {
+                    //鏂板
+                    case 'set_AddNew': set_AddNew();
+                        break;
+                    //缂栬緫
+                    case 'set_ShowBill': set_ShowBill();
+                        break;
+                    //鍒犻櫎
+                    case 'set_DeleteBill': set_DeleteBill();
+                        break;
+                    //鍒锋柊
+                    case 'get_Refresh': get_Refresh();
+                        break;
+                    ////娴忚
+                    //case 'get_view': get_view();
+                    //    break;
+                    //瀹℃牳鎸夐挳      锛�1:瀹℃牳銆�2:鍙嶅鏍革級
+                    case 'btn-Audit':
+                        set_CheckBill(0);
+                        break;
+                    //鍙嶅鏍告寜閽�
+                    case 'btn-DeAudit':
+                        set_CheckBill(1);
+                        break;
+                    //鍏抽棴鎸夐挳        锛�1:鍏抽棴銆�2:鍙嶅叧闂級
+                    case 'btn-Close':
+                        set_CloseBill(0);
+                        break;
+                    //鍙嶅叧闂寜閽�
+                    case 'btn-DeClose':
+                        set_CloseBill(1);
+                        break;
+                    //浣滃簾鎸夐挳        锛�1:浣滃簾銆�2:鍙嶄綔搴燂級
+                    case 'btn-Drop':
+                        set_DropBill(0);
+                        break;
+                    //鍙嶄綔搴熸寜閽�
+                    case 'btn-DeDrop':
+                        set_DropBill(1);
+                        break;
+                    //閫�鍑烘寜閽�
+                    case 'get_Exit': Pub_Close(2);
+                        break;
+                    //鍒楄缃�
+                    case 'set_HideColumn': get_HideColumn();
+                        break;
+                };
+            });
+            //#endregion
+
+            //#region 鐐瑰嚮琛岄�変腑楂樹寒
+            table.on('row(mainTable)', function (obj) {
+                //閫変腑琛屾敼鍙橀鑹�
+                var flag = !obj.tr.find(':checkbox:first').prop('checked');
+                obj.tr.find(':checkbox').prop('checked', flag);
+                if (flag) {
+                    obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked');  //璁剧疆澶嶉�夋閫変腑鏍峰紡
+                    $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//鏀瑰彉褰撳墠tr鑳屾櫙棰滆壊鍜屽瓧浣撻鑹�
+                } else {
+                    obj.tr.find('.layui-form-checkbox').removeClass('layui-form-checked');//鍙栨秷澶嶉�夋閫変腑鏍峰紡
+                    $(obj.tr.selector).attr({ "style": "background:" });//鍙栨秷褰撳墠tr棰滆壊
+                }
+                //mainTable 涓鸿〃鏍糏D   娉ㄦ剰姝ゅ濡傛灉ID涓嶆纭皢瀵艰嚧浣犲湪鐩戝惉澶嶉�夋鏃惰幏鍙栦笉鍒颁綘閫夋嫨鐨勬暟鎹紝鍓嶉潰鐨勫彧鏄坊鍔犳垨鍒犻櫎閫変腑鏈�変腑鏍峰紡浠ュ強璁剧疆鑳屾櫙鑹诧紝瀛椾綋棰滆壊
+                layui.each(table.cache.mainTable, function (i, l) {
+                    if (obj.tr.index() == l.LAY_TABLE_INDEX) {
+                        l.LAY_CHECKED = flag;
+                    }
+                });
+            })
+            //#endregion
+
+            //#region 鍙屽嚮杩涘叆缂栬緫
+            table.on('rowDouble(mainTable)', function (obj) {
+                //閫変腑楂樹寒 鍙屽嚮琛�
+                obj.tr.find(':checkbox').prop('checked', true);
+                obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked');  //璁剧疆澶嶉�夋閫変腑鏍峰紡
+                $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//鏀瑰彉褰撳墠tr鑳屾櫙棰滆壊鍜屽瓧浣撻鑹�
+                //mainTable 涓鸿〃鏍糏D   娉ㄦ剰姝ゅ濡傛灉ID涓嶆纭皢瀵艰嚧浣犲湪鐩戝惉澶嶉�夋鏃惰幏鍙栦笉鍒颁綘閫夋嫨鐨勬暟鎹紝鍓嶉潰鐨勫彧鏄坊鍔犳垨鍒犻櫎閫変腑鏈�変腑鏍峰紡浠ュ強璁剧疆鑳屾櫙鑹诧紝瀛椾綋棰滆壊
+                layui.each(table.cache.mainTable, function (i, l) {
+                    if (obj.tr.index() == l.LAY_TABLE_INDEX) {
+                        l.LAY_CHECKED = true;
+                    }
+                });
+
+                var linterid = obj.data["hmainid"];
+                layer.open({
+                    type: 2
+                    , area: ['100%', '100%']
+                    , title: '閿�鍞鍗曞彉鏇村崟-缂栬緫'
+                    , shift: 0//寮瑰嚭鍔ㄧ敾
+                    , content: '../../閿�鍞鐞�/閿�鍞鍗曞彉鏇村崟/Xs_SeOrderChangeBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType='
+                    , btn: ['纭畾'],
+                    end: function (index, layero, that) {
+                        //鍒锋柊椤甸潰
+                        $("#btnSearch").trigger('click');
+                    }
+                })
+            });
+            //#endregion
+
+            //#region 閲嶇疆鎸夐挳
+            form.on('submit(btnReSearch)', function (data) {
+                set_ClearQuery();
+            });
+            //#endregion
+
+            //#region 鏌ヨ鎸夐挳
+            form.on('submit(btnSearch)', function (data) {
+                get_FastQuery(2);
+            });
+            //#endregion
+
+            //#endregion
+
+            //#region 鏈〉闈㈡墍鏈夎璋冪敤鐨勬柟娉�
+
+            //#region 鍒濆鍖栫晫闈�
+            function set_ClearBill() {
+                $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
+                //鍒濆鍖栬〃鏍�
+                set_InitGrid();
+                //鏌ヨ
+                get_FastQuery(1);
+                //Organ();
+            }
+            //#endregion
+
+            //#region 鍒濆鍖栬〃鏍兼柟娉�
+            function set_InitGrid() {
+                option = {
+                    elem: '#mainTable'
+                    , toolbar: '#toolbarDemo'
+                    , height: 'full-50'
+                    , page: true
+                    //, cellMinWidth: 90
+                    , limit: 50
+                    , limits: [50, 500, 5000, 50000]
+                };
+            }
+            //#endregion
+            //#endregion
+
+            //#region 鏌ヨ
+            function get_Display(sWhere) {
+                var ajaxLoad = layer.load();
+                $.ajax({
+                    url: GetWEBURL() + '/Xs_SeOrderChangeBill/list',
+                    type: "GET",
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"]},
+                    success: function (data1) {
+                        if (data1.count == 1) {
+                            var data = [];
+                            var col = [];
+                            //缁欑┖鐨勬暟缁勮祴鍊�
+                            for (var key in data1.list) {
+                                data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+                            }
+                            //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+                            col.push({ type: 'checkbox', fixed: 'left' });
+                            for (var i = 0; i < data.length; i++) {
+                                // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
+                                if ($.inArray(data[i].name, titleData) > -1) {
+                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒�
+                                }
+                                else {
+                                    switch (data[i].Type) {
+                                        //int
+                                        case 'DateTime':
+                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width:120 });
+                                            break;
+                                        default:
+                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120 });
+                                    }
+                                }
+                            }
+
+                            option.cols = [col];
+                            option.data = data1.data;
+                            table.render(option);
+
+                            //鍒锋柊琛ㄦ牸鏁版嵁
+                            DisPlay_HideColumn();
+
+                            layer.close(ajaxLoad);
+
+                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+                                ColFilter();
+                            }
+
+                            //layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
+                        } else {
+                            layer.close(ajaxLoad);
+                            layer.alert(data1.code + data1.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.close(ajaxLoad);
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+
+            }
+            //#endregion
+
+            //#region 蹇�熻繃婊�
+            function get_FastQuery(number) {
+                var HBillNo = $("#HBillNo").val();  //鍗曟嵁鍙�
+                var HDate = $("#HBeginDate").val();//寮�濮嬫棩鏈�
+                var HDate1 = $("#HEndDate").val();//缁撴潫鏃ユ湡
+                //浠绘剰瀛楁杩囨护
+                var ColName = $("#ColName").val();//澶嶉�夋
+                var Comparator = $("#Comparator").val()
+                var ColContent = $("#ColContent").val();
+
+                if (ColName != 0 && Comparator != 0) {
+                    var com = "";
+                    switch (Comparator) {
+                        case "7":
+                            com = "like'%" + ColContent + "%'";
+                            break;
+                        case "8":
+                            com = "like'%" + ColContent + "'";
+                            break;
+                        case "9":
+                            com = "like'" + ColContent + "%'";
+                            break;
+                        case "10":
+                            com = "not like'%" + ColContent + "%'";
+                            break;
+                        default:
+                            com = "" + Comparator + "'" + ColContent + "'";
+                            break;
+                    }
+                    sWhere += " and " + ColName + " " + com;
+                }
+                if (HDate) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
+                }
+                if (HDate1) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + HDate1 + "'";
+                }
+                if (HBillNo) {
+                    sWhere += " and 鍗曟嵁鍙� like '%" + HBillNo + "%'";
+                }
+                get_Display(sWhere);
+                sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
+            }
+            //#endregion
+
+            //#region 閲嶇疆杩囨护鏉′欢鏂规硶
+            function set_ClearQuery() {
+                $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HBillNo").val("");
+                $("#ColContent").val("");
+                $("#ColName").val("0");
+                $("#Comparator").val("0");
+                form.render('select');
+
+                sWhere = "";
+            }
+            //#endregion
+
+            //#region 鏂板
+            function set_AddNew() {
+                layer.open({
+                    type: 2
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['100%', '100%']
+                    , title: '閿�鍞鍗曞彉鏇村崟-鏂板'
+                    , shift: 0//寮瑰嚭鍔ㄧ敾
+                    , content: '../../閿�鍞鐞�/閿�鍞鍗曞彉鏇村崟/Xs_SeOrderChangeBill.html?OperationType=1&linterid=0&HSouceBillType='
+                    ,btn: ['纭畾'],
+                    end: function (index, layero, that) {
+                        //鍒锋柊椤甸潰
+                        $("#btnSearch").trigger('click');
+                    }
+                })
+            }
+            //#endregion
+
+            //#region 缂栬緫
+            function set_ShowBill() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var linterid = data[0].hmainid.toString();
+                    //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉
+                    layer.open({
+                        type: 2
+                        , area: ['100%', '100%']
+                        , title: '閿�鍞鍗曞彉鏇村崟-缂栬緫'
+                        , shift: 0//寮瑰嚭鍔ㄧ敾
+                        , content: '../../閿�鍞鐞�/閿�鍞鍗曞彉鏇村崟/Xs_SeOrderChangeBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType='
+                        , btn: ['纭畾'],
+                        end: function (index, layero, that) {
+                            //鍒锋柊椤甸潰
+                            $("#btnSearch").trigger('click');
+                        }
+                    })
+                } else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
+                }
+            }
+            //#endregion
+
+            //#region 娴忚
+            function get_view() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var linterid = data[0].HItemID.toString();
+                    //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉
+                    layer.open({
+                        type: 2
+                        , area: ['100%', '100%']
+                        , title: '椤圭洰闃舵鍒楄〃-娴忚'
+                        , shift: 0//寮瑰嚭鍔ㄧ敾
+                        , content: '../../椤圭洰绠$悊/椤圭洰闃舵/Add_Edit_Gy_ProjectStage.html?OperationType=4&linterid=' + linterid + '&HSouceBillType='
+                        , btn: ['纭畾'],
+                        // 鎸夐挳1 鐨勫洖璋�
+                        btn1: function (index, layero, that) {
+                            //鍒锋柊椤甸潰
+                            //window.location.reload();
+                        }
+                    })
+                } else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
+                }
+            }
+            //#endregion
+
+            //#region 鍒犻櫎
+            function set_DeleteBill() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var HInterID = data[0].hmainid.toString();
+                    layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) {
+                        var wait = layer.load();
+                        //閫昏緫鍒犻櫎鏂规硶
+                        $.ajax({
+                            url: GetWEBURL() + 'Xs_SeOrderChangeBill/delete',
+                            type: "GET",
+                            data: { "HInterID": HInterID, "user": sessionStorage["HUserName"] },
+                            success: function (result) {
+                                console.log('gouba' + result);
+                                if (result.count == 1) {
+                                    layer.msg(result.Message, { icon: 1 }, function () {
+                                        // 寰楀埌frame绱㈠紩
+                                        var index = layer.getFrameIndex(window.name);
+                                        //鍏抽棴褰撳墠frame
+                                        layer.close(wait);
+                                        //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                        $("#btnSearch").trigger('click');
+                                    });
+                                } else {
+                                    layer.alert(result.code + result.Message, { icon: 5 });
+                                    layer.close(wait);
+                                }
+                            }, error: function () {
+                                layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                                layer.close(wait);
+                            }
+                        });
+                    })
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹垹闄わ紒');
+                }
+
+            }
+            //#endregion
+
+            //#region 鍒锋柊
+            function get_Refresh() {
+                $("#btnSearch").trigger('click');
+            }
+            //#endregion
+
+            //#region 鍙嶅鏍�/瀹℃牳鏁版嵁
+            function set_CheckBill(num) {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var InterID = data[0].hmainid.toString();
+                    //閫昏緫瀹℃牳鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "/Xs_SeOrderChangeBill/AuditXs_SeOrderChangeBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": InterID, "IsAudit": num, "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);
+                                    //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                    $("#btnSearch").trigger('click');
+                                });
+
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                        }
+                    });
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹鏍革紒');
+                }
+            }
+            //#endregion
+
+            //#region 鍙嶅叧闂�/鍏抽棴鏁版嵁
+            function set_CloseBill(num) {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var InterID = data[0].hmainid.toString();
+                    //閫昏緫瀹℃牳鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "/Xs_SeOrderChangeBill/CloseXs_SeOrderChangeBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": InterID, "IsAudit": num, "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);
+                                    //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                    $("#btnSearch").trigger('click');
+                                });
+
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                        }
+                    });
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹鏍革紒');
+                }
+            }
+            //#endregion
+
+            //#region 鍙嶄綔搴�/浣滃簾鏁版嵁
+            function set_DropBill(num) {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var InterID = data[0].hmainid.toString();
+                    //閫昏緫瀹℃牳鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "Xs_SeOrderChangeBill/DeleteXs_SeOrderChangeBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": InterID, "IsAudit": num, "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);
+                                    //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                    $("#btnSearch").trigger('click');
+                                });
+
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                        }
+                    });
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹鏍革紒');
+                }
+            }
+            //#endregion
+
+            //#region 闅愯棌鍒楄缃�
+            function get_HideColumn() {
+                var colName = "";
+                var contentUrl = "";
+                for (var i = 1; i < option.cols[0].length; i++) {
+                    colName += option.cols[0][i]["title"] + ",";
+                }
+                var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞
+                var urlLen = urlStr.split('/');
+                for (var i = 0; i < urlLen.length - 4; i++) {
+                    contentUrl += "../";
+                }
+                colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜
+
+                contentUrl += '鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
+
+                layer.open({
+                    type: 2
+                    , skin: "layui-layer-rim" //鍔犱笂杈规
+                    , title: "闅愯棌鍒楄缃�"  //鏍囬
+                    , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                    , shift: 2 //寮瑰嚭鍔ㄧ敾
+                    , area: ["50%", "90%"] //绐椾綋澶у皬
+                    , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                    , content: [contentUrl, "yes"]
+                    , btn: ["纭畾", "鍙栨秷"]
+                    , btn1: function (index, laero) {
+                        //鍒锋柊琛ㄦ牸鏁版嵁
+                        DisPlay_HideColumn();
+                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                        layer.close(index);//鍏抽棴寮圭獥
+                    }
+                })
+            }
+            //#endregion
+            //#region 鏄剧ず鍒楁暟鎹�
+            function DisPlay_HideColumn() {
+                $.ajax({
+                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
+                    type: "GET",
+                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
+                    success: function (data1) {
+                        if (data1.data.length != 0) {
+
+                            var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
+                            //var titleData = ["鍗曟嵁ID", "HMouldID", "hsubid", "HManagerID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
+                            dataCol = data1.data[0].HGridString.split(',');
+
+                            for (var i = 0; i < option.cols[0].length - 1; i++) {
+                                var dataCols = dataCol[i].split('|');
+                                //闅愯棌鍒�
+                                if (dataCols[1] == 1) {
+                                    option.cols[0][i + 1]["hide"] = true;
+                                }
+                                //璁剧疆鍒楀
+                                if (dataCols[3] > 0) {
+                                    option.cols[0][i + 1]["width"] = dataCols[3];
+                                }
+                                //璁剧疆鍐呭瀛椾綋澶у皬
+                                if (data1.data[0].HFontSize != 0) {
+                                    option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
+                                } else {
+                                    option.cols[0][i + 1]["style"] = "font-size:100%";
+                                }
+                                //璁剧疆鍒楀
+                                //if (data1.data[0].HColumnWidth != 0) {
+                                //    option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
+                                //} else {
+                                //    option.cols[0][i + 1]["width"] = "";
+                                //}
+                                //鏄剧ず鍒�
+                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
+                                    option.cols[0][i + 1]["hide"] = false;
+                                }
+                                //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�)
+                                switch (dataCols[2]) {
+                                    case "L":
+                                        option.cols[0][i + 1]["align"] = "left";
+                                        break;
+                                    case "M":
+                                        option.cols[0][i + 1]["align"] = "center";
+                                        break;
+                                    case "R":
+                                        option.cols[0][i + 1]["align"] = "right";
+                                        break;
+                                }
+                            }
+
+                            //鍙栨秷鍐荤粨鍒�
+                            for (var i = 1; i < option.cols[0].length - 1; i++) {
+                                if (option.cols[0][i]["fixed"] != null) {
+                                    option.cols[0][i]["fixed"] = null;
+                                }
+                                else {
+                                    break;
+                                }
+                            }
+                            //鍐荤粨鍒�
+                            if (data1.data[0].HFixCols != 0) {
+                                for (var i = 0; i < data1.data[0].HFixCols; i++) {
+                                    if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
+                                        data1.data[0].HFixCols += 1;
+                                    }
+                                    option.cols[0][i + 1]["fixed"] = "left";
+                                }
+                            }
+                            table.render(option);
+                        } else {
+                            table.render(option);
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                })
+            }
+            //#endregion
+
+            //#region 浠绘剰瀛楁杩囨护锛氬垪鍚嶆樉绀轰笅鎷夋
+            function ColFilter() {
+                var Organization = '<option  value="0" selected="selected" ></option>';
+                for (var i = 1; i < option.cols[0].length; i++) {
+                    if (option.cols[0][i].hide != true) {
+                        Organization += '<option  style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>';
+                    }
+                }
+                $("#ColName").empty();
+                $("#ColName").append(Organization);
+                form.render('select');
+            }
+            //#endregion
+
+        });
+
+            //#endregion
+
+            //浠ヤ笂鏄痩ayui妯″潡
+    </script>
+
+</body>
+</html>
\ No newline at end of file

--
Gitblit v1.9.1