From 5a3f1e62aace64153de405e9754b2fbec30577d7 Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期二, 09 十一月 2021 16:42:58 +0800
Subject: [PATCH] 器具采购订单打印、用户关联权限(权限树型列表)

---
 WebTM/views/PublicPage/PowerInformation.html                |  237 +++++++++++++++++++++++++++++++++
 WebTM/views/基础资料/公用基础资料/xmlLBM_MouldScrapOutStockBill.aspx  |    2 
 WebTM/views/系统管理/用户管理/Xt_UserList.html                      |   52 +++++++
 WebTM/views/基础资料/公用基础资料/xmlLBM_MouldProdInStockBill.aspx    |    2 
 WebTM/views/基础资料/公用基础资料/xmlLBM_MouldProdInStockBill.aspx.cs |    2 
 WebTM/views/系统管理/用户管理/Xt_UserSuplies.html                   |   82 +++++++----
 WebTM/views/基础资料/公用基础资料/HBarPlanPrint.html                  |    2 
 WebTM/WebTM.csproj                                          |    1 
 8 files changed, 346 insertions(+), 34 deletions(-)

diff --git a/WebTM/WebTM.csproj b/WebTM/WebTM.csproj
index ae9566c..f83f9fb 100644
--- a/WebTM/WebTM.csproj
+++ b/WebTM/WebTM.csproj
@@ -115,6 +115,7 @@
     <Content Include="views\PublicPage\Organizations.html" />
     <Content Include="views\PublicPage\PeopleInformations.html" />
     <Content Include="views\PublicPage\PeopleInformation.html" />
+    <Content Include="views\PublicPage\PowerInformation.html" />
     <Content Include="views\ReportHtml.html" />
     <Content Include="views\test\testRenderAutomationList.html" />
     <Content Include="views\鍩虹璧勬枡\鍏敤鍩虹璧勬枡\Add_Edit_Gy_OrderBackInfo.html.html" />
