You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/OA/Viewsjs/Wms_StockTake/Wms_StockTakeIndex.js

1531 lines
56 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

//库存综合查询
Ext.namespace('DsTruck');
DsTruck.Wms_StockTakeIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.DsTruck.Wms_StockTakeIndex.superclass.constructor.call(this);
};
Ext.extend(DsTruck.Wms_StockTakeIndex, Ext.Panel, {
PageSize: 1000,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '',
initUIComponents: function () {
this.formname = "Wms_StockTake"; //需求编号SR2017051700006根据领导要求修改 库存综合查询报表
//#region formSearch 下拉框信息加载
Ext.define('Tradermb', {
extend: 'Ext.data.Model',
idProperty: 'gid',
fields: [
{ name: 'gid', type: 'string' },
{ name: 'name', type: 'string' },
{ name: 'codename', type: 'string' }
]
});
//委托单位
this.storeCustomer = Ext.create('DsExt.ux.RefTableStore', {
model: 'Tradermb',
proxy: { url: '/CommMng/BasicDataRef/GetTrader' }
});
this.storeCustomer.load({ params: { condition: " 1=1 "} });
this.comboxCustomer = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
store: this.storeCustomer,
name: 'Customer',
valueField: 'name',
displayField: 'codename'
});
//应收客户
this.comboxFEECustomer = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '应收客户',
store: this.storeCustomer,
name: 'FEECustomer',
valueField: 'name',
displayField: 'codename'
});
//仓库
this.storeStock = Ext.create('DsExt.ux.RefTableStore', {
model: 'Tradermb',
proxy: { url: '/CommMng/BasicDataRef/GetTrader' }
});
this.storeStock.load({ params: { condition: " ISWAREHOUSE=1 "} });
this.comboxStock = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '仓库',
store: this.storeStock,
name: 'STORAGENAME',
valueField: 'name',
displayField: 'codename'
});
//操作人
this.storeUser = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeUser.load({ params: { condition: ""} });
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操作人',
forceSelection: true,
store: this.storeUser,
name: 'OP',
valueField: 'UserName',
displayField: 'CodeAndName'
});
//销售
this.storeSALE = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeSALE.load({ params: { condition: ""} });
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '销售',
forceSelection: true,
store: this.storeSALE,
name: 'SALE',
valueField: 'UserName',
displayField: 'CodeAndName'
});
//计算单位
Ext.define('CHARGEUNITmb', {
extend: 'Ext.data.Model',
fields: [
{ name: 'Name', type: 'string' }
]
});
var CHARGEUNITData = [{ "Name": "千克" },
{ "Name": "吨" },
{ "Name": "CBM" },
{ "Name": ""}];
var storeCHARGEUNIT = Ext.create('Ext.data.Store', {
model: 'CHARGEUNITmb',
data: CHARGEUNITData
});
this.comboxCHARGEUNIT = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '计算单位',
forceSelection: true,
store: storeCHARGEUNIT,
name: 'CHARGEUNIT',
valueField: 'Name',
displayField: 'Name'
});
//是否货转
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: '全部'
});
//分公司
this.storeCompany = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.CompanyModel',
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'
});
//库存状态
Ext.define('IsGOODSPACKSTOCKEModel', { extend: 'Ext.data.Model', fields: [{ name: 'Name', type: 'string'}] });
var IsGOODSPACKSTOCKEData = [{ "Name": "全部" }, { "Name": "有货" }, { "Name": "清库"}];
var storeIsGOODSPACKSTOCKE = Ext.create('Ext.data.Store', { model: 'IsGOODSPACKSTOCKEModel', data: IsGOODSPACKSTOCKEData });
this.comboxIsGOODSPACKSTOCKE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '库存状态',
forceSelection: true,
store: storeIsGOODSPACKSTOCKE,
name: 'IsGOODSPACKSTOCKE',
valueField: 'Name',
displayField: 'Name',
values: '全部'
});
//#endregion
//#region formSearch
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
//bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxCustomer, //this.comboxFEECustomer,
{
fieldLabel: '提单号',
name: 'MBLNO'
},
{
fieldLabel: '委托编号',
name: 'CUSTNO'
},
{
fieldLabel: '入库单号',
name: 'WMSNO'
}, this.comboxISCHANGE
// ,
// {
// fieldLabel: '箱号',
// name: 'CNTRNO'
// }
]
}
]//end items(fieldset 1)
}, //end fieldset 1
{//fieldset 2
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxStock, {
fieldLabel: '品名',
name: 'GOODSNAME'
}, {
fieldLabel: '规格',
name: 'GOODSSTANDARD'
}, this.comboxCHARGEUNIT, this.comboxIsGOODSPACKSTOCKE
]
}]//end items(fieldset 2)
}//end fieldset 2
, {//fieldset 2
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '从..到港日',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ArrivalDate_min'
}, {
fieldLabel: '到..到港日',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ArrivalDate_max'
}, this.comboxCompany, this.comboxOP, this.comboxSALE//, { xtype: 'hiddenfield' }
]
}]//end items(fieldset 2)
}
, {
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '库别',
name: 'WHS_CODE'
}, { xtype: 'hiddenfield' }
, { xtype: 'hiddenfield' }
, { xtype: 'hiddenfield' }
, { xtype: 'hiddenfield' }
]
}]
}
]//end root items
});
//#endregion formSearch
//#region 主列表
//#region 定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
idProperty: 'GID',
fields: [
{ name: 'WMSDATE', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'MBLNO', type: 'string' },
{ name: 'CUSTNO', type: 'string' },
{ name: 'WMSNO', type: 'string' },
{ name: 'STORAGENAME', type: 'string' },
{ name: 'GOODSNAME', type: 'string' },
{ name: 'GOODSMODEL', type: 'string' },
{ name: 'hj_GOODSRKSL', type: 'number' },
{ name: 'hj_GOODSPFSL_OUT', type: 'number' },
{ name: 'hj_GOODSSTOCK', type: 'number' },
{ name: 'hj_GOODSPACK', type: 'number' },
{ name: 'hj_GOODSPACKPFSL', type: 'number' },
{ name: 'hj_GOODSPACKSTOCK', type: 'number' },
{ name: 'CLEARSTOCKGAP', type: 'number' },
{ name: 'GID', type: 'string' },
{ name: 'ASSOCIATEDNO', type: 'string' },
{ name: 'CONTRACTNO', type: 'string' },
{ name: 'CHARGEUNIT', type: 'string' },
{ name: 'CUSTOMNO', type: 'string' },
{ name: 'GOODSGRADE', type: 'string' },
{ name: 'GOODSSLICE', type: 'number' }, //需求编号SR2017062800001
{name: 'GOODSSTANDARD', type: 'string' },
{ name: 'REMARK', type: 'string' },
{ name: 'hj_GOODSPACKACTUAL', type: 'number' },
{ name: 'hj_GOODSRKSLACTUAL', type: 'number' },
{ name: 'COMPANYNAME', type: 'string' },
{ name: 'GOODSNUM', type: 'number' },
{ name: 'WeiWanShui', type: 'number' }, //需求编号SR2017062200002
{name: 'ISBONDEDNAME', type: 'string' }, //是否保税SR2017062600003
{ name: 'GOODSSLICE_OUT', type: 'number' }, //需求编号SR2017071100001
{ name: 'AREANAME', type: 'string' },//需求编号SR2020051900002
{ name: 'WHS_CODE', type: 'string' },
{ name: 'COUNTRYOFORIGIN', type: 'string' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/OA/Wms_StockTake/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeCustomerList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
idProperty: 'CUSTOMERNAME',
fields: [
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'GOODSNAME', type: 'string' },
{ name: 'CHARGEUNIT', type: 'string' },
{ name: 'hj_GOODSRKSL', type: 'number' },
{ name: 'hj_GOODSPFSL_OUT', type: 'number' },
{ name: 'hj_GOODSSTOCK', type: 'number' },
{ name: 'hj_GOODSPACK', type: 'number' },
{ name: 'hj_GOODSPACKPFSL', type: 'number' },
{ name: 'hj_GOODSPACKSTOCK', type: 'number' },
{ name: 'CLEARSTOCKGAP', type: 'number' },
{ name: 'GOODSNUM', type: 'number' },
{ name: 'WeiWanShui', type: 'number' }, //需求编号SR2017062200002
{ name: 'ISBONDEDNAME', type: 'string' }, //是否保税SR2017062600003
{ name: 'MBLNO', type: 'string' }
],
remoteSort: false,
proxy: {
type: 'ajax',
url: '/OA/Wms_StockTake/GetGroupList',
reader: {
id: 'CUSTOMERNAME',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeCompanyList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
idProperty: 'COMPANYNAME',
fields: [
{ name: 'COMPANYNAME', type: 'string' },
{ name: 'GOODSNAME', type: 'string' },
{ name: 'CHARGEUNIT', type: 'string' },
{ name: 'hj_GOODSRKSL', type: 'number' },
{ name: 'hj_GOODSPFSL_OUT', type: 'number' },
{ name: 'hj_GOODSSTOCK', type: 'number' },
{ name: 'hj_GOODSPACK', type: 'number' },
{ name: 'hj_GOODSPACKPFSL', type: 'number' },
{ name: 'hj_GOODSPACKSTOCK', type: 'number' },
{ name: 'CLEARSTOCKGAP', type: 'number' },
{ name: 'GOODSNUM', type: 'number' },
{ name: 'WeiWanShui', type: 'number' }, //需求编号SR2017062200002
{ name: 'ISBONDEDNAME', type: 'string' }, //是否保税SR2017062600003
{ name: 'MBLNO', type: 'string' }
],
remoteSort: false,
proxy: {
type: 'ajax',
url: '/OA/Wms_StockTake/GetGroupList',
reader: {
id: 'COMPANYNAME',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//20180403 邓羽 鑫润丰需求 按品名统计
this.storeGOODSNAMEList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
idProperty: 'COMPANYNAME',
fields: [
{ name: 'COMPANYNAME', type: 'string' },
{ name: 'GOODSNAME', type: 'string' },
{ name: 'CHARGEUNIT', type: 'string' },
{ name: 'hj_GOODSRKSL', type: 'number' },
{ name: 'hj_GOODSPFSL_OUT', type: 'number' },
{ name: 'hj_GOODSSTOCK', type: 'number' },
{ name: 'hj_GOODSPACK', type: 'number' },
{ name: 'hj_GOODSPACKPFSL', type: 'number' },
{ name: 'hj_GOODSPACKSTOCK', type: 'number' },
{ name: 'CLEARSTOCKGAP', type: 'number' },
{ name: 'GOODSNUM', type: 'number' },
{ name: 'WeiWanShui', type: 'number' },
{ name: 'ISBONDEDNAME', type: 'string' },
{ name: 'MBLNO', type: 'string' }
],
remoteSort: false,
proxy: {
type: 'ajax',
url: '/OA/Wms_StockTake/GetGroupList',
reader: {
id: 'GOODSNAME',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//#endregion
//#region 列定义
this.initgirdDrcolums = [
{
sortable: true,
dataIndex: 'WMSDATE',
header: '入库日期',
width: 80
},
{
sortable: true,
dataIndex: 'COUNTRYOFORIGIN',
header: '原产国',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '货主',
width: 80
},
{
sortable: true,
dataIndex: 'MBLNO',
header: '提单号',
width: 100
},
{
sortable: true,
dataIndex: 'CUSTNO',
header: '委托编号',
width: 100
},
{
sortable: true,
dataIndex: 'WMSNO',
header: '入库单号',
width: 150
},
{
sortable: true,
dataIndex: 'STORAGENAME',
header: '仓库',
width: 80
}, {
sortable: true,
dataIndex: 'WHS_CODE',
header: '库别',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSNAME',
header: '品名',
width: 150
},
{
sortable: true,
dataIndex: 'GOODSMODEL',
header: '单位', //品牌需求编号SR2017061800001-12
width: 80
},
{
sortable: true,
dataIndex: 'GOODSSTANDARD',
header: '规格',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACK',
header: '入库件数',
width: 80
},
{
//需求编号SR2017062200002
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'WeiWanShui',
header: '未完税件数',
align: 'center',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'GOODSNUM',
header: '完税件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACKPFSL',
header: '出库件数',
width: 80
},
{
//需求编号SR2017061800001-7SR2017071100001
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'GOODSSLICE_OUT',
header: '出库包装件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACKSTOCK',
header: '库存件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSRKSL',
header: '入库数量',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPFSL_OUT',
header: '出库数量',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSSTOCK',
header: '库存数量',
width: 80
},
{
sortable: true,
dataIndex: 'CLEARSTOCKGAP',
header: '清库差',
width: 80
},
{
sortable: true,
dataIndex: 'AREANAME',
header: '储位',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMNO',
header: '报关单号/备案清单号',
width: 80
},
{
sortable: true,
dataIndex: 'CHARGEUNIT',
header: '计算单位',
width: 80
},
{
sortable: true,
dataIndex: 'CONTRACTNO',
header: '合同号',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSGRADE',
header: '品名的等级',
width: 80
},
{
//是否保税SR2017062600003
sortable: true,
dataIndex: 'ISBONDEDNAME',
header: '是否保税业务',
align: 'center',
width: 80
},
{
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACKACTUAL',
header: '实际件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSRKSLACTUAL',
header: '实际数量',
width: 80
},
{
sortable: true,
hidden: true,
dataIndex: 'GID',
header: 'GID',
width: 80
},
{
sortable: true,
hidden: true,
dataIndex: 'ASSOCIATEDNO',
header: 'BSNO',
width: 80
}];
this.initgirdDrcolums_Customer = [
{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '货主',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSNAME',
header: '品名',
width: 80
},
{
sortable: true,
dataIndex: 'MBLNO',
header: '提单号',
width: 100
},
{
sortable: true,
dataIndex: 'CHARGEUNIT',
header: '计算单位',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACK',
header: '入库件数',
width: 80
},
{
//需求编号SR2017062200002
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'WeiWanShui',
header: '未完税件数',
align: 'center',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'GOODSNUM',
header: '完税件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACKPFSL',
header: '出库件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACKSTOCK',
header: '库存件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSRKSL',
header: '入库数量',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPFSL_OUT',
header: '出库数量',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSSTOCK',
header: '库存数量',
width: 80
},
{
//是否保税SR2017062600003
sortable: true,
dataIndex: 'ISBONDEDNAME',
header: '是否保税业务',
align: 'center',
width: 80
}];
this.initgirdDrcolums_Company = [
{
sortable: true,
dataIndex: 'COMPANYNAME',
header: '分公司',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSNAME',
header: '品名',
width: 80
},
{
sortable: true,
dataIndex: 'MBLNO',
header: '提单号',
width: 100
},
{
sortable: true,
dataIndex: 'CHARGEUNIT',
header: '计算单位',
width: 80
},
{
sortable: true, //summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACK',
header: '入库件数',
width: 80
},
{
//需求编号SR2017062200002
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'WeiWanShui',
header: '未完税件数',
align: 'center',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'GOODSNUM',
header: '完税件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACKPFSL',
header: '出库件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACKSTOCK',
header: '库存件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSRKSL',
header: '入库数量',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPFSL_OUT',
header: '出库数量',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSSTOCK',
header: '库存数量',
width: 80
},
{
//是否保税SR2017062600003
sortable: true,
dataIndex: 'ISBONDEDNAME',
header: '是否保税业务',
align: 'center',
width: 80
}];
//#endregion
//#region 列定义_保存列表样式
this.column = this.initgirdDrcolums;
this.column = DsTruck.GetGridPanel(USERID, this.formname, this.column, 0); //使用者id表名中间column数组跳过一开始的几列
this.column_Customer = this.initgirdDrcolums_Customer;
this.column_Customer = DsTruck.GetGridPanel(USERID, this.formname + "_Customer", this.column_Customer, 0); //使用者id表名中间column数组跳过一开始的几列
this.column_Company = this.initgirdDrcolums_Company;
this.column_Company = DsTruck.GetGridPanel(USERID, this.formname + "_Company", this.column_Company, 0); //使用者id表名中间column数组跳过一开始的几列
this.column_GOODSNAME = this.initgirdDrcolums_Company;
this.column_GOODSNAME = DsTruck.GetGridPanel(USERID, this.formname + "_GOODSNAME", this.column_GOODSNAME, 0); //使用者id表名中间column数组跳过一开始的几列
//#endregion
//#region gridList列表显示信息
this.KCCBModel = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true });
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
stripeRows: true,
viewConfig: {
enableTextSelection: true,
autoFill: true
},
stateful: false,
selModel: this.KCCBModel,
columns: [new Ext.grid.RowNumberer()],
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.gridList_Customer = new Ext.grid.GridPanel({
store: this.storeCustomerList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
stripeRows: true,
viewConfig: {
enableTextSelection: true,
autoFill: true
},
stateful: false,
columns: this.column_Customer,
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeCustomerList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.gridList_Company = new Ext.grid.GridPanel({
store: this.storeCompanyList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
stripeRows: true,
viewConfig: {
enableTextSelection: true,
autoFill: true
},
stateful: false,
columns: this.column_Company,
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeCompanyList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.gridList_GOODSNAME = new Ext.grid.GridPanel({
store: this.storeGOODSNAMEList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
stripeRows: true,
viewConfig: {
enableTextSelection: true,
autoFill: true
},
stateful: false,
columns: this.column_GOODSNAME,
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeGOODSNAMEList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
/////////////以下部分为获取存储的gridpanel显示样式
this.column = DsTruck.GetGridPanel(USERID, this.formname, this.column, 1);
//使用者id表名 中间column数组跳过一开始的几列
this.column.unshift(new Ext.grid.RowNumberer());
this.gridList.reconfigure(this.storeList, this.column);
////////////////////////////
// this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
// this.SelectedRecord = record;
// this.OprationStatus = 'edit';
// DsOpenEditWin('/OA/Wms_StockTake/Edit', "", "650", "1000");
// }, this);
//#endregion
//#endregion
//#region formSearch 合计列表
//#region 定义数据集
this.storeList_Sum = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
idProperty: 'GID',
fields: [
{ name: 'hj_GOODSPACK', type: 'number' }, //入库件数
{name: 'WeiWanShui', type: 'number' }, //未完税件数
{name: 'GOODSNUM', type: 'number' }, //完税件数
{name: 'hj_GOODSPACKPFSL', type: 'number' }, //出库件数
{name: 'GOODSSLICE_OUT', type: 'number' }, //出库包装件数
{name: 'hj_GOODSPACKSTOCK', type: 'number' }, //库存件数
{name: 'hj_GOODSRKSL', type: 'number' }, //入库数量
{name: 'hj_GOODSPFSL_OUT', type: 'number' }, //出库数量
{name: 'hj_GOODSSTOCK', type: 'number' }, //库存数量
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/OA/Wms_StockTake/GetDataSumList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//#endregion
//#region 列定义
this.column_Sum = [
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACK',
header: '入库件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'WeiWanShui',
header: '未完税件数',
align: 'center',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'GOODSNUM',
header: '完税件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACKPFSL',
header: '出库件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'GOODSSLICE_OUT',
header: '出库包装件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPACKSTOCK',
header: '库存件数',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSRKSL',
header: '入库数量',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSPFSL_OUT',
header: '出库数量',
width: 80
},
{
sortable: true,
//summaryType: 'sum',
//summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
dataIndex: 'hj_GOODSSTOCK',
header: '库存数量',
width: 80
}];
//#endregion
//#region gridList列表显示信息
//定义Grid
this.gridList_Sum = new Ext.grid.GridPanel({
border: false,
store: this.storeList_Sum,
enableHdMenu: false,
region: 'south',
height: 50,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
stripeRows: true,
viewConfig: {
enableTextSelection: true,
autoFill: true
},
stateful: false,
columns: this.column_Sum
});
//#endregion
//#endregion
_this = this;
//#region 按钮Toolbar/框架/加载
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-', {
text: "打印", //"打印",
iconCls: 'btnprint',
menu: [
{ text: "全部", //"全部",
handler: function (menu, event) {
_this.onPrintClick();
}
}, { text: "选择打印", //"选择打印",
handler: function (menu, event) {
_this.PrintSelect();
}
}],
scope: this
}, '-'
, {
xtype: 'button',
width: 90,
text: "高级查询",
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getCondition();
if (this.winAccess == '' || typeof (this.winAccess) == "undefined") {
this.winAccess = new Shipping.DsQuery({});
} else {
this.winAccess.destroy();
this.winAccess = new Shipping.DsQuery({});
}
this.winAccess.StoreList = this.storeList;
this.winAccess.formname = this.formname;
this.winAccess.condition = sql;
this.winAccess.LoadQueryData_self(this.formname);
this.winAccess.show();
return;
},
scope: this
}, '-', {
text: "保存列表样式",
menu: [{ text: "保存",
handler: function (button, event) {
_this.onSaveClick();
}
}, { text: "初始化",
handler: function (menu, event) {
_this.onClearClick();
}
}],
scope: this
}]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 145,
items: [this.formSearch, this.panelBtn]
});
this.page_1 = new Ext.Panel({
id: "page_1",
layout: "border",
region: "center",
title: "按入库单",
items: [this.gridList]
});
this.page_2 = new Ext.Panel({
id: "page_2",
layout: "border",
region: "center",
title: "按客户",
items: [this.gridList_Customer]
});
this.page_3 = new Ext.Panel({
id: "page_3",
layout: "border",
region: "center",
title: "按分公司",
items: [this.gridList_Company]
});
this.page_4 = new Ext.Panel({
id: "page_4",
layout: "border",
region: "center",
title: "按品名",
items: [this.gridList_GOODSNAME]
});
this.MainTab = new Ext.tab.Panel({
layout: "border",
region: "center",
items: [this.page_1, this.page_2, this.page_3, this.page_4],
listeners: {
tabchange: function (tp, p) {
_this.onRefreshClick();
}
}
})
Ext.apply(this, {
border: false,
items: [this.panelTop, this.MainTab, this.gridList_Sum]
});
//#endregion
//#region 页面加载
this.storeList.on('beforeload', function (store) {
if (!this.checkSearchCondition()) {
return;
}
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
//#endregion
}, //end initUIComponents
//#region 查询
onRefreshClick: function (button, event) {
if (!this.checkSearchCondition()) {
return;
}
//
var sql = this.getCondition();
this.sqlcontext = sql;
var _p = this.MainTab.getActiveTab().id;
if (_p == "page_1") {
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
}
if (_p == "page_2") {
this.storeCustomerList.load({
params: { start: 0, limit: this.PageSize, condition: sql, GROUPBY: "Customer" },
waitMsg: "正在查询数据...",
scope: this
});
}
if (_p == "page_3") {
this.storeCompanyList.load({
params: { start: 0, limit: this.PageSize, condition: sql, GROUPBY: "Company" },
waitMsg: "正在查询数据...",
scope: this
});
}
if (_p == "page_4") {
this.storeGOODSNAMEList.load({
params: { start: 0, limit: this.PageSize, condition: sql, GROUPBY: "GOODSNAME" },
waitMsg: "正在查询数据...",
scope: this
});
}
this.storeList_Sum.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
//
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
var CustomerName = form.findField('Customer').getValue();
sql = sql + getAndConSql(sql, CustomerName, "vws.CustomerName = '" + CustomerName + "'");
var MBLNO = form.findField('MBLNO').getValue();
sql = sql + getAndConSql(sql, MBLNO, "(vs.MBLNO like '%" + MBLNO + "%' OR vws.BLNO like '%" + MBLNO + "%')");
var CUSTNO = form.findField('CUSTNO').getValue();
sql = sql + getAndConSql(sql, CUSTNO, "vs.CUSTNO like '%" + CUSTNO + "%'");
var WMSNO = form.findField('WMSNO').getValue();
sql = sql + getAndConSql(sql, WMSNO, "vws.WMSNO like '%" + WMSNO + "%'");
//箱号
//var CNTRNO = form.findField('CNTRNO').getValue();
//sql = sql + getAndConSql(sql, CNTRNO, " vws.nid in (select ASSOCIATEDNO from wms_in where cntrno like '" + CNTRNO + "') ");
var OP = form.findField('OP').getValue();
sql = sql + getAndConSql(sql, OP, " vs.OP like '%" + OP + "%'");
var SALE = form.findField('SALE').getValue();
sql = sql + getAndConSql(sql, SALE, " vs.SALE='" + SALE + "'");
//sql = sql + getAndConSql(sql, SALE, " w.Cargo_gid in( select CARGO_GID from Import_Saledetail where SALESNO in(select salesno from import_sales where SALE='" + SALE + "') ) ");
// var FEECustomer = form.findField('FEECustomer').getValue();
// sql = sql + getAndConSql(sql, FEECustomer, "vws.associatedno in (select distinct bsno from ch_fee where feetype=1 and customername='" + FEECustomer + "')");
var GOODSNAME = form.findField('GOODSNAME').getValue();
sql = sql + getAndConSql(sql, GOODSNAME, "vws.GOODSNAME like '%" + GOODSNAME + "%'");
var GOODSSTANDARD = form.findField('GOODSSTANDARD').getValue();
sql = sql + getAndConSql(sql, GOODSSTANDARD, "vws.GOODSSTANDARD like '%" + GOODSSTANDARD + "%'");
var STORAGENAME = form.findField('STORAGENAME').getValue();
sql = sql + getAndConSql(sql, STORAGENAME, "vws.STORAGENAME = '" + STORAGENAME + "'");
var ISCHANGE = form.findField('ISCHANGE').getValue();
if (ISCHANGE == '全部') { }
if (ISCHANGE == '不含货转') { sql = sql + getAndConSql(sql, ISCHANGE, "vws.ISCHANGE = " + 0 + ""); }
if (ISCHANGE == '只包括货转') { sql = sql + getAndConSql(sql, ISCHANGE, "vws.ISCHANGE = " + 1 + ""); }
var ArrivalDate_min = form.findField('ArrivalDate_min').getRawValue();
sql = sql + getAndConSql(sql, ArrivalDate_min, "vs.ETD >= '" + ArrivalDate_min + "'");
var ArrivalDate_max = form.findField('ArrivalDate_max').getRawValue();
sql = sql + getAndConSql(sql, ArrivalDate_max, "vs.ETD <= '" + ArrivalDate_max + " 23:59:59'");
var company = form.findField('company').getValue();
sql = sql + getAndConSql(sql, company, "vws.corpid = '" + company + "'");
var IsGOODSPACKSTOCKE = form.findField('IsGOODSPACKSTOCKE').getValue();
if (IsGOODSPACKSTOCKE == '有货') { sql = sql + getAndConSql(sql, IsGOODSPACKSTOCKE, "vws.hj_GOODSPACKSTOCK <> 0"); }
if (IsGOODSPACKSTOCKE == '清库') { sql = sql + getAndConSql(sql, IsGOODSPACKSTOCKE, "vws.hj_GOODSPACKSTOCK = 0"); }
var CHARGEUNIT = form.findField('CHARGEUNIT').getValue();
if (CHARGEUNIT != "") { sql = sql + getAndConSql(sql, CHARGEUNIT, "vws.CHARGEUNIT = '" + CHARGEUNIT + "'"); }
var WHS_CODE = form.findField('WHS_CODE').getValue();
if (WHS_CODE != "") { sql = sql + getAndConSql(sql, WHS_CODE, "vws.WHS_CODE = '" + WHS_CODE + "'"); }
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 sortstr = '';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
// this.gridList.filters.clearFilters();
var form = this.formSearch.getForm();
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //"正在查询数据...",
scope: this
});
},
//#endregion
//#region 保存列表样式
onSaveClick: function (button, event) {
var sql = this.getCondition();
var _p = this.MainTab.getActiveTab().id;
if (_p == "page_1") {
this.columns = DsTruck.SaveGridPanel(USERID, this.formname, this.gridList.columns, this.column, 0, true); //使用者id表名中间column数组跳过一开始的几列
}
if (_p == "page_2") {
this.column_Customer = DsTruck.SaveGridPanel(USERID, this.formname + "_Customer", this.gridList_Customer.columns, this.column_Customer, 0, true); //使用者id表名中间column数组跳过一开始的几列
}
if (_p == "page_3") {
this.column_Company = DsTruck.SaveGridPanel(USERID, this.formname + "_Company", this.gridList_Company.columns, this.column_Company, 0, true); //使用者id表名中间column数组跳过一开始的几列
}
if (_p == "page_4") {
this.column_GOODSNAME = DsTruck.SaveGridPanel(USERID, this.formname + "_GOODSNAME", this.gridList_GOODSNAME.columns, this.column_GOODSNAME, 0, true); //使用者id表名中间column数组跳过一开始的几列
}
},
onClearClick: function (button, event) {
var sql = this.getCondition();
var _p = this.MainTab.getActiveTab().id;
if (_p == "page_1") {
this.gridList.reconfigure(this.storeList, this.initgirdDrcolums);
this.columns = DsTruck.SaveGridPanel(USERID, this.formname, this.gridList.columns, this.initgirdDrcolums, 0, true); //使用者id表名中间column数组跳过一开始的几列
}
if (_p == "page_2") {
this.gridList_Customer.reconfigure(this.storeCustomerList, this.initgirdDrcolums_Customer);
this.columns_Customer = DsTruck.SaveGridPanel(USERID, this.formname + "_Customer", this.gridList_Customer.columns, this.initgirdDrcolums_Customer, 0, true); //使用者id表名中间column数组跳过一开始的几列
}
if (_p == "page_3") {
this.gridList_Company.reconfigure(this.storeCompanyList, this.initgirdDrcolums_Company);
this.columns_Company = DsTruck.SaveGridPanel(USERID, this.formname + "_Company", this.gridList_Company.columns, this.initgirdDrcolums_Company, 0, true); //使用者id表名中间column数组跳过一开始的几列
}
if (_p == "page_4") {
this.gridList_GOODSNAME.reconfigure(this.storeGOODSNAME, this.initgirdDrcolums_Company);
this.columns_GOODSNAME = DsTruck.SaveGridPanel(USERID, this.formname + "_GOODSNAME", this.gridList_GOODSNAME.columns, this.initgirdDrcolums_Company, 0, true); //使用者id表名中间column数组跳过一开始的几列
}
},
//#endregion
//#region 导出Excel
onExportClick: function (button, event) {
var sql = this.getCondition();
var _p = this.MainTab.getActiveTab().id;
if (_p == "page_1") {
GridExportExcelPage(this.gridList);
}
if (_p == "page_2") {
GridExportExcelPage(this.gridList_Customer);
}
if (_p == "page_3") {
GridExportExcelPage(this.gridList_Company);
}
if (_p == "page_4") {
GridExportExcelPage(this.gridList_GOODSNAME);
}
}
//#endregion
, onPrintClick: function (button, event) {
// var printType = 'WmsInfoReport_opseai'; //海运进口 入库明细
var printType = 'WMS_StockTake_print1';
var sql1 = "";
var _p = this.MainTab.getActiveTab().id;
if (_p == "page_1") {
sql1 = " select vws.*,(select name from company where gid=vws.corpid) as COMPANYNAME " +
" ,vs.ETD,vs.mblno,vs.custno,ISBONDEDNAME=(case when vws.ISBONDED=1 then '是' else '否' end) " +
" from vw_wms_stocktake as vws left join v_op_bs as vs on vs.BSNO=vws.ASSOCIATEDNO and vs.OPLB = 'WMS_IN' ";
var wherestr = this.getCondition();
if (wherestr != '') {
sql1 += "where 1=1 and " + wherestr;
}
}
if (_p == "page_2") {
sql1 = " select CUSTOMERNAME,goodsname,chargeunit,ISBONDED,ISBONDEDNAME=(case when ISBONDED=1 then '是' else '否' end) " +
",sum(hj_GOODSRKSL) hj_GOODSRKSL,sum(hj_GOODSPFSL_OUT) hj_GOODSPFSL_OUT " +
",sum(hj_GOODSstock) hj_GOODSstock,sum(hj_GOODSPACK) hj_GOODSPACK " +
",sum(hj_GOODSPACKPFSL) hj_GOODSPACKPFSL,sum(hj_GOODSpackstock) hj_GOODSpackstock,sum(GOODSNUM) GOODSNUM,sum(WeiWanShui) WeiWanShui " +
"from " +
"(select vws.*,vs.ETD from vw_wms_stocktake vws left join v_op_bs vs on vs.BSNO=vws.ASSOCIATEDNO ";
var wherestr = this.getCondition();
if (wherestr != '') {
sql1 += "where 1=1 and " + wherestr;
};
sql1 += ")t1 group by CUSTOMERNAME,goodsname,chargeunit,ISBONDED ";
}
if (_p == "page_3" || _p == "page_4") {
sql1 = " select (select name from company where gid=corpid) companyname,goodsname,chargeunit,ISBONDED,ISBONDEDNAME=(case when ISBONDED=1 then '是' else '否' end) " +
",sum(hj_GOODSRKSL) hj_GOODSRKSL,sum(hj_GOODSPFSL_OUT) hj_GOODSPFSL_OUT " +
",sum(hj_GOODSstock) hj_GOODSstock,sum(hj_GOODSPACK) hj_GOODSPACK " +
",sum(hj_GOODSPACKPFSL) hj_GOODSPACKPFSL,sum(hj_GOODSpackstock) hj_GOODSpackstock,sum(GOODSNUM) GOODSNUM,sum(WeiWanShui) WeiWanShui " +
"from " +
"(select vws.*,vs.ETD from vw_wms_stocktake vws left join v_op_bs vs on vs.BSNO=vws.ASSOCIATEDNO ";
var wherestr = this.getCondition();
if (wherestr != '') {
sql1 += "where 1=1 and " + wherestr;
};
sql1 += ")t1 group by corpid,goodsname,chargeunit,ISBONDED ";
}
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
return ret;
}
//
});