123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- var refreshGirdData;
- var logbegin = '';
- var logend = '';
- var StartTimeBegin = '';
- var StartTimeend = '';
- var EndTimeBegin = '';
- var EndTimeend = '';
- var selectRowsData;
- var selectedRow;
- var bootstrap = function ($, learun) {
- "use strict";
- var psuid = "";
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- page.search({ queryJson: JSON.stringify({Out:0}) });
- },
- bind: function () {
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- // 调用后台查询
- // queryJson 查询条件
- var date = $('#lr_search_date_datesearch').html();
- if (date == '') {
- logbegin = '';
- logend = '';
- }
- var starttime = $('#lr_search_date_StartTime').html();
- if (starttime == '') {
- StartTimeBegin = '';
- StartTimeend = '';
- }
- var endtime = $('#lr_search_date_EndTime').html();
- if (endtime == '') {
- EndTimeBegin = '';
- EndTimeend = '';
- }
- //queryJson["AddTimeFrom"] = logbegin;
- //queryJson["AddTimeTo"] = logend;
- queryJson["WareHouseId"] = $("#WareHouseId").lrselectGet();
- queryJson["BomCode"] = $("#BomCode").val();
- queryJson["BomSetGrpName"] = $("#BomSetGrpName").val();
- queryJson["Out"] = $("#Out").lrselectGet();
- queryJson["AddTimeFrom"] = $("#AddTimeFrom").val();
- queryJson["AddTimeTo"] = $("#AddTimeTo").val();
- queryJson["Id"] = $("#Id").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();
- });
- $('.datetime').each(function () {
- $(this).lrdatetime({
- dfdata: [
- { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
- { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
- { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
- { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
- ],
- // 月
- mShow: false,
- premShow: false,
- // 季度
- jShow: false,
- prejShow: false,
- // 年
- ysShow: false,
- yxShow: false,
- preyShow: false,
- yShow: false,
- // 默认
- dfvalue: 'all',
- selectfn: function (begin, end) {
- let id = $(this).attr('id');
- if (id == 'datesearch') {
- logbegin = begin;
- logend = end;
- }
- else if (id == 'StartTime') {
- StartTimeBegin = begin;
- StartTimeend = end;
- }
- else if (id == 'EndTime') {
- EndTimeBegin = begin;
- EndTimeend = end;
- }
- }
- });
- });
- $('#WareHouseId').lrselect({
- url: top.$.rootUrl + '/FJManager/BaseWarehouse/GetSelectWarehouseNameList',
- maxHeight: 180,
- allowSearch: false
- });
- $('#Out').lrselect({
- url: top.$.rootUrl + '/FJManager/Enums/YesNoList',
- maxHeight: 60,
- allowSearch: false
- });
- $('#lr_Out').on('click', function () {
- selectRowsData = $('#gridtable').jfGridGet("rowdata");
- if (selectRowsData.length == 0) {
- learun.alert.error('未选择行!');
- return false;
- }
- learun.layerForm({
- id: 'form',
- title: '是否已出库',
- url: top.$.rootUrl + '/FJManager/BillRingpalletizing/Form',
- width: 450,
- height: 300,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
-
- });
-
- $('#lr_HaveQty').on('click', function () {
- selectRowsData = $('#gridtable').jfGridGet("rowdata");
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (selectRowsData.length == 0) {
- learun.alert.error('未选择行!');
- return false;
- }
- if (selectRowsData.length >1) {
- learun.alert.error('不能多选,请选择一条数据!');
- return false;
- }
- selectedRow = selectRowsData[0];
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '修改已有个数',
- url: top.$.rootUrl + '/FJManager/BillRingpalletizing/Form2?keyValue=' + keyValue,
- width: 450,
- height: 300,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- $('#lr_OvertimeOut').on('click', function () {
- var postData = $('#gridtable').jfGridGet("rowdata");
- if (postData.length == 0) {
- learun.alert.error('未选择行!');
- return false;
- }
- learun.layerConfirm('是否确认超时出库!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/FJManager/BillRingpalletizing/UpdateOvertimeOut', { ids: JSON.stringify(postData.map((item) => item.Id)) }, function () {
- refreshGirdData();
- });
- }
- });
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/FJManager/BillRingpalletizing/GetPageList',
- headData: [
- { label: 'ID编号', name: 'Id', width: 160 },
- { label: '仓库', name: 'WarehouseName', width: 120, align: 'left', sortname:'WareHouseId' },
- { label: '垛形编号', name: 'BomSetGrpCode', width: 100, align: 'left' },
- { label: '垛形名', name: 'BomSetGrpName', width: 100, align: 'left' },
- { label: '工字轮个数', name: 'HWCountQty', width: 100, align: 'left' },
- { label: '投料信息', name: 'BomCode', width: 100, align: 'left' },
- { label: '已有工字轮个数', name: 'HaveQty', width: 100, align: 'left' },
- { label: '上一次放置位', name: 'LastXYNO', width: 100, align: 'left' },
- {
- label: '是否出库', name: 'Out', width: 100, align: 'left', formatter: function (cellvalue) {
- if (cellvalue == true) {
- return '<span class=\"label label-success\" >是</span>';
- } else {
- return '<span class=\"label label-default\" >否</span>';
- }
- }
- },
- { label: '备注', name: 'Memo', width: 100, align: 'left' },
- { label: '创建用户', name: 'AddWho', width: 100, align: 'left' },
- { label: '更新用户', name: 'EditWho', width: 100, align: 'left' },
- { label: '创建时间', name: 'AddTime', width: 130, align: 'left' },
- { label: '更新时间', name: 'EditTime', width: 130, align: 'left' },
-
- ],
- mainId: 'Id',
- isPage: true,
- reloadSelected: true,
- autowWidth: true,
- sidx: 'AddTime',
- sord: 'DESC',
- isMultiselect: true,
- isSubGrid: true, // 是否有子表
- subGridExpanded: function (subid, rowdata) {
- psuid = subid;
- $('#' + subid).jfGrid({
- url: top.$.rootUrl + '/FJManager/BaseWareCell/GetListsByGroupID',
- headData: [
- { label: "仓库", name: "WarehouseName", width: 120, align: "left" },
- { label: "货位号", name: "Code", width: 100, align: "left" },
- { label: "货位名称", name: "Name", width: 120, align: "left" },
- { label: "货位状态", name: "StatusName", width: 90, align: "left", sortname: "StateNum" },
- { label: "货位类型", name: "TypeName", width: 70, align: "left", sortname: "TypeNum" },
- {
- label: "是否停用", name: "IsStop", width: 70, align: "left", formatter: function (cellvalue) {
- if (cellvalue == 0) {
- return '<span class=\"label label-success\" >正常</span>';
- } else if (cellvalue == 1) {
- return '<span class=\"label label-default\" >停用</span>';
- } else {
- return '<span class=\"label label-default\" >未知</span>';
- }
- }
- },
- { label: "组ID", name: "GroupID", width: 160, align: "left" },
- { label: "货位值", name: "Size", width: 50, align: "left" },
- { label: "RFID条码", name: "ContGrpBarCode", width: 130, align: "left" },
- { label: "行", name: "Row", width: 50, align: "left" },
- { label: "列", name: "Col", width: 50, align: "left" },
- { label: "层", name: "Layer", width: 50, align: "left" },
- { label: "深度", name: "Depth", width: 50, align: "left" },
- { label: "设备", name: "SCRel", width: 60, align: "left" },
- { label: '出库跺型', name: 'XYNO', width: 100, align: 'left' },
- ]
- });
- $('#' + subid).jfGridSet('reloadSon', { groupId: rowdata.Id});
- },
- });
- page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val() }) });
- },
- search: function (param) {
- $('#gridtable').jfGridSet('reload', param);
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|