diff --git a/WebTM/views/PublicPage/PowerInformation.html b/WebTM/views/PublicPage/PowerInformation.html
new file mode 100644
index 0000000..e9ca843
--- /dev/null
+++ b/WebTM/views/PublicPage/PowerInformation.html
@@ -0,0 +1,237 @@
+锘�<!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/treeTable.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/lay/modules/util.js"></script>
+    <style media="screen">
+        .custom-tree-item-clicked {
+            color: #FC9003
+        }
+        .layui-form-item .layui-inline {
+            margin-bottom: 5px;
+             margin-right: 0px; 
+        }
+    </style>
+</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-form-item" style="border-top: solid 1px #F6F6F6;">
+                                    <div class="layui-row" style="padding:10px 0">
+                                        <div class="layui-col-xs3 layui-inline">
+                                            <div id="treeUser" lay-filter="treeUser" class="demo-tree demo-tree-box" style="overflow: scroll;"></div>
+                                        </div>
+                                        <div class="layui-col-xs9 layui-inline">
+                                            <div>
+                                                <table class="" id="mainTable" lay-filter="mainTable"></table>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </form>
+                </div>
+            </div>
+        </div>
+    </div>
+
+    <script src="../../layuiadmin/layui/zgqlayui.js"></script>
+    <script src="../../layuiadmin/zgqCustom/zgqCustom.js"></script>
+    <script src="../../layuiadmin/PubCustom.js"></script>
+    <script>
+        //鑾峰彇鍙傛暟
+        var params = get_UrlVars();
+        if (typeof (params[params[0]]) == "undefined") {
+            var OperationType = 1;//鎿嶄綔绫诲瀷
+            var TreeFlag = true;//鎿嶄綔绫诲瀷
+        } else {
+            debugger;
+            var TreeFlag = params[params[0]];//鎿嶄綔绫诲瀷
+            var linterid = params[params[1]];//婧愬崟id
+            var HSouceBillType = params[params[2]];//婧愬崟绫诲瀷
+        }
+
+        var treeCkData = { id: 0 };
+        var TagId = "";
+        var TagParentId = "";
+
+        layui.config({
+            base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
+        }).extend({
+            index: 'lib/index', //涓诲叆鍙fā鍧�
+        }).use(['tree', 'index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
+            var $ = layui.$
+                , admin = layui.admin
+                , layer = layui.layer
+                , table = layui.table
+                , form = layui.form
+                , element = layui.element
+                , laypage = layui.laypage
+                , laydate = layui.laydate
+                , util = layui.util
+                , tree = layui.tree
+            if (TreeFlag == "false")
+            {
+                //$(".layui-col-xs3").css("display", "none"); //闅愯棌鏍戝瀷
+                //$(".layui-col-xs9").css("width", "100%"); //璁剧疆瀹藉害
+            }
+            else
+            {
+                tree.render({
+                    elem: '#treeUser',
+                    data: getData(),
+                    showCheckbox: false,     //鏄惁鏄剧ず澶嶉�夋
+                    id: 'demoId',
+                    isJump: false, //鏄惁鍏佽鐐瑰嚮鑺傜偣鏃跺脊鍑烘柊绐楀彛璺宠浆
+                    showLine: true,//鏄惁寮�鍚繛鎺ョ嚎
+                    onlyIconControl: true,   //鐐瑰嚮鍚庝笉鏀剁缉
+                    isopen: true,  //鍔犺浇瀹屾瘯鍚庣殑灞曞紑鐘舵�侊紝榛樿鍊硷細true
+                    accordion: true,
+                    height:"full-50",
+                    click: function (obj) {
+                        //鐐瑰嚮楂樺厜
+                        if (obj.data.id !== treeCkData.id) {
+                            $('div[data-id="' + obj.data.id + '"] span').eq(1).last().addClass("custom-tree-item-clicked");
+                            $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked');
+                            treeCkData = obj.data;
+                            TagId = obj.data.id;
+                            TagParentId = obj.data.ParentID;
+                        }
+                        else {
+                            $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked');
+                            treeCkData = { id: 0 };
+                            TagId = "";
+                            TagParentId = "";
+                        }
+
+
+                        $.ajax({
+                            url: GetWEBURL() + '/PublicPageMethod/PowerList',
+                            type: "GET",
+                            data: { "czybm": "998", "sGnbm": obj.data.id},
+                            success: function (data1) {
+                                if (data1.count == 1) {
+                                    option.data = data1.data;
+                                    table.render(option);
+                                    layer.close(index);
+                                } else {
+                                    layer.close(index);
+                                    layer.alert(data1.code + data1.Message, { icon: 5 });
+                                }
+                            }, error: function () {
+                                layer.close(index);
+                                layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                            }
+                        });
+                    }
+                });
+            }
+
+
+
+            var option = {
+                elem: '#mainTable'
+                //, toolbar: '#toolbarDemo'
+                , height: 'full-50'
+                , page: false
+                , cellMinWidth: 90
+                , cols: [[
+                    , { field: 'hid', title: 'hid', sort: true, hide: true }
+                    , { field: 'gnbm', title: 'gnbm', sort: true, hide: true }
+                    , {
+                        field: '鏄惁鏉冮檺', title: '鏄惁鏉冮檺', templet: function (row) {
+                            console.log(row);
+                            var html = "<input type='checkbox' lay-skin='primary' lay-filter='checkboxIsSelected' table-index='" + row.LAY_TABLE_INDEX + "' class='checkboxIsSelected' value='" + row.鏄惁鏉冮檺 + "' ";
+                            if (row.鏄惁鏉冮檺 == 1) {
+                                html += " checked ";
+                            }
+                            html += ">";
+                            return html;
+                        }}
+                    , { field: '鍔熻兘璇存槑', title: '鍔熻兘璇存槑' }
+                ]]
+            };
+
+            var index = layer.load(0, { shade: false });
+            //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
+            $.ajax({
+                url: GetWEBURL() + '/PublicPageMethod/PowerList',
+                type: "GET",
+                data: { "czybm": "998","sGnbm":"" },
+                success: function (data1) {
+                    if (data1.count == 1) {
+                        option.data = data1.data;
+                        table.render(option);
+                        layer.close(index);
+                    } else {
+                        layer.close(index);
+                        layer.alert(data1.code + data1.Message, { icon: 5 });
+                    }
+                }, error: function () {
+                    layer.close(index);
+                    layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                }
+            });
+
+            //浠ヤ笂鏄痩ayui妯″潡
+        });
+
+        //鏌ヨ鏍戠姸鏁版嵁
+        function getData() {
+            var treeData;
+
+            $.ajax({
+                url: GetWEBURL() + '/Gy_MaintenanceMode/PowerLoadTree',
+                type: "GET",
+                //data: { "sWhere": sWhere },
+                async: false,
+                success: function (result) {
+                    var data = result.data;
+                    //鐢熸垚鏁版嵁瀵硅薄闆嗗悎
+                    treeData = LoadTree(data);
+
+                }
+            });
+            return treeData;
+        }
+        /**澶勭悊鏍戝舰灞曠ず鏁版嵁锛岃姹傛湁ID鍜孭arentID銆乼itle瀛楁**/
+        function LoadTree(data) {
+            let map = {};
+            let treeData = [];
+            data.forEach(it => {
+                map[it.id] = it;    //ID涓烘瘡涓妭鐐圭殑id
+            })
+            //鐢熸垚缁撴灉闆�
+            data.forEach(it => {
+                const parent = map[it.ParentID];   //ParentID涓虹埗鑺傜偣鐨刬d
+                if (parent) {
+                    if (!Array.isArray(parent.children)) parent.children = [];
+                    parent.children.push(it);
+                } else {
+                    treeData.push(it)
+                }
+            })
+            return treeData;
+        }
+
+    </script>
+
+</body>
+</html>
diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/HBarPlanPrint.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/HBarPlanPrint.html"
index 6d6ac5b..c2d3c95 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/HBarPlanPrint.html"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/HBarPlanPrint.html"
@@ -99,7 +99,7 @@
             case "HMouldOtherOutBill"://鍏朵粬鍑哄簱鍗曟墦鍗�
                 CreateDisplayViewerEx("100%", "100%", "../../grf/" + OpenTmp + ".grf", "xmlLBM_MouldOtherOutStockBill.aspx?linterid=" + value, true, "");
                 break;
