WebTM/views/ÏîÄ¿¹ÜÀí/¹¤³ÌÏîÄ¿/PM_ProjectEndBillMain.html
@@ -14,6 +14,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/PageTitle.js"></script>
    <style>
        .main-btn { /*头部主按钮*/
            padding: 0 2px; /*调整按钮左右空隙大小*/
@@ -57,6 +58,7 @@
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnEdit" id="btnEdit">退出</button>
                    </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>
@@ -108,7 +110,7 @@
                                            </div>
                                        </div>
                                        <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="HCusName" name="HCusName" id="HCusName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" name="HCusID" id="HCusID" lay-verify="HCusID" value="0">
@@ -131,7 +133,7 @@
                                                <input type="date" class="layui-input" lay-verify="HEndDate" name="HEndDate" id="HEndDate" style="padding-left: 80px;">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
@@ -175,7 +177,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="HPMTeamName" name="HPMTeamName" id="HPMTeamName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" name="HPMTeamID" id="HPMTeamID" lay-verify="HPMTeamID" value="0">
@@ -185,7 +187,7 @@
                                            </div>
                                        </div>
                                        <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="HPMEmpName" name="HPMEmpName" id="HPMEmpName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" name="HPMEmpID" id="HPMEmpID" lay-verify="HPMEmpID" value="0">
@@ -195,7 +197,7 @@
                                            </div>
                                        </div>
                                        <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="HWorkEmpName" name="HWorkEmpName" id="HWorkEmpName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" name="HWorkEmpID" id="HWorkEmpID" lay-verify="HWorkEmpID" value="0">
@@ -205,7 +207,7 @@
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">备注</label>
@@ -225,6 +227,7 @@
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--其他信息-->
                            <div class="layui-tab-item">
                                <div class="layui-form-item">
@@ -253,19 +256,19 @@
                                        <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="HMakerDate" id="HMakerDate" style="background-color:#efefef4d;" readonly>
                                                <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="HUpdaterDate" id="HUpdaterDate" style="background-color:#efefef4d;" readonly>
                                                <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="HCheckerDate" id="HCheckerDate" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
@@ -293,32 +296,33 @@
                                        <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="HCloseManDate" id="HCloseManDate" style="background-color:#efefef4d;" readonly>
                                                <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="HDeleteManDate" id="HDeleteManDate" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HDeleteDate" id="HDeleteDate" 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="HBackerDate" id="HBackerDate" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HBackDate" id="HBackDate" 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; width:500px;">
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBackRemark" id="HBackRemark" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
@@ -361,6 +365,16 @@
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
            var HModuleType = "4761";
            //通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
            var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType);
            $("h1").html('<b>' + HPageTitle + '</b>');
            //#endregion
            //#region åˆ¤æ–­æ˜¯å¦ç™»å½• æœªç™»å½•则跳到登录页
            if (sessionStorage.login != "login") {
                layer.confirm("登录失效,请重新登录!", {
@@ -369,12 +383,15 @@
            }
            //#endregion
          
            //#region åˆ¤æ–­å¹¶è®¾ç½®æ“ä½œç±»åž‹ã€é¡µé¢åˆå§‹åŒ–
            if (OperationType == null || OperationType == 1) {                            //新增
                OperationType = 1;
                //生成并设置主表的内码和单据号
                createBillNo();
@@ -385,6 +402,7 @@
                //初始化项目工程主表开始时间和结束时间
                $("#HRunBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HTestDate").val(Format(new Date(), "yyyy-MM-dd"));
                //初始化日期
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
@@ -394,8 +412,7 @@
            else if (OperationType == 3) {//如果修改则走下面 new
                //初始化 ç¼–辑回显数据
                RoadBillMain(linterid);
                
@@ -415,6 +432,7 @@
            //#endregion
          
           
@@ -440,7 +458,7 @@
            //#region é€‰æ‹©å®¢æˆ·æŒ‰é’®
            form.on('submit(btnSearchHCusID)', function () {
                get_checkSearchHSendEmp();
                get_checkSearchHCus();
            });
            //#endregion
@@ -627,7 +645,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '员工表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=2&HOrgID=' + HOrgID, 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=HPM&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -657,7 +675,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '员工表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=2&HOrgID=' + HOrgID, 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=HWorker&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -677,7 +695,34 @@
                })
            }
            //#endregion
            //#region å®¢æˆ·é€‰æ‹©é¡µé¢
            function get_checkSearchHCus() {
                var HOrgID = $("#HOrgID").val();
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '客户表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/销售基础资料/Gy_Customer.html?openType=2&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        //获取数据
                        $("#HCusID").val(checkStatus.data[0].HItemID);//客户id
                        $("#HCusName").val(checkStatus.data[0].客户名称);//客户名称
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                    , end: function () { }
                })
            }
            //#endregion
            //#region ç®¡ç†å‘˜é€‰æ‹©é¡µé¢
            function get_checkSearchHManager() {
                var HOrgID = $("#HOrgID").val();
@@ -687,7 +732,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '员工表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=2&HOrgID=' + HOrgID, 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=HManager&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -704,6 +749,7 @@
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                    , end: function () { }
                })
            }
            //#endregion
