123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- /*
-
- * 创建人:超级管理员
- * 日 期:2019-06-06 06:08
- * 描 述:点位管理
- */
- var selectedRow;
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var warehouseId = '';
- 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_add').on('click', function () {
- selectedRow = null;
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/BaseManager/BasePoint/Form?warehouseId=' + warehouseId,
- width: 700,
- height: 500,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('F_no');
- selectedRow = $('#gridtable').jfGridGet('rowdata');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/BaseManager/BasePoint/Form?keyValue=' + keyValue,
- width: 700,
- height: 500,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('F_no');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/BaseManager/BasePoint/DeleteForm', { keyValue: keyValue }, function () {
- });
- }
- });
- }
- });
- },
-
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/BaseManager/BasePoint/GetPageList',
- headData: [
- { label: '点位编码', name: 'F_no', width: 120, align: "left" },
- { label: '点位描述', name: 'F_name', width: 100, align: "left" },
- {
- label: '点位类型', name: 'F_type', width: 80, align: "center"
- , formatterAsync: function (callback, value, row) {
- learun.clientdata.getAsync('dataItem', {
- Rowkey: value,
- GrpCode: 'EPointType',
- getType: 'Num',
- callback: function (item) {
- callback(item.F_NAME);
- }
- });
- }
- },
-
- {
- label: '点位状态', name: 'F_status', width: 80, align: "center"
- , formatterAsync: function (callback, value, row) {
- learun.clientdata.getAsync('dataItem', {
- Rowkey: value,
- GrpCode: 'EPointState',
- getType: 'Num',
- callback: function (item) {
- callback(item.F_NAME);
- }
- });
- }
- },
- { label: '创建用户', name: 'F_addUserNo', width: 120, align: "left" },
- { label: '创建时间', name: 'F_addTime', width: 120, align: "left" },
- { label: '修改用户', name: 'F_editUserNo', width: 120, align: "left" },
- { label: '修改时间', name: 'F_editTime', width: 120, align: "left" },
-
- ],
- mainId: 'F_NO',
- isPage: true,
- sidx: 'F_EDITTIME',
- sord: "desc"
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.warehouseId = warehouseId;
- $('#gridtable').jfGridSet('reload', param);
- //$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|