123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- var refreshGirdData;
- var OneInTimebegin = '';
- var OneInTimeend = '';
- var ProductTimebegin = '';
- var ProductTimeend = '';
- var logbegin = '';
- var logend = '';
- var selectedRow;
- var selectRowsData;
- var refreshGirdData; // 更新数据
- var bootstrap = function ($, learun) {
- "use strict";
- const Directions = [{ id: "", text: "" }, { id: "L", text: "左手车" }, { id: "R", text: "右手车" }]; //左/右手车
- const WareDirects = [{ id: "", text: "" }, { id: "S", text: "南" }, { id: "N", text: "北" }]; //南北向
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- for (var j = 0; j < Directions.length; j++) {
- if (Directions[j].id == '') {
- $("#Direction").append($("<option value=''>请选择</option>"));
- }
- else {
- $("#Direction").append($("<option value='" + Directions[j].id + "'>" + Directions[j].text + "</option>"));
- }
- }
- for (var j = 0; j < WareDirects.length; j++) {
- if (WareDirects[j].id == '') {
- $("#WareDirect").append($("<option value=''>请选择</option>"));
- }
- else {
- $("#WareDirect").append($("<option value='" + WareDirects[j].id + "'>" + WareDirects[j].text + "</option>"));
- }
- }
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- // 调用后台查询
- // queryJson 查询条件
- console.log(queryJson);
- queryJson["WarehouseId"] = $("#WarehouseId").lrselectGet();
- queryJson["Name"] = $("#Name").val();
- queryJson["MachNo"] = $("#MachNo").val();
- queryJson["Station"] = $("#Station").val();
- queryJson["GrpCode"] = $("#GrpCode").val();
- queryJson["Direction"] = $("#Direction").val();
- queryJson["WareDirect"] = $("#WareDirect").val();
- queryJson["BillCode"] = $("#BillCode").val();
- queryJson["WorkOrder"] = $("#WorkOrder").val();
- queryJson["SetGrpCode"] = $("#SetGrpCode").val();
- queryJson["ProSetGrpCode"] = $("#ProSetGrpCode").val();
- queryJson["ProBillCode"] = $("#ProBillCode").val();
- queryJson["ProWorkOrder"] = $("#ProWorkOrder").val();
- queryJson["MacTypeCode"] = $("#MacTypeCode").val();
- queryJson["MacTypeName"] = $("#MacTypeName").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_import').on('click', function () {
- learun.layerForm({
- id: 'ImportForm',
- title: '导入Excel数据',
- url: top.$.rootUrl + '/Utility/ImportForm?ordertype=' + 100,
- width: 600,
- height: 400,
- maxmin: true,
- btn: null
- });
- });
- // 新增
- $('#lr_add').on('click', function () {
- var keyValue = {};
- selectedRow = {};
- learun.layerForm({
- id: 'form',
- title: '添加仓库',
- url: top.$.rootUrl + '/FJManager/BillMachInfo/Form',
- height: 400,
- width: 800,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- selectedRow = $('#gridtable').jfGridGet('rowdata');
- if (selectedRow.length == 0) {
- learun.alert.error('未选择行!');
- return false;
- }
- if (selectedRow.length > 1) {
- learun.alert.error('选择了多行!');
- return false;
- }
- var keyValue = selectedRow[0].Id;
- selectedRow = selectedRow[0];
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑机台信息',
- url: top.$.rootUrl + '/FJManager/BillMachInfo/Form?keyValue=' + keyValue,
- height: 400,
- width: 800,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/FJManager/BillMachInfo/Delete', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 批量修改南北向
- $('#lr_waredirectedit').on('click', function () {
- selectedRow = $('#gridtable').jfGridGet('rowdata');
- if (selectedRow.length == 0) {
- learun.alert.error('未选择行!');
- return false;
- }
- learun.layerForm({
- id: 'form',
- title: '批量修改南北向',
- url: top.$.rootUrl + '/FJManager/BillMachInfo/WareDirectForm',
- height: 400,
- width: 800,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- $('#WarehouseId').lrselect({
- url: top.$.rootUrl + '/FJManager/BaseWarehouse/GetSelectWarehouseNameList',
- maxHeight: 180,
- allowSearch: false
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/FJManager/BillMachInfo/GetPageList',
- headData: [
- { label: 'Id', name: 'Id', hidden: true },
- { label: '仓库', name: 'WarehouseName', width: 100, align: 'left' },
- {
- label: '南北向', name: 'WareDirect', width: 60, align: 'left', formatter: function (cellvalue) {
- if (cellvalue == "N" ) {
- return '<span class=\"label label-success\" >北</span>';
- } else if (cellvalue == "S") {
- return '<span class=\"label label-warning\" >南</span>';
- } else {
- return '<span class=\"label label-default\" >未知</span>';
- }
- } },
- { label: '机台号', name: 'MachNo', width: 100, align: 'left' },
- { label: '名称', name: 'Name', width: 100, align: 'left' },
- { label: '机台组', name: 'GrpCode', width: 100, align: 'left' },
- { label: 'AGV托盘位', name: 'Station', width: 100, align: 'left' },
- { label: '最近的仓库名称', name: 'NearestWarehouseName', width: 100, align: 'left' },
- {
- label: '左/右手车', name: 'Direction', width: 100, align: 'left', formatter: function (cellvalue) {
- if (cellvalue == "L") {
- return '<span class=\"label label-success\" >左手车</span>';
- } else if (cellvalue == "R") {
- return '<span class=\"label label-warning\" >右手车</span>';
- } else {
- return '<span class=\"label label-default\" >未知</span>';
- }
- } },
- { label: '帘线工序工单号', name: 'BillCode', width: 100, align: 'left' },
- { label: '生产订单号', name: 'WorkOrder', width: 100, align: 'left' },
- { label: '垛型编码', name: 'SetGrpCode', width: 100, align: 'left' },
- { label: '预排帘线工序工单号', name: 'ProBillCode', width: 100, align: 'left' },
- { label: '预排生产订单号', name: 'ProWorkOrder', width: 100, align: 'left' },
- { label: '预排垛型编码', name: 'ProSetGrpCode', width: 100, align: 'left' },
- { label: '机器类型编码', name: 'MacTypeCode', width: 100, align: 'left' },
- { label: '机器类型名称', name: 'MacTypeName', width: 100, align: 'left' },
- { label: 'Agv地标', name: 'AgvPoint', width: 100, align: 'left' },
- {
- label: "是否启用", name: "IsStop", width: 80, align: "left", formatter: function (cellvalue) {
- if (cellvalue == 0) {
- return '<span class=\"label label-success\" >是</span>';
- } else {
- return '<span class=\"label label-default\" >否</span>';
- }
- }
- },
- { label: '备注', name: 'Memo', width: 100, align: 'left' },
- { label: "创建时间", name: "AddTime", width: 130, align: "left" },
- { label: "更新时间", name: "EditTime", width: 130, align: "left" },
- { label: "创建用户", name: "AddWho", width: 110, align: "left" },
- { label: "更新用户", name: "EditWho", width: 110, align: "left" },
- ],
- mainId: 'Id',
- isPage: true,
- reloadSelected: true,
- autowWidth: true,
- sidx: 'AddTime',
- sord: 'DESC',
- isMultiselect: true,
- });
- page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val() }) });
- },
- search: function (param) {
- $('#gridtable').jfGridSet('reload', param);
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|