@@ -717,7 +763,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '供应商表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/采购基础资料/Gy_Supplier.html?openType=2&HOrgID=' + HOrgID, 'yes']
                    , content: ['../../基础资料/采购基础资料/Gy_Supplier.html?openType=HSup&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -734,6 +780,7 @@
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                    , end: function () { }
                })
            }
            //#endregion
@@ -747,7 +794,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '员工表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=2&HOrgID=' + HOrgID, 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=HEmp&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -764,6 +811,7 @@
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                    , end: function () { }
                })
            }
            //#endregion
@@ -889,12 +937,32 @@
                    layer.msg("单据号不能为空!");
                    return false;
                }
                if ($("#HProID").val() == "0") {
                if ($("#HProjecID").val() == "0") {
                    layer.msg("项目代码没有选择!");
                    return false;
                }
                if ($("#HDate").val() == "") {
                    layer.msg("日期不能为空!");
                    return false;
                }
                if ($("#HManagerID").val() == "0") {
                    layer.msg("管理员不能为空!");
                    return false;
                }
                if ($("#HWorkEmpID").val() == "0") {
                    layer.msg("实施担当不能为空!");
                    return false;
                }
                if ($("#HPMEmpID").val() == "0") {
                    layer.msg("项目经理不能为空!");
                    return false;
                }
                if ($("#HPMTeamID").val() == "0") {
                    layer.msg("交付方不能为空!");
                    return false;
                }
                if ($("#HCusID").val() == "0") {
                    layer.msg("客户不能为空!");
                    return false;
                }
@@ -1031,7 +1099,55 @@
        });
        //工程项目
        function GetProjectBillValue(obj) {
            if (obj[0].关闭人 == null || obj[0].关闭人 == "") {
                $("#HProjectID").val(obj[0].HInterID);
                $("#HProNumber").val(obj[0].项目代码);//工程项目代码
                $("#HProName").val(obj[0].项目名称);//工程项目名称
                $("#HCusID").val(obj[0].HCusID);//客户id
                $("#HCusName").val(obj[0].客户);//客户名称
                $("#HMainSourceInterID").val(obj[0].HInterID);
                $("#HMainSourceEntryID").val(obj[0].HEntryID);
                $("#HMainSourceBillNo").val(obj[0].单据号);
                $("#HMainSourceBillType").val(obj[0].单据类型);
            } else {
                layer.msg("该项目已关闭,不可选择!");
            }
        }
        //管理员
        function GetHManagerValue(obj) {
            $("#HManagerID").val(obj[0].HItemID);//管理员id
            $("#HManagerName").val(obj[0].职员名称);//管理员名称
        }
        //项目经理
        function GetHPMValue(obj) {
            $("#HPMEmpID").val(obj[0].HItemID);//客户id
            $("#HPMEmpName").val(obj[0].职员名称);//客户名称
        }
        //实施担当
        function GetHWorkerValue(obj) {
            $("#HWorkEmpID").val(obj[0].HItemID);//员工id
            $("#HWorkEmpName").val(obj[0].职员名称);//员工名称
        }
        //测试人员
        function GetHSupNameValue(obj) {
            $("#HPMTeamID").val(obj[0].HItemID);//交付方id
            $("#HPMTeamName").val(obj[0].供应商名称);//供应商名称
        }
        //交付方
        function GetHEmpValue(obj) {
            $("#HTestEmp").val(obj[0].HItemID);//测试人员id
            $("#HTestEmpName").val(obj[0].职员名称);//测试人员名称
        }
        //客户
        function GetHCusNameValue(obj) {
            $("#HCusID").val(obj[0].HItemID);//交付方id
            $("#HCusName").val(obj[0].客户名称);//供应商名称
        }
    </script>
</body>