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.

186 lines
7.0 KiB
JavaScript

Ext.namespace('Shipping');
Shipping.SeaiFee = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.SeaiFee.superclass.constructor.call(this);
};
Ext.extend(Shipping.SeaiFee, Ext.Panel, {
ParentWin: null,
OpStatus: 'add',
StoreList: null,
EditRecord: null,
region: 'north',
initUIComponents: function () {
//枚举参照相关
//编辑form
this.storebill = Ext.create('Ext.data.Store', {
model: 'MsSeai',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsSeaiFee/GetBLData',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
var condition = " BsNo='" + getUrlParam('id') + "'";
this.formEdit = Ext.widget('form', {
frame: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [{
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [
{ xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '委托编号',
readOnly: true,
name: 'CUSTNO'
}, {
fieldLabel: '主提单号',
readOnly: true,
name: 'MBLNO'
}, {
fieldLabel: '箱型箱量',
readOnly: true,
name: 'CNTRTOTAL'
}, {
fieldLabel: '业务来源',
readOnly: true,
name: 'BSSOURCE'
}]
},
{ xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '揽货人',
readOnly: true,
name: 'SALE'
}, {
fieldLabel: '委托单位',
readOnly: true,
name: 'CUSTOMERNAME'
}, {
fieldLabel: '卸货港',
readOnly: true,
name: 'PORTDISCHARGE'
}, {
fieldLabel: '贸易方式',
readOnly: true,
name: 'TRADETYPE'
}]
},
{ xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '品名',
readOnly: true,
name: 'GOODSNAME'
}, {
fieldLabel: '净重',
readOnly: true,
name: 'NETWEIGHT'
}, {
fieldLabel: '',
xtype: 'hiddenfield',
flex: 2
}]
}]
}]
}); //end this.formEdit
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 120,
id: "BillHead",
items: [this.formEdit]
});
this.panelFee = new Shipping.FeeEditGrid({
region: 'center',
layout: 'border'
});
this.storebill.load({ params: { condition: condition },
callback: function (r, options, success) {
if (success) {
if (r.length == 1) {
this.formEdit.getForm().loadRecord(this.storebill.getAt(0));
this.panelFee.EditRecord = this.storebill.getAt(0);
}
}
},
scope: this
});
this.bsno = getUrlParam('id');
this.panelFee.strBSNO = this.bsno;
this.panelFee.stroplb = 'op_Seai';
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "WTDW-委托单位", "CUSTTYPE": "委托单位", "CUSTNAME": "CUSTOMERNAME" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CGS-船公司", "CUSTTYPE": "船公司", "CUSTNAME": "CARRIER" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "DCDL-订舱代理", "CUSTTYPE": "订舱代理", "CUSTNAME": "FORWARDER" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "BGH-报关行", "CUSTTYPE": "报关行", "CUSTNAME": "CUSTOMSER" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CD-车队", "CUSTTYPE": "车队", "CUSTNAME": "TRUCKER" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "FHR-发货人", "CUSTTYPE": "发货人", "CUSTNAME": "SHIPPERID" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "SHR-收货人", "CUSTTYPE": "收货人", "CUSTNAME": "CONSIGNEEID" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "TZR-通知人", "CUSTTYPE": "通知人", "CUSTNAME": "NOTIFYPARTYID" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "DL-代理", "CUSTTYPE": "代理", "CUSTNAME": "AGENTID" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CZ-场站", "CUSTTYPE": "场站", "CUSTNAME": "YARD" });
this.panelFee.StoreDrOpRange.load({ params: { optype: "modSeaiRecvFeeManagement"} });
this.panelFee.StoreCrOpRange.load({ params: { optype: "modSeaiPayFeeManagement"} });
this.panelFee.storeFeeNameRef.load({ params: { condition: "ISSEA='1' "} });
this.panelFee.StoreDateCurr.load({ params: { optype: "op_Seai", bsno: this.bsno} });
this.panelFee.StoreUnit.load({ params: { bsno: this.bsno} });
this.panelFee.storeDrChFee.load({ params: { billno: this.bsno, type: 1, optype: "op_Seai"} });
this.panelFee.storeCrChFee.load({ params: { billno: this.bsno, type: 2, optype: "op_Seai"} });
this.panelFee.storeBodySum.load({ params: { bsno: this.bsno, optype: "op_Seai"} });
this.panelFee.storeChFeeGain.load({ params: { bsno: this.bsno, optype: "op_Seai"} });
// this.panelFee.storeChFeeGain.load({ params: { bsno: this.bsno },
// callback: function (r, options, success) {
// if (success) {
// this.panelFee.formtotal.getForm().loadRecord(this.panelFee.storeChFeeGain.getAt(0));
// }
// },
// scope: this
// });
Ext.apply(this, {
items: [this.panelTop, this.panelFee]
});
}
});