From 22870b2ceda5ea1dc4e83c8b8d6a11973b834be3 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期四, 24 八月 2023 15:37:56 +0800
Subject: [PATCH] 指引卡开工单列表 指引卡完工单列表

---
 WebTM/views/项目管理/工作任务/PM_WorkTaskBill.html |  169 ++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 138 insertions(+), 31 deletions(-)

diff --git "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBill.html" "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBill.html"
index a926ba0..e1d02f5 100644
--- "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBill.html"
+++ "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBill.html"
@@ -59,10 +59,10 @@
 
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">淇濆瓨</button>
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnEdit" id="btnEdit">閫�鍑�</button>
-                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckBill" id="set_CheckBill">瀹℃牳</button>
+                        <!--<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckBill" id="set_CheckBill">瀹℃牳</button>
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck" id="set_AbandonCheck">鍙嶅鏍�</button>
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CloseBill" id="set_CloseBill">鍏抽棴</button>
-                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CancelCloseBill" id="set_CancelCloseBill">鍙嶅叧闂�</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CancelCloseBill" id="set_CancelCloseBill">鍙嶅叧闂�</button>-->
                     </div>
                     <div class="layui-tab" lay-filter="tab-POStockInBill">
                         <ul class="layui-tab-title" lay-filter="tab-all">
@@ -75,28 +75,38 @@
                                 <div class="layui-form-item" style="padding-top: 10px;">
                                     <div class="layui-row">
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">鍗曟嵁鍙�*</label>
+                                            <label class="layui-form-label" style="width: 85px;">鍗曟嵁鍙�<label style="color:red"> * </label></label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
                                                 <input type="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
                                                 <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID">
                                             </div>
                                         </div>
-                                        <div class="layui-inline">
+                                        <!--<div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;">椤圭洰浠g爜<label style="color:red"> * </label></label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
                                                 <input type="text" class="layui-input" lay-verify="HProNumber" name="HProNumber" id="HProNumber">
+                                            </div>
+                                        </div>-->
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">椤圭洰浠g爜<label style="color:red"> * </label></label>
+                                            <div class="layui-input-block" style="margin-left: 77px;">
+                                                <input type="text" class="layui-input" lay-verify="HProNumber" name="HProNumber" id="HProNumber" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <!--<input type="hidden" name="HProjectStageID" id="HProjectStageID" lay-verify="HProjectStageID" value="0">-->
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHProNumber" id="btnSearchHProNumber" style="padding: 0 10px;float: right;margin-right: 3px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+                                                </button>
                                             </div>
                                         </div>
                                         <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;">
-                                                <input type="text" class="layui-input" lay-verify="HProName" name="HProName" id="HProName">
+                                                <input type="text" class="layui-input" lay-verify="HProName" name="HProName" id="HProName" readonly>
                                             </div>
                                         </div>
                                     </div>
                                     <div class="layui-row">
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">椤圭洰闃舵*</label>
+                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">椤圭洰闃舵<label style="color:red"> * </label></label>
                                             <div class="layui-input-block" style="margin-left: 77px;">
                                                 <input type="text" class="layui-input" lay-verify="HProjectStageName" name="HProjectStageName" id="HProjectStageName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                 <input type="hidden" name="HProjectStageID" id="HProjectStageID" lay-verify="HProjectStageID" value="0">
@@ -112,7 +122,7 @@
                                             </div>
                                         </div>
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">鏃ユ湡</label>
+                                            <label class="layui-form-label" style="width: 85px;">鏃ユ湡<label style="color:red"> * </label></label>
                                             <div class="layui-input-block" style="margin-left: 120px; width:180px;">
                                                 <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 80px;">
                                             </div>
@@ -148,7 +158,7 @@
                                     </div>
                                     <div class="layui-row">
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">娲惧崟浜�*</label>
+                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">娲惧崟浜�<label style="color:red"> * </label></label>
                                             <div class="layui-input-block" style="margin-left: 77px;">
                                                 <input type="text" class="layui-input" lay-verify="HSendEmp" name="HSendEmp" id="HSendEmp" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                 <!--<input type="hidden" name="HPMEmpID" id="HPMEmpID" lay-verify="HPMEmpID" value="0">-->