-            case "HMouldScrapOutBill"://鍣ㄥ叿鐢熶骇棰嗙敤鍗曟墦鍗�
+            case "HMouldScrapOutBill"://鍣ㄥ叿澶勭悊鍑哄簱鍗曟墦鍗�
                 CreateDisplayViewerEx("100%", "100%", "../../grf/" + OpenTmp + ".grf", "xmlLBM_MouldScrapOutStockBill.aspx?linterid=" + value, true, "");
                 break;
             case "HMouldScrapInBill"://鍣ㄥ叿鎶ュ簾鍏ュ簱鍗曟墦鍗�
diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/xmlLBM_MouldProdInStockBill.aspx" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/xmlLBM_MouldProdInStockBill.aspx"
index 1bd24d7..da491b5 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/xmlLBM_MouldProdInStockBill.aspx"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/xmlLBM_MouldProdInStockBill.aspx"
@@ -6,7 +6,7 @@
 <head runat="server">
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <title></title>
-    <script runat="server"> 
+     <script runat="server"> 
     protected void Page_Load(object sender, EventArgs e)
     {
         //鈽呯壒鍒彁绀衡槄锛�
diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/xmlLBM_MouldProdInStockBill.aspx.cs" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/xmlLBM_MouldProdInStockBill.aspx.cs"
index 315f00f..131ceb2 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/xmlLBM_MouldProdInStockBill.aspx.cs"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/xmlLBM_MouldProdInStockBill.aspx.cs"
@@ -7,7 +7,7 @@
 
 namespace WebTM.views.鍩虹璧勬枡.鍏敤鍩虹璧勬枡
 {
-    public partial class xmlLBM_MouldProdInStockBill1 : System.Web.UI.Page
+    public partial class xmlLBM_MouldProdInStockBill : System.Web.UI.Page
     {
         protected void Page_Load(object sender, EventArgs e)
         {
diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/xmlLBM_MouldScrapOutStockBill.aspx" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/xmlLBM_MouldScrapOutStockBill.aspx"
index 8aa3f49..edc7350 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/xmlLBM_MouldScrapOutStockBill.aspx"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/xmlLBM_MouldScrapOutStockBill.aspx"
@@ -1,4 +1,4 @@
-锘�<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="xmlLBM_MouldScrapOutStockBill.aspx.cs" Inherits="WebTM.views.鍩虹璧勬枡.鍏敤鍩虹璧勬枡.xmlLBM_MouldProdInStockBill" %>
+锘�<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="xmlLBM_MouldScrapOutStockBill.aspx.cs" Inherits="WebTM.views.鍩虹璧勬枡.鍏敤鍩虹璧勬枡.xmlLBM_MouldScrapOutStockBill" %>
 
 <!DOCTYPE html>
 
diff --git "a/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206/Xt_UserList.html" "b/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206/Xt_UserList.html"
index 9d78fea..5675178 100644
--- "a/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206/Xt_UserList.html"
+++ "b/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206/Xt_UserList.html"
@@ -71,6 +71,7 @@
                             <div class="layui-btn-container">
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-add-1"></i>鏂板</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-edit"></i>缂栬緫</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Power"><i class="layui-icon">&#xe641;</i>鏉冮檺</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>閫�鍑�</button>
 
@@ -127,6 +128,10 @@
                     //缂栬緫鎸夐挳
                     case 'btn-Edit':
                         set_ShowBill();
+                        break;
+                    //鏉冮檺
+                    case 'btn-Power':
+                        set_PowerBill();
                         break;
                     case 'btn-Delete':
                         set_DeleteBill();
@@ -294,6 +299,53 @@
                 }
             }
 
+            //鏉冮檺
+            function set_PowerBill()
+            {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var linterid = data[0].鐢ㄦ埛缂栫爜.toString();
+                    //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉
+                    layer.open({
+                        type: 2,
+                        skin: 'layui-layer-rim', //鍔犱笂杈规
+                        title: '鐢ㄦ埛鏉冮檺鍏宠仈',
+                        closeBtn: 1,
+                        shift: 2,
+                        area: ['100%', '100%'],
+                        maxmin: true,
+                        content: ['../../PublicPage/PowerInformation.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=', '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('璇烽�夋嫨鏁版嵁');
+                            }
+                            $("#HSupName").val(checkStatus.data[0].HName);
+                            $("#HSupID").val(checkStatus.data[0].HItemID);
+                            layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                        }
+                        , btn2: function (index, layero) {
+                            //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+                            //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+                        },
+                        end: function () {
+
+                        },
+                        success: function (layero, index) {
+
+                        }
+                    });
+
+                } else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
+                }
+            }
+
             //蹇�熻繃婊�
             function get_FastQuery() {
                 var HNumber = $("#HNumber").val();
diff --git "a/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206/Xt_UserSuplies.html" "b/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206/Xt_UserSuplies.html"
index 587e59c..f2dc5a0 100644
--- "a/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206/Xt_UserSuplies.html"
+++ "b/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206/Xt_UserSuplies.html"
@@ -13,6 +13,7 @@
     <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">
 
         /*begin 姝ゆ牱寮忕敤浜庢秷闄よ鍏冪礌涓竷灞�瀹藉害涓嶅鐨勯棶棰�*/
@@ -21,6 +22,7 @@
             margin-bottom: 5px;
             margin-right: 0px;
         }
