123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324 |
- var refreshGirdData;
- var OneInTimebegin = '';
- var OneInTimeend = '';
- var ProductTimebegin = '';
- var ProductTimeend = '';
- var logbegin = '';
- var logend = '';
- var selectRowsData;
- 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["MatCode"] = $("#MatCode").val();
- //queryJson["MatName"] = $("#MatName").val();
- //queryJson["BoxBarCode"] = $("#BoxBarCode").val();
- //queryJson["InvBarCode"] = $("#InvBarCode").val();
- //queryJson["Tunnel"] = $("#Tunnel").val();
- //queryJson["Code"] = $("#Code").val();
- //queryJson["PutRow"] = $("#PutRow").val();
- //queryJson["PutCol"] = $("#PutCol").val();
- //queryJson["PutLayer"] = $("#PutLayer").val();
- //queryJson["OneInTimeBegin"] = $("#OneInTimebegin").val();
- //queryJson["OneInTimeEnd"] = $("#OneInTimeend").val();
- //queryJson["ProductTimeBegin"] = $("#ProductTimebegin").val();
- //queryJson["ProductTimeEnd"] = $("#ProductTimeend").val();
- //queryJson["Grade"] = $("#Grade").val();
- //queryJson["DoseNo"] = $("#DoseNo").val();
- //queryJson["ContGrpType"] = $("#ContGrpType").lrselectGet();
- //queryJson["InvStateCode"] = 3;
- //queryJson["IsSurplus"] = $("#IsSurplus").lrselectGet();
- //queryJson["IsRework"] = $("#IsRework").lrselectGet();
- //queryJson["IsFast"] = $("#IsFast").lrselectGet();
- //queryJson["IsFail"] = $("#IsFail").lrselectGet();
- //queryJson["IsBlack"] = $("#IsBlack").lrselectGet();
- //queryJson["ExecStateCode"] = $("#ExecStateCode").lrselectGet();
- queryJson["WbGroupCode"] = $("#WbGroupCode").val();
- //queryJson["SolderCount"] = $("#SolderCount").val();
- //queryJson["HoldTime"] = $("#HoldTime").val();
- //queryJson["IsControlpanel"] = $("#IsControlpanel").lrselectGet();
- //queryJson["IsTorsChk"] = $("#IsTorsChk").lrselectGet();
- //queryJson["IsCore"] = $("#IsCore").lrselectGet();
- queryJson["IsTimeOut"] = $("#IsTimeOut").lrselectGet();
- queryJson["HwTypeCode"] = $("#HwType").lrselectGet();
- //queryJson["TorsChkQty"] = $("#TorsChkQty").lrselectGet();
- queryJson["Wind"] = $("#Wind").val();
- queryJson["SkuCode"] = $("#SkuCode").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(), InvStateCode: 3 }) });
- });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
-
- $('#lr_ManualPalletizing').on('click', function () {
-
- var url = weburl + "api/Sx/ManualPalletizingStockOut";
- learun.layerConfirm('是否确认手动码垛!', function (res, index) {
- if (res) {
- $.ajax({
- type: 'post',
- //data: { location: postData.map((item) => item.Id) },
- data: JSON.stringify({
- "equip": 'L',
- "sku": $("#SkuCode").val(),
- "wbGroupCode": $("#WbGroupCode").val(),
- "wind": $("#Wind").val(),
- "hwType": $("#HwType").lrselectGet(),
- "isTimeOut": String($("#IsTimeOut").lrselectGet()),
- }),
- dataType: 'json',
- contentType: "application/json;charset=utf-8",
- url: url,
- success: function (response) {
- //resCode 200 resMsg "成功"
- refreshGirdData();
- top.layer.close( index);
- learun.alert.info(response.resMsg);
- }
- });
- }
- });
- });
-
-
- $('#OneInTime').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) {
- OneInTimebegin = begin;
- OneInTimeend = end;
- }
- });
- $('#ProductTime').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) {
- ProductTimebegin = begin;
- ProductTimeend = end;
- }
- });
-
-
- $('#IsTimeOut').lrselect({
- url: top.$.rootUrl + '/SXManager/Enums/YesNoList',
- maxHeight: 60,
- allowSearch: false
- });
- $('#HwType').lrselect({
- url: top.$.rootUrl + '/SXManager/Enums/HwTypeList',
- maxHeight: 60,
- allowSearch: false
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/SXManager/Inventorys/GetPageList2',
- headData: [
- { label: "容器条码", name: "ContGrpBarCode", width: 130, align: "left" },
- {
- label: "库存类型", name: "ContGrpTypeName", width: 60, align: "left", sortname: "ContGrpType"
- },
- //{ label: "材料号", name: "InvBarCode", width: 110, align: "left" },
- { label: "库存状态", name: "InvStateName", width: 80, align: "left", sortname: "InvStateCode" },
- //{ label: "巷道", name: "Tunnel", width: 50, align: "left" },
- //{ label: "货位号", name: "Code", width: 100, align: "left" },
- {
- label: "货位状态", name: "CellState", 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: "BoxBarCode", width: 120, align: "left" },
- { label: "SKU", name: "SkuCode", width: 80, align: "left" },
- { label: "机器组", name: "WbGroupCode", width: 80, align: "left" },
- { label: "行", name: "PutRow", width:40, align: "left" },
- { label: "列", name: "PutCol", width: 40, align: "left" },
- { label: "层", name: "PutLayer", width:40, align: "left" },
- { label: "首次入库时间", name: "OneInTime", width: 130, align: "left" },
- { label: "生产时间", name: "ProductTime", width: 130, align: "left" },
- { label: "物料编码", name: "MatCode", width: 80, align: "left" },
- { label: "物料名称", name: "MatName", width: 80, align: "left" },
- { label: "预锁单号", name: "SalesDoc", width: 120, align: "left" },
- { label: "总重量", name: "TolWQty", width: 80, align: "left" },
- { label: "净重", name: "NetWQty", width: 80, align: "left" },
- { label: "皮重", name: "TareWQty", width: 80, align: "left" },
- { label: "长度", name: "LengthQty", width: 80, align: "left" },
- {
- label: "是否余料", name: "IsSurplus", width: 80, 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: "IsBlack", width: 80, 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: "IsRework", width: 80, 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: "IsFast", width: 80, 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: "IsFail", width: 80, 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: "ExecStateCode", width: 80, align: "left"
- , formatter: function (cellvalue) {
- if (cellvalue == "InvState_Normal") {
- return '<span class=\"label label-default\" >否</span>';
- } else {
- return '<span class=\"label label-success\" >是</span>';
- }
- }
- },
- {
- label: "是否已扭转", name: "TorsChkQty", width: 80, 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: "PreStock", width: 120, align: "left" },
- { label: "绕向", name: "Wind", width: 120, align: "left" },
- { label: "异常原因", name: "FailReason", width: 80, align: "left" },
- { label: "等级", name: "Grade", width: 80, align: "left" },
- { label: "退料原因", name: "BackReason", width: 80, align: "left" },
- { label: "工序订单号", name: "ProcessDocsCode", width: 120, align: "left" },
- { label: "生产机台号", name: "ProductMachCode", width: 80, align: "left" },
- { label: "产线编号", name: "ProductLineNo", width: 80, align: "left" },
- { label: "入库单号", name: "InDocsNo", width: 120, align: "left" },
- { label: "入库单行号", name: "InDocsRowNo", width: 120, align: "left" },
- { label: "扭转检测弓高", name: "TorsChkChord", width: 80, align: "left" },
- { label: "弓高是否合格", name: "TorsChkChordIsGood", width: 80, align: "left" },
- { label: "扭转检测平直度", name: "TorsChkFlatness", width: 80, align: "left" },
- { label: "平直度是否合格", name: "TorsChkFlatnessIsGood", width: 80, align: "left" },
- { label: "扭转机台工位", name: "TorsChkStation", width: 80, align: "left" },
- { label: "扭转值是否合格", name: "TorsChkValueIsGood", width: 80, align: "left" },
- { label: "创建时间", name: "AddTime", width: 150, align: "left" },
- { label: "更新时间", name: "EditTime", width: 150, 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(), InvStateCode: 3 }) });
- },
- search: function (param) {
- param = param || { queryJson: JSON.stringify({InvStateCode: 3 }) };
- $('#gridtable').jfGridSet('reload', param);
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|