From d0fec1b2fb615781a8148566db01dee9caf4f7c8 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 27 九月 2022 17:04:56 +0800
Subject: [PATCH] 添加组织字段

---
 WebTM/views/生产管理/报工台工序/产量汇报/Sc_ProductReportStepBillList_Web.html |   50 +++++++++++++++++++++++-
 WebTM/views/生产管理/报工台工序/产量汇报/Sc_Add_ProductReportStepBillList.html |   48 ++++++++++++++++++++++-
 2 files changed, 92 insertions(+), 6 deletions(-)

diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_Add_ProductReportStepBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_Add_ProductReportStepBillList.html"
index fcf68d9..9156cd8 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_Add_ProductReportStepBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_Add_ProductReportStepBillList.html"
@@ -119,6 +119,24 @@
                                                             <input class="layui-input" name="HDate" id="HDate" disabled autocomplete="off" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                                         </div>
                                                     </div>
+                                                    <!--<div class="layui-inline">
+        <label class="layui-form-label">缁勭粐:</label>
+        <div class="layui-input-inline">
+            <input class="layui-input" name="HOrgID" lay-verify="HOrgID" id="HOrgID" autocomplete="off">
+        </div>
+    </div>-->
+                                                    <div class="layui-col-xs4 layui-inline">
+                                                        <label class="layui-form-label">缁勭粐锛�</label>
+                                                        <div class="layui-input-inline" style="margin-bottom: -15px;">
+                                                            <div class="layui-form">
+                                                                <div class="layui-form-item">
+                                                                    <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
+                                                                        <!--鍔ㄦ�佹覆鏌撶粍缁�-->
+                                                                    </select>
+                                                                </div>
+                                                            </div>
+                                                        </div>
+                                                    </div>
                                                 </div>
                                                 <div class="layui-form-item">
                                                     <div class="layui-inline">
@@ -378,6 +396,8 @@
             var HSourceBillNo = params[params[6]];
             var HSourceBillType = params[params[7]];
         }
+        //鑾峰彇鐧诲綍缁勭粐
+        //$('#HOrgID').val(sessionStorage["Organization"])
 
         //var edit = function (data) {
         //    HBillType = data[0].HBillType;
@@ -407,7 +427,7 @@
             //鍒濆鍖栬〃鍗曟彃浠�
             set_InitFrom();
 
-
+            Organ();//鏄剧ず缁勭粐
             //鍒ゆ柇鎿嶄綔绫诲瀷
             if (OperationType == 1) {//鏃犳簮鍗�
                 set_AddFNew();
@@ -419,6 +439,8 @@
                 var HICMOInID = params[params[3]];//鐢熶骇璁㈠崟涓讳富ID
                 var HICMOEnID = params[params[4]];//鐢熶骇璁㈠崟瀛怚D
                 set_EditFromGrid(linterid, HICMOInID, HICMOEnID);
+                //绂佺敤缁勭粐閫夐」
+                $("#HOrgID").attr("disabled", true);
             }
             else {
                 layer.alert("鏈煡鎿嶄綔绫诲瀷锛�", { icon: 5 });
@@ -622,7 +644,7 @@
                                 $("#HCloseDate").val(formatDate(LoadData[0].鍏抽棴鏃ユ湡)); //鍏抽棴鏃ユ湡
                                 $("#HDeleteMan").val(LoadData[0].浣滃簾浜�); //浣滃簾浜�
                                 $("#HDeleteDate").val(formatDate(LoadData[0].浣滃簾鏃ユ湡)); //浣滃簾鏃ユ湡
-
+                                $("#HOrgID").val(LoadData[0].缁勭粐); //缁勭粐
                             }
                             else {
                                 layer.alert(data.Message, { icon: 5 });
@@ -862,7 +884,27 @@
                 });
             });
 
