duhe
2023-09-22 2e65340e012e6bf0a5b90cf1114b971eefd42699
WebTM/views/ÏîÄ¿¹ÜÀí/¹¤×÷ÈÎÎñ/PM_WorkTaskReportBillList.html
@@ -40,6 +40,18 @@
                                    </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="HReportEmp" id="HReportEmp">
                                    </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="HBillStatus" id="HBillStatus">
                                    </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">
@@ -53,6 +65,18 @@
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;">
                                    <div class="layui-row" style="margin-top:5px">
                                        <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="HProjectName" id="HProjectName">
                                            </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="HTaskNote" id="HTaskNote">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">过滤</label>
                                            <div class="layui-input-block">
@@ -241,9 +265,14 @@
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
                //查询
                get_FastQuery(1);
                //初始化组织
                Organ();
                //查询
                if (addSWhereByOpenType()) {                        //addSWhereByOpenType()方法判断是否其它页面打开本页面,若是则处理过滤条件,并返回true
                    get_FastQuery(2);
                } else {
                    get_FastQuery(1);
                }
            }
            //#endregion
@@ -254,6 +283,7 @@
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , totalRow: true
                    //, cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 50000]
@@ -266,6 +296,7 @@
                //获取登录页组织列
                $.ajax({
                    type: "get",
                    async: false,
                    url: GetWEBURL() + "/Web/GetOrganizations",
                    success: function (result) {
                        var Organization = "";
@@ -293,6 +324,7 @@
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"]},
                    success: function (data1) {
                        if (data1.count == 1) {
                            var totalArray = ["评估工时","自评工时","耗用工时"];
                            var data = [];
                            var col = [];
                            //给空的数组赋值
@@ -306,7 +338,9 @@
                                if ($.inArray(data[i].name, titleData) > -1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                }
                                else {
                                else if ($.inArray(data[i].name, totalArray)>-1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
                                }else {
                                    switch (data[i].Type) {
                                        //int
                                        case 'DateTime':
@@ -347,12 +381,25 @@
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery(number) {
                ////获取登录账户对应职员名称
                var HUserName = getHEmpByHUserName();
                if (HUserName != "" && HUserName != null) {
                    sWhere = " and æ±‡æŠ¥äºº = '" + HUserName + "' ";
                }
                var HOrgID = "";
                var HBillNo = $("#HBillNo").val();  //单据号
                var HReportEmp = $("#HReportEmp").val();//汇报人
                var HBillStatus = $("#HBillStatus").val();//单据状态
                var HProjectName = $("#HProjectName").val();//项目名称
                var HTaskNote = $("#HTaskNote").val();//任务描述
                //任意字段过滤
                var ColName = $("#ColName").val();//复选框
                var Comparator = $("#Comparator").val()
                var ColContent = $("#ColContent").val();
                if (ColName != 0 && Comparator != 0) {
                    var com = "";
@@ -388,6 +435,19 @@
                if (HOrgID) {
                    sWhere += " and HOrgID = '" + HOrgID + "'";
                }
                if (HBillStatus) {
                    sWhere += " and å•据状态 like '%" + HBillStatus + "%'";
                }
                if (HProjectName) {
                    sWhere += " and é¡¹ç›®åç§° like '%" + HProjectName + "%'";
                }
                if (HTaskNote) {
                    sWhere += " and ä»»åŠ¡æè¿° like '%" + HTaskNote + "%'";
                }
                if (HReportEmp) {
                    sWhere += " and æ±‡æŠ¥äºº like '%" + HReportEmp + "%'";
                }
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
@@ -396,6 +456,10 @@
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶æ–¹æ³•
            function set_ClearQuery() {
                $("#HBillNo").val("");
                $("#HReportEmp").val("");
                $("#HBillStatus").val("");
                $("#HProjectName").val("");
                $("#HTaskNote").val("");
                $("#HOrgID").val(sessionStorage["OrganizationID"]);
                $("#ColContent").val("");
                $("#ColName").val("0");
@@ -802,6 +866,61 @@
            }
            //#endregion
            //#region èŽ·å–å‚æ•°
            function getUrlVars() {
                var vars = [], hash;
                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
                for (var i = 0; i < hashes.length; i++) {
                    hash = hashes[i].split('=');
                    vars.push(hash[0]);
                    vars[hash[0]] = hash[1];
                }
                return vars;
            }
            //#endregion
            //#region åˆ¤æ–­æ˜¯ç›´æŽ¥æ‰“开页面还是其它页面通过选择按钮打开,并显示相应数据
            function addSWhereByOpenType() {
                //获取参数
                var params = getUrlVars();
                var openType = params[params[0]]; //从参数中获取 æ‰“开方式  1直接打开 2其它页面通过选择按钮打开
                var HOrgID = params[params[1]];
                if (openType == 2) {
                    sWhere += " and ISNULL(关闭人,'') = '' and ISNULL(作废人,'') = '' ";
                    $("#HOrgID").val(HOrgID);
                    form.render("select");
                    return true;
                }
                return false;
            }
            //#endregion
            //#region æ ¹æ®ç™»å½•账户获取相应职员
            function getHEmpByHUserName() {
                var Czybm = sessionStorage["Czybm"];
                var HUserName = "";
                var wait = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/PM_WorkTaskReportBill/getHEmpByHUserName',
                    type: "GET",
                    async: false,
                    data: { "Czybm": Czybm, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 1) {
                            HUserName = result.data[0]["HEmpName"];
                            layer.close(wait);
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
                            layer.close(wait);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                        layer.close(wait);
                    }
                });
                return HUserName;
            }
            //#endregion
        });
            //#endregion