yusijie
2024-04-02 1ade401c90b87d507ab70cf40e08441cbfe52421
WebTM/views/ÏîÄ¿¹ÜÀí/ÏîÄ¿½×¶Î/PM_ProjectReportBill.html
@@ -387,7 +387,7 @@
        </div>
    </script>
    <script>
        var optiondata = [];
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
@@ -832,46 +832,56 @@
                        }
                        //设置表体数据
                        var HBillInterID = checkStatus.data[0].HInterID;
                        $.ajax({
                            url: GetWEBURL() + "/PM_ProjectBill/editInit",
                            type: "GET",
                            async: false,
                            data: { "HInterID": HBillInterID, "user": sessionStorage["HUserName"] },
                            success: function (result) {
                                //获取数据库中该项目的项目成员数据
                                var tableSub_Emp = result.data[2];
                                //根据表体列,填充表体数据
                                var num = [];
                                for (var i = 0; i < tableSub_Emp.length; i++) {
                                    var rowdata =
                                    {
                                        "RowID": (i + 1) * 10
                                        , 'HEmpID': tableSub_Emp[i]["HEmployeeID"]
                                        , 'HEmpName': tableSub_Emp[i]["HEmployeeName"]
                                        , 'HIsPM': tableSub_Emp[i]["HIsPM"]
                                        , 'HRate': tableSub_Emp[i]["HRate"]
                                        , 'HAvgMoney': '0'
                                        , 'HCountMoney': '0'
                                        , 'HRemarkSub': ''
                                    };
                                    num.push(rowdata);
                                }
                                option.data = num;
                                table.render(option);
                                //设置复选框选中状态
                                for (var i = 0; i < tableSub_Emp.length; i++) {
                                    if (tableSub_Emp[i].HIsPM) {
                                        $('#HIsPM' + (i + 1)).attr("checked", true);
                                    }
                                }
                                form.render('checkbox');
                            }
                        })
                        get_NumberNum(HBillInterID);
                        layer.close(index);//关闭弹窗
                    }
                    , btn2: function (index, layero) { }
                    , end: function () {
                        get_NumberNum($("#HProjectID").val());
                    }
                })
            }
            //#endregion
            //#region   é€‰æ‹©é¡¹ç›®ä»£ç ,带出子表数据
            function get_NumberNum(HBillInterID) {
                $.ajax({
                    url: GetWEBURL() + "/PM_ProjectBill/editInit",
                    type: "GET",
                    async: false,
                    data: { "HInterID": HBillInterID, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        //获取数据库中该项目的项目成员数据
                        var tableSub_Emp = result.data[2];
                        //根据表体列,填充表体数据
                        var num = [];
                        for (var i = 0; i < tableSub_Emp.length; i++) {
                            var rowdata =
                            {
                                "RowID": (i + 1) * 10
                                , 'HEmpID': tableSub_Emp[i]["HEmployeeID"]
                                , 'HEmpName': tableSub_Emp[i]["HEmployeeName"]
                                , 'HIsPM': tableSub_Emp[i]["HIsPM"]
                                , 'HRate': tableSub_Emp[i]["HRate"]
                                , 'HAvgMoney': '0'
                                , 'HCountMoney': '0'
                                , 'HRemarkSub': ''
                            };
                            num.push(rowdata);
                        }
                        option.data = num;
                        table.render(option);
                        //设置复选框选中状态
                        for (var i = 0; i < tableSub_Emp.length; i++) {
                            if (tableSub_Emp[i].HIsPM) {
                                $('#HIsPM' + (i + 1)).attr("checked", true);
                            }
                        }
                        form.render('checkbox');
                    }
                })
            }
            //#endregion
            //#region é¡¹ç›®é˜¶æ®µé€‰æ‹©é¡µé¢
@@ -903,6 +913,9 @@
                        layer.close(index);//关闭弹窗
                    }
                    , btn2: function (index, layero) { }
                    , end: function () {
                    }
                })
            }
            //#endregion
@@ -916,7 +929,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '员工表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=2&HOrgID=' + HOrgID, 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=HReport&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -933,6 +946,7 @@
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                    , end: function () { }
                })
            }
            //#endregion
@@ -1023,7 +1037,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '员工表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=2&HOrgID=' + HOrgID, 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=HReceive&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1039,6 +1053,9 @@
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                    , end: function () {
                    }
                })
            }
            //#endregion
@@ -1531,7 +1548,7 @@
                                , shift: 2                                          //弹出动画
                                , area: ["90%", "90%"]                              //窗体大小
                                , maxmin: true                                      //设置最大最小按钮是否显示
                                , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=2&HOrgID=' + HOrgID, 'yes']
                                , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=HEmp&HOrgID=' + HOrgID, 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -1547,6 +1564,12 @@
                                        , "HEmpName": checkStatus.data[0].职员名称
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    obj.update({
                                        "HEmpID": optiondata[0].HItemID
                                        , "HEmpName": optiondata[0].职员名称
                                    })
                                }
                            })
                        }
@@ -1767,6 +1790,48 @@
        }
            //#endregion
        //项目代码
        function GetProjectBillValue(obj) {
            $("#HProjectID").val(obj[0].HInterID);
            $("#HProNumber").val(obj[0].项目代码);
            $("#HProjectStageID").val(obj[0].HProjectStageID);
            $("#HProjectStageName").val(obj[0].项目阶段);
            $("#HStageNote").val(obj[0].项目阶段详细内容);
            $("#HPMGoodsID").val(obj[0].HPMGoodsID);
            $("#HRelationGoods").val(obj[0].阶段相关交付物);
            $("#HIsKey").val((obj[0].里程碑 == 'Y' ? true : false));
            $("#HRate").val(obj[0].阶段业绩占比);
            $("#HMainSourceInterID").val(obj[0].HInterID);
            $("#HMainSourceEntryID").val(obj[0].HEntryID);
            $("#HMainSourceBillNo").val(obj[0].单据号);
            $("#HMainSourceBillType").val(obj[0].单据类型);
        }
        //项目阶段
        function GetProjectStageValue(obj) {
            $("#HProjectStageID").val(obj[0].HItemID);//项目阶段id
            $("#HProjectStageName").val(obj[0].阶段名称);//项目阶段名称
            $("#HStageNote").val(obj[0].项目阶段详细内容);//项目阶段详细内容
        }
        //汇报人
        function GetHReportValue (obj) {
            $("#HReportEmpID").val(obj[0].HItemID);//客户id
            $("#HReportEmpName").val(obj[0].职员名称);//客户名称
        }
        //接收人
        function GetHReceiveValue(obj) {
            $("#HReceiveEmp").val(obj[0].职员名称);//接收人名称
        }
        //员工
        function GetHEmpValue(obj) {
            optiondata = obj
        }
    </script>
</body>
</html>