@@ -158,9 +168,13 @@
                                             </div>
                                         </div>
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">鎺ユ敹浜�</label>
-                                            <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" lay-verify="HReceiveEmp" name="HReceiveEmp" id="HReceiveEmp">
+                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">鎺ユ敹浜�</label>
+                                            <div class="layui-input-block" style="margin-left: 77px;">
+                                                <input type="text" class="layui-input" lay-verify="HReceiveEmp" name="HReceiveEmp" id="HReceiveEmp" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <!--<input type="hidden" name="HPMEmpID" id="HPMEmpID" lay-verify="HPMEmpID" value="0">-->
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHReceiveEmp" id="btnSearchHReceiveEmp" style="padding: 0 10px;float: right;margin-right: 3px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+                                                </button>
                                             </div>
                                         </div>
                                         <div class="layui-inline">
@@ -185,7 +199,7 @@
                                     </div>
                                     <div class="layui-row">
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">澶囨敞<label style="color:red"> * </label></label>
+                                            <label class="layui-form-label" style="width: 85px;">澶囨敞</label>
                                             <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
                                                 <input type="text" class="layui-input" lay-verify="HRemark" name="HRemark" id="HRemark">
                                             </div>
@@ -193,7 +207,7 @@
                                     </div>
                                     <div class="layui-row">
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">缁勭粐*</label>
+                                            <label class="layui-form-label" style="width: 85px;">缁勭粐<label style="color:red"> * </label></label>
                                             <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
                                                 <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
                                                     <!--鍔ㄦ�佹覆鏌撶粍缁�-->
@@ -216,7 +230,7 @@
                                         <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>
+                                                <input type="text" class="layui-input" name="HUpdater" id="HUpdater" style="background-color:#efefef4d;" readonly>
                                             </div>
                                         </div>
                                         <div class="layui-inline">
@@ -237,7 +251,7 @@
                                         <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="HUpDaterDate" id="hupdatedate" style="background-color:#efefef4d;" readonly>
+                                                <input type="text" class="layui-input" name="HUpdaterDate" id="HUpdaterDate" style="background-color:#efefef4d;" readonly>
                                             </div>
                                         </div>
                                         <div class="layui-inline">
@@ -321,6 +335,8 @@
 
             //妯″潡鍚�
             var HModName = "PM_WorkTaskBill";
+            //璁板綍缁勭粐鐨勫��
+            var HOrgIDBar = 0;
             //鑾峰彇鍙傛暟
             var params = getUrlVars();
             var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷  1娣诲姞 淇濆瓨  2澶嶅埗  3 缂栬緫
@@ -348,6 +364,8 @@
 
             //#region 鍒ゆ柇骞惰缃搷浣滅被鍨嬨�侀〉闈㈠垵濮嬪寲
             if (OperationType == null || OperationType == 1) {                            //鏂板
+                //绂佺敤缁勭粐閫夐」
+                $("#HOrgID").attr("disabled", true);
                 OperationType = 1;
                 //鐢熸垚骞惰缃富琛ㄧ殑鍐呯爜鍜屽崟鎹彿
                 createBillNo();
@@ -389,6 +407,12 @@
             //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
 
             //#region 寮圭獥閫夋嫨瑙﹀彂浜嬩欢
+            //#region 閫夋嫨椤圭洰浠g爜鎸夐挳
+            form.on('submit(btnSearchHProNumber)', function () {
+                get_checkSearchHProNumber();
+            });
+            //#endregion
+
             //#region 閫夋嫨椤圭洰闃舵鎸夐挳
             form.on('submit(btnSearchHProjectStage)', function () {
                 get_checkSearchHProjectStage();
@@ -398,6 +422,12 @@
             //#region 閫夋嫨娲惧崟浜烘寜閽�
             form.on('submit(btnSearchHSendEmp)', function () {
                 get_checkSearchHSendEmp();
+            });
+            //#endregion
+
+            //#region 閫夋嫨鎺ユ敹浜烘寜閽�
+            form.on('submit(btnSearchHReceiveEmp)', function () {
+                get_checkSearchHReceiveEmp();
             });
             //#endregion
 
@@ -498,7 +528,10 @@
                                 Organization += '<option  style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
                             }
                             $("#HOrgID").append(Organization);
-                            $("#HOrgID").val(sessionStorage["OrganizationID"])
+                            if (OperationType == 1) {
+                                HOrgIDBar = sessionStorage["OrganizationID"];
+                            }
+                            $("#HOrgID").val(HOrgIDBar);
                             form.render('select');
                         }
                         layer.closeAll("loading");
@@ -536,6 +569,46 @@
             }
             //#endregion
 