+
         .layui-form-label {
             float: left;
             display: block;
@@ -28,10 +30,8 @@
             width: 31px;
             font-weight: 400;
             line-height: 20px;
-             text-align: left; 
+            text-align: left;
         }
-    
-
     </style>
 </head>
 <body>
@@ -50,7 +50,7 @@
                             <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                                 <div class="layui-tab-content">
                                     <div class="layui-tab-item layui-show">
-                                        <div class="layui-form-item">                                 
+                                        <div class="layui-form-item">
                                             <div class="layui-inline">
                                                 <label class="layui-form-label">鐢ㄦ埛</label>
                                                 <div class="layui-input-inline">
@@ -88,6 +88,18 @@
         <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
     </script>
     <script>
+        //鑾峰彇鍙傛暟
+        var params = get_UrlVars();
+        if (typeof (params[params[0]]) == "undefined") {
+            var OperationType = 1;//鎿嶄綔绫诲瀷
+            var closeType = 2;  //鍏抽棴绫诲瀷
+        } else {
+            var OperationType = params[params[0]];//鎿嶄綔绫诲瀷
+            var linterid = params[params[1]];//婧愬崟id
+            var HSouceBillType = params[params[2]];//婧愬崟绫诲瀷
+            var closeType = params[params[3]];  //鍏抽棴绫诲瀷
+        }
+
         layui.config({
             base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
         }).extend({
@@ -111,10 +123,18 @@
 
             //鍒濆鍖栬〃鏍�
             set_InitGrid();
+
             //鍒ゆ柇鎿嶄綔绫诲瀷
-            //鏃犳簮鏂板
+            if (OperationType == 1) {//鏃犳簮鏂板
+                //鏃犳簮鏂板
                 set_AddFNew();
-          
+            }
+            else if (OperationType == 3) {//缂栬緫
+                set_EditFromGrid(linterid);
+            }
+            else {
+                layer.alert("鏈煡鎿嶄綔绫诲瀷锛�", { icon: 5 });
+            }
             //#endregion
 
             //#region 鐐瑰嚮浜嬩欢锛屽寘鎷琽n鍜宖orm浜嬩欢
@@ -167,15 +187,13 @@
                             type: "GET",
                             data: { "HUserID": checkStatus.data[0].HNumber },
                             success: function (data) {
-                                if (data.data != null && data.data != "")
-                                {
+                                if (data.data != null && data.data != "") {
                                     option.data = data.data;
                                     table.render(option);
                                 }
-                                else
-                                {
+                                else {
                                     table.reload("mainTable", {});
-                                    table.reload('mainTable', { data:[] });
+                                    table.reload('mainTable', { data: [] });
                                 }
 
                             }
@@ -240,7 +258,7 @@
                                 }
                             });
                         }
