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/MvcShipping/Viewsjs/MsRptOpHdProfit/MsRptOpHdProfitIndex.js

1830 lines
76 KiB
JavaScript

3 years ago
//集运管理-路单查询
Ext.namespace('Shipping');
Shipping.MsRptOpHdProfitIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsRptOpHdProfitIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsRptOpHdProfitIndex, Ext.Panel, {
PageSize: 100,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '1=2',
bslistsortfield: '',
bslistsortdire: '',
initUIComponents: function () {
Ext.Ajax.timeout = 120000;
this.formname = 'MsRptOpHdProfitIndex';
this.storectndisp = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CtnDispModel',
proxy: { url: '/CommMng/BasicDataRef/GetCtnDisp' }
});
this.sqlcontext = '1=2';
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'BSNO', type: 'string' },
{ name: 'OPLB', type: 'string' },
{ name: 'OPLBNAME', type: 'string' },
{ name: 'OPTYPE', type: 'string' },
{ name: 'BSTYPE', type: 'string' },
{ name: 'FEESTATUSREF', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'CUSTFULLNAME', type: 'string' },
{ name: 'CUSTNO', type: 'string' },
{ name: 'MBLNO', type: 'string' },
{ name: 'HBLNO', type: 'string' },
{ name: 'ETD', type: 'string' },
{ name: 'VESSEL', type: 'string' },
{ name: 'VOYNO', type: 'string' },
{ name: 'INPUTBY', type: 'string' },
{ name: 'CREATETIME', type: 'string' },
{ name: 'BSSTATUS', type: 'string' },
{ name: 'SALE', type: 'string' },
{ name: 'OP', type: 'string' },
{ name: 'DOC', type: 'string' },
{ name: 'CUSTSERVICE', type: 'string' },
{ name: 'PORTLOAD', type: 'string' },
{ name: 'PORTDISCHARGE', type: 'string' },
{ name: 'CUSTOMNO', type: 'string' },
{ name: 'ACCDATE', type: 'string' },
{ name: 'CARRIER', type: 'string' },
{ name: 'BSSOURCE', type: 'string' },
{ name: 'LANE', type: 'string' },
{ name: 'FORWARDER', type: 'string' },
{ name: 'CNTRTOTAL', type: 'string' },
{ name: 'TRADETERM', type: 'string' },
{ name: 'GOODSNAME', type: 'string' },
{ name: 'OPDATE', type: 'string' },
{ name: 'CUSTOMDATE', type: 'string' },
{ name: 'ENTERP', type: 'string' },
{ name: 'REMARK', type: 'string' },
{ name: 'TRADETERM', type: 'string' },
{ name: 'CONSIGNEE', type: 'string' },
{ name: 'DESTINATION', type: 'string' },
{ name: 'BLFRT', type: 'string' },
{ name: 'MBLFRT', type: 'string' },
{ name: 'CNTRSEALNO', type: 'string' },
{ name: 'VESSEL2N', type: 'string' },
{ name: 'VOYNO2N', type: 'string' },
{ name: 'PKGS', type: 'number' },
{ name: 'CBM', type: 'number' },
{ name: 'KGS', type: 'number' },
{ name: 'NETWEIGHT', type: 'number' },
{ name: 'TEU', type: 'number' },
{ name: 'CNTR1', type: 'number' },
{ name: 'CNTR2', type: 'number' },
{ name: 'CNTR3', type: 'number' },
{ name: 'CNTR4', type: 'number' },
{ name: 'CNTR5', type: 'number' },
{ name: 'CNTR6', type: 'number' },
{ name: 'CNTR7', type: 'number' },
{ name: 'CNTR8', type: 'number' },
{ name: 'CNTR9', type: 'number' },
{ name: 'CNTR10', type: 'number' },
{ name: 'OTCNTR', type: 'number' },
{ name: 'USDHYFDR', type: 'number' },
{ name: 'USDHYFCCDR', type: 'number' },
{ name: 'USDDR', type: 'number' },
{ name: 'USDDCDL1CR', type: 'number' },
{ name: 'USDDCDL1CROBJ', type: 'string' },
{ name: 'USDDCDL2CR', type: 'number' },
{ name: 'USDDCDL2CROBJ', type: 'string' },
{ name: 'USDHYFCCCR', type: 'number' },
{ name: 'USDKODAICR', type: 'number' },
{ name: 'USDDZFCR', type: 'number' },
{ name: 'USDCR', type: 'number' },
{ name: 'RMBGZDR', type: 'number' },
{ name: 'RMBLYFDR', type: 'number' },
{ name: 'RMBCCDR', type: 'number' },
{ name: 'RMBDR', type: 'number' },
{ name: 'RMBCR', type: 'number' },
{ name: 'RMBDCDL1CR', type: 'number' },
{ name: 'RMBDCDL1CROBJ', type: 'string' },
{ name: 'RMBDCDL2CR', type: 'number' },
{ name: 'RMBDCDL2CROBJ', type: 'string' },
{ name: 'RMBDCDL3CR', type: 'number' },
{ name: 'RMBDCDL3CROBJ', type: 'string' },
{ name: 'RMBCZF1CR', type: 'number' },
{ name: 'RMBCZF1CROBJ', type: 'string' },
{ name: 'RMBCZF2CR', type: 'number' },
{ name: 'RMBCZF2CROBJ', type: 'string' },
{ name: 'RMBCZF3CR', type: 'number' },
{ name: 'RMBCZF3CROBJ', type: 'string' },
{ name: 'RMBLYF1CR', type: 'number' },
{ name: 'RMBLYF1CROBJ', type: 'string' },
{ name: 'RMBLYF2CR', type: 'number' },
{ name: 'RMBLYF2CROBJ', type: 'string' },
{ name: 'RMBLYF3CR', type: 'number' },
{ name: 'RMBLYF3CROBJ', type: 'string' },
{ name: 'RMBBGF1CR', type: 'number' },
{ name: 'RMBBGF1CROBJ', type: 'string' },
{ name: 'RMBBGF1CR', type: 'number' },
{ name: 'RMBBGF1CROBJ', type: 'string' },
{ name: 'RMBCD1CR', type: 'number' },
{ name: 'RMBCD1CROBJ', type: 'string' },
{ name: 'RMBCD2CR', type: 'number' },
{ name: 'RMBCD2CROBJ', type: 'string' },
{ name: 'RMBCD3CR', type: 'number' },
{ name: 'RMBCD3CROBJ', type: 'string' },
{ name: 'RMBBGFCR', type: 'number' },
{ name: 'RMBBGFCROBJ', type: 'string' },
{ name: 'RMBDZFCR', type: 'number' },
{ name: 'RMBSUBTTLCR', type: 'number' },
{ name: 'RMBOTCR', type: 'number' },
{ name: 'RMBPROFIT', type: 'number' },
{ name: 'USDPROFIT', type: 'number' }
],
remoteSort: true,
proxy: {
type: 'ajax',
timeout: 120000,
url: '/MvcShipping/MsRptOpHdProfit/BsListData',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.initgirdcolums = [{
sortable: true,
dataIndex: 'BSNO',
text: '编号',
hidden: true,
width: 130
}, {
sortable: true,
dataIndex: 'OPTYPE',
text: Zi.LAN.OPTYPE,
width: 136
}, {
sortable: true,
dataIndex: 'CARRIER',
text: Zi.LAN.CARRIER,
width: 136
}, {
sortable: true,
dataIndex: 'CUSTNO',
text: Zi.LAN.CUSTNO,
width: 136
}, {
sortable: true,
dataIndex: 'MBLNO',
text: Zi.LAN.MBLNO,
width: 120
}, {
sortable: true,
dataIndex: 'HBLNO',
text: Zi.LAN.HBLNO,
width: 120
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
text: Zi.LAN.CUSTOMERNAME,
width: 120
}, {
sortable: true,
dataIndex: 'CONSIGNEE',
text: Zi.LAN.CONSIGNEE,
width: 120
}, {
sortable: true,
dataIndex: 'ETD',
text: Zi.LAN.ETD,
width: 86
}, {
sortable: true,
dataIndex: 'PORTLOAD',
text: Zi.LAN.PORTLOAD,
width: 80
}, {
sortable: true,
dataIndex: 'PORTDISCHARGE',
text: Zi.LAN.PORTDISCHARGE,
width: 150
}, {
sortable: true,
dataIndex: 'DESTINATION',
text: Zi.LAN.DESTINATION,
width: 150
}, {
sortable: true,
dataIndex: 'VESSEL',
text: Zi.LAN.VESSEL,
width: 200
}, {
sortable: true,
dataIndex: 'VOYNO',
text: Zi.LAN.VOYNO,
width: 50
}, {
sortable: true,
dataIndex: 'VESSEL2N',
text: Zi.LAN.VESSEL2N,
width: 200
}, {
sortable: true,
dataIndex: 'VOYNO2N',
text: Zi.LAN.VOYNO2N,
width: 50
}, {
sortable: true,
dataIndex: 'TRADETYPE',
text: Zi.LAN.TRADETYPE,
width: 120
}, {
sortable: true,
dataIndex: 'BLFRT',
text: Zi.LAN.BLFRT,
width: 120
}, {
sortable: true,
dataIndex: 'MBLFRT',
text: Zi.LAN.MBLFRT,
width: 120
}, {
sortable: true,
dataIndex: 'CNTRSEALNO',
text: Zi.LAN.CNTRSEALNO,
width: 120
},
{
sortable: true,
id: '',
dataIndex: 'CNTR1',
text: '箱型1',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR2',
text: '箱型2',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR3',
text: '箱型3',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR4',
text: '箱型4',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR5',
text: '箱型5',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR6',
text: '箱型6',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR7',
text: '箱型7',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR8',
text: '箱型8',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR9',
text: '箱型9',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR10',
text: '箱型10',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'OTCNTR',
text: Zi.LAN.OTCNTR,
width: 60
}, {
text: Zi.LAN.ALLINUSDDR,
dataIndex: 'ALLINUSDDR',
columns: [{
sortable: true,
dataIndex: 'USDHYFDR',
text: '应收海运费',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDHYFCCDR',
text: '海运费(东京收)',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDDR',
text: '应收合计',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
}, {
text: '应付海运费',
dataIndex: 'ALLINUSDCR',
columns: [{
sortable: true,
dataIndex: 'USDDCDL1CR',
text: '应付海运费1',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
id: '',
dataIndex: 'USDDCDL1CROBJ',
text: '订舱代理1',
width: 60
},{
sortable: true,
dataIndex: 'USDDCDL2CR',
text: '应付海运费2',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
id: '',
dataIndex: 'USDDCDL2CROBJ',
text: '订舱代理2',
width: 60
}, {
sortable: true,
dataIndex: 'USDHYFCCCR',
text: '东京付海运',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
dataIndex: 'USDKODAICR',
text: '应付KODAI USA',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDDZFCR',
text: '单证费',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDCR',
text: '应付合计',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
}, {
text: '应收人民币',
dataIndex: 'ALLINRMBDR',
columns: [{
sortable: true,
dataIndex: 'RMBGZDR',
text: '港杂',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBLYFDR',
text: '陆运',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBCCDR',
text: '东京收',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBDR',
text: '合计',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
}, {
text: '应付人民币',
dataIndex: 'ALLINRMBCR',
columns: [
{
sortable: true,
dataIndex: 'RMBDCDL1CR',
text: '订舱代理费1',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
id: '',
dataIndex: 'RMBDCDL1CROBJ',
text: '订舱代理1',
width: 60
},{
sortable: true,
dataIndex: 'RMBDCDL2CR',
text: '订舱代理费2',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
id: '',
dataIndex: 'RMBDCDL2CROBJ',
text: '订舱代理2',
width: 60
},{
sortable: true,
dataIndex: 'RMBDCDL3CR',
text: '订舱代理费3',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
id: '',
dataIndex: 'RMBDCDL3CROBJ',
text: '订舱代理3',
width: 60
},{
sortable: true,
dataIndex: 'RMBCZF1CR',
text: '箱检费1',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
id: '',
dataIndex: 'RMBCZF1CROBJ',
text: '场站1',
width: 60
},{
sortable: true,
dataIndex: 'RMBCZF2CR',
text: '箱检费2',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
id: '',
dataIndex: 'RMBCZF2CROBJ',
text: '场站2',
width: 60
},{
sortable: true,
dataIndex: 'RMBCZF3CR',
text: '箱检费3',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
id: '',
dataIndex: 'RMBCZF3CROBJ',
text: '场站3',
width: 60
}, {
sortable: true,
dataIndex: 'RMBLYF1CR',
text: '陆运费1',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'RMBLYF1CROBJ',
text: '车队1',
width: 60
}, {
sortable: true,
dataIndex: 'RMBLYF2CR',
text: '陆运费2',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'RMBLYF2CROBJ',
text: '车队2',
width: 60
}, {
sortable: true,
dataIndex: 'RMBLYF3CR',
text: '陆运费3',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'RMBLYF3CROBJ',
text: '车队3',
width: 60
}, {
sortable: true,
dataIndex: 'RMBBGF1CR',
text: '报关费1',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
dataIndex: 'RMBBGF1CROBJ',
text: '报关行1',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBBGF2CR',
text: '报关费2',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
dataIndex: 'RMBBGF2CROBJ',
text: '报关行2',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBCD1CR',
text: '舱单费1',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
dataIndex: 'RMBCD1CROBJ',
text: '船代1',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBCD2CR',
text: '舱单费2',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
dataIndex: 'RMBCD2CROBJ',
text: '船代2',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBCD3CR',
text: '舱单费3',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
dataIndex: 'RMBCD3CROBJ',
text: '船代3',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBDZFCR',
text: '单证费',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBBXFCR',
text: '保险费',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
},{
sortable: true,
dataIndex: 'RMBBXFCROBJ',
text: '保险公司',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBSUBTTLCR',
text: '小计',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
},{
sortable: true,
dataIndex: 'RMBOTDR',
text: '应收其他',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBOTCR',
text: '应付其他',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBCR',
text: '应付人民币合计',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
text: '利润',
dataIndex: 'ALLINPR',
columns: [{
sortable: true,
dataIndex: 'RMBPROFIT',
text: 'RMB利润',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDPROFIT',
text: 'USD利润',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
}, {
sortable: true,
dataIndex: 'REMARK',
text: Zi.LAN.REMARK,
width: 120
}
];
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: '每页记录数',
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
// this.girdcolums = this.initgirdcolums;
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.initgirdcolums, 1);
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: this.girdcolums,
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum]
});
// this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.girdcolums, 1);
// this.gridList.reconfigure(this.storeList, this.girdcolums);
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
if (record.data.OPLBNAME == "报关业务") {
openUrl = "../MvcShipping/MsOpApply/ApplyFeeView?handle=check&bsno=" + record.data.BSNO;
} else {
openUrl = "../MvcShipping/MsOpBill/MsOpFeeView?handle=check&bsno=" + record.data.BSNO;
}
window.open(openUrl, openType, openSet);
}, this);
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
this.bslistsortfield = column.dataIndex;
this.bslistsortdire = direction;
}, this);
//#region formSearch
//#region formSearch枚举参照相关
_this = this;
this.StoreOpLb = Ext.create('DsExt.ux.RefEnumStore', {});
this.StoreOpLb.load({ params: { enumTypeId: 96005} });
this.comboxOpLb = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_OPLB,
store: this.StoreOpLb,
forceSelection: true,
name: 'PS_OPLB',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeBsType = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeBsType.load({ params: { enumTypeId: 96004} });
this.comboxBsType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_BSTYPE,
store: this.storeBsType,
name: 'PS_BSTYPE',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeSalesCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeSalesCode.load();
this.comboxSalesCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_SALE,
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_SALE',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.comboxOp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_OP,
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_OP',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.comboxCUSTSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_CUSTSERVICE,
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_CUSTSERVICE',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_CUSTOMERNAME,
store: this.storeCustCode,
name: 'PS_CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeEnterpCode = Ext.create('DsExt.ux.RefTableStore', {
fields: [
{ name: 'CUSTOMER', type: 'string' },
{ name: 'ENTERPID', type: 'string' }
],
proxy: { url: '/MvcShipping/MsOpApply/GetENTERPLIST' }
});
this.storeEnterpCode.load();
this.comboxEnterp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_ENTERP,
store: this.storeEnterpCode,
name: 'PS_ENTERP',
valueField: 'CUSTOMER',
displayField: 'CUSTOMER',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//业务来源
this.storeSource = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.SourceModel',
proxy: { url: '/CommMng/BasicDataRef/GetSource' }
});
this.storeSource.load();
this.storeSourceDetail = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.SourceDetailModel',
proxy: { url: '/CommMng/BasicDataRef/GetSourceDetail2' }
});
this.comboxBSSOURCE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.BSSOURCE,
store: this.storeSource,
forceSelection: true,
name: 'BSSOURCE',
valueField: 'SourceName',
displayField: 'SourceName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var recs = DsStoreQueryBy(this.storeSource, 'SourceID', records[0].data.SourceID);
if (recs.getCount() > 0) {
var data = recs.getAt(0).data;
var s = "SOURCEID='" + data.SourceID + "'";
this.storeSourceDetail.load({ params: { condition: s} });
} else {
var BSSOURCEDETAIL = this.formSearch.getForm().findField('BSSOURCEDETAIL');
BSSOURCEDETAIL.setValue('');
}
}
}
}
});
this.storeSourceDetail.load();
this.comboxBSSOURCEDETAIL = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.BSSOURCEDETAIL,
store: this.storeSourceDetail,
forceSelection: true,
name: 'BSSOURCEDETAIL',
valueField: 'SourceDetail',
displayField: 'SourceDetail',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
Ext.define('SubComp', {
extend: 'Ext.data.Model',
fields: [
{ name: 'GID', type: 'string' },
{ name: 'NAME', type: 'string' },
{ name: 'ENNAME', type: 'string' }
]
});
this.StoreSubComp = Ext.create('DsExt.ux.RefTableStore', {
model: 'SubComp',
proxy: { url: '/MvcShipping/MsBaseInfo/GetCompanyEN' }
});
this.StoreSubComp.load({ params: { condition: ""} });
this.comboxSubComp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.CORPID,
store: this.StoreSubComp,
name: 'SUBCOMP',
// flex: 0.5,
// labelWidth: 55,
valueField: 'GID',
displayField: 'NAME',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.StoreFeeLock = Ext.create('Ext.data.Store', {
fields: ['OpLb']
});
this.StoreFeeLock.add({ "OpLb": "全部" });
this.StoreFeeLock.add({ "OpLb": "已锁定" });
this.StoreFeeLock.add({ "OpLb": "未锁定" });
this.comboxFeeLock = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.FEESTATUSREF,
store: this.StoreFeeLock,
forceSelection: true,
name: 'PS_FEELOCK',
flex: 0.8,
// flex: 0.5,
// labelWidth: 55,
valueField: 'OpLb',
displayField: 'OpLb',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeINVSTATUS = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeINVSTATUS.add({ "FSTATUS": "", "NAME": "全部" });
this.storeINVSTATUS.add({ "FSTATUS": "0", "NAME": "仅开票" });
this.storeINVSTATUS.add({ "FSTATUS": "1", "NAME": "仅不开票" });
this.comboxINVSTATUS = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.INVSTATUS,
store: this.storeINVSTATUS,
valueField: 'FSTATUS',
displayField: 'NAME',
flex: 0.7,
labelWidth: 55,
forceSelection: true,
name: 'ISINVOICE',
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeISADVANCEDPAY = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeISADVANCEDPAY.add({ "FSTATUS": "", "NAME": "全部" });
this.storeISADVANCEDPAY.add({ "FSTATUS": "0", "NAME": "仅未垫付" });
this.storeISADVANCEDPAY.add({ "FSTATUS": "1", "NAME": "仅垫付" });
this.comboxISADVANCEDPAY = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.ISADVANCEDPAY, //是否开垫付
store: this.storeISADVANCEDPAY,
valueField: 'FSTATUS',
displayField: 'NAME',
forceSelection: true,
name: 'ISADVANCEDPAY',
flex: 0.8,
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.CheckAmend = new Ext.form.Checkbox({
fieldLabel: Zi.LAN.AMEND,
checked: false,
flex: 0.7,
});
this.storeHYF = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeHYF.add({ "FSTATUS": "", "NAME": "包括" });
this.storeHYF.add({ "FSTATUS": "0", "NAME": "不包括" });
this.comboxHYF = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.HYF,
store: this.storeHYF,
valueField: 'FSTATUS',
displayField: 'NAME',
// flex: 0.7,
// labelWidth: 55,
forceSelection: true,
name: 'ISHYF',
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeVoyVeg = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.VesselModel',
proxy: { url: '/CommMng/BasicDataRef/GetVesselList' }
});
this.storeVoyVeg.load({ params: { condition: ""} });
this.comboxVoyVeg = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.VESSEL,
store: this.storeVoyVeg,
valueField: 'VESSEL',
flex: 1.5,
name: 'PS_VESSEL',
displayField: 'VESSEL',
enableKeyEvents: true,
listeners: {
keyup: 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: 80,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxOpLb, {
fieldLabel: Zi.LAN.PS_MBLNO,
name: 'PS_MBLNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxVoyVeg, {
fieldLabel: Zi.LAN.VOYNO,
name: 'PS_VOYNO',
labelWidth: 40,
flex: 0.5,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.GOODSNAME,
name: 'PS_GOODSNAME',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxOp, this.comboxSubComp
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxBsType, this.comboxSalesCode, this.comboxCustCode, {
fieldLabel: Zi.LAN.PS_EXPDATEBGN,
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.PS_EXPDATEEND,
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxBSSOURCE, this.comboxEnterp
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.PS_ACCDATEBGN,
xtype: 'monthfield',
name: 'PS_ACCDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.PS_ACCDATEEND,
xtype: 'monthfield',
name: 'PS_ACCDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxBSSOURCEDETAIL, this.comboxCUSTSERVICE, this.comboxFeeLock, this.comboxINVSTATUS, this.comboxISADVANCEDPAY,this.CheckAmend
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//查询工具条
this.CheckSaveQuery = new Ext.form.Checkbox({
fieldLabel: Zi.LAN.SaveQuery,
checked: true,
width: 120
});
_this = this;
this.SearchBtn = new Ext.Button({
text: Zi.LAN.HideQuery,
handler: function () {
if (_this.SearchBtn.text == Zi.LAN.HideQuery) {
_this.panelSearch.hide();
_this.SearchBtn.setText(Zi.LAN.SearchBtn2);
} else {
_this.panelSearch.show();
_this.SearchBtn.setText(Zi.LAN.HideQuery);
}
}
});
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: Zi.LAN.Refresh,
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
var isvisible = true;
var issavevalue = false;
if (_this.SearchBtn.text == Zi.LAN.HideQuery)
isvisible = true
else
isvisible = false;
if (this.CheckSaveQuery.checked)
issavevalue = true
saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue);
},
scope: this
}, {
text: Zi.LAN.btnExportExcel,
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-',
{
text: Zi.LAN.btnprint,
iconCls: 'btnprint',
handler: function (button, event) {
this.Print();
},
scope: this
}, '-', this.SearchBtn, {
xtype: 'button',
width: 90,
text: Zi.LAN.ClearSql,
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, '-', {
xtype: 'button',
text: Zi.LAN.DsQuery,
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getCondition();
var winAccess = new Shipping.DsQuery({
});
winAccess.StoreList = this.storeList;
winAccess.formname = this.formname;
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}, '-', this.CheckSaveQuery, '-', {
text: Zi.LAN.SaveGrid,
id: "btntest",
menu: [
{
text: Zi.LAN.SaveGrid2,
handler: function (button, event) {
_this.onSaveGridClick(button, event);
}
}, {
text: Zi.LAN.InitGrid,
handler: function (button, event) {
_this.oninitGridClick(button, event);
}
}],
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 29,
items: [this.panelBtn]
});
this.panelSearch = new Ext.Panel({
layout: "border",
region: "north",
height: 96,
items: [this.formSearch]
});
this.panelBodyChFee = new Ext.Panel({
title: Zi.LAN.BodyChFee,
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.gridList]
});
this.tabpanel = new Ext.TabPanel
({
activeTab: 0,
autoWidth: true,
border: false,
frame: false,
region: 'center',
id: "TabPanelID",
enableTabScroll: true,
items:
[
this.panelBodyChFee
]
});
Ext.apply(this, {
items: [this.panelTop, this.panelSearch, this.tabpanel]
});
_this = this;
this.storectndisp.load({ params: { condition: "" },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
_this.InitGrid(_this.girdcolums, _this.gridList, _this.storeList);
}
}
},
scope: this
});
_this = this;
this.storeList.on('beforeload', function (store) {
var amendstr='false';
if (this.CheckAmend.checked==true) amendstr='true';
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext,amendstr:amendstr });
}, this);
LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery);
}, //end initUIComponents
InitGrid: function (grid, thgridList, thstoreList) {
var agirdcolums = grid;
for (i = 0; i < this.storectndisp.getCount(); i += 1) {
var itemindex = i + 1;
var memberyf = this.storectndisp.getAt(i);
for (var j = 0; j < agirdcolums.length; j++) {
if (agirdcolums[j].dataIndex == 'CNTR1') {
if (memberyf.data.CNT1 != '' && memberyf.data.CNT1 != null) {
agirdcolums[j].text = memberyf.data.CNT1;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR2') {
if (memberyf.data.CNT2 != '' && memberyf.data.CNT2 != null) {
agirdcolums[j].text = memberyf.data.CNT2;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR3') {
if (memberyf.data.CNT3 != '' && memberyf.data.CNT3 != null) {
agirdcolums[j].text = memberyf.data.CNT3;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR4') {
if (memberyf.data.CNT4 != '' && memberyf.data.CNT4 != null) {
agirdcolums[j].text = memberyf.data.CNT4;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR5') {
if (memberyf.data.CNT5 != '' && memberyf.data.CNT5 != null) {
agirdcolums[j].header = memberyf.data.CNT5;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR6') {
if (memberyf.data.CNT6 != '' && memberyf.data.CNT6 != null) {
agirdcolums[j].text = memberyf.data.CNT6;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR7') {
if (memberyf.data.CNT7 != '' && memberyf.data.CNT7 != null) {
agirdcolums[j].text = memberyf.data.CNT7;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR8') {
if (memberyf.data.CNT8 != '' && memberyf.data.CNT8 != null) {
agirdcolums[j].text = memberyf.data.CNT8;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR9') {
if (memberyf.data.CNT9 != '' && memberyf.data.CNT9 != null) {
agirdcolums[j].text = memberyf.data.CNT9;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR10') {
if (memberyf.data.CNT10 != '' && memberyf.data.CNT10 != null) {
agirdcolums[j].text = memberyf.data.CNT10;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
}
};
thgridList.reconfigure(thstoreList, agirdcolums);
},
onRefreshClick: function (button, event) {
if (!this.checkSearchCondition())
return;
var sql = this.getCondition();
this.sqlcontext = sql;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
var amendstr='false';
if (this.CheckAmend.checked==true) amendstr='true';
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql,amendstr:amendstr },
waitMsg: "正在查询数据...",
scope: this
});
},
onDsQuery: function (button, event) {
var sql = this.sqlcontext;
var amendstr='false';
if (this.CheckAmend.checked==true) amendstr='true';
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql,amendstr:amendstr },
waitMsg: "正在查询数据...",
scope: this
});
},
getCondition: function () {
var form = this.formSearch.getForm();
var sql = " isnull(B.ISCANCEL,0)<>1 ";//退舱
3 years ago
/*
var sqldata = form.getValues();
sql = Ext.JSON.encode(sqldata);
*/
var mblNo = form.findField('PS_MBLNO').getValue();
2 years ago
sql = sql + getAndConSql(sql, mblNo, " (isnull(b.CUSTNO,'')+' '+isnull(b.MBLNO,'')+' '+isnull(b.HBLNO,'')+' '+isnull(b.CUSTOMNO,'')+' '+isnull(b.ORDERNO,'') like '%" + mblNo + "%') ");
3 years ago
//var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue();
//sql = sql + getAndConSql(sql, expDate_Min, " B.OPDATE>='" + expDate_Min + "'");
//var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
//sql = sql + getAndConSql(sql, expDate_Max, " B.OPDATE<='" + expDate_Max + " 23:59:59'");
var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, expDate_Min, " B.ETD>='" + expDate_Min + "'");
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
sql = sql + getAndConSql(sql, expDate_Max, " B.ETD<='" + expDate_Max + " 23:59:59'");
// var etdDate_Min = form.findField('PS_ETDDATEBGN').getRawValue();
// sql = sql + getAndConSql(sql, etdDate_Min, " B.ETD>='" + etdDate_Min + "'");
// var etdDate_Max = form.findField('PS_ETDDATEEND').getRawValue();
// sql = sql + getAndConSql(sql, etdDate_Max, " B.ETD<='" + etdDate_Max + " 23:59:59'");
var accDate_Min = form.findField('PS_ACCDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, accDate_Min, " B.ACCDATE>='" + accDate_Min + "'");
var accDate_Max = form.findField('PS_ACCDATEEND').getRawValue();
sql = sql + getAndConSql(sql, accDate_Max, " B.ACCDATE<='" + accDate_Max + "'");
var ENTERP = form.findField('PS_ENTERP').getValue();
sql = sql + getAndConSql(sql, ENTERP, "B.ENTERP='" + ENTERP + "'");
var CUSTOMERNAME = form.findField('PS_CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "B.CUSTOMERNAME='" + CUSTOMERNAME + "'");
var SALE = form.findField('PS_SALE').getValue();
sql = sql + getAndConSql(sql, SALE, "B.SALE='" + SALE + "'");
var OP = form.findField('PS_OP').getValue();
sql = sql + getAndConSql(sql, OP, "B.OP='" + OP + "'");
var BSTYPE = form.findField('PS_BSTYPE').getValue();
sql = sql + getAndConSql(sql, BSTYPE, "B.BSTYPE='" + BSTYPE + "'");
var OPLB = form.findField('PS_OPLB').getValue();
sql = sql + getAndConSql(sql, OPLB, "B.OPLBNAME='" + OPLB + "'");
var SUBCOMP = form.findField('SUBCOMP').getValue();
sql = sql + getAndConSql(sql, SUBCOMP, "B.CORPID='" + SUBCOMP + "'");
var PS_CUSTSERVICE = form.findField('PS_CUSTSERVICE').getValue();
sql = sql + getAndConSql(sql, PS_CUSTSERVICE, "B.CUSTSERVICE='" + PS_CUSTSERVICE + "'");
var VESSEL = form.findField('PS_VESSEL').getValue();
sql = sql + getAndConSql(sql, VESSEL, "B.VESSEL like '%" + VESSEL + "%'");
var VOYNO = form.findField('PS_VOYNO').getValue();
sql = sql + getAndConSql(sql, VOYNO, "B.VOYNO like '%" + VOYNO + "%'");
var GOODSNAME = form.findField('PS_GOODSNAME').getValue();
sql = sql + getAndConSql(sql, GOODSNAME, "B.GOODSNAME like '%" + GOODSNAME + "%'");
var BSSOURCE = form.findField('BSSOURCE').getValue();
sql = sql + getAndConSql(sql, BSSOURCE, "B.BSSOURCE='" + BSSOURCE + "'");
var BSSOURCEDETAIL = form.findField('BSSOURCEDETAIL').getValue();
sql = sql + getAndConSql(sql, BSSOURCEDETAIL, "B.BSSOURCEDETAIL='" + BSSOURCEDETAIL + "'");
var ISINVOICE = form.findField('ISINVOICE').getValue();
sql = sql + getAndConSql(sql, ISINVOICE, "G.ISINVOICE=" + ISINVOICE);
var ISADVANCEDPAY = form.findField('ISADVANCEDPAY').getValue();
sql = sql + getAndConSql(sql, ISADVANCEDPAY, "G.ISADVANCEDPAY=" + ISADVANCEDPAY);
var PS_FEELOCK = form.findField('PS_FEELOCK').getValue();
if (PS_FEELOCK == '已锁定')
sql = sql + getAndConSql(sql, PS_FEELOCK, "B.FEESTATUS=1");
else if (PS_FEELOCK == '未锁定')
sql = sql + getAndConSql(sql, PS_FEELOCK, "B.FEESTATUS=0");
// var ISHYF = form.findField('ISHYF').getValue();
// if (ISHYF == '0') {
// sql = sql + getAndConSql(sql, ISHYF, " NOT EXISTS (select 1 from ch_fee WHERE B.BSNO=ch_fee.BSNO AND ch_fee.FEENAME='海运费') ");
// }
return sql;
},
checkSearchCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return false;
}
return true;
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.SelectedRecord.data.BSNO;
ret[4] = "MsRptOpHdProfitIndex";
return ret;
},
onSaveGridClick: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, this.formname + 'bs', this.gridList.columns, this.girdcolums, 1, true);
},
oninitGridClick: function (button, event) {
var agirdcolums = this.initgirdcolums;
this.gridList.reconfigure(this.storeList, agirdcolums);
this.girdcolums = DsTruck.SaveGridPanel(USERID, this.formname + 'bs', this.gridList.columns, this.initgirdcolums, 1, true);
this.gridListSum.reconfigure(this.storeSumList, this.initgridlistsumcolumn);
this.gridlistsumcolumn = DsTruck.SaveGridPanel(USERID, this.formname + 'bssourcedetail', this.gridListSum.columns, this.initgridlistsumcolumn, 1, true);
},
onExportClick: function (button, event) {
grid2Excel(this.gridList, "业务利润");
}
,
Print: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var sortstr = ' B.ETD DESC';
if (this.bslistsortfield != '' && this.bslistsortdire != '') {
sortstr = this.bslistsortfield + ' ' + this.bslistsortdire;
}
var amendstr='false';
if (this.CheckAmend.checked==true) amendstr='true';
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcShipping/MsRptOpHdProfit/BsListData',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: _this.sqlcontext,
printstr: 'true',
sortstr: sortstr,amendstr:amendstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.Data;
var condition = jsonresult.Message;
if (condition != '') condition = ' where ' + condition;
var printType = 'MSRPTHDPROFITLIST';
var sql1 = returnstr;
var sql2 = "";
var sql3 = "select CUSTOMERNAME,COUNT(BSNO) BLCOUNT,SUM(TEU) TEU from V_OP_BILL where BSNO IN (SELECT distinct B.BSNO FROM V_OP_BILL B LEFT JOIN v_op_gain_sum_INV G ON (G.BSNO=B.BSNO) " + condition + ") group by CUSTOMERNAME";
var sql4 = "select CARRIER,COUNT(BSNO) BLCOUNT,SUM(TEU) TEU from V_OP_BILL where BSNO IN (SELECT distinct B.BSNO FROM V_OP_BILL B LEFT JOIN v_op_gain_sum_INV G ON (G.BSNO=B.BSNO) " + condition + ") group by CARRIER";
var sql5 = "select OP,COUNT(BSNO) BLCOUNT,SUM(TEU) TEU from V_OP_BILL where BSNO IN (SELECT distinct B.BSNO FROM V_OP_BILL B LEFT JOIN v_op_gain_sum_INV G ON (G.BSNO=B.BSNO) " + condition + ") group by OP";
var sql6 = "select COUNT(BSNO) BLCOUNT,SUM(TEU) TEU from V_OP_BILL where BSNO IN (SELECT distinct B.BSNO FROM V_OP_BILL B LEFT JOIN v_op_gain_sum_INV G ON (G.BSNO=B.BSNO) " + condition + ") ";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}
});