+            //#region 椤圭洰浠g爜閫夋嫨椤甸潰
+            function get_checkSearchHProNumber() {
+                //鎵撳紑宸ョ▼椤圭洰灏忕獥浣�
+                layer.open({
+                    type: 2
+                    , skin: "layui-layer-rim"                           //鍔犱笂杈规
+                    , title: "宸ョ▼椤圭洰鍒楄〃"                             //鏍囬
+                    , closeBtn: 1                                       //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                    , shift: 2                                          //寮瑰嚭鍔ㄧ敾
+                    , area: ["90%", "90%"]                              //绐椾綋澶у皬
+                    , maxmin: true                                      //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                    , content: ["../../椤圭洰绠$悊/宸ョ▼椤圭洰/PM_ProjectBillList.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("璇烽�夋嫨涓�鏉℃暟鎹�");
+                        }
+
+                        //鍒ゆ柇椤圭洰鏄惁鍏抽棴
+                        if (checkStatus.data[0].鍏抽棴浜� == null || checkStatus.data[0].鍏抽棴浜� == "") {
+                            $("#HProNumber").val(checkStatus.data[0].椤圭洰浠g爜);//宸ョ▼椤圭洰浠g爜
+                            $("#HProName").val(checkStatus.data[0].椤圭洰鍚嶇О);//宸ョ▼椤圭洰浠g爜
+                            $("#HProjectStageID").val(checkStatus.data[0].HProjectStageID);//宸ョ▼椤圭洰浠g爜
+                            $("#HProjectStageName").val(checkStatus.data[0].椤圭洰闃舵);//宸ョ▼椤圭洰浠g爜
+                        } else {
+                            layer.msg("璇ラ」鐩凡鍏抽棴锛屼笉鍙�夋嫨锛�");
+                        }
+
+
+                        
+                        layer.close(index);//鍏抽棴寮圭獥
+                    }
+                    , btn2: function (index, layero) { }
+                })
+            }
+            //#endregion
 
             //#region 椤圭洰闃舵閫夋嫨椤甸潰
             function get_checkSearchHProjectStage() {
@@ -560,10 +633,7 @@
                         }
 
                         $("#HProjectStageID").val(checkStatus.data[0].HItemID);//椤圭洰闃舵id
-                        $("#HProjectStageName").val(checkStatus.data[0].HName);//椤圭洰闃舵鍚嶇О
-                        if ($("#HProjectStageName").val() == "") {
-                            $("#HProjectStageName").val(checkStatus.data[0].HNumber);
-                        }
+                        $("#HProjectStageName").val(checkStatus.data[0].闃舵鍚嶇О);//椤圭洰闃舵鍚嶇О
                         layer.close(index);//鍏抽棴寮圭獥
                     }
                     , btn2: function (index, layero) { }
