123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- var refreshGirdData;
- var OneInTimebegin = '';
- var OneInTimeend = '';
- var ProductTimebegin = '';
- var ProductTimeend = '';
- var logbegin = '';
- var logend = '';
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- // 调用后台查询
- // queryJson 查询条件
- queryJson["Pation"] = $("#Pation").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();
- });
- // 写信号
- $('#lr_write').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Code');
- var postData = $('#gridtable').jfGridGet('rowdata');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认写该站台信号!', function (res) {
- if (res) {
- var url = WCSWebUrl + "api/Wcs/Write?deviceType=2&devCode=" + postData.Code + "&protocol=1&propName=1&value=1";
-
- $.ajax({
- type: 'post',
- dataType: 'json',
- contentType: "application/json;charset=utf-8",
- url: url,
- success: function (response) {
- //resCode 200 resMsg "成功"
- refreshGirdData();
- top.layer.close(top.layer.index);
- learun.alert.info(response.resMsg);
- }
- });
- }
- });
- }
- });
- // 清除信号
- $('#lr_clear').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Code');
- var postData = $('#gridtable').jfGridGet('rowdata');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认清除该站台信号!', function (res) {
- if (res) {
- var url = WCSWebUrl + "api/Wcs/Write?deviceType=2&devCode=" + postData.Code + "&protocol=1&propName=1&value=clear";
-
- $.ajax({
- type: 'post',
- dataType: 'json',
- contentType: "application/json;charset=utf-8",
- url: url,
- success: function (response) {
- //resCode 200 resMsg "成功"
- refreshGirdData();
- top.layer.close(top.layer.index);
- learun.alert.info(response.resMsg);
- }
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/PTManager/DeviceInfo/GetInOutStationStatus',
- headData: [
- { label: "仓库", name: "WareHouseName", width: 80, align: "left" },
- { label: "站台", name: "Code", width: 80, align: "left" },
- { label: "名称", name: "Name", width: 80, align: "left" },
- {
- label: "有无货架", name: "StatusName", width: 150, align: "left", formatter: function (cellvalue) {
- if (cellvalue == '0') {
- return '<span class=\"label label-default\" >无货架</span>';
- } else {
- return '<span class=\"label label-success\" >有空货架</span>';
- }
- }
- },
- { label: "设备状态", name: "PHStatusName", width: 80, align: "left" },
- ],
- mainId: 'WareHouseName',
- isPage: false,
- reloadSelected: true,
- autowWidth: true,
- sidx: 'Code',
- sord: 'DESC',
- isMultiselect: false,
- });
- page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val() }) });
- },
- search: function (param) {
- param = param || { queryJson: JSON.stringify({ InvStateCode: 3 }) };
- $('#gridtable').jfGridSet('reload', param);
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|