Ext.namespace('Shipping');
Shipping.MsOpSeaeSaleEdit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpSeaeSaleEdit.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpSeaeSaleEdit, Ext.Panel, {
ParentWin: null,
OpStatus: 'add',
StoreList: null,
editRecord: null,
Editdata: null,
stroplb: '海运出口',
salefee:'1',
initUIComponents: function () {
this.serialNo = 0;
//this.bodyDel = [];
this.itemindex = 1;
this.initloaddata = 0;
_this = this;
//#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.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
this.storeOpCode5 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
//客服
this.comboxCUSTSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客服',
store: this.storeOpCode,
forceSelection: true,
name: 'CUSTSERVICE',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
//揽货人
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '揽货人',
store: this.storeOpCode,
forceSelection: true,
name: 'SALE',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
//操 作
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操 作',
store: this.storeOpCode,
forceSelection: true,
name: 'OP',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
//单证
this.comboxDOC = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '单 证',
store: this.storeOpCode,
forceSelection: true,
name: 'DOC',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
this.comboxFRCUSTSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.FRCUSTSERVICE, //'客服',
store: this.storeOpCode5,
forceSelection: true,
name: 'FRCUSTSERVICE',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
//客户加载_委托单位
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
//委托单位
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
store: this.storeCustCode,
forceSelection: true,
name: 'CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
allowBlank: false,
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var data = combo.value;
this.formHead.getForm().findField('SALE').setValue(records[0].data.SALE);
var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')";
this.storeInfoClientContact.load({ params: { condition: s },
callback: function (r, options, success) {
if (success) {
if (this.storeInfoClientContact.getCount() > 0) {
var member = this.storeInfoClientContact.getAt(0);
this.comboxInfoClientContact.setValue(member.data.SHOWNAME);
// this.formHead.getForm().findField('OPERATOREMAIL').setValue(member.data.EMAIL);
this.formHead.getForm().findField('OPERATORTEL').setValue(member.data.TEL);
// this.formHead.getForm().findField('OPERATORFAX').setValue(member.data.FAX);
} else {
this.comboxInfoClientContact.setValue('');
// this.formHead.getForm().findField('OPERATOREMAIL').setValue('');
this.formHead.getForm().findField('OPERATORTEL').setValue('');
// this.formHead.getForm().findField('OPERATORFAX').setValue('');
}
}
},
scope: this
});
var sF = " ISFINANCIALSTAFF=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')";
this.storeInfoClientContactFF.load({ params: { condition: sF },
callback: function (r, options, success) {
if (success) {
if (this.storeInfoClientContactFF.getCount() > 0) {
var member = this.storeInfoClientContactFF.getAt(0);
this.comboxClientFCContact.setValue(member.data.SHOWNAME);
// this.formHead.getForm().findField('FINANCIALSTAFFEMAIL').setValue(member.data.EMAIL);
this.formHead.getForm().findField('FINANCIALSTAFFTEL').setValue(member.data.TEL);
// this.formHead.getForm().findField('FINANCIALSTAFFFAX').setValue(member.data.FAX);
} else {
this.comboxClientFCContact.setValue('');
// this.formHead.getForm().findField('FINANCIALSTAFFEMAIL').setValue('');
this.formHead.getForm().findField('FINANCIALSTAFFTEL').setValue('');
// this.formHead.getForm().findField('FINANCIALSTAFFFAX').setValue('');
}
}
},
scope: this
});
this.storeShipper.load({ params: { condition: "shippertype=2 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + combo.value + "') )"} });
this.storeConsignee.load({ params: { condition: "shippertype=1 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + combo.value + "') )"} });
this.storenotifyparty.load({ params: { condition: "shippertype=3 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + combo.value + "') )"} });
this.storeagent.load({ params: { condition: "shippertype=4 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + combo.value + "') )"} });
}
}
}
});
//委托单位_联系人
this.storeInfoClientContact = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.InfoClientContactModel',
proxy: { url: '/CommMng/BasicDataRef/GetInfoClientContactList' }
});
this.storeInfoClientContactFF = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.InfoClientContactModel',
proxy: { url: '/CommMng/BasicDataRef/GetInfoClientContactList' }
});
//this.storeInfoClientContact.load();
this.comboxInfoClientContact = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客户操作',
store: this.storeInfoClientContact,
// forceSelection: true,
name: 'OPERATOR',
valueField: 'SHOWNAME',
displayField: 'SHOWNAME',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var Cargoinforecords = DsStoreQueryBy(this.storeInfoClientContact, 'GID', records[0].data.GID);
if (Cargoinforecords.getCount() > 0) {
var Cargoinfodata = Cargoinforecords.getAt(0).data;
// this.formHead.getForm().findField('OPERATOREMAIL').setValue(Cargoinfodata.EMAIL);
this.formHead.getForm().findField('OPERATORTEL').setValue(Cargoinfodata.TEL);
// this.formHead.getForm().findField('OPERATORFAX').setValue(Cargoinfodata.FAX);
} else {
// this.formHead.getForm().findField('OPERATOREMAIL').setValue('');
this.formHead.getForm().findField('OPERATORTEL').setValue('');
// this.formHead.getForm().findField('OPERATORFAX').setValue('');
}
}
}
}
});
this.comboxClientFCContact = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客户财务',
store: this.storeInfoClientContactFF,
// forceSelection: true,
name: 'FINANCIALSTAFFCODE',
valueField: 'SHOWNAME',
displayField: 'SHOWNAME',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var Cargoinforecords = DsStoreQueryBy(this.storeInfoClientContactFF, 'GID', records[0].data.GID);
if (Cargoinforecords.getCount() > 0) {
var Cargoinfodata = Cargoinforecords.getAt(0).data;
// this.formHead.getForm().findField('FINANCIALSTAFFEMAIL').setValue(Cargoinfodata.EMAIL);
this.formHead.getForm().findField('FINANCIALSTAFFTEL').setValue(Cargoinfodata.TEL);
// this.formHead.getForm().findField('FINANCIALSTAFFFAX').setValue(Cargoinfodata.FAX);
} else {
// this.formHead.getForm().findField('FINANCIALSTAFFEMAIL').setValue('');
this.formHead.getForm().findField('FINANCIALSTAFFTEL').setValue('');
// this.formHead.getForm().findField('FINANCIALSTAFFFAX').setValue('');
}
}
}
}
});
//客户加载_场站
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,
forceSelection: true,
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,
forceSelection: true,
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,
forceSelection: true,
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,
forceSelection: true,
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,
forceSelection: true,
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,
forceSelection: true,
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,
forceSelection: true,
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,
forceSelection: true,
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,
// forceSelection: true,
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,
// forceSelection: true,
name: 'BSSOURCE',
valueField: 'SourceName',
displayField: 'SourceName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var recs = DsStoreQueryBy(this.storeSource, 'SourceID', records[0].data.SourceID);
if (recs.getCount() > 0) {
var data = recs.getAt(0).data;
var s = "SOURCEID='" + data.SourceID + "'";
this.storeSourceDetail.load({ params: { condition: s} });
} else {
var BSSOURCEDETAIL = this.formHead.getForm().findField('BSSOURCEDETAIL');
BSSOURCEDETAIL.setValue('');
}
}
}
}
});
this.storeSourceDetail.load();
this.comboxBSSOURCEDETAIL = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '贸易条款',
store: this.storeSourceDetail,
// forceSelection: true,
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,
forceSelection: true,
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',
// forceSelection: true,
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,
// forceSelection: true,
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,
forceSelection: true,
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,
// forceSelection: true,
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,
// forceSelection: true,
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,
// forceSelection: true,
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',
// forceSelection: true,
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,
// forceSelection: true,
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: '结算方式',
forceSelection: true,
name: 'STLNAME',
valueField: 'STLNAME',
displayField: 'STLNAME'
});
//#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: '业务编号',
name: 'BSNO', hidden: true
}, {
fieldLabel: 'MASTERNO', //'业务编号',
name: 'MASTERNO', hidden: true
}, {
fieldLabel: 'CREATETIME', //'CREATETIME',
name: 'CREATETIME', hidden: true
}, {
fieldLabel: 'INPUTBY',
name: 'INPUTBY', hidden: true
}, {
fieldLabel:'CNTRTOTAL', //'CNTRTOTAL',
name: 'CNTRTOTAL', hidden: true
}, {
fieldLabel: 'MSHIPPERID', //'MSHIPPERID',
name: 'MSHIPPERID', hidden: true
}, {
fieldLabel: 'MCONSIGNEEID', //'MCONSIGNEEID',
name: 'MCONSIGNEEID', hidden: true
}, {
fieldLabel: 'MNOTIFYPARTYID', //'MNOTIFYPARTYID',
name: 'MNOTIFYPARTYID', hidden: true
}, {
fieldLabel: 'MSHIPPER', //'MSHIPPER',
xtype: 'textareafield',
name: 'MSHIPPER', hidden: true
}, {
fieldLabel: 'MCONSIGNEE', //'MCONSIGNEE',
xtype: 'textareafield',
name: 'MCONSIGNEE', hidden: true
}, {
fieldLabel: 'MNOTIFYPARTY', //'MNOTIFYPARTY',
xtype: 'textareafield',
name: 'MNOTIFYPARTY', hidden: true
}, {
fieldLabel:'MBLFRT', //'MBLFRT',
name: 'MBLFRT', hidden: true
}, {
fieldLabel: 'SALEDEPT', //'SALEDEPT',
name: 'SALEDEPT', hidden: true
}, {
fieldLabel: '业务锁定',
disabled: true,
readOnly: true,
name: 'BSSTATUSREF'
}, {
fieldLabel: '费用锁定',
readOnly: true,
disabled: true,
name: 'FEESTATUSREF'
}, {
fieldLabel: '会计期间',
xtype: 'monthfield',
name: 'ACCDATE'
}, this.comboxBLTYPE, {
fieldLabel: '贸易条款',
name: 'TRADETERM'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxCustCode, this.comboxBSSOURCE, this.comboxBSSOURCEDETAIL, {
fieldLabel: '结算方式',
name: 'STLNAME'
}, {
fieldLabel: '结算日期', //'结算日期', readOnly: true,
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'STLDATE', id: "STLDATE"
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxOP, this.comboxSALE, this.comboxDOC, this.comboxCUSTSERVICE, {
fieldLabel: '发票号', //'发票号',
name: 'INVNO'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '委托编号',
allowBlank: true,
name: 'CUSTNO'
}, {
fieldLabel: '订舱编号',
name: 'ORDERNO'
}, {
fieldLabel: '主提单号',
name: 'MBLNO'
}, {
fieldLabel: '分提单号',
name: 'HBLNO'
}, {
fieldLabel: '合约号', //'运费协议号',
name: 'CONTRACTNO'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '参考号',
name: 'SERVICECONTRACTNO'
}, {
fieldLabel: '申请放箱号', //'申请放箱号',
name: 'APPLYNO'
}, this.comboxInfoClientContact, {
fieldLabel: 'TEL',
name: 'OPERATORTEL'
}, this.comboxClientFCContact]
}, this.myCheckboxService
]//end items(fieldset 1)
}); //end this.formEdit
//#endregion
//#region 集装箱-数据集
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',
// tbar: [{
// text: '增加明细',
// tooltip: '增加明细',
// id: "btnadddetail",
// iconCls: "btnadddetail",
// handler: function (button, event) {
// this.onAddDetailClick(button, event);
// },
// scope: this
// }, '-', {
// text: '删除明细',
// tooltip: '删除明细',
// id: "btndeldetail",
// iconCls: "btndeletedetail",
// handler: function (button, event) {
// this.onDelDetailClick(button, event);
// },
// scope: this
// }, '-', {
// text: '展开集装箱',
// id: "btnadddetail2",
// handler: function (button, event) {
// this.onUpDetailClick(button, event);
// },
// scope: this
// }, '-', {
// text: '引入场站数据',
// id: "btnaddyarddata",
// handler: function (button, event) {
// this.onaddyarddataClick(button, event);
// },
// scope: this
// }],
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: 48,
editor: this.comboxCTNALL
}, {
dataIndex: 'CTNNUM',
header: '箱量',
width: 30,
editor: {
xtype: 'numberfield',
allowBlank: false,
selectOnFocus: true
}
}, {
dataIndex: 'CNTRNO',
header: '箱号',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'SEALNO',
header: '封号',
width: 65,
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: '温度单位',
forceSelection: true,
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: 2,
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.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
});
// this.storeCodeDisport.load();
this.storeCodeDisport2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
});
// this.storeCodeDisport2.load();
this.storeCodeDisport3 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
});
// this.storeCodeDisport3.load();
this.storeCodeDisport4 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
});
//国内港口(出口装货港、进口卸货港)
this.storeCodeLoadport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeLoadportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportList' }
});
// this.storeCodeLoadport.load();
// this.storeCodeDisport4.load();
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '装货港',
store: this.storeCodeLoadport,
name: 'PORTLOAD',
valueField: 'PORT',
displayField: 'CodeAndName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var selectrecords = DsStoreQueryBy(this.storeCodeLoadport, 'PORT', combo.value);
if (selectrecords.getCount() > 0) {
var selectdata = selectrecords.getAt(0).data;
this.formEdit.getForm().findField('PORTLOADID').setValue(selectdata.EDICODE);
} else {
this.formEdit.getForm().findField('PORTLOADID').setValue('');
}
}
}
}
});
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '卸货港',
store: this.storeCodeDisport,
name: 'PORTDISCHARGE',
valueField: 'PORT',
queryMode: 'local',
displayField: 'PORT',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var selectrecords = DsStoreQueryBy(this.storeCodeDisport, 'PORT', combo.value);
if (selectrecords.getCount() > 0) {
var selectdata = selectrecords.getAt(0).data;
this.formEdit.getForm().findField('PORTDISCHARGEID').setValue(selectdata.EDICODE);
var DESTINATION = this.formEdit.getForm().findField('DESTINATIONID').getValue();
if (DESTINATION == null || DESTINATION == '') {
this.formEdit.getForm().findField('DESTINATION').setValue(combo.value);
this.formEdit.getForm().findField('DESTINATIONID').setValue(selectdata.EDICODE);
}
var PLACEDELIVERY = this.formEdit.getForm().findField('PLACEDELIVERY').getValue();
if (PLACEDELIVERY == null || PLACEDELIVERY == '') {
this.formEdit.getForm().findField('PLACEDELIVERY').setValue(combo.value);
this.formEdit.getForm().findField('PLACEDELIVERYID').setValue(selectdata.EDICODE);
}
} else {
this.formEdit.getForm().findField('PORTDISCHARGEID').setValue('');
}
}
}
}
});
this.comboxDESTINATION = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '目的地',
store: this.storeCodeDisport2,
name: 'DESTINATION',
valueField: 'PORT',
displayField: 'PORT',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var selectrecords = DsStoreQueryBy(this.storeCodeDisport2, 'PORT', combo.value);
if (selectrecords.getCount() > 0) {
var selectdata = selectrecords.getAt(0).data;
this.formEdit.getForm().findField('DESTINATIONID').setValue(selectdata.EDICODE);
} else {
this.formEdit.getForm().findField('DESTINATIONID').setValue('');
}
}
}
}
});
this.comboxPLACEDELIVERY = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '交货地',
store: this.storeCodeDisport3,
name: 'PLACEDELIVERY',
valueField: 'PORT',
displayField: 'PORT',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var selectrecords = DsStoreQueryBy(this.storeCodeDisport3, 'PORT', combo.value);
if (selectrecords.getCount() > 0) {
var selectdata = selectrecords.getAt(0).data;
this.formEdit.getForm().findField('PLACEDELIVERYID').setValue(selectdata.EDICODE);
} else {
this.formEdit.getForm().findField('PLACEDELIVERYID').setValue('');
}
}
}
}
});
this.comboxPLACERECEIPT = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '收货地点',
store: this.storeCodeDisport4,
name: 'PLACERECEIPT',
valueField: 'PORT',
displayField: 'PORT'
});
//付费方式
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,
forceSelection: true,
name: 'BLFRT',
valueField: 'FRT',
displayField: 'FRT',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
if (combo.value == "FREIGHT PREPAID") {
var portload = this.formEdit.getForm().findField('PORTLOAD').getValue();
var portloadid = this.formEdit.getForm().findField('PORTLOADID').getValue();
this.formEdit.getForm().findField('PREPARDAT').setValue(portload);
this.formEdit.getForm().findField('PAYABLEAT').setValue('');
this.formEdit.getForm().findField('ISSUEPLACE').setValue(portload);
this.formEdit.getForm().findField('ISSUEPLACEID').setValue(portloadid);
} else if (combo.value == "FREIGHT COLLECT") {
var PORTDISCHARGE = this.formEdit.getForm().findField('PORTDISCHARGE').getValue();
var PORTDISCHARGEID = this.formEdit.getForm().findField('PORTDISCHARGEID').getValue();
this.formEdit.getForm().findField('PREPARDAT').setValue('');
this.formEdit.getForm().findField('PAYABLEAT').setValue(PORTDISCHARGE);
this.formEdit.getForm().findField('ISSUEPLACE').setValue(PORTDISCHARGE);
this.formEdit.getForm().findField('ISSUEPLACEOD').setValue(PORTDISCHARGEID);
}
}
}
}
});
//运输条款
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,
forceSelection: true,
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,
forceSelection: true,
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,
forceSelection: true,
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: '温度单位',
forceSelection: true,
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: "货物标示",
forceSelection: true,
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,
forceSelection: true,
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, this.comboxCARRIER, 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: 'textareafield',
grow: true,
fieldLabel: 'AGENT',
height: 60,
name: 'AGENT',
anchor: '100%'
}, {
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.comboxFRCUSTSERVICE]
}, 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: '预抵日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'ETA'
}, this.comboxVoyVeg, {
fieldLabel: '航次',
flex: 0.5,
name: 'VOYNO'
}, {
fieldLabel: '船舶呼号',
flex: 0.5,
name: 'VESSELID'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [this.comboxPORTLOAD, this.comboxPORTDISCHARGE, this.comboxDESTINATION, this.comboxPLACEDELIVERY, this.comboxPLACERECEIPT]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '装港代码',
name: 'PORTLOADID'
}, {
fieldLabel: '卸港代码',
name: 'PORTDISCHARGEID'
}, {
fieldLabel: '目的代码',
name: 'DESTINATIONID'
}, {
fieldLabel: '交货代码',
name: 'PLACEDELIVERYID'
}, {
fieldLabel: '收货代码',
name: 'PLACERECEIPTID'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'label',
html: 'Seal No.(封志号)
Marks & Nos.(标记与号码) '
}, {
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: '     Description of Goods
     (包装种类与货名)'
}, this.comboxGOODSNAME, this.comboxCargoid, {
fieldLabel: 'HS编码',
name: 'HSCODE'
}]
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: '  ',
labelSeparator: '',
labelWidth: 20,
height: 250,
name: 'DESCRIPTION',
anchor: '100%'
}]
}, {
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'label',
html: '         No.of containers or pkgs.
         (箱数或件数)'
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: '  ',
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: '          Gross Weight 毛重(公斤)'
}, {
xtype: 'textareafield',
grow: true,
height: 40,
labelWidth: 20,
labelSeparator: '',
fieldLabel: '  ',
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: '          Measurement 尺码(立方米)'
}, {
xtype: 'textareafield',
grow: true,
height: 40,
labelWidth: 20,
labelSeparator: '',
fieldLabel: '  ',
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'
}, this.comboxBLNUM]
}, {
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: [{
id: 'btnEPrev',
text: "上一票",
// iconCls: "btnsave",
handler: function (button, event) {
this.PrevRecord();
},
scope: this
}, {
id: 'btnENext',
text: "下一票",
// iconCls: "btnsave",
handler: function (button, event) {
this.NextRecord();
},
scope: this
},
// , {
// id: 'btnESave',
// text: "保存",
// iconCls: "btnsave",
// handler: function (button, event) {
// this.SaveAms('0');
// this.Save('0');
// },
// scope: this
// }, {
// id: 'btnESaveAndClose',
// text: "保存并关闭",
// handler: function (button, event) {
// this.SaveAms('1');
// this.Save('1');
// },
// scope: this
// },
'-', {
text: "关闭",
handler: function (button, event) {
window.close();
},
scope: this
},
// , {
// text: "新建",
// handler: function (button, event) {
// this.LoadData('add', '');
// var basicForm = this.formEdit.getForm();
// basicForm.findField('BsNo').setDisabled(false);
// },
// scope: this
// },
'-', {
text: "打印",
iconCls: "btnprint",
handler: function (button, event) {
this.Print();
},
scope: this
}, '-',
//
// {
// text: "AFR舱单",
// menu: [
// { text: "日本AFR",
// handler: function (menu, event) {
// _this.onCreateAfrClick(menu, event, 1);
// }
// }, { text: "日本AMR",
// handler: function (menu, event) {
// _this.onCreateAfrClick(menu, event, 2);
// }
// }],
// scope: this
// }, '-', {
// text: "船代舱单",
// menu: [
// { text: "舱单申报",
// handler: function (menu, event) {
// _this.onCreateCustomClick(menu, event, 'CUSTOM');
// }
// }, { text: "中通舱单",
// handler: function (menu, event) {
// _this.onCreateCustomZTClick(menu, event, 'ZT');
// }
// }, { text: "直发舱单",
// handler: function (menu, event) {
// _this.winDSMANIFESTShow.show();
// }
// }],
// scope: this
// }, '-', {
// text: "其他操作",
// menu: [
// { text: "转换成大写字母",
// handler: function (menu, event) {
// _this.onUpCaseClick(menu, event);
// }
// }, { text: "生成报关业务",
// handler: function (menu, event) {
// _this.SaveBG();
// }
// }],
// scope: this
// }, '-',
{
iconCls: "btnotherinf",
menu: [
{ text: "舱单状态",
handler: function (menu, event) {
_this.onCustomStatusClick(menu, event);
}
}, { text: "烟台码头状态",
handler: function (menu, event) {
_this.onYanTaiYardStatusClick(menu, event);
}
}, { text: "青岛场站数据",
handler: function (menu, event) {
_this.onGETYARDClick(menu, event);
}
},
{
text: "青岛港单票查询",
handler: function (menu, event) {
_this.onQQCTUBILLClick();
}
},
{
text: "单船查询",
handler: function (menu, event) {
_this.onGETQDVESSELClick(menu, event);
}
}],
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,
forceSelection: true,
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编号',
labelWidth: 100,
name: 'LASTPORTOFCALLID'
}, {
fieldLabel: '日期', //'报关日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'LASTPORTOFCALLDATE'
}, {
fieldLabel: '第一个停靠港', //'SCAC编号',
labelWidth: 100,
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'
}, this.comboxAMSCOUNTRY, {
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]
});
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.tabSeaepanel = new Ext.TabPanel({
activeTab: 0,
autoWidth: true,
border: true,
frame: false,
region: 'center',
id: "TabSeaePanel",
enableTabScroll: true,
items:
[
this.panelSeae
]
});
Ext.apply(this, {
items: [this.tabSeaepanel]
});
//#endregion
this.LoadInitData();
//#region 其他
parentWin = window.parent.opener._this;
this.InitData();
//绑定事件
this.gridList.on('edit', function (editor, e, eOpts) {
this.gridAfterEdit(editor, e, eOpts);
}, this);
//#endregion
}, //end initUIComponents
//#region 加载事件
InitData: function () {
this.opStatus = 'add';
var condition = '';
_this = this;
if (parentWin) {
var ret = parentWin.OprationSwap();
this.opStatus = ret[0];
this.StoreList = ret[1];
this.editRecord = ret[2];
}
if (this.opStatus == 'edit') {
condition = "BSNO='" + this.editRecord.get('BSNO') + "'";
//this.storeBodyList.load({ params: { condition: condition} });
}
if (this.opStatus == 'copyadd') {
this.CopyNewData();
} else
this.LoadData(this.opStatus, condition);
this.LoadMustBe();
// if (this.initloaddata == 0) {
// this.LoadInitData();
// this.initloaddata = 1;
// };
}, //end InitData
LoadData: function (opstatus, condition) {
this.serialNo = 0;
//this.bodyDel = [];
this.opStatus = opstatus;
if (this.opStatus == 'edit') {
var sMBLNO = this.editRecord.get('MBLNO').toString().trim();
if (sMBLNO != "") {
document.title = "海运出口-主提单号:" + this.editRecord.get('MBLNO').toString().trim();
}
else {
document.title = "海运出口-委托编号:" + this.editRecord.get('CUSTNO').toString().trim();
}
}
else {
document.title = "海运出口-新增";
}
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOpSeae/GetData',
params: {
handle: opstatus,
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);
if (this.opStatus == 'add') {
this.LoadDefValue();
}
this.LoadInit(data);
this.Editdata = data;
this.GetEditStatus();
var paneltabfee = new Shipping.SeaeFee({
id: 'pnlmodSeaeAllFee',
layout: "border",
region: "center",
autoScroll: true,
frame: false,
salefee:'1',
closable: true,
title: '费用信息'
});
this.tabSeaepanel.add(paneltabfee);
var panelReceiptEditGrid = new Shipping.SeaeReceipt({
id: 'pnlReceiptEditGrid',
layout: "border",
region: "center",
autoScroll: true,
frame: false,
closable: true,
title: '单据管理'
});
this.tabSeaepanel.add(panelReceiptEditGrid);
var paneltabfeeamend = new Ext.Panel({
id: 'pnlmodSeaeAmendFee',
layout: "fit",
region: "center",
autoScroll: true,
frame: false,
closable: true,
title: '更改单信息',
html: ' '
});
// var paneltabfeeamend = new Shipping.SeaeAmendFee({
// id: 'pnlmodSeaeAmendFee',
// layout: "border",
// region: "center",
// autoScroll: true,
// frame: false,
// closable: true,
// title: '更改单信息'
// });
this.tabSeaepanel.add(paneltabfeeamend);
this.tabSeaepanel.doLayout();
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
var billno = '*';
var gid = '*';
if (this.opStatus == 'edit') {
//billno = this.editRecord.get('BSNO');
//condition = "BSNO='" + this.editRecord.get('BSNO') + "'";
this.storeBodyList.load({ params: { condition: condition} });
} else {
condition = "BSNO='xx'";
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
//#region 复制新建
CopyNewData: function () {
var data = this.editRecord.data;
var basicForm = this.formHead.getForm();
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);
this.opStatus = 'add';
basicForm.findField('BSNO').setDisabled(false);
var field = basicForm.findField('BSNO');
field.setValue('topseae' + NewGuid());
basicForm.findField('BSNO').setDisabled(true);
field = basicForm.findField('CUSTNO');
field.setValue('');
field = basicForm.findField('INPUTBY');
field.setValue(SHOWNAME);
field = basicForm.findField('OP');
field.setValue(SHOWNAME);
var field = basicForm.findField('BSSTATUSREF');
field.setValue('未锁定');
var field = basicForm.findField('FEESTATUSREF');
field.setValue('未锁定');
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m');
field = basicForm.findField('ACCDATE');
field.setValue(mydatestr);
// this.storeBodyList.load({ params: { condition: "BSNO='" + this.editRecord.get('BSNO') + "'" },
// callback: function (r, options, success) {
// if (success) {
// if (this.storeBodyList.getCount() > 0) {
// for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
// var memberbody = this.storeBodyList.getAt(j);
// memberbody.set("CTN_ID", NewGuid());
// memberbody.set("BSNO", '*');
// memberbody.commit();
// };
// } else {
// }
// }
// },
// scope: this
// });
},
//#endregion
//#endregion
LoadInitData: function () {
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
this.storeOpCode.load();
this.storeOpCode5.load();
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: ""} });
// this.storeCodeLoadport.load();
// this.storeCodeDisport.load();
// this.storeCodeDisport2.load();
// this.storeCodeDisport3.load();
// this.storeCodeDisport4.load();
},
//#region 保存
Save: function (type) {
var basicForm = this.formEdit.getForm();
var basicForm2 = this.formHead.getForm();
if (!basicForm.isValid()) {
return;
}
if (!basicForm2.isValid()) {
return;
}
//
var bodydatas = [];
for (var i = 0; i < this.storeBodyList.getCount(); i += 1) {
var member = this.storeBodyList.getAt(i);
bodydatas.push(member);
}
//
var jsonBody = ConvertRecordsToJsonAll(bodydatas);
//var jsonDelBody = ConvertRecordsToJsonAll(this.bodyDel);
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/Save',
scope: this,
params: {
opstatus: this.opStatus,
data: Ext.JSON.encode(data),
data2: Ext.JSON.encode(data2),
data3: Ext.JSON.encode(data3),
body: jsonBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnData = jsonresult.Data;
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(returnData);
this.formHead.getForm().reset();
this.formHead.getForm().setValues(returnData);
this.formEDI.getForm().reset();
this.formEDI.getForm().setValues(returnData);
this.Editdata = returnData;
//
if (this.opStatus == 'add') {
var arrNewRecords = this.StoreList.insert(0, returnData);
this.editRecord = this.StoreList.getAt(0);
if (type == '0') {
this.opStatus = 'edit';
basicForm2.findField('BSNO').setDisabled(true);
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
memberbody.set("BSNO", this.editRecord.get('BSNO'));
memberbody.commit();
};
} else if (type == '1') {
window.close();
} else if (type == '2') {
this.LoadData('add', '');
}
if (type == '0') {
this.opStatus = 'edit';
basicForm2.findField('BSNO').setDisabled(true);
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
memberbody.set("BSNO", this.editRecord.get('BSNO'));
memberbody.commit();
};
} else if (type == '1') {
window.close();
} else if (type == '2') {
this.LoadData('add', '');
}
}
else if (this.opStatus == 'edit') {
var editp = Ext.create('MsOpSeaeModel', returnData);
this.editRecord.fields.each(function (field) {
if (field.persist) {
name = field.name;
if (name != 'id')
this.editRecord.set(name, editp.get(name));
}
}, this);
this.editRecord.commit();
if (type == '0') {
this.opStatus = 'edit';
basicForm2.findField('BSNO').setDisabled(true);
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
memberbody.set("BSNO", this.editRecord.get('BSNO'));
memberbody.commit();
};
} else if (type == '1') {
window.close();
} else if (type == '2') {
this.LoadData('add', '');
}
}
} 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
SaveAms: function (type) {
var basicForm = this.formAMS.getForm();
if (!basicForm.isValid()) {
return;
}
var bsno = this.formHead.getForm().findField('BSNO').getValue();
this.formAMS.getForm().findField('AMSNO').setDisabled(false);
var data = this.formAMS.getForm().getValues(false, false, false);
this.formAMS.getForm().findField('AMSNO').setDisabled(true);
Ext.Ajax.request({
url: '/MvcShipping/MsOpSeae/SaveAms',
scope: this,
params: {
data: Ext.JSON.encode(data),
bsno: bsno
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnData = jsonresult.Data;
this.formAMS.getForm().reset();
this.formAMS.getForm().setValues(returnData);
} else {
}
} else {
}
}
});
}, //end save
//#endregion
//#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 舱单状态
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();
var bsno = this.formHead.getForm().findField('BSNO').getValue();
if (mblno === "") {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.TiDanHaoBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//提单号不能为空!'
return;
}
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsOpSeae/GetyardctnList',
params: {
bs: bsno,
mblno: mblno,
yard: 'YGT',
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: Zi.LAN.GuanBi, //"关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
Ext.Msg.hide();
}
else {
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
},
//#endregion
//#region QQCT、QQCTU海关放行查询
onQQCTQQCTUBILLClick: 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/GetQQCTQQCTUBILL',
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,
bodyPadding: 0,
html: jsonresult.data
});
me = this;
winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
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
});
}
},
//#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();
// btnEAddDetail.enable();
// btnEDeleteDetail.enable();
// btnEUpDetail.enable();
// } else {
// btnESave.disable();
// btnESaveAndClose.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 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 j = this.StoreList.indexOf(this.editRecord);
if (j == (this.StoreList.data.length - 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);
}
});