1
duhe
2024-08-15 40cd70d9a9d13001c1b6c2269334e8a363c562c3
WebTM/views/ÖÊÁ¿¹ÜÀí/ÖÊÁ¿±¨±í/QC_MoistureContentDataLedger.html
@@ -47,8 +47,9 @@
                                    <label class="layui-form-label" style="width: 85px;">判定结果</label>
                                    <div class="layui-input-block" style="margin-left: 120px; width: 85px;">
                                        <select name="HResult" id="HResult" lay-verify="HResult">
                                            <option value="合格">合格</option>
                                            <option value="不合格">不合格</option>
                                            <option value="-1">全部</option>
                                            <option value="1">合格</option>
                                            <option value="0">不合格</option>
                                        </select>
                                    </div>
                                </div>
@@ -193,7 +194,7 @@
            , soulTable = layui.soulTable
        var sWhere = "";
        var option = [];
        var HModName = "QC_QualityStatisticsDailyReport";
        var HModName = "QC_MoistureContentDataLedger";
        var titleData = ["HInterID", "HEntryID", "HBadReasonID", "HSourceInterID", "HSourceEntryID"];//子表不需要显示的字段 å¯æ‰©å±•
        //#endregion
@@ -277,13 +278,13 @@
            var columns = [];
            columns.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计' });
            columns.push({ field: '日期', title: '日期', sort: true, width: 90});
            columns.push({ field: '日期', title: '日期', sort: true, width: 180});
            columns.push({ field: '机台号', title: '机台号', sort: true, width: 110 });
            columns.push({ field: '取样重量', title: '取样重量', sort: true, width: 110 });
            columns.push({ field: '测量结果', title: '测量结果', sort: true, totalRow: true, width: 110});
            columns.push({ field: '判定结果', title: '判定结果', sort: true, totalRow: true, width: 110});
            columns.push({ field: '检测人', title: '检测人', sort: true, totalRow: true, width: 110});
            columns.push({ field: '备注', title: '备注', sort: true, totalRow: true, width: 110});
            columns.push({ field: '取样重量', title: '取样重量', sort: true, totalRow: true, width: 110 });
            columns.push({ field: '测量结果', title: '测量结果', sort: true, width: 110});
            columns.push({ field: '判定结果', title: '判定结果', sort: true, width: 110});
            columns.push({ field: '检测人', title: '检测人', sort: true, width: 110});
            columns.push({ field: '备注', title: '备注', sort: true, width: 110});
            option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo1'
@@ -314,7 +315,57 @@
                success: function (data1) {
                    if (data1.count == 1) {
                        option.data=data1.data
                        if (data1.list.length > 0) {
                            var data = [];
                            var col = [];
                            //给空的数组赋值
                            for (var key in data1.list) {
                                data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                            }
                            //在列表左边添加勾选框
                            col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计行' });
                            for (var i = 0; i < data.length; i++) {
                                if ($.inArray(data[i].name, titleData) > -1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                }
                                else {
                                    switch (data[i].Type) {
                                        //int
                                        case 'DateTime':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
                                            break;
                                        case 'long':
                                        case 'Int32':
                                        case 'Int64':
                                        case 'double':
                                        case 'Decimal':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 140, totalRow: true });
                                            break;
                                        default:
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                    }
                                }
                            }
                            option = {
                                elem: '#mainTable'
                                , toolbar: '#toolbarDemo1'
                                , height: 'full-50'
                                , page: true
                                , totalRow: true
                                , limit: 500
                                , data: data1.data
                                , limits: [50, 500, 5000, 20000]
                                //, done: function (res, curr, count) {
                                //    soulTable.render(this);
                                //}
                                , cols: [col]
                            };
                        } else {
                            set_InitGrid();
                            option.data = data1.data
                        }
                        table.render(option);
                        //刷新表格数据
@@ -424,7 +475,7 @@
                , HResult: HResult
                , HSourceID: HSourceID
            }
            set_InitGrid();
            //set_InitGrid();
            get_Display(JSON.stringify(sWhere));
            sWhere = "";//调用接口后清空sWhere缓存
        }