var F_no = request('F_no'); var keyword = ''; var refreshGird; var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { page.initGrid(); page.bind(); }, bind: function () { // 查询 $('#btn_Search').on('click', function () { keyword = $('#txt_Keyword').val(); page.search({ keyword: keyword, pno: F_no }); alert(keyword); }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); //// 新增 //$('#lr_add').on('click', function () { // top.selectedDataItemRow = null; // var parentId = $('#gridtable').jfGridValue('F_ItemDetailId') || '0'; // learun.layerForm({ // id: 'form', // title: '添加字典', // url: top.$.rootUrl + '/LR_SystemModule/DataItem/Form?parentId=' + parentId + '&itemCode=' + F_no, // width: 500, // height: 370, // callBack: function (id) { // return top[id].acceptClick(refreshGird); // } // }); //}); //// 编辑 //$('#lr_edit').on('click', function () { // var keyValue = $('#gridtable').jfGridValue('F_ItemDetailId'); // top.selectedDataItemRow = $('#gridtable').jfGridGet('rowdata'); // if (learun.checkrow(keyValue)) { // learun.layerForm({ // id: 'form', // title: '编辑字典', // url: top.$.rootUrl + '/LR_SystemModule/DataItem/Form?itemCode=' + F_no, // width: 500, // height: 370, // callBack: function (id) { // return top[id].acceptClick(refreshGird); // } // }); // } //}); //// 删除 //$('#lr_delete').on('click', function () { // var keyValue = $('#gridtable').jfGridValue('F_ItemDetailId'); // if (learun.checkrow(keyValue)) { // learun.layerConfirm('是否确认删除该项!', function (res) { // if (res) { // learun.deleteForm(top.$.rootUrl + '/LR_SystemModule/DataItem/DeleteDetailForm', { keyValue: keyValue }, function () { // refreshGird(); // }); // } // }); // } //}); }, initGrid: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/OrderManager/StockOutOrder/GetStockOutDetail', headData: [ { label: '物料编码', name: 'F_matNo', width: 120, align: 'left' }, { label: '物料名称', name: 'F_matName', width: 120, align: 'left' }, { label: '物料类型', name: 'F_matType', width: 100, align: "left", formatterAsync: function (callback, value, row) { learun.clientdata.getAsync('dataItem', { Rowkey: value, GrpCode: 'EMatType', getType: 'Num', callback: function (item) { callback(item.F_NAME); } }); }, }, { label: '托盘号', name: 'F_trayNo', width: 120, align: 'left' }, { label: '箱号', name: 'F_boxNo', width: 80, align: 'left' }, { label: '货位', name: 'F_locationNo', width: 80, align: 'left' }, { label: '数量', name: 'F_quantity', width: 80, align: 'center' }, //{ // label: "有效", name: "F_EnabledMark", width: 50, align: "center", // formatter: function (cellvalue) { // return cellvalue == 1 ? "" : ""; // } //}, { label: "操作人", name: "F_addUserNo", width: 120, align: "left" }, { label: "创建时间", name: "F_addTime", width: 120, align: "left" } ], isTree: true, mainId: 'F_rowNo', parentId: 'F_pNo', }); page.search(); }, search: function (param) { param = param || {}; param.keyword = keyword; param.pno = F_no; $('#gridtable').jfGridSet('reload', param); } }; refreshGird = function () { page.search(); }; page.init(); }