123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- 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();
- 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 + '/PTManager/Enums/GetContGrpTypeList',
- maxHeight: 180,
- allowSearch: false
- });
- $('#InvStateCode').lrselect({
- url: top.$.rootUrl + '/PTManager/Enums/GetInvStateList',
- maxHeight: 180,
- allowSearch: false
- });
- // 新增
- $('#lr_add').on('click', function () {
- var keyValue = {};
- selectedRow = {};
- learun.layerForm({
- id: 'form',
- title: '添加RFID',
- url: top.$.rootUrl + '/PTManager/Rfid/Form',
- height: 400,
- width: 800,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('ContBarCode');
- selectedRow = $('#gridtable').jfGridGet('rowdata');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑RFID信息',
- url: top.$.rootUrl + '/PTManager/Rfid/Form?keyValue=' + keyValue,
- height: 400,
- width: 800,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('ContBarCode');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/PTManager/Rfid/Delete', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/PTManager/Rfid/GetPageList',
- headData: [
-
- { label: "Rfid条码", name: "ContBarCode", width: 110, align: "left" },
- { label: "名称", name: "Name", width: 80, align: "left" },
- { label: "类型", name: "TypeCode", width: 80, align: "left" },
- { label: "长度", name: "LengthQty", width: 80, align: "left" },
- { label: "宽度", name: "WidthQty", width: 80, align: "left" },
- { label: "高度", name: "HighQty", width: 80, align: "left" },
- { label: "重量", name: "WeightQty", width: 80, align: "left" },
- { label: "创建时间", name: "AddTime", width: 80, align: "left" },
- { label: "修改时间", name: "EditTime", width: 80, 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();
- }
|