-           
+
                         obj.event = "";
                         return false;
                     }
@@ -249,8 +267,7 @@
 
             //淇濆瓨
             form.on('submit(Saver)', function (data) {
-                if ($("#UserName").val() == "")
-                {
+                if ($("#UserName").val() == "") {
                     layer.msg("鐢ㄦ埛涓嶈兘涓虹┖锛�");
                     return false;
                 }
@@ -265,13 +282,12 @@
                 for (var i = 0; i < JSON.parse(sSubStr).length; i++) {
                     list.push(JSON.parse(sSubStr)[i].渚涘簲鍟嗕唬鐮�)
                 }
-                if (isAllEqual(list))
-                {
+                if (isAllEqual(list)) {
                     layer.msg("鏈夐噸澶嶇殑渚涘簲鍟嗕俊鎭紒");
                     return false;
                 }
-                
-                var sMainSub = sSubStr + ';' + UserID 
+
+                var sMainSub = sSubStr + ';' + UserID
                 $.ajax(
                     {
                         type: "POST",
@@ -302,6 +318,19 @@
                     });
             });
 
+            //閫�鍑�
+            form.on('submit(Exit)', function (data) {
+                if (OperationType == 1) {
+                    Pub_Close(closeType);//鐩存帴鏂板closeType鍊间负2锛屽垪琛ㄨ皟鏂板closeType鍊间粠鍒楄〃浼犻��
+                }
+                else if (OperationType == 3) {
+                    Pub_Close(closeType);
+                }
+                else {
+                    Pub_Close(2);
+                }
+            });
+
             //#endregion
 
             //#region 姝ら〉闈㈡墍鏈夋柟娉�
@@ -309,7 +338,7 @@
             function set_InitGrid() {
                 columns = [
                     { type: 'checkbox', fixed: 'left' }
-                    , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe"}
+                    , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
                     , { field: 'HSupID', title: 'HSupID', edit: 'text', hide: true }
                     , { field: 'HSupperNumber', title: '渚涘簲鍟嗕唬鐮�', edit: 'text', event: 'HSupperNumber' }
                     , { field: 'HSupperName', title: '渚涘簲鍟嗗悕绉�', edit: 'text' }
@@ -370,17 +399,10 @@
                 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);
-                            table.reload('mainTable', { data: oldData });
-                            layer.close(index);
-                        }
+                        var oldData = table.cache["mainTable"];
+                        oldData.splice(obj.tr.data('index'), 1);
+                        table.reload('mainTable', { data: oldData });
+                        layer.close(index);
                     });
                 }
             }

--
Gitblit v1.9.1