zrg
2024-11-28 727ee25aeb5fcaf84e2cf009b2eacd3a86bcb3ca
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Gy_MouldFileResume.html
@@ -184,7 +184,29 @@
            });
            //点击主表带出从表数据
            table.on('row(mainTable)', function (obj) { //注:tool æ˜¯å·¥å…·æ¡äº‹ä»¶åï¼Œtest æ˜¯ table åŽŸå§‹å®¹å™¨çš„å±žæ€§ lay-filter="对应的值"
            //table.on('row(mainTable)', function (obj) { //注:tool æ˜¯å·¥å…·æ¡äº‹ä»¶åï¼Œtest æ˜¯ table åŽŸå§‹å®¹å™¨çš„å±žæ€§ lay-filter="对应的值"
            //});
            //#region ç‚¹å‡»è¡Œé€‰ä¸­é«˜äº®
            table.on('row(mainTable)', function (obj) {
                //选中行改变颜色
                var flag = !obj.tr.find(':checkbox:first').prop('checked');
                obj.tr.find(':checkbox').prop('checked', flag);
                if (flag) {
                    obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked');  //设置复选框选中样式
                    $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//改变当前tr背景颜色和字体颜色
                } else {
                    obj.tr.find('.layui-form-checkbox').removeClass('layui-form-checked');//取消复选框选中样式
                    $(obj.tr.selector).attr({ "style": "background:" });//取消当前tr颜色
                }
                //mainTable ä¸ºè¡¨æ ¼ID   æ³¨æ„æ­¤å¤„如果ID不正确将导致你在监听复选框时获取不到你选择的数据,前面的只是添加或删除选中未选中样式以及设置背景色,字体颜色
                layui.each(table.cache.mainTable, function (i, l) {
                    if (obj.tr.index() == l.LAY_TABLE_INDEX) {
                        l.LAY_CHECKED = flag;
                    }
                });
                var datas = obj.data; //获得当前行数据
                var linterid = datas.hmainid;
                $.ajax({
@@ -208,7 +230,9 @@
                        layer.alert("接口失效!", { icon: 5 });
                    }
                });
            });
            })
            //#endregion
            //重置按钮
            form.on('submit(btnReSearch)', function (data) {
@@ -245,6 +269,7 @@
                    , toolbar: '#toolbarDemo'
                    , height: '400'
                    , page: true
                    , totalRow: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
@@ -252,7 +277,7 @@
                        soulTable.render(this);
                    }
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        { type: 'checkbox', fixed: 'left', totalRowText: '合计行'}
                        , { field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                        , { field: '日期', title: '日期', templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>", sort: true}
                        , { field: '单据号', title: '单据号', sort: true }
@@ -291,10 +316,10 @@
                        , { field: '初始模具规格', title: '初始器具规格', sort: true }
                        , { field: '当前设计寿命', title: '当前设计寿命', sort: true }
                        , { field: '初始设计寿命', title: '初始设计寿命', sort: true }
                        , { field: '使用寿命', title: '使用寿命', sort: true }
                        , { field: '剩余寿命', title: '剩余寿命', sort: true }
                        , { field: '已生产数量', title: '已生产数量', sort: true }
                        , { field: '已生产重量', title: '已生产重量', sort: true }
                        , { field: '使用寿命', title: '使用寿命', sort: true, totalRow: true }
                        , { field: '剩余寿命', title: '剩余寿命', sort: true, totalRow: true }
                        , { field: '已生产数量', title: '已生产数量', sort: true, totalRow: true }
                        , { field: '已生产重量', title: '已生产重量', sort: true, totalRow: true }
                        , { field: '备注', title: '备注', sort: true }
                        , { field: '关联数量', title: '关联数量', sort: true }
                        , { field: '制单人', title: '制单人', sort: true }
@@ -320,6 +345,7 @@
                    //, toolbar: '#toolbarDemo'
                    , height: '350'
                    , page: true
                    , totalRow: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
@@ -335,7 +361,7 @@
                        , { field: '器具名称', title: '器具名称', width: 200 }
                        , { field: '器具规格', title: '器具规格', width: 200 }
                        , { field: '器具型号', title: '器具型号', width: 200 }
                        , { field: '数量', title: '数量', width: 200 }
                        , { field: '数量', title: '数量', width: 200, totalRow: true}
                        , { field: '仓库', title: '仓库', width: 200 }
                        , { field: '仓位', title: '仓位', width: 200 }
                        , { field: '调出仓库', title: '调出仓库', width: 200 }
@@ -359,6 +385,7 @@
                    //, toolbar: '#toolbarDemo'
                    , height: '350'
                    , page: true
                    , totalRow: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
@@ -377,10 +404,10 @@
                        , { field: '器具名称', title: '器具名称', width: 200 }
                        , { field: '器具规格', title: '器具规格', width: 200 }
                        , { field: '器具型号', title: '器具型号', width: 200 }
                        , { field: '生产数量', title: '生产数量', width: 200 }
                        , { field: '设计寿命', title: '设计寿命', width: 200 }
                        , { field: '耗用寿命', title: '耗用寿命', width: 200 }
                        , { field: '剩余寿命', title: '剩余寿命', width: 200 }
                        , { field: '生产数量', title: '生产数量', width: 200, totalRow: true }
                        , { field: '设计寿命', title: '设计寿命', width: 200, totalRow: true }
                        , { field: '耗用寿命', title: '耗用寿命', width: 200, totalRow: true }
                        , { field: '剩余寿命', title: '剩余寿命', width: 200, totalRow: true }
                        , { field: '制单人', title: '制单人' }
                        , { field: '制单日期', title: '制单日期', templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '审核人', title: '审核人' }
@@ -400,6 +427,7 @@
                    //, toolbar: '#toolbarDemo'
                    , height: '350'
                    , page: true
                    , totalRow: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
@@ -434,6 +462,7 @@
                    //, toolbar: '#toolbarDemo'
                    , height: '350'
                    , page: true
                    , totalRow: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]