123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- /*
- * 描 述:订单
- */
- var refreshGirdData; // 更新数据
- var logbegin = '';
- var logend = '';
- var selectedRow;
- var bootstrap = function ($, learun) {
- var psuid = "";
- "use strict";
- var page = {
- init: function () {
- page.initGrid();
- page.bind();
- },
- bind: function () {
-
-
- // 查询
- $('#btn_Search').on('click', function () {
- page.search({queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val() }) });
- });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 作废
- $('#lr_cancel').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('F_no');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认作废该入库单?', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/OrderManager/EntryOrder/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 导出数据
- $('#lr_exportnow').on('click', function () {
- var subsuid = "";
- if (psuid == "") {
- psuid = $('#gridtable').attr('id');
- }
- else if (psuid != "") {
- var t = $('#' + psuid).attr('id');
- if (t == undefined)
- psuid = $('#gridtable').attr('id');
- }
- var mainGridId = $('#gridtable').attr('id');
- learun.layerForm({
- id: "ExcelExportForm",
- title: '导出Excel数据',
- url: top.$.rootUrl + '/Utility/ExcelExportForm?mainGridId=' + mainGridId + '&gridId=' + psuid + '&filename=' + encodeURI(encodeURI("入库单")),
- width: 500,
- height: 380,
- callBack: function (id) {
- return top[id].acceptClick();
- },
- btn: ['导出Excel', '关闭']
- });
- });
- },
- initGrid: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/OrderManager/EntryOrder/GetEntryOrderPageList',
- headData: [
- { label: '入库单号', name: 'F_no', width: 160, align: "left" },
- //learun.jfFormatter.col_EOrderState(),
- {
- label: '入库单类型', name: 'F_orderType', width: 100, align: "left",
- formatterAsync: function (callback, value, row) {
- learun.clientdata.getAsync('dataItem', {
- Rowkey: value,
- GrpCode: 'EntryOrderType',
- getType: 'Num',
- callback: function (item) {
- callback(item.F_NAME);
- }
- });
- },
- },
- { label: '仓库', name: 'F_warehouse', width: 100, align: "left" },
- { label: '关联单号', name: 'F_relatedOrderNo', width: 160, align: "left" },
- { label: '行数', name: 'F_totalOrderLines', width: 160, align: "left" },
- { label: '托盘号', name: 'F_trayNo', width: 100, align: "left" },
- {
- label: '订单状态', name: 'F_orderStatus', width: 100, align: "left",
- formatterAsync: function (callback, value, row) {
- learun.clientdata.getAsync('dataItem', {
- Rowkey: value,
- GrpCode: 'EOrderState',
- getType: 'Num',
- callback: function (item) {
- callback(item.F_NAME);
- }
- });
- },
- },
- {
- label: '是否保税', name: 'F_isBonded', width: 70, align: "center"
- , formatter: function (cellvalue) {
- if (cellvalue == 0) {
- return '<span class=\"label label-success\" style=\"cursor: pointer;\">否</span>';
- } else {
- return '<span class=\"label label-default\" style=\"cursor: pointer;\">是</span>';
- }
- }
- },
- {
- label: '是否整盘', name: 'F_fullPlate', width: 70, align: "center"
- , formatter: function (cellvalue) {
- if (cellvalue == 0) {
- return '<span class=\"label label-success\" style=\"cursor: pointer;\">否</span>';
- } else {
- return '<span class=\"label label-default\" style=\"cursor: pointer;\">是</span>';
- }
- }
- },
- { label: '备注', name: 'F_memo', width: 160, align: "left" },
- { label: '创建用户', name: 'F_addUserNo', width: 100, align: "left" },
- { label: '创建时间', name: 'F_addTime', width: 150, align: "left" },
- { label: '编辑用户', name: 'F_editUserNo', width: 100, align: "left" },
- { label: '编辑时间', name: 'F_editTime', width: 150, align: "left" },
-
- ],
- mainId: 'F_no',
- isPage: true,
- sidx: 'F_editTime',
- sord: 'desc',
- reloadSelected: true,
- isSubGrid: true, // 是否有子表
- subGridExpanded: function (subid, rowdata) {
- psuid = subid;
- $('#' + subid).jfGrid({
- url: top.$.rootUrl + '/OrderManager/EntryOrder/GetEntryOrderItem',
- headData: [
-
- { label: '物料编号', name: 'F_matNo', width: 100, align: "left" },
- { label: '物料名称', name: 'F_matName', width: 200, align: "left" },
- {
- label: '物料类型', name: 'F_matType', width: 100, align: "left",
- formatterAsync: function (callback, value, row) {
- learun.clientdata.getAsync('dataItem', {
- Rowkey: value,
- GrpCode: 'EMatType',
- getType: 'Num',
- callback: function (item) {
- callback(item.F_NAME);
- }
- });
- },
- },
- { label: '行号', name: 'F_boxNo', width: 100, align: "left" },
- { label: '数量', name: 'F_quantity', width: 100, align: "left" },
- //{ label: '实际入库数量', name: 'F_actualQty', width: 100, align: "left" },
- //{ label: '货位', name: 'F_location', width: 100, align: "left" },
- //{ label: '批次号', name: 'F_batchNo', width: 100, align: "left" },
- { label: '创建用户', name: 'F_addUserNo', width: 100, align: "left" },
- { label: '创建时间', name: 'F_addTime', width: 150, align: "left" },
- { label: '编辑用户', name: 'F_editUserNo', width: 100, align: "left" },
- { label: '编辑时间', name: 'F_editTime', width: 150, align: "left" },
- { label: '备注', name: 'F_memo', width: 100, align: "left" },
- ]
- });
- $('#' + subid).jfGridSet('reloadSon', { OrderNo: rowdata.F_no });
- }// 子表展开后调用函数
- });
- page.search({ queryJson: JSON.stringify({ Btime: logbegin, Etime: logend, keyword: $('#txt_Keyword').val() }) });
- },
- search: function (param) {
- $('#gridtable').jfGridSet('reload', param);
- }
- };
- // 保存数据后回调刷新
- refreshGirdData = function () {
- page.search();
- }
- page.init();
- }
|