@@ -591,6 +661,34 @@
                         $("#HSendEmp").val(checkStatus.data[0].HName);//瀹㈡埛鍚嶇О
                         if ($("#HSendEmp").val() == "") {
                             $("#HSendEmp").val(checkStatus.data[0].HNumber);
+                        }
+                        layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) { }
+                })
+            }
+            //#endregion
+
+            //#region 鎺ユ敹浜洪�夋嫨椤甸潰
+            function get_checkSearchHReceiveEmp() {
+                layer.open({
+                    type: 2//寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['90%', '90%']//澶у皬
+                    , title: '鍛樺伐琛�'//鏍囬
+                    , shift: 2//寮瑰嚭鍔ㄧ敾
+                    , content: ['../../Baseset/鍩虹璧勬枡/Gy_EmployeeList.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('璇烽�夋嫨鏁版嵁');
+                        }
+                        //鑾峰彇鏁版嵁
+                        $("#HReceiveEmp").val(checkStatus.data[0].HName);//鎺ユ敹浜哄悕绉�
+                        if ($("#HReceiveEmp").val() == "") {
+                            $("#HReceiveEmp").val(checkStatus.data[0].HNumber);
                         }
                         layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
@@ -631,6 +729,13 @@
             function set_AddNew(data) {
                 //鑾峰彇缁勭粐鏁版嵁
                 data.field.HPRDORGID = sessionStorage["OrganizationID"];//缁勭粐
+                //鑻ヤ负缂栬緫-淇濆瓨锛屽垯鏇存柊淇敼浜哄拰淇敼鏃堕棿
+                if (OperationType == 3) {
+                    data.field.HUpdater = sessionStorage["HUserName"];
+                    data.field.HUpdaterDate = Format(new Date(), "yyyy-MM-dd");
+                    $("#HUpdater").val(sessionStorage["HUserName"]);
+                    $("#HUpdaterDate").val(Format(new Date(), "yyyy-MM-dd"));
+                }
                 //鑾峰彇琛ㄥご鏁版嵁骞跺簭鍒楀寲
                 var sMainStr = JSON.stringify(data.field);              //涓昏〃鏁版嵁
 
@@ -697,17 +802,20 @@
                             , "HMaker": tableMain[0]["HMaker"]
                             , "HUpdater": tableMain[0]["HUpdater"]
                             , "HChecker": tableMain[0]["HChecker"]
-                            , "HMakerDate": tableMain[0]["HMakerDate"] == null ? "" : Format(new Date(tableMain[0]["HMakerDate"]), "yy-MM-dd")
-                            , "HUpdaterDate": tableMain[0]["HUpdaterDate"] == null ? "" : Format(new Date(tableMain[0]["HUpdaterDate"]), "yy-MM-dd")
-                            , "HCheckerDate": tableMain[0]["HCheckerDate"] == null ? "" : Format(new Date(tableMain[0]["HCheckerDate"]), "yy-MM-dd")
+                            , "HMakerDate": tableMain[0]["HMakerDate"] == null ? "" : Format(new Date(tableMain[0]["HMakerDate"]), "yyyy-MM-dd")
+                            , "HUpdaterDate": tableMain[0]["HUpdaterDate"] == null ? "" : Format(new Date(tableMain[0]["HUpdaterDate"]), "yyyy-MM-dd")
+                            , "HCheckerDate": tableMain[0]["HCheckerDate"] == null ? "" : Format(new Date(tableMain[0]["HCheckerDate"]), "yyyy-MM-dd")
                             , "HCloseMan": tableMain[0]["HCloseMan"]
                             , "HDeleteMan": tableMain[0]["HDeleteMan"]
                             , "HBacker": tableMain[0]["HBacker"]
-                            , "HCloseManDate": tableMain[0]["HCloseManDate"] == null ? "" : Format(new Date(tableMain[0]["HCloseManDate"]), "yyyy-MM-dd")
-                            , "HDeleteManDate": tableMain[0]["HDeleteManDate"] == null ? "" : tFormat(new Date(tableMain[0]["HDeleteManDate"]), "yyyy-MM-dd")
+                            , "HCloseManDate": tableMain[0]["HCloseDate"] == null ? "" : Format(new Date(tableMain[0]["HCloseDate"]), "yyyy-MM-dd")
+                            , "HDeleteManDate": tableMain[0]["HDeleteDate"] == null ? "" : Format(new Date(tableMain[0]["HDeleteDate"]), "yyyy-MM-dd")
                             , "HBackerDate": tableMain[0]["HBackerDate"] == null ? "" : Format(new Date(tableMain[0]["HBackerDate"]), "yyyy-MM-dd")
                             , "HBackRemark": tableMain[0]["HBackRemark"]
                         });
+
+                        //缁勭粐鐨勫�糎OrgID鍙樺寲锛岄噸鏂版覆鏌�
+                        HOrgIDBar = tableMain[0]["HOrgID"];
                     }
                 })
             }
@@ -820,16 +928,11 @@
                     layer.msg("鍗曟嵁鍙蜂笉鑳戒负绌�!");
                     return false;
                 }
-
                 if ($("#HProNumber").val() == "") {
                     layer.msg("椤圭洰浠g爜涓嶈兘涓虹┖!");
                     return false;
                 }
-                if ($("#HProName").val() == "") {
-                    layer.msg("椤圭洰鍚嶇О涓嶈兘涓虹┖!");
-                    return false;
-                }
-                if ($("#HProjectStageName").val() == "") {
+                if ($("#HProjectStageID").val() == "0") {
                     layer.msg("椤圭洰闃舵娌℃湁閫夋嫨!");
                     return false;
                 }
@@ -837,6 +940,10 @@
                     layer.msg("浠诲姟鍚嶇О涓嶈兘涓虹┖!");
                     return false;
                 }
+                if ($("#HDate").val() == "") {
+                    layer.msg("鏃ユ湡涓嶈兘涓虹┖!");
+                    return false;
+                }
                 if ($("#HSendEmp").val() == "") {
                     layer.msg("娲惧崟浜烘病鏈夐�夋嫨!");
                     return false;

--
Gitblit v1.9.1