| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 | var refreshGirdData;var OneInTimebegin = '';var OneInTimeend = '';var ProductTimebegin = '';var ProductTimeend = '';var logbegin = '';var logend = '';var selectedRow;var refreshGirdData; // 更新数据var bootstrap = function ($, learun) {    "use strict";    var page = {        init: function () {            page.initGird();            page.bind();        },        bind: function () {            $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {                // 调用后台查询                // queryJson 查询条件                var oneintime = $('#lr_search_date_OneInTime').html();                if (oneintime == '') {                    OneInTimebegin = '';                    OneInTimeend = '';                }                var producttime = $('#lr_search_date_ProductTime').html();                if (producttime == '') {                    ProductTimebegin = '';                    ProductTimeend = '';                }                console.log(queryJson);                queryJson["Code"] = $("#Code").val();                queryJson["Name"] = $("#Name").val();                queryJson["ShortDesc"] = $("#ShortDesc").val();                queryJson["SpoolType"] = $("#SpoolType").val();                page.search({ queryJson: JSON.stringify(queryJson) });            }, 250);            // 查询            $('#btn_Search').on('click', function () {                var keyword = $('#txt_Keyword').val();                page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val() }) });            });            // 刷新             $('#lr_refresh').on('click', function () {                location.reload();            });            //$('#ContGrpType').lrselect({            //    url: top.$.rootUrl + '/FJManager/Enums/GetContGrpTypeList',            //    maxHeight: 180,            //    allowSearch: false            //});            $('#InvStateCode').lrselect({                url: top.$.rootUrl + '/FJManager/Enums/GetInvStateList',                maxHeight: 180,                allowSearch: false            });            // 新增            $('#lr_add').on('click', function () {                var keyValue = {};                selectedRow = {};                learun.layerForm({                    id: 'form',                    title: '添加物料',                    url: top.$.rootUrl + '/FJManager/BaseMatinfo/Form',                    height: 400,                    width: 800,                    callBack: function (id) {                        return top[id].acceptClick(refreshGirdData);                    }                });            });            // 编辑            $('#lr_edit').on('click', function () {                var keyValue = $('#gridtable').jfGridValue('Code');                selectedRow = $('#gridtable').jfGridGet('rowdata');                if (learun.checkrow(keyValue)) {                    learun.layerForm({                        id: 'form',                        title: '编辑物料信息',                        url: top.$.rootUrl + '/FJManager/BaseMatinfo/Form?keyValue=' + keyValue,                        height: 400,                        width: 800,                        callBack: function (id) {                            return top[id].acceptClick(refreshGirdData);                        }                    });                }            });            // 删除            $('#lr_delete').on('click', function () {                var keyValue = $('#gridtable').jfGridValue('Code');                if (learun.checkrow(keyValue)) {                    learun.layerConfirm('是否确认删除该项!', function (res) {                        if (res) {                            learun.deleteForm(top.$.rootUrl + '/FJManager/BaseMatinfo/Delete', { keyValue: keyValue }, function () {                                refreshGirdData();                            });                        }                    });                }            });        },        // 初始化列表         initGird: function () {            $('#gridtable').jfGrid({                url: top.$.rootUrl + '/FJManager/BaseMatinfo/GetPageList',                headData: [                                      { label: "物料编码", name: "Code", width: 110, align: "left" },                    { label: "物料名称", name: "Name", width: 80, align: "left" },                    { label: "物料描述", name: "ShortDesc", width: 80, align: "left" },                    { label: "镀层", name: "Plating", width: 80, align: "left" },                    { label: "镀层克重", name: "PlatingWeight", width: 80, align: "left" },                    { label: "强度", name: "Strength", width: 80, align: "left" },                    { label: "工字轮类型", name: "SpoolType", width: 80, align: "left" },                    { label: "线密度", name: "Linear", width: 80, align: "left" },                    {                        label: "是否启用时长", name: "IsHold", width: 80, align: "left", formatter: function (cellvalue) {                            if (cellvalue == true) {                                return '<span class=\"label label-success\"  >是</span>';                            } else {                                return '<span class=\"label  label-default\" >否</span>';                            }                        }                    },                    { label: "启用时长", name: "HoldDuration", width: 80, align: "left" },                    { label: "创建时间", name: "AddTime", width: 130, align: "left" },                    { label: "修改时间", name: "EditTime", width: 130, align: "left" },                ],                mainId: 'Id',                isPage: true,                reloadSelected: true,                autowWidth: true,                sidx: 'AddTime',                sord: 'DESC',            });            page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val() }) });        },        search: function (param) {            $('#gridtable').jfGridSet('reload', param);        }    };    refreshGirdData = function () {        $('#gridtable').jfGridSet('reload');    };    page.init();}
 |