//集运管理-路单查询 Ext.namespace('Shipping'); Shipping.WMSDetailIndexNew = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.WMSDetailIndexNew.superclass.constructor.call(this); }; Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, { PageSize: 4000, sqlcontext: '', OprationStatus: null, //仅当弹出界面时使用 SelectedRecord: null, id: "WMSDetailForm", initUIComponents: function () { _this = this; this.formname = "WMSDetailForm"; Ext.define('WMSDetailmb', { extend: 'Ext.data.Model', idProperty: '', fields: [ { name: 'NID', type: 'string' }, { name: 'BLNO', type: 'string' }, { name: 'CUSTOMNO', type: 'string' }, { name: 'CUSTOMERNAME', type: 'string' }, { name: 'STORAGENAME', type: 'string' }, { name: 'GOODSNAME', type: 'string' }, { name: 'GOODSSTANDARD', type: 'string' }, { name: 'GOODSMODEL', type: 'string' }, { name: 'WMSNO', type: 'string' }, { name: 'OUTBSNO_OUT', type: 'string' }, { name: 'BSNO_OUT', type: 'string' }, { name: 'WMSDATE', type: 'date' }, { name: 'DODATE_OUT', type: 'date' }, { name: 'GOODSRKSL', type: 'float' }, { name: 'GOODSRKSLACTUAL', type: 'float' }, { name: 'GOODSPFSL_OUT', type: 'float' }, { name: 'GOODSSTOCK', type: 'float' }, { name: 'CHARGEUNIT', type: 'string' }, { name: 'GOODSOUTFEE_OUT', type: 'float' }, { name: 'GOODSOUTFEEAP_OUT', type: 'float' }, { name: 'ARFEE', type: 'float' }, { name: 'APFEE', type: 'float' }, { name: 'ARFEE_OUT', type: 'float' }, { name: 'APFEE_OUT', type: 'float' }, { name: 'FREESTORAGEPERIOD', type: 'string' }, { name: 'CONTRACTNO', type: 'string' }, { name: 'GOODSPACK', type: 'float' }, { name: 'GOODSPACKSTOCK', type: 'float' }, { name: 'GOODSPACKPFSL_OUT', type: 'float' }, { name: 'TRUCKNO_OUT', type: 'string' }, { name: 'REMARK_OUT', type: 'string' }, { name: 'MODIFIEDUSER', type: 'string' }, { name: 'MODIFIEDTIME', type: 'string' }, { name: 'CREATEUSER_OUT', type: 'string' }, { name: 'CREATETIME_OUT', type: 'string' }, { name: 'CNTRNO', type: 'string' }, { name: 'PICIHAO', type: 'string' }, { name: 'AREACODE', type: 'string' },//20180916 库位编码 { name: 'PRODDATE', type: 'date' }, { name: 'FACTORYNO', type: 'string' }, { name: 'WMSINREMARK', type: 'string' }, { name: 'AREANAME', type: 'string' }, { name: 'TRAYNO', type: 'string' }, { name: 'WMSINGID', type: 'string' }, { name: 'COUNTRYOFORIGIN', type: 'string' }, { name: 'INVOICENO', type: 'string' }, { name: 'KINDPKGS', type: 'string' }, { name: 'BZTCHNO_WMSIN', type: 'string' } ] }); Ext.define('Tradermb', { extend: 'Ext.data.Model', idProperty: 'gid', fields: [ { name: 'gid', type: 'string' }, { name: 'name', type: 'string' }, { name: 'codename', type: 'string' } ] }); //#region 定义数据集 this.storeCustomerName = Ext.create('DsExt.ux.RefTableStore', { model: 'Tradermb', proxy: { url: '/CommMng/BasicDataRef/GetTrader' } }); this.storeCustomerName.load({ params: { condition: ""} }); this.comboxCustomerName = Ext.create('DsExt.ux.RefTableCombox', { //fieldLabel: '客户', id: "CustomerName", //hidden: true, forceSelection: true, store: this.storeCustomerName, name: 'CUSTOMERNAME', valueField: 'name', displayField: 'codename' }); Ext.define('ISCHANGEmb', { extend: 'Ext.data.Model', fields: [ { name: 'Name', type: 'string' } ] }); var ISCHANGEData = [{ "Name": "全部" }, { "Name": "不含货转" }, { "Name": "只包括货转"}]; var storeISCHANGE = Ext.create('Ext.data.Store', { model: 'ISCHANGEmb', data: ISCHANGEData }); this.comboxISCHANGE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '是否包括货转', forceSelection: true, store: storeISCHANGE, name: 'ISCHANGE', valueField: 'Name', displayField: 'Name', values: '全部', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeCustWmsCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCustWmsCode.load({ params: { condition: "ISWAREHOUSE='1'" } }); this.comboxCustWmsCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '仓库名称', store: this.storeCustWmsCode, forceSelection: true, id: 'STORAGENAME', name: 'STORAGENAME', valueField: 'CustName', displayField: 'CodeAndName', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); //用证公司,暂时还没用,鑫鹏威需要添加此选项 this.storeCompany = Ext.create('DsExt.ux.RefTableStore', { model: 'companymb', proxy: { url: '/CommMng/BasicDataRef/GetcompanyList' } }); this.storeCompany.load({ params: { condition: "" } }); this.comboxCompany = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '用证公司', store: this.storeCompany, name: 'company', valueField: 'gid', displayField: 'name', //flex:3, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); //库存状态 Ext.define('IsGOODSSTOCKModel', { extend: 'Ext.data.Model', fields: [{ name: 'Name', type: 'string' }] }); var IsGOODSSTOCKData = [{ "Name": "全部" }, { "Name": "有货" }, { "Name": "清库" }]; var storeIsGOODSSTOCK = Ext.create('Ext.data.Store', { model: 'IsGOODSSTOCKModel', data: IsGOODSSTOCKData }); this.comboxIsGOODSSTOCK = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '库存状态', forceSelection: true, store: storeIsGOODSSTOCK, name: 'IsGOODSSTOCK', valueField: 'Name', displayField: 'Name', values: '全部' }); //#endregion ///////////////////////////////////////// this.Pagenum = Ext.create('Ext.form.field.Number', { name: 'bottles', fieldLabel: Zi.LAN.bottles, //'每页记录数', labelAlign: 'right', value: this.PageSize, maxValue: 100000, width: 180, minValue: 0, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); //#region 列表数据 this.storeList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'WMSDetailmb', remoteSort: true, //groupField: 'CUSTOMERNAME', proxy: { type: 'ajax', //url: '/TruckMng/MsRptPcHeadOperate/QryData_ADL', url: '/MvcShipping/WMSDetail/GetDataListNew', //this.storeList.proxy.url = '/TruckMng/MsRptPcHeadOperate/QryData_ADL'; reader: { id: '', root: 'data', totalProperty: 'totalCount' } } }); var _this = this; this.column = [ { sortable: true, hidden: true, dataIndex: 'NID', header: 'NID', width: 80 }, { sortable: true, dataIndex: 'BLNO', header: '提单号', width: 80 }, { sortable: true, dataIndex: 'CNTRNO', header: '箱号', width: 80 }, { sortable: true, dataIndex: 'CUSTOMNO', header: '备案清单号', width: 80 }, { sortable: true, dataIndex: 'CONTRACTNO', header: '合同号', width: 80 }, { sortable: true, dataIndex: 'CUSTOMERNAME', header: '货主', width: 80 }, { sortable: true, dataIndex: 'STORAGENAME', header: '仓库名称', width: 80 }, { sortable: true, dataIndex: 'GOODSNAME', header: '品名', width: 80 }, { sortable: true, dataIndex: 'GOODSSTANDARD', header: '型号/牌号', width: 80 }, { sortable: true, dataIndex: 'GOODSMODEL', header: '规格/牌号', width: 80 }, { sortable: true, dataIndex: 'WMSNO', header: '入库单号', width: 80 }, { sortable: true, dataIndex: 'OUTBSNO_OUT', header: '出库单号', width: 80 }, { sortable: true, dataIndex: 'BSNO_OUT', header: '出库明细单号', width: 80 }, { sortable: true, dataIndex: 'WMSDATE', header: '入库日期', format: 'Y-m-d', renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 80 }, { sortable: true, dataIndex: 'DODATE_OUT', header: '出库日期', format: 'Y-m-d', renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 80 }, { sortable: true, dataIndex: 'GOODSRKSL', header: '入库量', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.0000; var existWMSNO = ''; var existWMSINGID = ''; var form = _this.formSearch.getForm(); var cbDetail = form.findField('cbDetail').getValue(); if (cbDetail == false) { for (var i = 0; i < dataArr.length; i++) { if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && dataArr[i].data.CHARGEUNIT != "箱") { continue; } else { existWMSNO += dataArr[i].data.WMSNO + ','; temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSL)); //temp += parseFloat(dataArr[i].data.GOODSRKSL); } } } else if (cbDetail == true) { for (var i = 0; i < dataArr.length; i++) { var curWMSNO = dataArr[i].data.WMSNO; var curWMSINGID = dataArr[i].data.WMSINGID; if (existWMSNO.indexOf(dataArr[i].data.WMSNO) == -1 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1 && dataArr[i].data.CHARGEUNIT != "箱") { existWMSINGID += dataArr[i].data.WMSINGID + ','; existWMSNO += dataArr[i].data.WMSNO + ','; //temp += parseFloat(dataArr[i].data.GOODSRKSL); temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSL)); } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { existWMSINGID += dataArr[i].data.WMSINGID + ','; //temp += parseFloat(dataArr[i].data.GOODSRKSL); temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSL)); } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { continue; } } } return Ext.util.Format.number(temp, '0.0000'); } }, { sortable: true, dataIndex: 'GOODSRKSLACTUAL', header: '实际入库量', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.0000; var existWMSNO = ''; var existWMSINGID = ''; var form = _this.formSearch.getForm(); var cbDetail = form.findField('cbDetail').getValue(); if (cbDetail == false) { for (var i = 0; i < dataArr.length; i++) { if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && dataArr[i].data.CHARGEUNIT != "箱") { continue; } else { existWMSNO += dataArr[i].data.WMSNO + ','; //temp += parseFloat(dataArr[i].data.GOODSRKSLACTUAL); temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSLACTUAL)); } } } else if (cbDetail == true) { for (var i = 0; i < dataArr.length; i++) { if (existWMSNO.indexOf(dataArr[i].data.WMSNO) == -1 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1 && dataArr[i].data.CHARGEUNIT != "箱") { existWMSINGID += dataArr[0].data.WMSINGID + ','; existWMSNO += dataArr[i].data.WMSNO + ','; //temp += parseFloat(dataArr[i].data.GOODSRKSLACTUAL); temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSLACTUAL)); } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { existWMSINGID += dataArr[i].data.WMSINGID + ','; //temp += parseFloat(dataArr[i].data.GOODSRKSLACTUAL); temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSLACTUAL)); } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { continue; } } } return Ext.util.Format.number(temp, '0.0000'); } }, { sortable: true, dataIndex: 'GOODSPFSL_OUT', header: '出库量', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.0000; var existOUTBSNO = ''; var form = _this.formSearch.getForm(); var cbDetail = form.findField('cbDetail').getValue(); if (cbDetail == false) { for (var i = 0; i < dataArr.length; i++) { var curWMSNO = dataArr[i].data.WMSNO; if ((existOUTBSNO.indexOf(dataArr[i].data.OUTBSNO_OUT)) >= 0 && (curWMSNO.indexOf(dataArr[i].data.WMSNO)) =='-1' && ((dataArr[i].data.CHARGEUNIT != 'CBM') || (dataArr[i].data.ISDETAIL == '0'))) { continue; } else { existOUTBSNO += dataArr[i].data.OUTBSNO_OUT + ','; temp = Add(temp, parseFloat(dataArr[i].data.GOODSPFSL_OUT)); // temp += parseFloat(dataArr[i].data.GOODSPFSL_OUT); } } } else if (cbDetail == true) { for (var i = 0; i < dataArr.length; i++) { //temp += parseFloat(dataArr[i].data.GOODSPFSL_OUT); temp = Add(temp, parseFloat(dataArr[i].data.GOODSPFSL_OUT)); } } return Ext.util.Format.number(temp, '0.0000'); } }, { sortable: true, dataIndex: 'GOODSSTOCK', header: '库存量', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.0000; var existWMSNO = ''; var existWMSINGID = ''; var form = _this.formSearch.getForm(); var cbDetail = form.findField('cbDetail').getValue(); if (cbDetail == false) { for (var i = 0; i < dataArr.length; i++) { if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && dataArr[i].data.CHARGEUNIT != "箱") { continue; } else { existWMSNO += dataArr[i].data.WMSNO + ','; //temp += parseFloat(dataArr[i].data.GOODSSTOCK); temp = Add(temp, parseFloat(dataArr[i].data.GOODSSTOCK)); } } } else if (cbDetail == true) { for (var i = 0; i < dataArr.length; i++) { if (existWMSNO.indexOf(dataArr[i].data.WMSNO) == -1 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1 && dataArr[i].data.CHARGEUNIT != "箱") { existWMSINGID += dataArr[i].data.WMSINGID + ','; existWMSNO += dataArr[i].data.WMSNO + ','; //temp += parseFloat(dataArr[i].data.GOODSSTOCK); temp = Add(temp, parseFloat(dataArr[i].data.GOODSSTOCK)); } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { existWMSINGID += dataArr[i].data.WMSINGID + ','; temp = Add(temp, parseFloat(dataArr[i].data.GOODSSTOCK)); //temp += parseFloat(dataArr[i].data.GOODSSTOCK); } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { continue; } } } return Ext.util.Format.number(temp, '0.0000'); } }, { sortable: true, dataIndex: 'CHARGEUNIT', header: '计费单位', width: 80 }, { sortable: true, dataIndex: 'GOODSOUTFEE_OUT', header: '应收仓储费', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.0000; var existOUTBSNO = ''; var form = _this.formSearch.getForm(); var cbDetail = form.findField('cbDetail').getValue(); if (cbDetail == false) { for (var i = 0; i < dataArr.length; i++) { var curWMSNO = dataArr[i].data.WMSNO; if ((existOUTBSNO.indexOf(dataArr[i].data.OUTBSNO_OUT)) >= 0 && (curWMSNO.indexOf(dataArr[i].data.WMSNO)) == '-1' && ((dataArr[i].data.CHARGEUNIT != 'CBM') || (dataArr[i].data.ISDETAIL == '0'))) { continue; } else { existOUTBSNO += dataArr[i].data.OUTBSNO_OUT + ','; temp = Add(temp, parseFloat(dataArr[i].data.GOODSOUTFEE_OUT)); //temp += parseFloat(dataArr[i].data.GOODSOUTFEE_OUT); } } } else if (cbDetail == true) { for (var i = 0; i < dataArr.length; i++) { //temp += parseFloat(dataArr[i].data.GOODSOUTFEE_OUT); temp = Add(temp, parseFloat(dataArr[i].data.GOODSOUTFEE_OUT)); } } return Ext.util.Format.number(temp, '0.0000'); } }, { sortable: true, dataIndex: 'GOODSOUTFEEAP_OUT', header: '应付仓储费', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.0000; var existOUTBSNO = ''; var form = _this.formSearch.getForm(); var cbDetail = form.findField('cbDetail').getValue(); if (cbDetail == false) { for (var i = 0; i < dataArr.length; i++) { var curWMSNO = dataArr[i].data.WMSNO; if ((existOUTBSNO.indexOf(dataArr[i].data.OUTBSNO_OUT)) >= 0 && (curWMSNO.indexOf(dataArr[i].data.WMSNO)) == '-1' && ((dataArr[i].data.CHARGEUNIT != 'CBM') || (dataArr[i].data.ISDETAIL == '0'))) { continue; }else { existOUTBSNO += dataArr[i].data.OUTBSNO_OUT + ','; //temp += parseFloat(dataArr[i].data.GOODSOUTFEEAP_OUT); temp = Add(temp, parseFloat(dataArr[i].data.GOODSOUTFEEAP_OUT)); } } } else if (cbDetail == true) { for (var i = 0; i < dataArr.length; i++) { //temp += parseFloat(dataArr[i].data.GOODSOUTFEEAP_OUT); temp = Add(temp, parseFloat(dataArr[i].data.GOODSOUTFEEAP_OUT)); } } return Ext.util.Format.number(temp, '0.0000'); } }, { sortable: true, dataIndex: 'ARFEE', header: '入库应收装卸费', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { return value; } }, { sortable: true, dataIndex: 'APFEE', header: '入库应付装卸费', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { return value; } }, { sortable: true, dataIndex: 'ARFEE_OUT', header: '出库应收装卸费', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { return value; } }, { sortable: true, dataIndex: 'APFEE_OUT', header: '出库应付装卸费', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { return value; } }, { sortable: true, dataIndex: 'FREESTORAGEPERIOD', header: '免仓储期', width: 80 }, { sortable: true, dataIndex: 'GOODSPACK', header: '入库件数', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.0000; var existWMSNO = ''; var existWMSINGID = ''; var form = _this.formSearch.getForm(); var cbDetail = form.findField('cbDetail').getValue(); if (cbDetail == false) { for (var i = 0; i < dataArr.length; i++) { if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && dataArr[i].data.CHARGEUNIT != "箱") { continue; } else { existWMSNO += dataArr[i].data.WMSNO + ','; temp += parseFloat(dataArr[i].data.GOODSPACK); } } } else if (cbDetail == true) { for (var i = 0; i < dataArr.length; i++) { var curWMSNO = dataArr[i].data.WMSNO; var curWMSINGID = dataArr[i].data.WMSINGID; if (existWMSNO.indexOf(dataArr[i].data.WMSNO) == -1 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1 && dataArr[i].data.CHARGEUNIT != "箱") { existWMSINGID += dataArr[i].data.WMSINGID + ','; existWMSNO += dataArr[i].data.WMSNO + ','; temp += parseFloat(dataArr[i].data.GOODSPACK); } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { existWMSINGID += dataArr[i].data.WMSINGID + ','; temp += parseFloat(dataArr[i].data.GOODSPACK); } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { continue; } } } return Ext.util.Format.number(temp, '0.0000'); } }, { sortable: true, dataIndex: 'GOODSPACKSTOCK', header: '剩余件数', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.00; var existWMSNO = ''; var existWMSINGID = ''; var form = _this.formSearch.getForm(); var cbDetail = form.findField('cbDetail').getValue(); if (cbDetail == false) { for (var i = 0; i < dataArr.length; i++) { if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && dataArr[i].data.CHARGEUNIT != "箱") { continue; } else { existWMSNO += dataArr[i].data.WMSNO + ','; temp += parseFloat(dataArr[i].data.GOODSPACKSTOCK); } } } else if (cbDetail == true) { for (var i = 0; i < dataArr.length; i++) { var curWMSNO = dataArr[i].data.WMSNO; var curWMSINGID = dataArr[i].data.WMSINGID; if (existWMSNO.indexOf(dataArr[i].data.WMSNO) == -1 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1 && dataArr[i].data.CHARGEUNIT != "箱") { existWMSINGID += dataArr[i].data.WMSINGID + ','; existWMSNO += dataArr[i].data.WMSNO + ','; temp += parseFloat(dataArr[i].data.GOODSPACKSTOCK); } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { existWMSINGID += dataArr[i].data.WMSINGID + ','; temp += parseFloat(dataArr[i].data.GOODSPACKSTOCK); } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { continue; } } } return temp; } }, { sortable: true, dataIndex: 'GOODSPACKPFSL_OUT', header: '出库件数', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0; var existOUTBSNO = ''; var form = _this.formSearch.getForm(); var cbDetail = form.findField('cbDetail').getValue(); if (cbDetail == false) { for (var i = 0; i < dataArr.length; i++) { var curWMSNO = dataArr[i].data.WMSNO; if ((existOUTBSNO.indexOf(dataArr[i].data.OUTBSNO_OUT)) >= 0 && (curWMSNO.indexOf(dataArr[i].data.WMSNO)) == '-1' && ((dataArr[i].data.CHARGEUNIT != 'CBM') || (dataArr[i].data.ISDETAIL == '0'))) { continue; } else { existOUTBSNO += dataArr[i].data.OUTBSNO_OUT + ','; temp += parseFloat(dataArr[i].data.GOODSPACKPFSL_OUT); } } } else if (cbDetail == true) { for (var i = 0; i < dataArr.length; i++) { temp += parseFloat(dataArr[i].data.GOODSPACKPFSL_OUT); } } return temp; } }, { sortable: true, dataIndex: 'TRUCKNO_OUT', header: '车号', width: 80 }, { sortable: true, dataIndex: 'REMARK_OUT', header: '出库备注', width: 80 }, { sortable: true, dataIndex: 'MODIFIEDUSER', header: '入库操作人', width: 80 }, { sortable: true, dataIndex: 'MODIFIEDTIME', header: '入库操作时间', width: 80 }, { sortable: true, dataIndex: 'CREATEUSER_OUT', header: '出库操作人', width: 80 }, { sortable: true, dataIndex: 'CREATETIME_OUT', header: '出库操作时间', width: 80 } , { sortable: true, dataIndex: 'PICIHAO', header: '批次号', width: 80 }, { sortable: true, dataIndex: 'AREACODE', header: '库位编码', width: 80 }, { sortable: true, dataIndex: 'AREANAME', header: '储位', width: 80 }, { sortable: true, dataIndex: 'TRAYNO', header: '托号', width: 120 }, { sortable: true, dataIndex: 'PRODDATE', header: '生产日期', width: 120 }, { sortable: true, dataIndex: 'FACTORYNO', header: '厂号', width: 120 }, { sortable: true, dataIndex: 'WMSINREMARK', header: '入库备注', width: 120 }, { sortable: true, dataIndex: 'COUNTRYOFORIGIN', header: '原产国', width: 140 }, { sortable: true, dataIndex: 'INVOICENO', header: '入库明细发票号', width: 140 }, { sortable: true, dataIndex: 'KINDPKGS', header: '入库明细包装', width: 140 }, { sortable: true, dataIndex: 'BZTCHNO_WMSIN', header: '入库明细批次号', width: 140 } ]; this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }); this.MainCB = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true }); Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, { width: 40 }); this.gridList = new Ext.grid.GridPanel({ store: this.storeList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, selModel: this.MainCB, columns: this.column, viewConfig: { enableTextSelection: true }, plugins: [this.cellEditing], features: [{ ftype: 'summary' }], // features: [{ // id: 'group', // ftype: 'grouping', // groupHeaderTpl: '{name}', // hideGroupedHeader: false, // enableGroupingMenu: true // }], bbar: [Ext.create('Ext.PagingToolbar', { store: this.storeList, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }), this.Pagenum] }); /////////////以下部分为获取存储的gridpanel显示样式 this.column = DsTruck.GetGridPanel(USERID, this.formname, this.column, 0, true); //使用者id,表名 ,中间column数组 this.column.unshift(new Ext.grid.RowNumberer()); this.gridList.reconfigure(this.storeList, this.column); //////////////////////////// //#endregion ////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// //#region formSearch //#region formSearch枚举参照相关 this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsTruckMng.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCustCode.load({ params: { condition: ""} }); this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '客户名称', typeAhead: true, store: this.storeCustCode, name: 'CUSTOMERNAME', valueField: 'CustName', displayField: 'CodeAndName' }); //品名 this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeGoodsModel', proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsList' } }); this.storeCodeGoodsList.load(); this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '品名', store: this.storeCodeGoodsList, forceSelection: true, name: 'GOODSNAME', valueField: 'GOODNAME', displayField: 'CodeAndName', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); //#endregion this.formSearch = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 110, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ this.comboxCustCode , { fieldLabel: '箱号', name: 'CNTRNO', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, this.comboxGOODSNAME, { fieldLabel: '规格/牌号', name: 'GOODSMODEL', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '合同号', name: 'CONTRACTNO', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ this.comboxISCHANGE, { fieldLabel: '从..入库日期', format: 'Y-m-d', xtype: 'datefield', name: 'WMSDATE_min', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '到..入库日期', format: 'Y-m-d', xtype: 'datefield', name: 'WMSDATE_max', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '从..出库日期', format: 'Y-m-d', xtype: 'datefield', name: 'DODATEOUT_min', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '到..出库日期', format: 'Y-m-d', xtype: 'datefield', name: 'DODATEOUT_max', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } } //, { xtype: 'hiddenfield', flex: 1 } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', anchor: '100%', items: [ this.comboxCustWmsCode, { fieldLabel: '库位编码', name: 'AREACODE', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '出库单号/明细单号', name: 'OUTBSNO', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '提单号', name: 'MBLNO', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } },this.comboxCompany //{ // xtype: 'hiddenfield' //} ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', anchor: '100%', items: [ { fieldLabel: '储位', name: 'AREANAME', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, this.comboxIsGOODSSTOCK, { xtype: "checkbox", //checkbox控件 id: "cbDetail", name: "cbDetail", boxLabel: "", fieldLabel: "是否带明细", inputValue: "true", //选中的值 uncheckedValue: "false", //未选中的值 checked: true //绘制时的选中状态 }, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); //#endregion formSearch var menu1 = new Ext.menu.Menu({ id: 'basicMenu', items: [{ text: '批量设为完成', handler: clickEnd }, { text: '批量设为未完成', handler: clickNotEnd }] }); function clickEnd() { panelTest.SetEnd("1"); }; function clickNotEnd() { panelTest.SetEnd("0"); }; this.panelBtn = new Ext.Panel({ region: "north", tbar: [ { text: "新建", id: "btnadd", hidden: true, iconCls: "btnadd", handler: function (button, event) { //this.OprationStatus = 'add'; //DsOpenEditWin("/TruckMng/MsWlPc/Edit_ADL", "", "700", "1000"); this.onAddPCClick(); }, scope: this }, { text: "删除", id: "btndelete", hidden: true, iconCls: "btndelete", handler: function (button, event) { this.onDeleteClick(button, event); }, scope: this }, '-', { text: "执行查询", iconCls: "btnrefresh", handler: function (button, event) { this.onRefreshClick(button, event); }, scope: this }, { text: "重置条件", iconCls: "btnreset", handler: function (button, event) { this.onClearSql(button, event); }, scope: this }, { xtype: 'button', width: 90, text: "高级查询", iconCls: "btnmore", handler: function (button, event) { var sql = _this.getCondition(); if (_this.winAccess) { _this.winAccess.close(); } _this.winAccess = new Shipping.DsQuery({ }); _this.winAccess.StoreList = _this.storeList; _this.winAccess.formname = _this.formname; _this.winAccess.condition = sql; _this.winAccess._parentWin = _this; _this.winAccess.show(); return; } }, '-',{ text: "导出Excel", id: "btnExportExcel", iconCls: 'btnexportexcel', handler: function (button, event) { this.onExportClick(button, event); }, scope: this }, '-', /*{ id: "btnFeeAuditReject", text: '驳回提交费用业务', tooltip: '驳回提交费用业务', iconCls: "btnrefuse", handler: function (button, event) { this.onAuditRefuseClick(button, event); }, scope: this }, {text: "批量设置完成", menu: menu1, scope: this },*/ { text: "保存列表样式", id: "btntest", handler: function (button, event) { var formname = this.formname; var tempcolumns = this.gridList.columns; DsTruck.SaveGridPanel(USERID, formname, tempcolumns, this.column, 0, false); }, scope: this }, { text: "保存修改", id: "SaveBtn", hidden: true, iconCls: "btnsave", handler: function (button, event) { this.onSaveClick(button, event); }, scope: this }, '-', { id: "btnLock", text: '费用入账', tooltip: '锁定入库信息', iconCls: "btnconfirm", handler: function (button, event) { this.LockWMS("1"); }, scope: this }, '-', { id: "btnUnLock", text: '取消费用入账', tooltip: '入库信息解除锁定', iconCls: "btnrefuse", handler: function (button, event) { this.LockWMS("0"); }, scope: this }, { text: "打印", id: "btnprint", iconCls: 'btnprint', handler: function (button, event) { this.onPrintClick(button, event); }, scope: this } //,this.CB_EditMode ] }); this.panelTop = new Ext.Panel({ layout: "border", region: "north", height: 150, items: [this.formSearch, this.panelBtn] }); Ext.apply(this, { items: [this.panelTop, this.gridList, this.gridList_edit] }); ///以下集中绑定事件 this.storeList.on('beforeload', function (store) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); var form = this.formSearch.getForm(); var cbDetail = form.findField('cbDetail').getValue(); Ext.apply(store.proxy.extraParams, { condition: sql, detail: cbDetail }); }, this); this.gridList.on('edit', function (editor, e, eOpts) { this.PCAfterEdit(editor, e, eOpts); }, this); this.cellEditing.on('beforeedit', function (editor, e) { return this.PCBeforeEdit(editor, e); }, this); this.LoadInitData(); }, //end initUIComponents LoadInitData: function () { //this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 ) "} }); }, onRefreshClick: function (button, event) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); this.sqlcontext = sql; var form = this.formSearch.getForm(); //是否带明细 var cbDetail = form.findField('cbDetail').getValue(); this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql ,detail:cbDetail}, waitMsg: "正在查询数据...", scope: this }); //} }, onClearSql: function () { var form = this.formSearch.getForm(); form.reset(); //this.InitData(); }, getCondition: function () { var form = this.formSearch.getForm(); var sql = ''; //客户名称 var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue(); sql = sql + getAndConSql(sql, CUSTOMERNAME, " V.CUSTOMERNAME='" + CUSTOMERNAME + "'"); //CNTRNO var CNTRNO = form.findField('CNTRNO').getValue(); sql = sql + getAndConSql(sql, CNTRNO, " CNTRNO like '%" + CNTRNO + "%' "); //GOODSNAME var GOODSNAME = form.findField('GOODSNAME').getValue(); sql = sql + getAndConSql(sql, GOODSNAME, " V.GOODSNAME like '%" + GOODSNAME + "%' "); //GOODSMODEL var GOODSMODEL = form.findField('GOODSMODEL').getValue(); sql = sql + getAndConSql(sql, GOODSMODEL, " V.GOODSMODEL like '%" + GOODSMODEL + "%' "); //CONTRACTNO var CONTRACTNO = form.findField('CONTRACTNO').getValue(); sql = sql + getAndConSql(sql, CONTRACTNO, " V.CONTRACTNO like '%" + CONTRACTNO + "%' "); var WMSDATE_min = form.findField('WMSDATE_min').getRawValue(); sql = sql + getAndConSql(sql, WMSDATE_min, " v.WMSDATE>='" + WMSDATE_min + "'"); var WMSDATE_max = form.findField('WMSDATE_max').getRawValue(); sql = sql + getAndConSql(sql, WMSDATE_max, " v.WMSDATE<='" + WMSDATE_max + " 23:59:59'"); var DODATEOUT_min = form.findField('DODATEOUT_min').getRawValue(); sql = sql + getAndConSql(sql, DODATEOUT_min, " v.DODATE_OUT>='" + DODATEOUT_min + "'"); var DODATEOUT_max = form.findField('DODATEOUT_max').getRawValue(); sql = sql + getAndConSql(sql, DODATEOUT_max, " v.DODATE_OUT<='" + DODATEOUT_max + " 23:59:59'"); var ISCHANGE = form.findField('ISCHANGE').getValue(); if (ISCHANGE == '全部') { } if (ISCHANGE == '不含货转') { sql = sql + getAndConSql(sql, ISCHANGE, "v.ISCHANGE = " + 0 + ""); } if (ISCHANGE == '只包括货转') { sql = sql + getAndConSql(sql, ISCHANGE, "v.ISCHANGE = " + 1 + ""); } //仓库名称 var StorageName = form.findField('STORAGENAME').getValue(); sql = sql + getAndConSql(sql, StorageName, " V.StorageName = '" + StorageName + "' "); //库位编码 var AREACODE = form.findField('AREACODE').getValue(); sql = sql + getAndConSql(sql, AREACODE, " V.AREACODE like '%" + AREACODE + "%' "); //出库单号/出库明细单号 var OUTBSNO = form.findField('OUTBSNO').getValue(); sql = sql + getAndConSql(sql, OUTBSNO, " (V.OUTBSNO_OUT like '%" + OUTBSNO + "%' OR V.BSNO_OUT like '%" + OUTBSNO + "%') "); //提单号 var MBLNO = form.findField('MBLNO').getValue(); sql = sql + getAndConSql(sql, MBLNO, " V.BLNO like '%" + MBLNO + "%' "); //用证公司 var company = form.findField('company').getValue(); sql = sql + getAndConSql(sql, company, "'" + company + "' in (select company from import_main where ContractNo = V.BSNO)"); /* if (sql != '') { sql += ' and ISLOCK=1 and ISLOCK2=0'; //需求编号:SR2017061400006-1 } else { sql += 'ISLOCK=1 and ISLOCK2=0'; } */ //储位 var AREANAME = form.findField('AREANAME').getValue(); sql = sql + getAndConSql(sql, AREANAME, " V.AREANAME like '%" + AREANAME + "%' "); var IsGOODSPACKSTOCKE = form.findField('IsGOODSSTOCK').getValue(); if (IsGOODSPACKSTOCKE == '有货') { sql = sql + getAndConSql(sql, IsGOODSPACKSTOCKE, "v.GOODSSTOCK <> 0"); } if (IsGOODSPACKSTOCKE == '清库') { sql = sql + getAndConSql(sql, IsGOODSPACKSTOCKE, "v.GOODSSTOCK = 0"); } return sql; }, checkSearchCondition: function () { var form = this.formSearch.getForm(); if (!form.isValid()) { Ext.Msg.alert('提示', '查询条件赋值错误,请检查。'); return false; } return true; }, onDsQuery: function () { //var girdcolums = this.gridList.getColumnMode(); this.PageSize = this.Pagenum.getValue(); var sql = this.sqlcontext; this.storeList.pageSize = this.PageSize; // this.gridList.filters.clearFilters(); var form = this.formSearch.getForm(); var cbDetail = form.findField('cbDetail').getValue(); this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql, detail: cbDetail }, waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //"正在查询数据...", scope: this }); }, OprationSwap: function () { var ret = new Array(); ret[0] = this.OprationStatus; ret[1] = this.storeList; ret[2] = this.SelectedRecord; if (this.OprationStatus == "add") { ret[3] = ""; } else { ret[3] = this.SelectedRecord.data.REFBILLNO; } ret[4] = "MsRptPcHeadQryIndex"; ret[5] = formtype; return ret; }, onExportClick: function (button, event) { GridExportExcelPage(this.gridList); }, SetBtnState: function () { var me = this; //此处用于北京二商项目的财务部门 在此处入账、解除入账出入库信息 Ext.Ajax.request({ waitMsg: '正在查询用户权限...', url: '/CommMng/BasicDataRef/GetAuthorityRange', params: { modName: "modImportSales", USERID: USERID }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); rec = result.data; //alert(rec.VISIBLERANGE); //alert(rec.OPERATERANGE); //可视范围无限制。 //可操作为0则全都可见 //,4为所有按钮均不可见,只能查询 //,3为特殊账户,可以编辑不可添加预收,可以加销售单,审销售单 //,2为业务只能新增删除销售单,不能操作预收 //,1为财务,可以新建删除预收,审批销售出库,不可操作销售单 this.VISIBLERANGE = rec.VISIBLERANGE; this.OPERATERANGE = rec.OPERATERANGE; if (this.OPERATERANGE == '1' || this.OPERATERANGE == '0') { Ext.getCmp("btnLock").enable(); Ext.getCmp("btnUnLock").enable(); } else { Ext.getCmp("btnLock").disable(); Ext.getCmp("btnUnLock").disable(); } } else Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); }, scope: this }); //request over } , LockWMS: function (Value) { if (this.editRecord == null) { alert("请先保存记录"); return; } if (this.editRecord.get('ISLOCK') == "True" && Value == "1") { alert("已经入账,不能重复操作"); return; } if (this.editRecord.get('ISLOCK') == "False" && Value == "0") { alert("目前没有入账,不能重复操作"); return; } var LockWMS = []; Ext.MessageBox.confirm('提示', '确定要操作该入库信息吗?', function (btn) { if (btn == 'yes') { LockWMS.push(this.editRecord); var LockWMSJSNO = ConvertRecordsToJsonAll(LockWMS); var _this = this; Ext.Ajax.request({// waitMsg: '正在处理数据...', url: '/MvcShipping/WMS/Lock', params: { data: LockWMSJSNO, LOCK: Value }, callback: function (options, success, response) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { alert(jsonresult.Message); if (Value == "1") { _this.editRecord.set("ISLOCK", "True"); var data = this.formEdit.getForm().getValues(); data.ISLOCK = "True"; this.formEdit.getForm().setValues(data); } else { _this.editRecord.set("ISLOCK", "False"); var data = this.formEdit.getForm().getValues(); data.ISLOCK = "False"; this.formEdit.getForm().setValues(data); } _this.editRecord.commit(); } else { alert("操作失败" + jsonresult.Message); } }, scope: this }); //request over } }, this); } //onDeleteClick , onPrintClick: function (button, event) { var form = this.formSearch.getForm(); var cbDetail = form.findField('cbDetail').getValue(); var sql1 = ""; if (cbDetail == true) { sql1 = " select DISTINCT dbo.F_WMS_CNTRNO(v.gid) CNTRNO,v.* from VW_WMSINOUT_DETAIL V WITH(NOLOCK) "; } else { sql1 = " select DISTINCT dbo.F_WMS_CNTRNO(v.gid) CNTRNO,v.* from VW_WMSINOUT_DETAIL_OVERALL V WITH(NOLOCK) "; } var printType = 'WmsDetailIndexList'; //sql1 = " select DISTINCT dbo.F_WMS_CNTRNO(v.gid) CNTRNO, v.* from VW_WMS_DETAIL V "; var wherestr = this.getCondition(); if (wherestr != '') { sql1 += " where 1 = 1 and " + wherestr; } sql1 += "order by CUSTOMERNAME ASC,WMSDATE ASC "; PrintComm(printType, sql1); } });