123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
-
- var selectedRow;
- var refreshGirdData;
- var typnum = 1;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- // 查询
- $('#btn_Search').on('click', function () {
- var keyword = $('#txt_Keyword').val();
- page.search({ keyword: keyword });
- });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- $('#lr_import').on('click', function () {
- learun.layerForm({
- id: 'ImportForm',
- title: '导入Excel数据',
- url: top.$.rootUrl + '/Utility/ImportForm?ordertype=' + typnum,
- width: 600,
- height: 300,
- maxmin: true,
- btn: null
- });
- });
- $('#lr_exportnow').on('click', function () {
- learun.layerForm({
- id: "ExcelExportForm",
- title: '导出Excel数据',
- url: top.$.rootUrl + '/Utility/ExcelExportForm?gridId=' + $('#gridtable').attr('id') + '&filename=' + encodeURI(encodeURI("仓库列表")),
- width: 500,
- height: 380,
- callBack: function (id) {
- return top[id].acceptClick();
- },
- btn: ['导出Excel', '关闭']
- });
- });
-
- // 启用
- $('#lr_enable').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('F_no');
- //alert(keyValue);
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认启用该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/BaseManager/BaseItem/Enable', { no: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 禁用
- $('#lr_disable').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('F_no');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认禁用该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/BaseManager/BaseItem/Disable', { no: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/BaseManager/BaseItem/GetPageList',
- headData: [
- { label: 'ID', name: 'F_no', width: 50, align: "left" },
- { label: '项目号', name: 'F_projectNo', width: 120, align: "left" },
- { label: '物料编码', name: 'F_matNo', width: 120, align: "left" },
- { label: '物料名称', name: 'F_matName', width: 120, align: "left" },
- { label: '物料名称1', name: 'F_matName1', 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: '飞旭物料类型1', name: 'F_partType', width: 120, align: "left" },
- {
- label: '状态', name: 'F_isStop', width: 120, align: "left",
- formatter: function (cellvalue) {
- if (cellvalue == 0) {
- return '<span class=\"label label-success\" style=\"cursor: pointer;\">启用</span>';
- } else {
- return '<span class=\"label label-default\" style=\"cursor: pointer;\">禁用</span>';
- }
- }},
- { label: '单位', name: 'F_unit', width: 120, align: "left" },
- { label: '备注', name: 'F_demo', width: 120, align: "left" },
- { label: '创建用户', name: 'F_addUserNo', width: 120, align: "left" },
- { label: '创建时间', name: 'F_addTime', width: 120, align: "left" },
- ],
- mainId: 'F_no',
- sidx: 'F_no',
- isPage: true
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', param);
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|