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/MsOpSeae/MsOpSeaeEditView.js

4301 lines
162 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('Shipping');
Shipping.MsOpSeaeView = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpSeaeView.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpSeaeView, Ext.Panel, {
ParentWin: null,
OpStatus: 'add',
StoreList: null,
editRecord: null,
Editdata: null,
stroplb: '海运出口',
initUIComponents: function () {
this.serialNo = 0;
//this.bodyDel = [];
this.itemindex = 1;
this.initloaddata = 0;
this.bsno = getUrlParam('bsno');
this.HSGID = getUrlParam('HSGID');
//#region 信息加载
this.storeDefValue = Ext.create('Ext.data.Store', {
model: 'DsShipping.ux.OpDefValue',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeOpDef/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeMustBe = Ext.create('Ext.data.Store', {
model: 'DsShipping.ux.OpDefValue',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeOpMustField/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//权限范围
this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' }
});
this.StoreOpRange.load({ params: { optype: "modOrderManagement"} });
//客户加载_场站
this.storeYARD = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
//船公司
this.comboxYARD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '场站',
store: this.storeYARD,
name: 'YARD',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//客户加载_船公司
this.storeCARRIER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
//船公司
this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船公司',
store: this.storeCARRIER,
name: 'CARRIER',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//客户加载_订舱代理
this.storeFORWARDER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
//船公司
this.comboxFORWARDER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '订舱代理',
store: this.storeFORWARDER,
name: 'FORWARDER',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.storePKGTYPE = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsExtEnumModel',
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
});
this.storePKGTYPE.load({ params: { enumTypeId: 97011} });
this.comboxPKGTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '装箱类型',
store: this.storePKGTYPE,
name: 'PACKINGTYPE',
valueField: 'EnumValueName',
displayField: 'EnumValueName'
});
//客户加载_仓库
this.storeWAREHOUSE = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
//车队
this.comboxWAREHOUSE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '仓库',
store: this.storeWAREHOUSE,
name: 'WAREHOUSE',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//客户加载_车队
this.storeTRUCKER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
//车队
this.comboxTRUCKER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '车队',
store: this.storeTRUCKER,
name: 'TRUCKER',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//客户加载_报关报检
this.storeCUSTOMSER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
//报关行
this.comboxCUSTOMSER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '报关行',
store: this.storeCUSTOMSER,
name: 'CUSTOMSER',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//键值维护表_装运方式
this.StoreBLTYPE = Ext.create('Ext.data.Store', {
fields: ['BLTYPE']
});
this.StoreBLTYPE.add({ "BLTYPE": "整箱" });
this.StoreBLTYPE.add({ "BLTYPE": "拼箱主票" });
this.StoreBLTYPE.add({ "BLTYPE": "拼箱分票" });
this.StoreBLTYPE.add({ "BLTYPE": "拼箱单票" });
this.comboxBLTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '装运方式',
store: this.StoreBLTYPE,
name: 'BLTYPE',
valueField: 'BLTYPE',
displayField: 'BLTYPE',
value: '整箱',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
if (combo.value == "拼箱单票" || combo.value == "拼箱分票") {
if (this.storeBodyList.getCount() > 0) {
combo.setValue(combo.originalValue);
alert("拼箱单票、拼箱分票是不允许添加集装箱信息的,因此请先删除集装箱信息!");
return;
}
else {
this.panelBodyCtn.hide();
}
}
else {
this.panelBodyCtn.show();
}
}
}
}
});
//品名
this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeGoodsModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsList' }
});
this.storeCodeGoodsList.load();
this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCodeGoodsList,
labelWidth: 250,
name: 'GOODSNAME',
valueField: 'GOODNAME',
displayField: 'CodeAndName'
});
//业务来源
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: '业务来源',
store: this.storeSource,
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.formHead.getForm().findField('BSSOURCEDETAIL');
BSSOURCEDETAIL.setValue('');
}
}
}
}
});
this.storeSourceDetail.load();
this.comboxBSSOURCEDETAIL = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '来源明细',
store: this.storeSourceDetail,
name: 'BSSOURCEDETAIL',
valueField: 'SourceDetail',
displayField: 'SourceDetail'
});
//所属部门
this.storeDept = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.DeptModel',
proxy: { url: '/CommMng/BasicDataRef/GetDeptList' }
});
this.storeDept.load();
this.comboxDept = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '所属部门',
store: this.storeDept,
name: 'SALEDEPT',
valueField: 'DeptName',
displayField: 'DeptName'
//,hidden: true
});
//件数包装
this.storeCodePackage = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodePackageModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodePackageList' }
});
this.storeCodePackage.load();
this.comboxKINDPKGS = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '包 装',
labelWidth: 35,
store: this.storeCodePackage,
padding: '0 0 0 10',
name: 'KINDPKGS',
valueField: 'PKGS',
displayField: 'PKGS',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var str_num = this.formEdit.getForm().findField('PKGS').getValue();
this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(str_num).toUpperCase() + ' ' + combo.value + ' ONLY.');
}
}
}
});
//件数包装_集装箱列表中的下拉框加载
this.comboxKINDPKGS_CTN = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '件数包装',
store: this.storeCodePackage,
name: 'KINDPKGS',
valueField: 'PKGS',
displayField: 'PKGS'
});
//箱型_集装箱列表中的下拉框加载
this.storeCodeCtn = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeCtnModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeCtnList' }
});
this.storeCodeCtn.load();
this.comboxCTNALL = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '箱型',
store: this.storeCodeCtn,
name: 'CTNALL',
valueField: 'CTN',
displayField: 'CTN'
});
//箱型_集装箱列表中的下拉框加载
this.storeLANE = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.Lane',
proxy: { url: '/CommMng/BasicDataRef/GetCodeLaneList' }
});
this.storeLANE.load();
this.comboxLANE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '航线',
store: this.storeLANE,
name: 'LANE',
valueField: 'LANE',
displayField: 'LANE'
});
//客户加载_发货人
this.storeShipper = Ext.create('DsExt.ux.RefTableStore', {
model: 'OpSeaeShipper',
proxy: { url: '/MvcShipping/MsOpSeae/GetShipperList' }
});
// this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} });
//发货人
this.comboxShipper = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: 'Shipper (发货人)',
store: this.storeShipper,
labelWidth: 150,
labelAlign: 'left',
name: 'SHIPPERID',
valueField: 'SHORTNAME',
displayField: 'CodeAndName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var selectrecords = DsStoreQueryBy(this.storeShipper, 'SHORTNAME', combo.value);
if (selectrecords.getCount() > 0) {
var selectdata = selectrecords.getAt(0).data;
this.formEdit.getForm().findField('SHIPPER').setValue(selectdata.SHIPPERDETAIL);
} else {
this.formEdit.getForm().findField('SHIPPER').setValue('');
}
}
}
}
});
//客户加载_收货人
this.storeConsignee = Ext.create('DsExt.ux.RefTableStore', {
model: 'OpSeaeShipper',
proxy: { url: '/MvcShipping/MsOpSeae/GetShipperList' }
});
// this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} });
//收货人
this.comboxConsignee = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: 'Consignee (收货人)',
labelWidth: 150,
labelAlign: 'left',
store: this.storeConsignee,
name: 'CONSIGNEEID',
valueField: 'SHORTNAME',
displayField: 'CodeAndName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var selectrecords = DsStoreQueryBy(this.storeConsignee, 'SHORTNAME', combo.value);
if (selectrecords.getCount() > 0) {
var selectdata = selectrecords.getAt(0).data;
this.formEdit.getForm().findField('CONSIGNEE').setValue(selectdata.SHIPPERDETAIL);
} else {
this.formEdit.getForm().findField('CONSIGNEE').setValue('');
}
}
}
}
});
//客户加载_通知人
this.storenotifyparty = Ext.create('DsExt.ux.RefTableStore', {
model: 'OpSeaeShipper',
proxy: { url: '/MvcShipping/MsOpSeae/GetShipperList' }
});
// this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} });
//通知人
this.comboxNotifyParty = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: 'Notify Party (通知人)',
store: this.storenotifyparty,
labelWidth: 150,
labelAlign: 'left',
name: 'NOTIFYPARTYID',
valueField: 'SHORTNAME',
displayField: 'CodeAndName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var selectrecords = DsStoreQueryBy(this.storenotifyparty, 'SHORTNAME', combo.value);
if (selectrecords.getCount() > 0) {
var selectdata = selectrecords.getAt(0).data;
this.formEdit.getForm().findField('NOTIFYPARTY').setValue(selectdata.SHIPPERDETAIL);
} else {
this.formEdit.getForm().findField('NOTIFYPARTY').setValue('');
}
}
}
}
});
//客户加载_代理
this.storeagent = Ext.create('DsExt.ux.RefTableStore', {
model: 'OpSeaeShipper',
proxy: { url: '/MvcShipping/MsOpSeae/GetShipperList' }
});
// this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} });
//收货人
this.comboxAgent = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '代 理',
store: this.storeagent,
name: 'AGENTID',
valueField: 'SHORTNAME',
displayField: 'CodeAndName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var selectrecords = DsStoreQueryBy(this.storeagent, 'SHORTNAME', combo.value);
if (selectrecords.getCount() > 0) {
var selectdata = selectrecords.getAt(0).data;
this.formEdit.getForm().findField('AGENT').setValue(selectdata.SHIPPERDETAIL);
} else {
this.formEdit.getForm().findField('AGENT').setValue('');
}
}
}
}
});
this.myCheckboxService = new Ext.form.CheckboxGroup({
id: 'myService',
xtype: 'checkboxgroup',
fieldLabel: '服务项目',
columns: 8,
items: [{
boxLabel: '熏蒸',
inputValue: true,
name: 'ISFUMIGATION',
id: 'ISFUMIGATION'
}, {
boxLabel: '仓储',
inputValue: true,
name: 'ISSTORAGE',
id: 'ISSTORAGE'
}, {
boxLabel: '陆运',
inputValue: true,
name: 'ISLAND',
id: 'ISLAND'
}, {
boxLabel: '报关',
inputValue: true,
name: 'ISCUSTOMS',
id: 'ISCUSTOMS'
}, {
boxLabel: '报检',
inputValue: true,
name: 'ISINSPECTION',
id: 'ISINSPECTION'
}, {
boxLabel: '订舱',
inputValue: true,
name: 'ISBOOKING',
id: 'ISBOOKING'
}, {
boxLabel: '使用代理',
inputValue: true,
name: 'ISAGENT',
id: 'ISAGENT'
}, {
boxLabel: '分单签单',
inputValue: true,
name: 'ISHBLNO',
id: 'ISHBLNO'
}
]
});
this.StoreStlName = Ext.create('Ext.data.Store', {
fields: ['STLNAME']
});
this.StoreStlName.add({ "STLNAME": "票结" });
this.StoreStlName.add({ "STLNAME": "半月结" });
this.StoreStlName.add({ "STLNAME": "月结" });
this.StoreStlName.add({ "STLNAME": "周结" });
this.comboxStlName = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreStlName,
fieldLabel: '结算方式',
name: 'STLNAME',
valueField: 'STLNAME',
displayField: 'STLNAME'
});
this.storeSaleCompany = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsCompanysEntity',
proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' }
});
this.storeSaleCompany.load({ params: { condition: "" } });
this.comboxSaleCompany = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel:'所属分部', //'委托分公司',
store: this.storeSaleCompany,
forceSelection: true,
readOnly: true,
name: 'SALECORPID',
valueField: 'GID',
displayField: 'NAME'
});
//#endregion
//#region 编辑formHead 基本信息
this.formHead = Ext.widget('form', {
region: 'north',
frame: true,
bodyPadding: 5,
collapsed: false,
collapsible: true,
trackResetOnLoad: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.BSNO2, //'业务编号',
name: 'BSNO', hidden: true
}, {
fieldLabel: Zi.LAN.MASTERNO, //'业务编号',
name: 'MASTERNO', hidden: true
}, {
fieldLabel: Zi.LAN.ORDERTYPE, //'订舱方式',
name: 'ORDERTYPE', hidden: true
}, {
fieldLabel: Zi.LAN.CREATETIME, //'CREATETIME',
name: 'CREATETIME', hidden: true
}, {
fieldLabel: Zi.LAN.INPUTBY, //'INPUTBY',
name: 'INPUTBY', hidden: true
}, {
fieldLabel: 'WARNCOUNT', //'CNTRTOTAL',
name: 'WARNCOUNT', hidden: true
}, {
fieldLabel: 'BLISSUESTATUS', //'CNTRTOTAL',
name: 'BLISSUESTATUS', hidden: true
}, {
fieldLabel: 'DRFEESTATUS', //'MSHIPPERID',
name: 'DRFEESTATUS', hidden: true
}, {
fieldLabel: 'CRFEESTATUS', //'MSHIPPERID',
name: 'CRFEESTATUS', hidden: true
}, {
fieldLabel: Zi.LAN.MSHIPPERID, //'MSHIPPERID',
name: 'MSHIPPERID', hidden: true
}, {
fieldLabel: Zi.LAN.MCONSIGNEEID, //'MCONSIGNEEID',
name: 'MCONSIGNEEID', hidden: true
}, {
fieldLabel: Zi.LAN.MNOTIFYPARTYID, //'MNOTIFYPARTYID',
name: 'MNOTIFYPARTYID', hidden: true
}, {
fieldLabel: Zi.LAN.MSHIPPER, //'MSHIPPER',
xtype: 'textareafield',
name: 'MSHIPPER', hidden: true
}, {
fieldLabel: 'MDESCRIPTION', //'MSHIPPER',
xtype: 'textareafield',
name: 'MDESCRIPTION', hidden: true
},
//{
//fieldLabel: Zi.LAN.OPERATORTEL, //'TEL',
//name: 'OPERATORTEL', hidden: true
//},
{
fieldLabel: Zi.LAN.MCONSIGNEE, //'MCONSIGNEE',
xtype: 'textareafield',
name: 'MCONSIGNEE', hidden: true
}, {
fieldLabel: Zi.LAN.MNOTIFYPARTY, //'MNOTIFYPARTY',
xtype: 'textareafield',
name: 'MNOTIFYPARTY', hidden: true
}, {
fieldLabel: Zi.LAN.MBLFRT, //'MBLFRT',
name: 'MBLFRT', hidden: true
}
//, {
// fieldLabel: Zi.LAN.SALEDEPT, //'SALEDEPT',
// name: 'SALEDEPT', hidden: true
//}
, {
fieldLabel: Zi.LAN.BSSTATUSREF, //'业务锁定',
disabled: true,
readOnly: true,
name: 'BSSTATUSREF'
}, {
fieldLabel: 'ISCANCEL', //'业务锁定',
disabled: true,
hidden: true,
readOnly: true,
name: 'ISCANCEL'
}, {
fieldLabel: Zi.LAN.FEESTATUSREF, //'费用锁定',
readOnly: true,
disabled: true,
name: 'FEESTATUSREF'
}, {
fieldLabel: Zi.LAN.ACCDATE, //'会计期间',
xtype: 'monthfield',
name: 'ACCDATE'
}, {
fieldLabel: Zi.LAN.BLTYPE, //'费用锁定',
readOnly: true,
name: 'BLTYPE'
}, {
fieldLabel: Zi.LAN.SALECOMPANY, //'费用锁定',
readOnly: true,
name: 'SALECOMPANY'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.CUSTOMERNAME, //'费用锁定',
readOnly: true,
name: 'CUSTOMERNAME'
}, {
fieldLabel: Zi.LAN.BSSOURCE, //'费用锁定',
readOnly: true,
name: 'BSSOURCE'
}, {
fieldLabel: Zi.LAN.BSSOURCEDETAIL, //'费用锁定',
readOnly: true,
name: 'BSSOURCEDETAIL'
}, {
fieldLabel: Zi.LAN.STLNAME, //'委托编号',
//flex: 0.5,
readOnly: true,
name: 'STLNAME'
}
, {
fieldLabel: Zi.LAN.STLDATE, //'结算日期', readOnly: true,
format: 'Y-m-d',
//flex: 0.5,
//labelWidth: 55,
readOnly: true,
// xtype: 'datefield',
name: 'STLDATE', id: "STLDATE"
}, {
fieldLabel: Zi.LAN.IRCODE, //'发票号',
readOnly: true,
//labelWidth: 50,
//flex: 0.5,
name: 'IRCODE'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.OP, //'发票号',
readOnly: true,
name: 'OP'
}, {
fieldLabel: Zi.LAN.SALE, //'发票号',
readOnly: true,
name: 'SALE'
}, {
fieldLabel: Zi.LAN.DOC, //'发票号',
readOnly: true,
name: 'DOC'
}, {
fieldLabel: Zi.LAN.CUSTSERVICE, //'发票号',
readOnly: true,
name: 'CUSTSERVICE'
}, {
fieldLabel: Zi.LAN.SALEDEPT2, //'发票号',
readOnly: true,
name: 'SALEDEPT'
}, {
fieldLabel: Zi.LAN.INVNO, //'发票号',
readOnly: true,
//labelWidth: 50,
//flex: 0.5,
name: 'INVNO'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.CUSTNO, //'委托编号',
allowBlank: true,
name: 'CUSTNO'
}, {
xtype: 'button',
id: 'btnCUSTNO',
iconCls: "btncancel",
handler: function (button, event) {
this.ClearCustNo();
},
scope: this
}]
}, {
fieldLabel: Zi.LAN.ORDERNO, //'订舱编号',
name: 'ORDERNO'
}, {
fieldLabel: Zi.LAN.MBLNO, //'主提单号',
name: 'MBLNO'
}, {
fieldLabel: Zi.LAN.HBLNO, //'分提单号',
name: 'HBLNO'
}, {
fieldLabel: Zi.LAN.CONTRACTNO, //'分提单号',
name: 'CONTRACTNO'
}, {
fieldLabel: Zi.LAN.INSURANCEOP, //'分提单号',
name: 'FINANCIALSTAFFFAX'
}
//, {
// fieldLabel: Zi.LAN.CONTRACTNO, //'运费协议号',
// name: 'CONTRACTNO',
// listeners: {
// focus: function (field, eOpts) {
// },
// scope: this
// }
//}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.SERVICECONTRACTNO, //'服务合同号',
//flex: 0.5,
name: 'SERVICECONTRACTNO'
}, {
fieldLabel: Zi.LAN.FINANCIALSTAFFTEL, //'ATD',
format: 'Y-m-d',
//flex: 0.5,
xtype: 'datefield',
//labelWidth: 55,
name: 'FINANCIALSTAFFTEL'
}, {
fieldLabel: Zi.LAN.APPLYNO, //'申请放箱号',
name: 'APPLYNO'
}, {
fieldLabel: Zi.LAN.OPERATOR, //'申请放箱号',
name: 'OPERATOR'
}, //{
{
fieldLabel: Zi.LAN.OPERATORTEL, //'TEL',
//labelWidth: 25,
//flex: 0.4,
name: 'OPERATORTEL'
}, //{
{
fieldLabel: Zi.LAN.FINANCIALSTAFF, //'TEL',
//labelWidth: 25,
//flex: 0.4,
name: 'FINANCIALSTAFF'
}]
}
]//end items(fieldset 1)
}); //end this.formEdit
//#endregion
//#region 集装箱-数据集
if (this.HSGID != undefined) {
this.storeBodyList = Ext.create('Ext.data.Store', {
model: 'MsOpSeaeDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpBill/GetHistryDetailData',
reader: {
id: 'BsNo,CTNCODE,CTN_ID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
} else {
this.storeBodyList = Ext.create('Ext.data.Store', {
model: 'MsOpSeaeDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeae/GetBodyList',
reader: {
id: 'BsNo,CTNCODE,CTN_ID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
}
//明细表表格
this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.gridList = new Ext.grid.GridPanel({
store: this.storeBodyList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListCellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'CTN_ID',
header: '编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'CTNCODE',
header: '序号',
width: 30
}, {
dataIndex: 'CTNALL',
header: '箱型',
width: 65,
editor: this.comboxCTNALL
}, {
dataIndex: 'CTNNUM',
header: '箱量',
width: 60,
editor: {
xtype: 'numberfield',
allowBlank: false,
selectOnFocus: true
}
}, {
dataIndex: 'CNTRNO',
header: '箱号',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'SEALNO',
header: '封号',
width: 80,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
sortable: true,
dataIndex: 'PKGS',
header: '件数',
width: 60,
editor: {
xtype: 'numberfield',
allowBlank: false,
selectOnFocus: true
}
}, {
dataIndex: 'KINDPKGS',
header: '包装',
width: 70,
editor: this.comboxKINDPKGS_CTN
}, {
dataIndex: 'KGS',
header: '重量',
width: 60,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'CBM',
header: '尺码',
width: 60,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'TAREWEIGHT',
header: '箱皮重',
width: 60,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'REMARK',
header: '备注',
width: 150,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}]
});
//#endregion
//#region 数据集
this.panelBodyCtn = new Ext.Panel({
title: '集装箱信息',
layout: "border",
height: 170,
//margin: '5 10',
frame: true,
items: [this.gridList]
});
this.panelBodyDr = new Ext.Panel({
title: '危险品信息',
layout: "border",
hidden: true,
height: 60,
frame: true,
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
defaults: {
anchor: '96%'
},
items: [{
fieldLabel: '危险品等级',
flex: 1,
labelWidth: 70,
name: 'DCLASS'
}, {
fieldLabel: '危险品编号',
flex: 1,
labelWidth: 70,
name: 'DUNNO'
}, {
fieldLabel: '危险品页号',
flex: 1,
labelWidth: 70,
name: 'DPAGE'
}, {
fieldLabel: '危险品标签',
flex: 1,
labelWidth: 70,
name: 'DLABEL'
}, {
fieldLabel: '危险品联系人',
flex: 1,
labelWidth: 90,
name: 'LINKMAN'
}]
}]
});
this.StoreTemp = Ext.create('Ext.data.Store', {
fields: ['ID', 'NAME']
});
this.StoreTemp.add({ "ID": "C", "NAME": "C摄氏" });
this.StoreTemp.add({ "ID": "F", "NAME": "F华氏" });
this.comboxTemp = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreTemp,
fieldLabel: '温度单位',
name: 'TEMPID',
valueField: 'ID',
displayField: 'NAME'
});
this.panelBodyRf = new Ext.Panel({
title: '冻柜信息',
layout: "border",
hidden: true,
height: 60,
//margin: '5 10',
frame: true,
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '冷藏通风量',
name: 'REEFERF'
}, {
fieldLabel: '设置温度',
name: 'TEMPSET'
}, this.comboxTemp, {
fieldLabel: '最低温度',
name: 'TEMPMIN'
}, {
fieldLabel: '最高温度',
name: 'TEMPMAX'
}]
}]
});
this.storeVoyVeg = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.VesselModel',
proxy: { url: '/CommMng/BasicDataRef/GetVesselList' }
});
this.comboxVoyVeg = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船 名',
store: this.storeVoyVeg,
name: 'VESSEL',
valueField: 'VESSEL',
flex: 1.5,
displayField: 'VESSEL',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var selectrecords = DsStoreQueryBy(this.storeVoyVeg, 'VoyName', combo.value);
if (selectrecords.getCount() > 0) {
var selectdata = selectrecords.getAt(0).data;
this.formEdit.getForm().findField('VESSELID').setValue(selectdata.EDICODE);
} else {
this.formEdit.getForm().findField('VESSELID').setValue('');
}
}
}
}
});
//国际港口(进口装货港、出口卸货港)
//付费方式
this.storeFrt = Ext.create('DsExt.ux.RefTableStore', {
model: 'CODE_FRT',
proxy: { url: '/CommMng/BasicDataRef/GetCodeFrtList' }
});
this.storeFrt.load({ params: { condition: ""} });
this.comboxBLFRT = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '付费方式',
store: this.storeFrt,
name: 'BLFRT',
valueField: 'FRT',
displayField: 'FRT'
});
//运输条款
this.storeSERVICE = Ext.create('DsExt.ux.RefTableStore', {
model: 'CODE_SERVICE',
proxy: { url: '/CommMng/BasicDataRef/GetCodeServiceList' }
});
this.storeSERVICE.load({ params: { condition: ""} });
this.comboxSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '运输条款',
store: this.storeSERVICE,
name: 'SERVICE',
valueField: 'SERVICE',
displayField: 'SERVICE'
});
//签单方式
this.storeISSUETYPE = Ext.create('DsExt.ux.RefTableStore', {
model: 'CODE_BLTYPE',
proxy: { url: '/CommMng/BasicDataRef/GetCodeBLTYPEList' }
});
this.storeISSUETYPE.load({ params: { condition: ""} });
this.comboxISSUETYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '签单方式',
store: this.storeISSUETYPE,
name: 'ISSUETYPE',
valueField: 'BLTYPE',
displayField: 'BLTYPE'
});
this.StoreBLNUM = Ext.create('Ext.data.Store', {
fields: ['NUM']
});
this.StoreBLNUM.add({ "NUM": "ZERO" });
this.StoreBLNUM.add({ "NUM": "ONE" });
this.StoreBLNUM.add({ "NUM": "TWO" });
this.StoreBLNUM.add({ "NUM": "THREE" });
this.StoreBLNUM.add({ "NUM": "FOUR" });
this.StoreBLNUM.add({ "NUM": "FIVE" });
this.StoreBLNUM.add({ "NUM": "SIX" });
this.StoreBLNUM.add({ "NUM": "SEVEN" });
this.StoreBLNUM.add({ "NUM": "EIGHT" });
this.StoreBLNUM.add({ "NUM": "NINE" });
this.StoreBLNUM.add({ "NUM": "TEN" });
this.comboxBLNUM = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '提单份数',
store: this.StoreBLNUM,
flex: 0.5,
name: 'NOBILL',
valueField: 'NUM',
displayField: 'NUM'
});
this.panelBodyDr2 = new Ext.Panel({
title: '危险品信息',
layout: "border",
hidden: true,
height: 60,
width: 1200,
frame: true,
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
defaults: {
anchor: '96%'
},
items: [{
fieldLabel: '危险品等级',
flex: 1,
labelWidth: 70,
name: 'DCLASS'
}, {
fieldLabel: '危险品编号',
flex: 1,
labelWidth: 70,
name: 'DUNNO'
}, {
fieldLabel: '危险品页号',
flex: 1,
labelWidth: 70,
name: 'DPAGE'
}, {
fieldLabel: '危险品标签',
flex: 1,
labelWidth: 70,
name: 'DLABEL'
}, {
fieldLabel: '危险品联系人',
flex: 1,
labelWidth: 90,
name: 'LINKMAN'
}]
}]
});
this.comboxTemp2 = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreTemp,
fieldLabel: '温度单位',
name: 'TEMPID',
valueField: 'ID',
displayField: 'NAME'
});
this.panelBodyRf2 = new Ext.Panel({
title: '冻柜信息',
layout: "border",
hidden: true,
height: 60,
//margin: '5 10',
frame: true,
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '冷藏通风量',
name: 'REEFERF'
}, {
fieldLabel: '设置温度',
name: 'TEMPSET'
}, this.comboxTemp2, {
fieldLabel: '最低温度',
name: 'TEMPMIN'
}, {
fieldLabel: '最高温度',
name: 'TEMPMAX'
}]
}]
});
this.formCargoShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [this.panelBodyDr2, this.panelBodyRf2]//end root items
});
me = this;
this.winCargoShow = Ext.create('Ext.window.Window', {
iconCls: "addicon",
width: 800,
height: 130,
resizable: false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.formCargoShow],
buttons: [{
text: "确定",
minWidth: 70,
handler: function () {
me.formEdit.getForm().findField('DCLASS').setValue(me.formCargoShow.getForm().findField('DCLASS').getValue())
me.formEdit.getForm().findField('DUNNO').setValue(me.formCargoShow.getForm().findField('DUNNO').getValue())
me.formEdit.getForm().findField('DPAGE').setValue(me.formCargoShow.getForm().findField('DPAGE').getValue())
me.formEdit.getForm().findField('DLABEL').setValue(me.formCargoShow.getForm().findField('DLABEL').getValue())
me.formEdit.getForm().findField('LINKMAN').setValue(me.formCargoShow.getForm().findField('LINKMAN').getValue())
me.formEdit.getForm().findField('REEFERF').setValue(me.formCargoShow.getForm().findField('REEFERF').getValue())
me.formEdit.getForm().findField('TEMPSET').setValue(me.formCargoShow.getForm().findField('TEMPSET').getValue())
me.formEdit.getForm().findField('TEMPID').setValue(me.formCargoShow.getForm().findField('TEMPID').getValue())
me.formEdit.getForm().findField('TEMPMAX').setValue(me.formCargoShow.getForm().findField('TEMPMAX').getValue())
me.formEdit.getForm().findField('TEMPMIN').setValue(me.formCargoShow.getForm().findField('TEMPMIN').getValue())
var CARGOID = me.formEdit.getForm().findField('CARGOID').getValue();
if (CARGOID == 'R') {
me.panelBodyDr.setVisible(false);
me.panelBodyRf.setVisible(true);
} else if (CARGOID == 'D') {
me.panelBodyDr.setVisible(true);
me.panelBodyRf.setVisible(false);
} else {
me.panelBodyDr.setVisible(false);
me.panelBodyRf.setVisible(false);
}
me.winCargoShow.close();
}
}]
});
this.StoreCargoid = Ext.create('Ext.data.Store', {
fields: ['ID', 'NAME']
});
this.StoreCargoid.add({ "ID": "S", "NAME": "S普通货" });
this.StoreCargoid.add({ "ID": "R", "NAME": "R冻柜" });
this.StoreCargoid.add({ "ID": "D", "NAME": "D危险品" });
this.StoreCargoid.add({ "ID": "O", "NAME": "O超限箱" });
this.comboxCargoid = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCargoid,
fieldLabel: "<a><font color='#FF0000'>货物标示</font></a>",
name: 'CARGOID',
valueField: 'ID',
displayField: 'NAME',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
if (combo.value == 'R') {
this.panelBodyDr2.setVisible(false);
this.panelBodyRf2.setVisible(true);
this.winCargoShow.width = 800;
this.winCargoShow.show();
} else if (combo.value == 'D') {
this.panelBodyDr2.setVisible(true);
this.panelBodyRf2.setVisible(false);
this.winCargoShow.width = 1200;
this.winCargoShow.show();
} else {
this.panelBodyDr.setVisible(false);
this.panelBodyRf.setVisible(false);
}
}
}
}
});
this.StoreTranStatus = Ext.create('Ext.data.Store', {
fields: ['CODE', 'STATUS']
});
this.StoreTranStatus.add({ "CODE": "C", "STATUS": "出运" });
this.StoreTranStatus.add({ "CODE": "W", "STATUS": "未出运" });
this.StoreTranStatus.add({ "CODE": "T", "STATUS": "退载" });
this.comboxTranStatus = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '出运状态',
store: this.StoreTranStatus,
name: 'TRANSTATUS',
valueField: 'CODE',
displayField: 'STATUS'
});
//#endregion
//#region 编辑formEdit 基本信息
this.formEdit = Ext.widget('form', {
region: 'north',
frame: true,
bodyPadding: 5,
layout: 'anchor',
trackResetOnLoad: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [{
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '96%'
},
items: [{
xtype: 'container',
layout: 'anchor',
flex: 2,
defaultType: 'textfield',
items: [this.comboxShipper, {
xtype: 'textareafield',
grow: true,
labelWidth: 0,
height: 80,
name: 'SHIPPER',
anchor: '100%'
}, this.comboxConsignee, {
xtype: 'textareafield',
grow: true,
labelWidth: 0,
height: 80,
name: 'CONSIGNEE',
anchor: '100%'
}, this.comboxNotifyParty, {
xtype: 'textareafield',
grow: true,
labelWidth: 0,
height: 80,
name: 'NOTIFYPARTY',
anchor: '100%'
}
]
}, {
xtype: 'container',
layout: 'anchor',
flex: 3,
defaultType: 'textfield',
items: [{
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [this.comboxYARD, {
fieldLabel: '船公司',
name: 'CARRIER'
}, this.comboxFORWARDER]
}, {
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [this.comboxAgent, {
fieldLabel: '截港日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datetimefield',
name: 'CLOSINGDATE'
}, {
fieldLabel: '截单日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datetimefield',
name: 'CLOSEDOCDATE'
}]
}, , {
xtype: 'container',
layout: 'hbox',
//flex: 1,
defaultType: 'textfield',
items: [
{
fieldLabel: 'AGENT', //'AGENT',
name: 'AGENT',
xtype: 'textareafield',
grow: true,
height: 50,
anchor: '100%',
flex: 1.8,
listeners: {
scope: this,
blur: function (field, The, eOpts) {
_this.formEdit.getForm().findField('AGENT')
.setValue(field.value.toUpperCase());
}
}
},
{
xtype: 'container',
layout: 'anchor',
defaultType: 'textfield',
items: [{
fieldLabel: '船代',
name: 'SHIPAGENCY'
}, {
fieldLabel:'交货日期', //'ATD',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'DELIVERYDATE'
}
]
}
]
}, {
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [this.comboxLANE, this.comboxCUSTOMSER, this.comboxPKGTYPE]
}, {
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [this.comboxWAREHOUSE, this.comboxTRUCKER, this.comboxTranStatus]
}, this.panelBodyCtn
]
}
]
}, {
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
defaults: {
anchor: '99%'
},
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '开船日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'ETD'
}, {
fieldLabel: 'ATD',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'ATD'
}, {
fieldLabel: '预抵日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'ETA'
}, this.comboxVoyVeg, {
fieldLabel: '航次',
flex: 0.5,
name: 'VOYNO'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '装货港',
name: 'PORTLOAD'
}, {
fieldLabel: '卸货港',
name: 'PORTDISCHARGE'
}, {
fieldLabel: '目的地',
name: 'DESTINATION'
}, {
fieldLabel: '交货地',
name: 'PLACEDELIVERY'
}, {
fieldLabel: '收货地',
name: 'PLACERECEIPT'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '装港代码',
name: 'PORTLOADID'
}, {
fieldLabel: '卸港代码',
name: 'PORTDISCHARGEID'
}, {
fieldLabel: '目的代码',
name: 'DESTINATIONID'
}, {
fieldLabel: '交货代码',
name: 'PLACEDELIVERYID'
}, {
fieldLabel: '收货代码',
flex: 0.5,
name: 'PLACERECEIPTID'
}, {
fieldLabel: '船舶呼号',
flex: 0.5,
name: 'VESSELID'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'label',
html: '<html>Seal No.(封志号)<br> Marks & Nos.(标记与号码) </html>'
}, {
xtype: 'textareafield',
grow: true,
height: 250,
name: 'MARKS',
anchor: '100%'
}
]
}, {
xtype: 'container',
layout: 'anchor',
flex: 3,
defaultType: 'textfield',
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'label',
html: '<html>&nbsp&nbsp&nbsp&nbsp&nbspDescription of Goods <br>&nbsp&nbsp&nbsp&nbsp&nbsp(包装种类与货名)</html>'
}, this.comboxGOODSNAME, this.comboxCargoid, {
fieldLabel: 'HS编码',
name: 'HSCODE'
}]
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: '&nbsp&nbsp',
labelSeparator: '',
labelWidth: 20,
height: 250,
name: 'DESCRIPTION',
anchor: '100%'
}]
}, {
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'label',
html: '<html>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspNo.of containers or pkgs.<br>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp箱数或件数)</html>'
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: '&nbsp&nbsp',
labelWidth: 20,
labelSeparator: '',
height: 40,
name: 'NOPKGS',
anchor: '100%',
listeners: {
scope: this,
change: function (field, newValue, oldValue, eOpts) {
if (newValue == null || newValue == '') return;
if (newValue != oldValue) {
var SS = newValue;
var i = SS.indexOf("\n");
var num = 0;
if (i > 0) {
var slist = SS.split("\n");
for (var i = 0; i < slist.length; i += 1) {
var member = slist[i];
var str_num = this.GetStringNum(member);
if (i == 0) {
var str_kind = member.substring(str_num.length);
}
num = parseFloat(num).add(parseFloat(str_num));
}
this.formEdit.getForm().findField('PKGS').setValue(num);
this.formEdit.getForm().findField('KINDPKGS').setValue(str_kind);
this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(num).toUpperCase() + ' ' + str_kind + ' ONLY.');
} else {
var str_num = this.GetStringNum(SS);
var str_kind = SS.substring(str_num.length);
this.formEdit.getForm().findField('PKGS').setValue(str_num);
this.formEdit.getForm().findField('KINDPKGS').setValue(str_kind);
this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(str_num).toUpperCase() + ' ' + str_kind + ' ONLY.');
}
}
}
}
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '总件数',
labelWidth: 70,
readOnly: true,
name: 'PKGS'
}, this.comboxKINDPKGS]
}, {
xtype: 'label',
html: '&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Gross Weight 毛重(公斤)'
}, {
xtype: 'textareafield',
grow: true,
height: 40,
labelWidth: 20,
labelSeparator: '',
fieldLabel: '&nbsp&nbsp',
name: 'GROSSWEIGHT',
anchor: '100%',
listeners: {
scope: this,
change: function (field, newValue, oldValue, eOpts) {
if (newValue == null || newValue == '') return;
if (newValue != oldValue) {
var SS = newValue;
var i = SS.indexOf("\n");
var num = 0;
if (i > 0) {
var slist = SS.split("\n");
for (var i = 0; i < slist.length; i += 1) {
var member = slist[i];
var str_num = this.GetStringNum(member);
num = parseFloat(num).add(parseFloat(str_num));
}
this.formEdit.getForm().findField('KGS').setValue(num);
} else {
var str_num = this.GetStringNum(SS);
this.formEdit.getForm().findField('KGS').setValue(str_num);
}
}
}
}
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '100%'
},
items: [{
labelWidth: 70,
fieldLabel: '总重量',
name: 'KGS'
}, {
xtype: 'label',
width: 50,
text: 'KGS'
}]
}, {
xtype: 'label',
html: '&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Measurement 尺码(立方米)'
}, {
xtype: 'textareafield',
grow: true,
height: 40,
labelWidth: 20,
labelSeparator: '',
fieldLabel: '&nbsp&nbsp',
name: 'MEASUREMENT',
anchor: '100%',
listeners: {
scope: this,
change: function (field, newValue, oldValue, eOpts) {
if (newValue == null || newValue == '') return;
if (newValue != oldValue) {
var SS = newValue;
var i = SS.indexOf("\n");
var num = 0;
if (i > 0) {
var slist = SS.split("\n");
for (var i = 0; i < slist.length; i += 1) {
var member = slist[i];
var str_num = this.GetStringNum(member);
num = parseFloat(num).add(parseFloat(str_num));
}
this.formEdit.getForm().findField('CBM').setValue(num);
} else {
var str_num = this.GetStringNum(SS);
this.formEdit.getForm().findField('CBM').setValue(str_num);
}
}
}
}
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
labelWidth: 70,
fieldLabel: '总尺码',
name: 'CBM'
}, {
xtype: 'label',
width: 50,
text: 'CBM'
}]
}
]
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '件数大写',
name: 'TOTALNO'
}]
}, this.panelBodyDr, this.panelBodyRf, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [this.comboxISSUETYPE, {
fieldLabel: '签单日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ISSUEDATE'
}, {
fieldLabel: '签单地点',
name: 'ISSUEPLACE'
}, {
fieldLabel: '签单地点代码',
labelWidth: 80,
flex: 0.5,
name: 'ISSUEPLACEID'
}, {
fieldLabel: '份数',
flex: 0.6,
name: 'NOBILL'
}, {
fieldLabel: '副本份数',
flex: 0.6,
name: 'COPYNOBILL'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [this.comboxBLFRT, {
fieldLabel: '预付地点',
name: 'PREPARDAT'
}, {
fieldLabel: '到付地点',
name: 'PAYABLEAT'
}, this.comboxSERVICE]
}, , {
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [
{
xtype: 'textareafield',
grow: true,
flex: 2,
fieldLabel: '备注', //'备注',
height: 60,
name: 'REMARK',
anchor: '100%'
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: '其他备注', //'备注',
height: 60,
name: 'OPERATORFAX',
anchor: '100%'
}
]
}]
}
]
}); //end this.formEdit
//#endregion
//#region 按钮Toolbar
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
text: "关闭",
handler: function (button, event) {
window.close();
},
scope: this
}, '-', {
text: "打印",
iconCls: "btnprint",
handler: function (button, event) {
this.Print();
},
scope: this
}]
}); //end 按钮Toolbar
//#endregion
//#region 框架结构
//#region 编辑formedi edi信息
this.formEDI = Ext.widget('form', {
region: 'north',
title: Zi.LAN.formEDI, //'其他信息',
frame: true,
bodyPadding: 5,
collapsed: false,
collapsible: true,
layout: 'hbox',
trackResetOnLoad: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
layout: 'anchor',
flex: 4,
defaultType: 'textfield',
items: [{
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.CUSTOMNO, //'报关单号',
name: 'CUSTOMNO'
}, {
fieldLabel: Zi.LAN.CUSTOMDATE, //'报关日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'CUSTOMDATE'
}, {
fieldLabel: Zi.LAN.INSPECTIONNO, //'商检单号',
name: 'INSPECTIONNO'
}, {
fieldLabel: Zi.LAN.INSPECTIONDATE, //'商检日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'INSPECTIONDATE'
}]
}, {
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.ENTERP, //'单位编码',
name: 'ENTERP'
}, {
fieldLabel: Zi.LAN.ENTERPID, //'单位编码',
name: 'ENTERPID'
}, {
fieldLabel: Zi.LAN.CUSTOMSNUM, //'报关票数',
flex: 0.5,
name: 'CUSTOMSNUM'
}, {
fieldLabel: Zi.LAN.PRERECORD, //'预录数',
flex: 0.5,
labelWidth: 45,
name: 'PRERECORD'
}, {
fieldLabel: Zi.LAN.CLEARCUSTOMDATE, //'通关日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'CLEARCUSTOMDATE'
}]
}, {
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.ISMOREGOOD, //'是否多品名',
flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISMOREGOOD'
}, {
fieldLabel: Zi.LAN.ISCONTAINERSOC, //'是否SOC',
flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISCONTAINERSOC'
}, {
fieldLabel: Zi.LAN.TERMSDELIVERY, //'单位编码',
name: 'TERMSDELIVERY'
}, {
fieldLabel: Zi.LAN.INSPECTSERVICE, //'单位编码',
name: 'INSPECTSERVICE'
}, {
fieldLabel: Zi.LAN.VESSEL, //'单位编码',
name: 'VESSEL2N'
}]
}
]
}, {
xtype: 'container',
layout: 'anchor',
flex: 2,
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.EDIREMARK, //'EDI备注',
height: 45,
name: 'EDIREMARK',
anchor: '100%'
}, {
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.VOYNO2N, //'二程航次',
name: 'VOYNO2N'
}, {
fieldLabel: Zi.LAN.VESSELID2N, //'二程航次',
name: 'VESSELID2N'
}
]
}
]
}
]//end items(fieldset 1)
}); //end this.formEdit
this.StoreAMSCOUNTRY = Ext.create('Ext.data.Store', {
fields: ['COUNTRY']
});
this.StoreAMSCOUNTRY.add({ "COUNTRY": "USD" });
this.StoreAMSCOUNTRY.add({ "COUNTRY": "CANADA" });
this.StoreAMSCOUNTRY.add({ "COUNTRY": "BRAZIL" });
this.comboxAMSCOUNTRY = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '所在国家',
store: this.StoreAMSCOUNTRY,
name: 'BYCOUNTRY',
valueField: 'COUNTRY',
displayField: 'COUNTRY'
});
this.formAMS = Ext.widget('form', {
region: 'center',
frame: true,
bodyPadding: 5,
collapsed: false,
collapsible: true,
trackResetOnLoad: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.KINGTAREWEIGHT, //'第一层包装皮重',
labelWidth: 90,
value: 0,
name: 'KINGTAREWEIGHT'
}, {
name: 'SHIPPERNAME', hidden: true
}, {
name: 'SHIPPERCODE', hidden: true
}, {
name: 'SHIPPERADDR1', hidden: true
}, {
name: 'SHIPPERADDR2', hidden: true
}, {
name: 'SHIPPERADDR3', hidden: true
}, {
name: 'SHIPPERCITY', hidden: true
}, {
name: 'SHIPPERPROVINCE', hidden: true
}, {
name: 'SHIPPERCOUNTRY', hidden: true
}, {
name: 'SHIPPERPOSTCODE', hidden: true
}, {
name: 'SHIPPERATTN', hidden: true
}, {
name: 'SHIPPERTEL', hidden: true
}, {
name: 'SHIPPEREMAIL', hidden: true
}, {
name: 'CONSIGNEECODE', hidden: true
}, {
name: 'CONSIGNEENAME', hidden: true
}, {
name: 'CONSIGNEEADDR1', hidden: true
}, {
name: 'CONSIGNEEADDR2', hidden: true
}, {
name: 'CONSIGNEEADDR3', hidden: true
}, {
name: 'CONSIGNEECITY', hidden: true
}, {
name: 'CONSIGNEEPROVINCE', hidden: true
}, {
name: 'CONSIGNEEATTN', hidden: true
}, {
name: 'CONSIGNEETEL', hidden: true
}, {
name: 'CONSIGNEEEMAIL', hidden: true
}, {
name: 'NOTIFYPARTYNAME', hidden: true
}, {
name: 'NOTIFYPARTYCODE', hidden: true
}, {
name: 'NOTIFYPARTYADDR1', hidden: true
}, {
name: 'NOTIFYPARTYADDR2', hidden: true
}, {
name: 'NOTIFYPARTYADDR3', hidden: true
}, {
name: 'NOTIFYPARTYCITY', hidden: true
}, {
name: 'NOTIFYPARTYPROVINCE', hidden: true
}, {
name: 'NOTIFYPARTYATTN', hidden: true
}, {
name: 'NOTIFYPARTYTEL', hidden: true
}, {
name: 'NOTIFYPARTYEMAIL', hidden: true
},
{
name: 'ENTERPRISECODETYPE', hidden: true//企业代码类型
},
{
name: 'ENTERPRISECODETYPE1', hidden: true//企业代码类型
},
{
name: 'ENTERPRISECODETYPE2', hidden: true//企业代码类型
},
{
name: 'INLANE', hidden: true//企业代码类型
},
{
name: 'USERAILWAY', hidden: true//企业代码类型
},
{
name: 'USERIVER', hidden: true//企业代码类型
},
{
name: 'USETRUCK', hidden: true//企业代码类型
},
{
name: 'RAILWAY_ETD', hidden: true//企业代码类型
},
{
name: 'RAILWAY_PORTLOAD', hidden: true//企业代码类型
},
{
name: 'RAILWAY_TRANSPORT', hidden: true//企业代码类型
},
{
name: 'RAILWAY_PORTDISCHARG', hidden: true//企业代码类型
},
{
xtype: 'textareafield', name: 'RAILWAY_REMARK', hidden: true//企业代码类型
},
{
name: 'RIVER_ETD', hidden: true//企业代码类型
},
{
name: 'RIVER_PORTLOAD', hidden: true//企业代码类型
},
{
name: 'RIVER_TRANSPORT', hidden: true//企业代码类型
},
{
name: 'RIVER_PORTDISCHARG', hidden: true//企业代码类型
},
{
xtype: 'textareafield', name: 'RIVER_REMARK', hidden: true//企业代码类型
},
{
name: 'TRUCK_ETD', hidden: true//企业代码类型
},
{
name: 'TRUCK_PORTLOAD', hidden: true//企业代码类型
},
{
name: 'TRUCK_TRANSPORT', hidden: true//企业代码类型
},
{
name: 'TRUCK_PORTDISCHARG', hidden: true//企业代码类型
},
{
xtype: 'textareafield', name: 'TRUCK_REMARK', hidden: true//企业代码类型
},
{
xtype: 'textareafield', name: 'CDESCRIPTION', hidden: true//企业代码类型
},
{
fieldLabel:'最后境外港', //'SCAC编号',
name: 'LASTPORTOFCALLID'
}, {
fieldLabel: '日期', //'报关日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'LASTPORTOFCALLDATE'
}, {
fieldLabel: '第一个停靠港', //'SCAC编号',
name: 'FIRSTPORTOFCALLID'
}, {
fieldLabel: '日期', //'报关日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'FIRSTPORTOFCALLDATE'
}, {
fieldLabel: Zi.LAN.NVONO, //'SCAC编号',
name: 'NVONO'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.ORDERREMARK, //'订舱人说明',
height: 60,
name: 'ORDERREMARK',
anchor: '100%'
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.FORWARD, //'委托方',
height: 60,
name: 'FORWARD',
anchor: '100%'
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.SIREMARK, //'SI备注',
height: 60,
name: 'SIREMARK',
anchor: '100%'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: 'FREIGHT PAYER', //'SCAC编号',
labelWidth: 100,
name: 'FREIGHTPAYER'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.BSNO2, //'业务编号',
name: 'BSNO', hidden: true
}, {
fieldLabel: Zi.LAN.AMSNO, //'AMSNO',
name: 'AMSNO', hidden: true
}, {
fieldLabel: Zi.LAN.AMSCODE, //'AMS代码',
name: 'AMSCODE'
}, {
fieldLabel: Zi.LAN.ORDERNO, //'定舱号',
name: 'ORDERNO'
}, {
fieldLabel: Zi.LAN.BYCOUNTRY, //'SCAC编号',
name: 'BYCOUNTRY'
}, {
fieldLabel: Zi.LAN.SCACCODE, //'SCAC编号',
name: 'SCACCODE'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.ITNCODE, //'ITN编号',
name: 'ITNCODE'
}, {
fieldLabel: Zi.LAN.GOODSNCM, //'货物NCM号',
name: 'GOODSNCM'
}, {
fieldLabel: Zi.LAN.ATTN, //'联系人',
name: 'ATTN'
}, {
fieldLabel: Zi.LAN.ATTNTEL, //'联系人电话',
name: 'ATTNTEL'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.ATTNEMAIL, //'联系人邮箱',
name: 'ATTNEMAIL'
}, {
fieldLabel: Zi.LAN.ATTNADDR, //'联系人地址',
flex: 3,
name: 'ATTNADDR'
}]
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.AMSSHIPPER, //'AMS发货人',
height: 60,
name: 'AMSSHIPPER',
anchor: '100%'
}]
}, {
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.CONSIGNEEPOSTCODE, //'收货人邮编',
name: 'CONSIGNEEPOSTCODE'
}, {
fieldLabel: Zi.LAN.CONSIGNEETAXNO, //'收货人税号',
name: 'CONSIGNEETAXNO'
}, {
fieldLabel: Zi.LAN.CONSIGNEECOUNTRY, //'收货人国家',
name: 'CONSIGNEECOUNTRY'
}]
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.AMSCONSIGNEE, //'AMS收货人',
height: 60,
name: 'AMSCONSIGNEE',
anchor: '100%'
}
]
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.NOTIFYPARTYPOSTCODE, //'通知人邮编',
name: 'NOTIFYPARTYPOSTCODE'
}, {
fieldLabel: Zi.LAN.NOTIFYPARTYTAXNO, //'通知人税号',
name: 'NOTIFYPARTYTAXNO'
}, {
fieldLabel: Zi.LAN.NOTIFYPARTYCOUNTRY, //'通知人国家',
name: 'NOTIFYPARTYCOUNTRY'
}]
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.AMSNOTIFYPARTY, //'AMS通知人',
height: 60,
name: 'AMSNOTIFYPARTY',
anchor: '100%'
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.NOTIFYPARTYID2, //'Also Notify Party第二通知人'
height: 60,
name: 'NOTIFYPARTYID2',
anchor: '100%'
}]
}, {
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: []
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.DOORADDR, //'到门地址',
height: 80,
name: 'DOORADDR',
anchor: '100%'
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.BSNOLIST, //'拆并单列表',
height: 80,
name: 'BSNOLIST',
anchor: '100%'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.ACICODE, //'收货人邮编',
name: 'ACICODE'
}, {
fieldLabel: Zi.LAN.TACCODE, //'收货人税号',
name: 'TACCODE'
}, {
fieldLabel: Zi.LAN.ERNCODE, //'收货人国家',
name: 'ERNCODE'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.VAECODE, //,
name: 'VAECODE'
}, {
fieldLabel: Zi.LAN.FECCODE, //'收货人税号',
name: 'FECCODE'
}]
}]
}]
}
]//end items(fieldset 1)
}); //end this.formEdit
//#endregion
this.panelpage = new Ext.Panel({
title: '委托详细信息',
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.formEdit]
});
this.panelEDIpage = new Ext.Panel({
title: 'EDI及其他信息',
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.formEDI, this.formAMS]
});
if (this.HSGID != undefined) {
this.tabSeaeWTpanel = new Ext.TabPanel({
activeTab: 0,
autoWidth: true,
border: true,
frame: false,
region: 'center',
enableTabScroll: true,
items:
[
this.panelpage,
this.panelEDIpage
]
});
} else {
this.tabSeaeWTpanel = new Ext.TabPanel({
activeTab: 0,
autoWidth: true,
border: true,
frame: false,
region: 'center',
enableTabScroll: true,
items:
[
this.panelpage,
this.panelEDIpage
]
});
}
this.panelSeae = new Ext.Panel({
title: '委托信息',
id: 'pnlmodNewOpSeaeInfo',
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
frame: false,
//closable:true,
items: [this.panelBtn, this.formHead, this.tabSeaeWTpanel]
});
this.treestore = new Ext.data.TreeStore({
model: 'DsShipping.ux.ModuleModel',
nodeParam: 'PARENTID',
proxy: {
type: 'ajax',
url: '/MvcShipping/MsBaseInfo/GetModuTreeRefList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
},
autoLoad: true,
root: {
name: '根节点',
expanded: true,
id: '213F23DE-8D2D-4794-9AC0-DB994197E16D'
}
});
this.tabtree = new Ext.tree.Panel({
region: 'west',
title: '业务信息',
split: true,
width: 180,
collapsible: true,
margins: '0 0 0 0',
store: this.treestore,
rootVisible: false,
hideHeaders: true,
animate: false,
lines: false,
columns: [{
xtype: 'treecolumn',
text: '模块名称',
width: 178,
dataIndex: 'DESCRIPTION'
}],
listeners: {
scope: this,
'itemclick': function (_this, record, item, index, e, eOpts) {
var finded = false;
if (record.data.MODULEURL == '@') {
this.tabSeaepanel.setActiveTab(0);
} else if (record.data.MODULEURL != '#') {
var children = this.tabSeaepanel.items;
if (children) {
for (var i = 0, len = children.length; i < len; i++) {
if (children.items[i].id) {
if (children.items[i].id == 'pnl' + record.data.NAME) {
this.tabSeaepanel.setActiveTab(i);
finded = true;
}
}
}
}
if (finded == false) {
if (this.formHead.getForm().findField('CUSTNO').getValue() == "") {
Ext.Msg.show({ title: '注意', msg: '请先保存业务信息后再打开其他模块!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
} else {
if (record.data.NAME == 'modSeaeAllFee') {
var paneltabitems = new Shipping.SeaeFee({
id: 'pnl' + record.data.NAME,
layout: "border",
region: "center",
autoScroll: true,
frame: false,
closable: true,
title: record.data.DESCRIPTION
});
} else if (record.data.NAME == 'modSeaeAmendFee') {
var paneltabitems = new Shipping.SeaeAmendFee({
id: 'pnl' + record.data.NAME,
layout: "border",
region: "center",
autoScroll: true,
frame: false,
closable: true,
title: record.data.DESCRIPTION
});
} else if (record.data.NAME == 'BILLOFLOADING') {
var paneltabitems = new Shipping.MsOpBillIndex({
id: 'pnl' + record.data.NAME,
layout: "border",
region: "center",
autoScroll: true,
frame: false,
closable: true,
title: record.data.DESCRIPTION
});
} else if (record.data.NAME == 'modOpSeaeFenList') {
var paneltabitems = new Shipping.MsOpSeaeFenIndex({
id: 'pnl' + record.data.NAME,
layout: "border",
region: "center",
autoScroll: true,
frame: false,
closable: true,
title: record.data.DESCRIPTION
});
} else {
var paneltabitems = new Ext.Panel({
id: 'pnl' + record.data.NAME,
layout: "fit",
region: "center",
autoScroll: true,
frame: false,
closable: true,
title: record.data.DESCRIPTION,
html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + record.data.MODULEURL + '"> </iframe>'
});
}
this.tabSeaepanel.add(paneltabitems);
this.tabSeaepanel.setActiveTab(paneltabitems);
this.tabSeaepanel.doLayout();
}
}
}
}
}
});
this.tabSeaepanel = new Ext.TabPanel({
activeTab: 0,
autoWidth: true,
border: true,
frame: false,
region: 'center',
id: "TabSeaePanel",
enableTabScroll: true,
items:
[
this.panelSeae
]
});
if (this.HSGID != undefined) {
Ext.apply(this, {
items: [this.tabSeaepanel]
});
} else {
Ext.apply(this, {
items: [this.tabtree, this.tabSeaepanel]
});
}
//#endregion
// this.LoadInitData();
//#region 其他
this.InitData();
//绑定事件
this.gridList.on('edit', function (editor, e, eOpts) {
this.gridAfterEdit(editor, e, eOpts);
}, this);
//#endregion
}, //end initUIComponents
//#region 加载事件
InitData: function () {
var condition = '';
_this = this;
condition = "BSNO='" + this.bsno + "'";
if (this.HSGID != undefined) {
condition = "GID='" + this.HSGID + "'";
this.LoadHistryData(condition);
}
else
this.LoadData(condition);
}, //end InitData
LoadData: function (condition) {
this.serialNo = 0;
//this.bodyDel = [];
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOpSeae/GetData',
params: {
handle: 'edit',
condition: condition
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
data = result.data;
this.formHead.getForm().reset();
this.formHead.getForm().setValues(data);
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(data);
this.formEDI.getForm().reset();
this.formEDI.getForm().setValues(data);
var editp = Ext.create('MsOpSeaeModel', data);
this.editRecord = editp;
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
var billno = '*';
var gid = '*';
this.storeBodyList.load({ params: { condition: condition} });
this.formCargoShow.getForm().reset();
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOpSeae/GetAmsData',
params: {
condition: condition
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
data = result.data;
this.formAMS.getForm().reset();
this.formAMS.getForm().setValues(data);
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}, // end LoadDate
LoadHistryData: function (condition) {
this.serialNo = 0;
//this.bodyDel = [];
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOpBill/GetHistryData',
params: {
handle: 'edit',
condition: condition
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
data = result.Data;
this.formHead.getForm().reset();
this.formHead.getForm().setValues(data);
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(data);
this.formEDI.getForm().reset();
this.formEDI.getForm().setValues(data);
var editp = Ext.create('MsOpSeaeModel', data);
this.editRecord = editp;
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
var billno = '*';
var gid = '*';
this.storeBodyList.load({ params: { condition: "LINKGID='" + this.HSGID + "' AND HSTYPE='OPCTN'"} });
this.formCargoShow.getForm().reset();
// Ext.Ajax.request({
// waitMsg: '正在查询主表数据...',
// url: '/MvcShipping/MsOpSeae/GetAmsData',
// params: {
// condition: condition
// },
// callback: function (options, success, response) {
// if (success) {
// var result = Ext.JSON.decode(response.responseText);
// if (!result.Success) {
// Ext.Msg.show({
// title: '提示',
// msg: result.Message,
// icon: Ext.MessageBox.ERROR,
// buttons: Ext.Msg.OK
// });
// return;
// }
// data = result.data;
// this.formAMS.getForm().reset();
// this.formAMS.getForm().setValues(data);
// } else {
// Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
// }
// },
// scope: this
// });
}, // end LoadDate
//#endregion
LoadInitData: function () {
this.storeYARD.load({ params: { condition: "ISYARD='1'"} });
this.storeCARRIER.load({ params: { condition: "ISCARRIER='1'"} });
this.storeFORWARDER.load({ params: { condition: "ISBOOKING='1'"} });
this.storeCUSTOMSER.load({ params: { condition: "ISCUSTOM='1'"} });
this.storeTRUCKER.load({ params: { condition: "ISTRUCK='1'"} });
this.storeWAREHOUSE.load({ params: { condition: "ISWAREHOUSE='1'"} });
this.storeVoyVeg.load({ params: { condition: ""} });
},
//#region 集装箱按钮事件
onAddDetailClick: function (button, event) {
this.addDetail();
}, //end onAddDetailClick
onDelDetailClick: function (button, event) {
this.deleteDetail();
}, //onDelDetailClick
onUpDetailClick: function (button, event) {
this.UpDetail();
}, //end onAddDetailClick
gridAfterEdit: function (editor, e, eOpts) {
if (e.field == 'PKGS' || e.field == 'KGS' || e.field == 'CBM') {
this.setAllTotal();
if (e.field == 'KGS') {
var KGS = this.formEdit.getForm().findField('KGS').getValue();
this.formEdit.getForm().findField('GROSSWEIGHT').setValue(KGS + 'KGS');
}
if (e.field == 'CBM') {
var CBM = this.formEdit.getForm().findField('CBM').getValue();
this.formEdit.getForm().findField('MEASUREMENT').setValue(CBM + 'CBM');
}
if (e.field == 'PKGS') {
var PKGS = this.formEdit.getForm().findField('PKGS').getValue();
var KINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue();
this.formEdit.getForm().findField('NOPKGS').setValue(PKGS + KINDPKGS);
this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(PKGS).toUpperCase() + ' ' + KINDPKGS + ' ONLY.');
}
} else if (e.field == 'KINDPKGS') {
var KINDPKGS = e.record.data['KINDPKGS'];
this.setHeadFieldValue('KINDPKGS', KINDPKGS);
var PKGS = this.formEdit.getForm().findField('PKGS').getValue();
this.formEdit.getForm().findField('NOPKGS').setValue(PKGS + KINDPKGS);
this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(PKGS).toUpperCase() + ' ' + KINDPKGS + ' ONLY.');
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
if (memberbody.data.KINDPKGS == "" || memberbody.data.KINDPKGS == NaN || memberbody.data.KINDPKGS == null) {
memberbody.set("KINDPKGS", KINDPKGS);
memberbody.commit();
}
};
}
},
addDetail: function () {
//var newSerialno = DsGetNewSerialNo(this.storeBodyList, this.serialNo);
var newSerialno = this.DsGetNewNo(this.storeBodyList);
this.serialNo = newSerialno;
this.tabtree.expandAll();
var record = Ext.create('MsOpSeaeDetail', {
CTN_ID: NewGuid(),
BSNO: '*',
CTNCODE: newSerialno,
CTNALL: '',
CTNNUM: 1,
CNTRNO: '',
SEALNO: '',
PKGS: 0,
KINDPKGS: '',
KGS: 0,
TAREWEIGHT: 0,
CBM: 0,
REMARK: ''
});
this.storeBodyList.add(record);
var n = this.storeBodyList.getCount();
this.gridListCellEditing.startEditByPosition({ row: n - 1, column: 2 });
},
UpDetail: function () {
var StoreCtn = Ext.create('Ext.data.Store', {
fields: [{ name: 'CTN', type: 'string' },
{ name: 'CTNNUM', type: 'number' },
{ name: 'PKGS', type: 'number' },
{ name: 'KINDPKGS', type: 'string' },
{ name: 'KGS', type: 'number' },
{ name: 'CBM', type: 'number' }
]
});
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
if (memberbody.data.CTNNUM > 1) {
StoreCtn.add({ "CTN": memberbody.data.CTNALL, "CTNNUM": memberbody.data.CTNNUM, "PKGS": memberbody.data.PKGS, "KINDPKGS": memberbody.data.KINDPKGS, "KGS": memberbody.data.KGS, "CBM": memberbody.data.CBM });
};
var pkgs = memberbody.data.PKGS;
var kgs = memberbody.data.KGS;
var cbm = memberbody.data.CBM;
var ctnnum = memberbody.data.CTNNUM;
memberbody.set("CTNNUM", 1);
memberbody.set("PKGS", Div(pkgs, ctnnum));
memberbody.set("KGS", Div(kgs, ctnnum));
memberbody.set("CBM", Div(cbm, ctnnum));
memberbody.commit();
};
for (var j = 0; j < StoreCtn.getCount(); j += 1) {
var memberbody = StoreCtn.getAt(j);
for (var I = 0; I < memberbody.data.CTNNUM - 1; I += 1) {
var pkgs = memberbody.data.PKGS;
var kgs = memberbody.data.KGS;
var cbm = memberbody.data.CBM;
var ctnnum = memberbody.data.CTNNUM;
var kingpkgs = memberbody.data.KINDPKGS;
var newSerialno = this.DsGetNewNo(this.storeBodyList);
this.serialNo = newSerialno;
var record = Ext.create('MsOpSeaeDetail', {
CTN_ID: NewGuid(),
BSNO: '*',
CTNCODE: newSerialno,
CTNALL: memberbody.data.CTN,
CTNNUM: 1,
CNTRNO: '',
SEALNO: '',
PKGS: Div(pkgs, ctnnum),
KINDPKGS: kingpkgs,
KGS: Div(kgs, ctnnum),
TAREWEIGHT: 0,
CBM: Div(cbm, ctnnum),
REMARK: ''
});
this.storeBodyList.add(record);
}
};
var n = this.storeBodyList.getCount();
this.gridListCellEditing.startEditByPosition({ row: n - 1, column: 2 });
},
onaddyarddataClick: function () {
var YARD = this.formEdit.getForm().findField('YARD').getValue();
if (YARD == '' || YARD == NaN || YARD == null) {
Ext.Msg.show({ title: '警告', msg: '场站不能为空!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
var MBLNO = this.formHead.getForm().findField('MBLNO').getValue();
if (MBLNO == '' || MBLNO == NaN || MBLNO == null) {
Ext.Msg.show({ title: '警告', msg: '主提单号不能为空!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
Ext.Msg.wait('正在提取数据, 请稍侯..');
var storeyardctn = Ext.create('Ext.data.Store', {
model: 'MsOpSeaeDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeae/GetyardctnList',
reader: {
id: 'BSNO,CTNCODE,CTN_ID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
storeyardctn.load({ params: { bs: BSNO, mblno: MBLNO, yard: YARD },
callback: function (r, options, success) {
if (success) {
var jsonresult = Ext.JSON.decode(options.response.responseText);
if (storeyardctn.getCount() > 0) {
// for (var i = 0; i < this.storeBodyList.getCount(); i += 1) {
// var memberbody = this.storeBodyList.getAt(i);
// if (memberbody.data.CNTRNO=="")
// this.storeBodyList.remove(memberbody);
// }
for (var j = 0; j < storeyardctn.getCount(); j += 1) {
var member = storeyardctn.getAt(j);
var selectrecords = DsStoreQueryBy(this.storeBodyList, 'CNTRNO', member.data.CNTRNO);
if (selectrecords.getCount() > 0) {
var memberbody = selectrecords.getAt(0);
memberbody.set("CNTRNO", member.data.CNTRNO);
if (member.data.SEALNO != '') {
memberbody.set("SEALNO", member.data.SEALNO);
}
if (member.data.KINDPKGS != '') {
memberbody.set("KINDPKGS", member.data.KINDPKGS);
}
if (member.data.PKGS != 0) {
memberbody.set("PKGS", member.data.PKGS);
}
if (member.data.KGS != 0) {
memberbody.set("KGS", member.data.KGS);
}
if (member.data.CBM != 0) {
memberbody.set("CBM", member.data.CBM);
}
memberbody.commit();
} else {
var newSerialno = this.DsGetNewNo(this.storeBodyList);
this.serialNo = newSerialno;
var record = Ext.create('MsOpSeaeDetail', {
CTN_ID: NewGuid(),
BSNO: '*',
CTNCODE: newSerialno,
CTNALL: member.data.CTNALL,
CTNNUM: 1,
CNTRNO: member.data.CNTRNO,
SEALNO: member.data.SEALNO,
PKGS: member.data.PKGS,
KINDPKGS: member.data.KINDPKGS,
KGS: member.data.KGS,
TAREWEIGHT: member.data.TAREWEIGHT,
CBM: member.data.CBM,
REMARK: ''
});
this.storeBodyList.add(record);
}
};
this.setAllTotal();
var KGS = this.formEdit.getForm().findField('KGS').getValue();
this.formEdit.getForm().findField('GROSSWEIGHT').setValue(KGS + 'KGS');
var CBM = this.formEdit.getForm().findField('CBM').getValue();
this.formEdit.getForm().findField('MEASUREMENT').setValue(CBM + 'CBM');
var PKGS = this.formEdit.getForm().findField('PKGS').getValue();
var KINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue();
this.formEdit.getForm().findField('NOPKGS').setValue(PKGS + KINDPKGS);
this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(PKGS).toUpperCase() + ' ' + KINDPKGS + ' ONLY.');
Ext.Msg.hide();
} else {
if (jsonresult.Success) {
Ext.Msg.show({ title: '警告', msg: '没有提取的相关数据!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
} else
Ext.Msg.show({ title: '警告', msg: jsonresult.Message, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
}
}
},
scope: this
});
},
DsGetNewNo: function (store) {
var result = store.getCount();
if (result == 0) {
return 1;
}
// var record = store.getAt(result - 1).data.CTNCODE;
result = result + 1;
return result;
},
deleteDetail: function () {
var BSSTATUS = this.formHead.getForm().findField('BSSTATUSREF').getValue();
if (BSSTATUS == '锁定') {
Ext.Msg.show({ title: '警告', msg: '业务已锁定,不允许操作!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
var selectedRecords = this.gridList.selModel.getSelection();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.BSNO == "" || rec.data.BSNO == "*")//如果是新增但没有保存的数据,没有必要提交到后台
{
this.storeBodyList.remove(selectedRecords[i]);
this.setAllTotal();
var KGS = this.formEdit.getForm().findField('KGS').getValue();
this.formEdit.getForm().findField('GROSSWEIGHT').setValue(KGS + 'KGS');
var CBM = this.formEdit.getForm().findField('CBM').getValue();
this.formEdit.getForm().findField('MEASUREMENT').setValue(CBM + 'CBM');
var PKGS = this.formEdit.getForm().findField('PKGS').getValue();
var KINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue();
this.formEdit.getForm().findField('NOPKGS').setValue(PKGS + KINDPKGS);
this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(PKGS).toUpperCase() + ' ' + KINDPKGS + ' ONLY.');
}
else {
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/MvcShipping/MsOpSeae/DeleteDetail',
params: {
data: Ext.JSON.encode(rec.data)
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeBodyList.remove(rec);
this.setAllTotal();
var KGS = this.formEdit.getForm().findField('KGS').getValue();
this.formEdit.getForm().findField('GROSSWEIGHT').setValue(KGS + 'KGS');
var CBM = this.formEdit.getForm().findField('CBM').getValue();
this.formEdit.getForm().findField('MEASUREMENT').setValue(CBM + 'CBM');
var PKGS = this.formEdit.getForm().findField('PKGS').getValue();
var KINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue();
this.formEdit.getForm().findField('NOPKGS').setValue(PKGS + KINDPKGS);
this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(PKGS).toUpperCase() + ' ' + KINDPKGS + ' ONLY.');
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}
//this.storeBodyList.remove(selectedRecords[i]);
}
},
setAllTotal: function () {
this.setPKGSTotal();
this.setKGSTotal();
this.setCBMTotal();
},
setPKGSTotal: function () {
var total = this.calcDetailTotal('PKGS');
this.setHeadFieldValue('PKGS', total);
},
setKGSTotal: function () {
var total = this.calcDetailTotal('KGS');
this.setHeadFieldValue('KGS', total);
},
setCBMTotal: function () {
var total = this.calcDetailTotal('CBM');
this.setHeadFieldValue('CBM', total);
},
calcDetailTotal: function (fieldName) {
var total = 0;
for (var i = 0; i < this.storeBodyList.getCount(); i += 1) {
var member = this.storeBodyList.getAt(i);
var value = member.get(fieldName);
total = Add(total, value);
}
return total;
},
setHeadFieldValue: function (fieldName, value) {
var field = this.formEdit.getForm().findField(fieldName);
field.setValue(value);
},
//#endregion
//#region
LoadDefValue: function () {
this.storeDefValue.load({ params: { condition: "BSTYPE='海运出口'" },
callback: function (r, options, success) {
if (success) {
if (this.storeDefValue.getCount() > 0) {
for (var j = 0; j < this.storeDefValue.getCount(); j += 1) {
var member = this.storeDefValue.getAt(j);
var headfield = this.formHead.getForm().findField(member.data.FIELDNAME);
if (headfield != NaN && headfield != null)
headfield.setValue(member.data.DEFVALUE);
var headfield = this.formEdit.getForm().findField(member.data.FIELDNAME);
if (headfield != NaN && headfield != null)
headfield.setValue(member.data.DEFVALUE);
var headfield = this.formEDI.getForm().findField(member.data.FIELDNAME);
if (headfield != NaN && headfield != null)
headfield.setValue(member.data.DEFVALUE);
};
} else {
}
}
},
scope: this
});
},
LoadMustBe: function () {
this.storeMustBe.load({ params: { condition: "BSTYPE='海运出口'" },
callback: function (r, options, success) {
if (success) {
if (this.storeMustBe.getCount() > 0) {
for (var j = 0; j < this.storeMustBe.getCount(); j += 1) {
var member = this.storeMustBe.getAt(j);
var headfield = this.formHead.getForm().findField(member.data.FIELDNAME);
if (headfield != NaN && headfield != null)
headfield.allowBlank = false;
var headfield = this.formEdit.getForm().findField(member.data.FIELDNAME);
if (headfield != NaN && headfield != null)
headfield.allowBlank = false;
var headfield = this.formEDI.getForm().findField(member.data.FIELDNAME);
if (headfield != NaN && headfield != null)
headfield.allowBlank = false;
};
} else {
}
}
},
scope: this
});
},
LoadInit: function (data) {
var CUSTOMERNAME = this.formHead.getForm().findField('CUSTOMERNAME').getValue();
var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + CUSTOMERNAME + "')";
this.storeInfoClientContact.load({ params: { condition: s} });
var sF = " ISFINANCIALSTAFF=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + CUSTOMERNAME + "')";
this.storeInfoClientContactFF.load({ params: { condition: sF} });
this.storeShipper.load({ params: { condition: "shippertype=2 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" },
callback: function (r, options, success) {
if (success) {
this.formEdit.getForm().findField('SHIPPERID').setValue(data.SHIPPERID);
}
},
scope: this
});
this.storeConsignee.load({ params: { condition: "shippertype=1 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" },
callback: function (r, options, success) {
if (success) {
this.formEdit.getForm().findField('CONSIGNEEID').setValue(data.CONSIGNEEID);
}
},
scope: this
});
this.storenotifyparty.load({ params: { condition: "shippertype=3 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" },
callback: function (r, options, success) {
if (success) {
this.formEdit.getForm().findField('NOTIFYPARTYID').setValue(data.NOTIFYPARTYID);
}
},
scope: this
});
this.storeagent.load({ params: { condition: "shippertype=4 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" },
callback: function (r, options, success) {
if (success) {
this.formEdit.getForm().findField('AGENTID').setValue(data.AGENTID);
}
},
scope: this
});
var BLTYPE = this.formHead.getForm().findField('BLTYPE').getValue();
if (BLTYPE == "拼箱单票" || BLTYPE == "拼箱分票") {
this.panelBodyCtn.hide();
}
else {
this.panelBodyCtn.show();
}
var CARGOID = this.formEdit.getForm().findField('CARGOID').getValue();
if (CARGOID == 'R') {
this.panelBodyDr.setVisible(false);
this.panelBodyRf.setVisible(true);
} else if (CARGOID == 'D') {
this.panelBodyDr.setVisible(true);
this.panelBodyRf.setVisible(false);
} else {
this.panelBodyDr.setVisible(false);
this.panelBodyRf.setVisible(false);
}
},
//#endregion
//#region 转换成大写字符
onUpCaseClick: function (menu, event) {
this.formEdit.getForm().findField('SHIPPER').setValue(this.formEdit.getForm().findField('SHIPPER').getValue().toUpperCase());
this.formEdit.getForm().findField('CONSIGNEE').setValue(this.formEdit.getForm().findField('CONSIGNEE').getValue().toUpperCase());
this.formEdit.getForm().findField('NOTIFYPARTY').setValue(this.formEdit.getForm().findField('NOTIFYPARTY').getValue().toUpperCase());
this.formEdit.getForm().findField('AGENT').setValue(this.formEdit.getForm().findField('AGENT').getValue().toUpperCase());
this.formEdit.getForm().findField('MARKS').setValue(this.formEdit.getForm().findField('MARKS').getValue().toUpperCase());
this.formEdit.getForm().findField('DESCRIPTION').setValue(this.formEdit.getForm().findField('DESCRIPTION').getValue().toUpperCase());
},
//#endregion
//#region 报文
onCreateAfrClick: function (menu, event, type) {
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
var basicForm = this.formHead.getForm();
var billNo = basicForm.findField('CUSTNO').value;
if (billNo == '*' || billNo == '') {
Ext.Msg.show({ title: '错误', msg: '单据还没有保存,无法生成报文', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
Ext.Ajax.request({
waitMsg: '正在生成...',
url: '/MvcShipping/MsOpSeae/CreateAfrList',
params: {
BSNOS: BSNO,
type: type
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
onCreateCustomClick: function (menu, event, type) {
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
var basicForm = this.formHead.getForm();
var billNo = basicForm.findField('CUSTNO').value;
if (billNo == '*' || billNo == '') {
Ext.Msg.show({ title: '错误', msg: '单据还没有保存,无法生成报文', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
Ext.Ajax.request({
waitMsg: '正在生成...',
url: '/MvcShipping/MsOpSeae/CreateCustomList',
params: {
BSNOS: BSNO,
type: type
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
//#endregion
//#region 保存报关
SaveBG: function (type) {
var basicForm = this.formEdit.getForm();
var basicForm2 = this.formHead.getForm();
if (!basicForm.isValid()) {
return;
}
if (!basicForm2.isValid()) {
return;
}
this.formHead.getForm().findField('BSNO').setDisabled(false);
var data = this.formHead.getForm().getValues(false, false, false);
var data2 = this.formEdit.getForm().getValues(false, false, false);
var data3 = this.formEDI.getForm().getValues(false, false, false);
this.formHead.getForm().findField('BSNO').setDisabled(true);
Ext.Msg.wait('正在生成数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在生成数据...',
url: '/MvcShipping/MsOpSeae/SaveBG',
scope: this,
params: {
data: Ext.JSON.encode(data),
data2: Ext.JSON.encode(data2),
data3: Ext.JSON.encode(data3)
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
} 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
});
}
}
});
}, //end save
//#endregion
//#region 舱单状态
onCustomStatusClick: function (menu, event) {
var bsno = this.formHead.getForm().findField('BSNO').getValue();
var mblno = this.formHead.getForm().findField('MBLNO').getValue()
if (mblno == "") {
return;
}
Ext.Msg.wait('正在提取数据...');
Ext.Ajax.request({
waitMsg: '正在提取数据...',
url: '/MvcShipping/MsOpSeae/Get56CDCSTATUSList',
params: {
mblno: mblno,
bsno: bsno
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var statusdata = jsonresult.data;
var boxitems = "";
formCustomDataShow = Ext.widget('form', {
region: 'center',
autoScroll: true, height: 460,
// border: false,
bodyPadding: 0,
html: jsonresult.data
});
me = this;
winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
// closeAction: 'hide',
width: 1000,
height: 480,
layout: 'fit',
resizable: true,
modal: true,
closeAction: 'close',
closable: true,
items: [formCustomDataShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
Ext.Msg.hide();
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
},
//#endregion
//#region 场站查询
onGETYARDClick: function (button, event) {
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
var MBLNO = this.formHead.getForm().findField('MBLNO').getValue();
var YARD = this.formEdit.getForm().findField('YARD').getValue();
if (MBLNO == "" || YARD == "") {
Ext.Msg.show({ title: '提示', msg: '提单号和场站不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.wait('正在提取数据...');
Ext.Ajax.request({
waitMsg: '正在提取数据...',
url: '/MvcShipping/MsOpSeae/GetyardctnList',
params: {
bs: BSNO,
mblno: MBLNO,
yard: YARD,
isweb: true
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var statusdata = jsonresult.data;
var boxitems = "";
formCustomDataShow = Ext.widget('form', {
region: 'center',
autoScroll: true, height: 460,
// border: false,
bodyPadding: 0,
html: jsonresult.data
});
me = this;
winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
// closeAction: 'hide',
width: 1100,
height: 500,
layout: 'fit',
resizable: true,
modal: true,
closeAction: 'close',
closable: true,
items: [formCustomDataShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
Ext.Msg.hide();
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
},
//#endregion
//#region QQCT单票查询
onQQCTBILLClick: function (button, event) {
var mblno = this.formHead.getForm().findField('MBLNO').getValue();
if (mblno == "") {
Ext.Msg.show({ title: '提示', msg: '提单号不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.wait('正在提取数据...');
Ext.Ajax.request({
waitMsg: '正在提取数据...',
url: '/MvcShipping/MsOpSeae/GetQQCTBILL',
params: {
mblno: mblno,
bsno: ''
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var statusdata = jsonresult.data;
var boxitems = "";
formCustomDataShow = Ext.widget('form', {
region: 'center',
autoScroll: true, height: 460,
// border: false,
bodyPadding: 0,
html: jsonresult.data
});
me = this;
winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
// closeAction: 'hide',
width: 1100,
height: 500,
layout: 'fit',
resizable: true,
modal: true,
closeAction: 'close',
closable: true,
items: [formCustomDataShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
Ext.Msg.hide();
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
},
//#endregion
//#region QQCTU单票查询
onQQCTUBILLClick: function (button, event) {
var mblno = this.formHead.getForm().findField('MBLNO').getValue();
if (mblno == "") {
Ext.Msg.show({ title: '提示', msg: '提单号不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.wait('正在提取数据...');
Ext.Ajax.request({
waitMsg: '正在提取数据...',
url: '/MvcShipping/MsOpSeae/GetQQCTUBILL',
params: {
mblno: mblno,
bsno: ''
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var statusdata = jsonresult.data;
var boxitems = "";
formCustomDataShow = Ext.widget('form', {
region: 'center',
autoScroll: true, height: 460,
// border: false,
bodyPadding: 0,
html: jsonresult.data
});
me = this;
winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
// closeAction: 'hide',
width: 1100,
height: 500,
layout: 'fit',
resizable: true,
modal: true,
closeAction: 'close',
closable: true,
items: [formCustomDataShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
Ext.Msg.hide();
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
},
//#endregion
//#region 单船查询
onGETQDVESSELClick: function (button, event) {
var vessel = this.formEdit.getForm().findField('VESSEL').getValue();
var voyno = this.formEdit.getForm().findField('VOYNO').getValue();
if (vessel == "") {
Ext.Msg.show({ title: '提示', msg: '船名不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.wait('正在提取数据...');
Ext.Ajax.request({
waitMsg: '正在提取数据...',
url: '/MvcShipping/MsOpSeae/GetQDVESSEL',
params: {
vessel: vessel,
voyno: voyno
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var statusdata = jsonresult.data;
var boxitems = "";
formCustomDataShow = Ext.widget('form', {
region: 'center',
autoScroll: true, height: 460,
// border: false,
bodyPadding: 0,
html: jsonresult.data
});
me = this;
winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
// closeAction: 'hide',
width: 1100,
height: 500,
layout: 'fit',
resizable: true,
modal: true,
closeAction: 'close',
closable: true,
items: [formCustomDataShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
Ext.Msg.hide();
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
},
//#endregion
//#region 烟台港箱动态
onYanTaiYardStatusClick: function (button, event) {
var mblno = this.formHead.getForm().findField('MBLNO').getValue();
if (mblno == "") {
Ext.Msg.show({ title: '提示', msg: '没有要刷新查看的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
var yantaiyardview = new Shipping.YantaiYardView({
});
yantaiyardview.mblno = mblno;
yantaiyardview.show();
return;
}
},
//#endregion
//#region 编辑时按钮等的状态
GetEditStatus: function () {
var canedit = false;
//var bsStatus = this.formHead.getForm().findField('BSSTATUS').getValue();
var BSSTATUS = this.formHead.getForm().findField('BSSTATUSREF').getValue();
var inputby = this.formHead.getForm().findField('INPUTBY').getValue();
var op = this.formHead.getForm().findField('OP').getValue();
_this = this;
if (BSSTATUS == '锁定') {
canedit = false;
this.setSaveBtnStatus(canedit);
} else {
this.StoreOpRange.load({ params: { optype: "modOrderManagement" },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
var records = DsStoreQueryBy(_this.StoreOpRange, 'OPID', op);
if (records.getCount() > 0) {
canedit = true;
} else {
var recordins = DsStoreQueryBy(_this.StoreOpRange, 'OPID', inputby);
if (recordins.getCount() > 0) {
canedit = true;
} else {
canedit = false;
}
}
} else { canedit = false; }
_this.setSaveBtnStatus(canedit);
}
}
});
}
_this = this;
Ext.Ajax.request({
waitMsg: '正在查询委托编号状态...',
url: '/MvcShipping/MsBaseInfo/GetRuleEdit',
params: {
rulename: '委托编号',
ruletype: '1'
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
var custno = _this.formHead.getForm().findField('CUSTNO');
custno.setReadOnly(true);
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '正在查询委托编号状态...',
url: '/MvcShipping/MsBaseInfo/GetRuleEdit',
params: {
rulename: '分提单号',
ruletype: '1'
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
var hblno = _this.formHead.getForm().findField('HBLNO');
hblno.setReadOnly(true);
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
GetStringNum: function (str) {
var num = 0;
if (str == null || str == '') return num;
if (str.length == 0) return num;
var if_find = false;
var str_num = '';
for (var i = 0; i < str.length; i += 1) {
var member = str.substr(i, 1);
if ((member == '0') || (member == '1') || (member == '2') || (member == '3')
|| (member == '4') || (member == '5') || (member == '6') || (member == '7')
|| (member == '8') || (member == '9') || (member == '.') || (member == '-')) {
if (!if_find) {
str_num = str_num + member;
}
} else {
if_find = true;
}
}
return str_num;
},
setSaveBtnStatus: function (enable) {
var btnESave = Ext.getCmp('btnESave');
var btnESaveAndClose = Ext.getCmp('btnESaveAndClose');
var btnESaveAndNew = Ext.getCmp('btnESaveAndNew');
var btnEAddDetail = Ext.getCmp('btnadddetail');
var btnEDeleteDetail = Ext.getCmp('btndeldetail');
var btnEUpDetail = Ext.getCmp('btnadddetail2');
if (enable) {
btnESave.enable();
btnESaveAndClose.enable();
btnESaveAndNew.enable();
btnEAddDetail.enable();
btnEDeleteDetail.enable();
btnEUpDetail.enable();
} else {
btnESave.disable();
btnESaveAndClose.disable();
btnESaveAndNew.disable();
btnEAddDetail.disable();
btnEDeleteDetail.disable();
btnEUpDetail.disable();
}
},
//#endregion
//#region 打印
Print: function () {
var basicForm = this.formHead.getForm();
var billNo = basicForm.findField('BSNO').value;
if (billNo == '*' || billNo == '') {
Ext.Msg.show({ title: '错误', msg: '单据还没有保存,请保存后再打印', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var printType = 'MSOPSEAE';
var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM op_seae WHERE BSNO = '" + billNo + "'";
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
//#endregion
PrevRecord: function () {
var modifystr = this.getIsModify();
if (modifystr != "") {
Ext.Msg.show({ title: '警告', msg: modifystr + '未保存,如果离开此页,将丢失未保存的更改 ', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var j = this.StoreList.indexOf(this.editRecord);
if (j == 0) {
Ext.Msg.show({ title: '警告', msg: '已是最前一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
if (j == this.StoreList.count) {
Ext.Msg.show({ title: '警告', msg: '已是最后一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var children = this.tabSeaepanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
if (children.items[i].id) {
if (children.items[i].id == 'pnlmodNewOpSeaeInfo') {
} else {
children.items[i].close();
}
}
}
}
this.tabSeaepanel.doLayout();
j = j - 1;
this.editRecord = this.StoreList.getAt(j);
if (this.opStatus == 'edit') {
condition = "BSNO='" + this.editRecord.get('BSNO') + "'";
//this.storeBodyList.load({ params: { condition: condition} });
}
this.LoadData(this.opStatus, condition);
},
NextRecord: function () {
var modifystr = this.getIsModify();
if (modifystr != "") {
Ext.Msg.show({ title: '警告', msg: modifystr + '未保存,如果离开此页,将丢失未保存的更改 ', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var j = this.StoreList.indexOf(this.editRecord);
if (j == (this.StoreList.count - 1)) {
Ext.Msg.show({ title: '警告', msg: '已是最后一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var children = this.tabSeaepanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
if (children.items[i].id) {
if (children.items[i].id == 'pnlmodNewOpSeaeInfo') {
// this.tabSeaepanel.setActiveTab(i);
} else {
children.items[i].close();
}
}
}
}
this.tabSeaepanel.doLayout();
j = j + 1;
this.editRecord = this.StoreList.getAt(j);
if (this.opStatus == 'edit') {
condition = "BSNO='" + this.editRecord.get('BSNO') + "'";
//this.storeBodyList.load({ params: { condition: condition} });
}
this.LoadData(this.opStatus, condition);
},
getIsModify: function () {
var feepanel = Ext.getCmp('pnlmodSeaeAllFee');
if (feepanel != NaN && feepanel != null) {
var feemodify = feepanel.panelFee.getModifyStatus();
if (feemodify) {
return '费用信息';
}
}
var feeamendpanel = Ext.getCmp('pnlmodSeaeAmendFee');
if (feeamendpanel != NaN && feeamendpanel != null) {
var feemodify = feeamendpanel.panelFee.getModifyStatus();
if (feemodify) {
return '更改单信息';
}
}
var drmodify = this.storeBodyList.getModifiedRecords();
if (panelEdit.formEdit.getForm().isDirty() == true || panelEdit.formHead.getForm().isDirty() == true || panelEdit.formEDI.getForm().isDirty() == true || drmodify.length != 0) {
return '业务信息';
}
else return '';
}
});