-
+            //鑾峰彇缁勭粐
+            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);
+                            $("#HOrgID").val(sessionStorage["OrganizationID"])
+                            form.render('select');
+                        }
+                        layer.closeAll("loading");
+                    }
+                })
+            }
 
             //楠岃瘉姹囨姤鏁伴噺鏄惁瓒呰繃璁″垝鏁伴噺
             function OverStepQty(objdata) {
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_ProductReportStepBillList_Web.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_ProductReportStepBillList_Web.html"
index febc824..a83f5bf 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_ProductReportStepBillList_Web.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_ProductReportStepBillList_Web.html"
@@ -67,6 +67,14 @@
                                         <input type="text" class="layui-input" name="Part" id="Part" style="width:190px;">
                                     </div>
                                 </div>
+                                <div class="layui-inline">
+                                    <label class="layui-form-label" style="width: 85px;">缁勭粐</label>
+                                    <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
+                                        <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
+                                            <!--鍔ㄦ�佹覆鏌撶粍缁�-->
+                                        </select>
+                                    </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>
@@ -203,6 +211,9 @@
                 $("#HBillNo").val("");
                 $("#Part").val("");
                 $("#Source").val("");
+                $("#HOrgID").val(sessionStorage["OrganizationID"]);
+                form.render('select');
+                sWhere = "";
             });
         //#endregion
 
@@ -214,6 +225,7 @@
                 set_InitGrid();
                 //鏌ヨ
                 get_Display(sWhere);
+                Organ();
 
             }
 
@@ -244,6 +256,7 @@
                                 }
                             }
                         }
+                        , { field: '缁勭粐', title: '缁勭粐', width: 200 }
                         , {
                             field: 'HBillStatus', title: '鍗曟嵁鐘舵��', width: 200, templet: function (d) {
                                 switch (d.HBillStatus) {
@@ -341,6 +354,28 @@
                 };
             }
 
+            //鑾峰彇缁勭粐
+            function Organ() {
+                //鑾峰彇鐧诲綍椤电粍缁囧垪
+                $.ajax({
+                    type: "get",
+                    url: GetWEBURL() + "/Web/GetOrganizations",
+                    success: function (result) {
+                        var Organization = "";
+                        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);
+                            $("#HOrgID").val(sessionStorage["OrganizationID"])
+                            form.render('select');
+                        }
+                        layer.closeAll("loading");
+                    }
+                })
+            }
+
             //鏌ヨ鏁版嵁
             function get_Display(sWhere)
             {
@@ -368,13 +403,20 @@
             }
 
             // 蹇�熻繃婊�
-            function get_FastQuery() {
+            function get_FastQuery(number) {
                 var HDate = $("#HDate").val();//寮�濮嬫棩鏈�
                 var HDate1 = $("#HDate1").val();//缁撴潫鏃ユ湡
                 var HBillNo = $("#HBillNo").val(); //鍗曟嵁鍙�
                 var Part = $("#Part").val();       //鐗╂枡淇℃伅
                 var Source = $("#Source").val();  //璧勬簮
+                var HOrgID = ""; //缁勭粐
                 sWhere += SchWhere;
+                if (number == 1) {
+                    HOrgID = sessionStorage["OrganizationID"];
+                }
+                else {
+                    HOrgID = $("#HOrgID").val();//缁勭粐
+                }
                 if (HDate) {
                     sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
                 }
@@ -390,7 +432,9 @@
                 if (Source) {
                     sWhere += " and 鐢熶骇璧勬簮 like '%" + Dept + "%'";
                 }
-
+                if (HOrgID) {
+                    sWhere += " and HOrgID = '" + HOrgID + "'";
+                }
                 get_Display(sWhere);
                 //璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
                 sWhere = "";
@@ -423,7 +467,7 @@
                     var HInterID = data[0].HInterID;
                     var HICMOInID = data[0].HSourceInterID;
                     var HICMOEnID = data[0].HSourceEntryID;
-                    var HRelationInterID = data[0].HRelationInterID;
+                    var HRelationInterID = data[0].HRelationInterID;    
                     if (HRelationInterID == 1) {
                         layer.msg('鍗曟嵁宸叉姤妫�瀹℃牳鏃犳硶淇敼锛�');
                         return false;

--
Gitblit v1.9.1