|
|
Ext.namespace('Shipping');
|
|
|
|
|
|
Shipping.MsOpSeaiEdit = function (config) {
|
|
|
Ext.applyIf(this, config);
|
|
|
this.initUIComponents();
|
|
|
window.Shipping.MsOpSeaiEdit.superclass.constructor.call(this);
|
|
|
};
|
|
|
|
|
|
Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
|
|
|
ParentWin: null,
|
|
|
OpStatus: 'add',
|
|
|
StoreList: null,
|
|
|
EditRecord: null,
|
|
|
Editdata: null,
|
|
|
MainEditRecord: null,
|
|
|
stroplb: '海运进口',
|
|
|
isfen: false,
|
|
|
showQYSendBtn:false,
|
|
|
|
|
|
initUIComponents: function () {
|
|
|
this.itemindex = 1;
|
|
|
this.accdatesameetd = 0;
|
|
|
this.MsPeriod = null;
|
|
|
this.serialNo = 0;
|
|
|
this.SALEORDERDEPTBYOP = 0;
|
|
|
this.copyfee = false;
|
|
|
|
|
|
|
|
|
var BLTYPEDFIELDNAME = 'EnumValueName';
|
|
|
if (strLANGUAGES == "en-us") {
|
|
|
BLTYPEDFIELDNAME = 'EnumValueName_2';
|
|
|
}
|
|
|
|
|
|
this.storecodeservice = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'MsCodeOpService',
|
|
|
proxy: { url: '/MvcShipping/MsCodeOpService/GetDataList' }
|
|
|
});
|
|
|
|
|
|
//#region formSearch 下拉框信息加载
|
|
|
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: "modSeaImportList"} });
|
|
|
|
|
|
//客服
|
|
|
this.storeCUSTSERVICECode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.UserRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
|
|
|
});
|
|
|
//this.storeCUSTSERVICECode.on('beforeload', function (store) {
|
|
|
// var sql = " u.GID IN (SELECT USERID FROM user_userattribute WHERE ATTRIBUTEID='D4BF2204-F0AC-4F12-B02C-6520D57BF806' and VALUE='true' ) ";
|
|
|
// Ext.apply(store.proxy.extraParams, { condition: sql });
|
|
|
//}, this);
|
|
|
this.storeCUSTSERVICECode.load();
|
|
|
this.storeCUSTSERVICECode.load({ params: { condition: " GID IN (SELECT USERID FROM user_userattribute WHERE ATTRIBUTEID='D4BF2204-F0AC-4F12-B02C-6520D57BF806' and VALUE='true' ) " } });
|
|
|
|
|
|
|
|
|
this.comboxCUSTSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.CUSTSERVICE, //'客服',
|
|
|
store: this.storeCUSTSERVICECode,
|
|
|
//flex: 0.8,
|
|
|
forceSelection: true,
|
|
|
id: 'CUSTSERVICE',
|
|
|
name: 'CUSTSERVICE',
|
|
|
valueField: 'UserName',
|
|
|
displayField: 'CodeAndName'
|
|
|
});
|
|
|
//揽货人
|
|
|
this.storeSALECode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.UserRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
|
|
|
});
|
|
|
//this.storeSALECode.load();
|
|
|
this.storeSALECode.on('beforeload', function (store) {
|
|
|
var CUSTOMERNAME = this.formHead.getForm().findField('CUSTOMERNAME').getValue();
|
|
|
Ext.apply(store.proxy.extraParams, { CUSTOMERNAME: CUSTOMERNAME });
|
|
|
}, this);
|
|
|
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.SALE, //'揽货人',
|
|
|
store: this.storeSALECode,
|
|
|
//flex: 0.8,
|
|
|
// forceSelection: true,
|
|
|
id: 'SALE',
|
|
|
queryMode: 'remote',
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
name: 'SALE',
|
|
|
valueField: 'UserName',
|
|
|
displayField: 'CodeAndName',
|
|
|
value: SHOWNAME,
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
if (this.SALEORDERDEPTBYOP == 0)
|
|
|
this.formHead.getForm().findField('SALEDEPT').setValue(records[0].data.DEPTNAME);
|
|
|
this.formHead.getForm().findField('SALECORPID').setValue(records[0].data.CORPID);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
//操 作
|
|
|
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.UserRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
|
|
|
});
|
|
|
this.storeOpCode.load();
|
|
|
|
|
|
this.storeOpCode5 = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.UserRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
|
|
|
});
|
|
|
this.storeOpCode5.load();
|
|
|
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.OP, //'操 作',
|
|
|
store: this.storeOpCode,
|
|
|
//flex: 0.8,
|
|
|
forceSelection: true,
|
|
|
id: 'OP',
|
|
|
name: 'OP',
|
|
|
valueField: 'UserName',
|
|
|
displayField: 'CodeAndName',
|
|
|
value: SHOWNAME,
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
if (this.SALEORDERDEPTBYOP == 1)
|
|
|
this.formHead.getForm().findField('SALEDEPT').setValue(records[0].data.DEPTNAME);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
//录入人
|
|
|
this.storeINPUTBYCode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.UserRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
|
|
|
});
|
|
|
this.storeINPUTBYCode.load();
|
|
|
this.comboxINPUTBY = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.INPUTBY, //'录入人',
|
|
|
store: this.storeINPUTBYCode,
|
|
|
//flex: 0.8,
|
|
|
forceSelection: true,
|
|
|
id: 'INPUTBY',
|
|
|
name: 'INPUTBY',
|
|
|
valueField: 'UserName',
|
|
|
displayField: 'CodeAndName',
|
|
|
value: SHOWNAME,
|
|
|
hidden: true
|
|
|
});
|
|
|
this.storeOpCode4 = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.UserRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
|
|
|
});
|
|
|
this.storeOpCode4.load();
|
|
|
this.comboxDOC = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.DOC, //'单 证',
|
|
|
store: this.storeOpCode4,
|
|
|
//flex: 0.8,
|
|
|
forceSelection: true,
|
|
|
queryMode: 'remote',
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
name: 'DOC',
|
|
|
valueField: 'UserName',
|
|
|
displayField: 'CodeAndName',
|
|
|
value: SHOWNAME
|
|
|
});
|
|
|
|
|
|
//仓储出库货主
|
|
|
this.storeCustWmsCode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
|
|
|
});
|
|
|
this.storeCustWmsCode.load({ params: { condition: "ISWAREHOUSE='1'"} });
|
|
|
this.comboxCustWmsCode = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.CUSTOMERNAME_WMS, //'仓储货主',
|
|
|
store: this.storeCustWmsCode,
|
|
|
forceSelection: true,
|
|
|
id: 'CUSTOMERNAME_WMS',
|
|
|
name: 'CUSTOMERNAME_WMS',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName'
|
|
|
});
|
|
|
//委托单位
|
|
|
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' }
|
|
|
});
|
|
|
// this.storeCustCode.load({ params: { condition: ""} });
|
|
|
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.CUSTOMERNAME, //'委托单位',
|
|
|
store: this.storeCustCode,
|
|
|
forceSelection: true,
|
|
|
queryMode: 'remote',
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
id: 'CUSTOMERNAME',
|
|
|
name: 'CUSTOMERNAME',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName',
|
|
|
allowBlank: false,
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
var data = combo.value;
|
|
|
var sale = records[0].data.SALE;
|
|
|
if (sale.indexOf(',') > 0) sale = sale.substring(0, sale.indexOf(','));
|
|
|
|
|
|
var recordCustCode = Ext.create('DsShipping.ux.UserRefModel', {
|
|
|
GId: NewGuid(),
|
|
|
UserCode: sale,
|
|
|
UserName: sale,
|
|
|
CodeAndName: sale
|
|
|
});
|
|
|
|
|
|
_this.storeSALECode.add(recordCustCode);
|
|
|
|
|
|
this.formHead.getForm().findField('SALE').setValue(sale);
|
|
|
var s = "LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')";
|
|
|
//this.formHead.getForm().findField('SALE').setValue(records[0].data.SALE);
|
|
|
this.formHead.getForm().findField('SALECORPID').setValue(records[0].data.SALECORPID);
|
|
|
this.storeInfoClientContact.load({ params: { condition: s} });
|
|
|
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 + "') )"} });
|
|
|
if (records[0].data.BSSOURCE != '') {
|
|
|
this.formHead.getForm().findField('BSSOURCE').setValue(records[0].data.BSSOURCE);
|
|
|
var recs = DsStoreQueryBy(this.storeSource, 'SourceName', records[0].data.BSSOURCE);
|
|
|
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('');
|
|
|
}
|
|
|
}
|
|
|
if (this.SALEORDERDEPTBYOP == 0) {
|
|
|
var recs = DsStoreQueryBy(this.storeOpCode, 'UserName', records[0].data.SALE);
|
|
|
if (recs.getCount() > 0) {
|
|
|
var data = recs.getAt(0).data;
|
|
|
this.formHead.getForm().findField('SALEDEPT').setValue(data.DEPTNAME);
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (this.SALEORDERDEPTBYOP == 1) {
|
|
|
var recs = DsStoreQueryBy(this.storeOpCode, 'UserName', records[0].data.OP);
|
|
|
if (recs.getCount() > 0) {
|
|
|
var data = recs.getAt(0).data;
|
|
|
this.formHead.getForm().findField('SALEDEPT').setValue(data.DEPTNAME);
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
//委托单位_联系人
|
|
|
this.storeInfoClientContact = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.InfoClientContactModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetInfoClientContactList' }
|
|
|
});
|
|
|
this.comboxInfoClientContact = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.SHOWNAME_Client, //'联系人',
|
|
|
labelWidth: 95,
|
|
|
store: this.storeInfoClientContact,
|
|
|
id: 'SHOWNAME',
|
|
|
name: 'SHOWNAME',
|
|
|
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('EMAIL').setValue(Cargoinfodata.EMAIL);
|
|
|
this.formHead.getForm().findField('TEL').setValue(Cargoinfodata.TEL);
|
|
|
// this.formHead.getForm().findField('FAX').setValue(Cargoinfodata.FAX);
|
|
|
} else {
|
|
|
// this.formHead.getForm().findField('EMAIL').setValue('');
|
|
|
this.formHead.getForm().findField('TEL').setValue('');
|
|
|
// this.formHead.getForm().findField('FAX').setValue('');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//客户加载_贸易代理
|
|
|
this.storeTRADINGAGENCY = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
|
|
|
});
|
|
|
this.storeTRADINGAGENCY.load({ params: { condition: "ISTRADINGAGENCY='1'"} });
|
|
|
this.comboxTRADINGAGENCY = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.TRADINGAGENCY, //'贸易代理',
|
|
|
store: this.storeTRADINGAGENCY,
|
|
|
forceSelection: true,
|
|
|
id: 'TRADINGAGENCY',
|
|
|
name: 'TRADINGAGENCY',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName'
|
|
|
});
|
|
|
|
|
|
//客户加载_船公司
|
|
|
this.storeCARRIER = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
|
|
|
});
|
|
|
this.storeCARRIER.load({ params: { condition: "ISCARRIER='1'"} });
|
|
|
this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.CARRIER, //'船公司',
|
|
|
store: this.storeCARRIER,
|
|
|
forceSelection: true,
|
|
|
id: 'CARRIER',
|
|
|
name: 'CARRIER',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName',
|
|
|
value:''
|
|
|
});
|
|
|
|
|
|
//客户加载_船代
|
|
|
this.storeCARRIERAGENT = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
|
|
|
});
|
|
|
this.storeCARRIERAGENT.load({ params: { condition: "ISSHIPAGENCY='1'"} });//ISSHIPPINGAGENT//需求编码:SR2017061700003
|
|
|
this.comboxCARRIERAGENT = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.CARRIERAGENT, //'船代',//需求编码:SR2017061700003
|
|
|
store: this.storeCARRIERAGENT,
|
|
|
forceSelection: true,
|
|
|
id: 'SHIPAGENCY',
|
|
|
name: 'SHIPAGENCY',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName',
|
|
|
value:''
|
|
|
});
|
|
|
|
|
|
//客户加载_车队
|
|
|
this.storeTRUCKER = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
|
|
|
});
|
|
|
this.storeTRUCKER.load({ params: { condition: "ISTRUCK='1'"} });
|
|
|
this.comboxTRUCKER = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.TRUCKER, //'车队',
|
|
|
store: this.storeTRUCKER,
|
|
|
forceSelection: true,
|
|
|
id: 'TRUCKER',
|
|
|
name: 'TRUCKER',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName',
|
|
|
value:''
|
|
|
});
|
|
|
|
|
|
//客户加载_报关
|
|
|
this.storeCUSTOMSER = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
|
|
|
});
|
|
|
this.storeCUSTOMSER.load({ params: { condition: "ISCUSTOM='1'"} });
|
|
|
this.comboxCUSTOMSER = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.CUSTOMSER, //'报关行',
|
|
|
store: this.storeCUSTOMSER,
|
|
|
forceSelection: true,
|
|
|
id: 'CUSTOMSER',
|
|
|
name: 'CUSTOMSER',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName',
|
|
|
value:''
|
|
|
});
|
|
|
|
|
|
this.storeEnterpCode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListEnterp' }
|
|
|
});
|
|
|
|
|
|
this.comboxCustENTERP = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.ENTERP, //'经营单位',
|
|
|
store: this.storeEnterpCode,
|
|
|
queryMode: 'remote',
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
// forceSelection: true,
|
|
|
name: 'ENTERP',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName',
|
|
|
value:''
|
|
|
});
|
|
|
|
|
|
//客户加载_报检
|
|
|
this.storeINSPECTION = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
|
|
|
});
|
|
|
this.storeINSPECTION.load({ params: { condition: "ISCUSTOM='1'"} });
|
|
|
this.comboxINSPECTION = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.INSPECTION, //'报检',
|
|
|
store: this.storeINSPECTION,
|
|
|
forceSelection: true,
|
|
|
id: 'INSPECTION',
|
|
|
name: 'INSPECTION',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName',
|
|
|
value:''
|
|
|
});
|
|
|
|
|
|
//客户加载_其他(码头)
|
|
|
this.storeOTHER = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
|
|
|
});
|
|
|
this.storeOTHER.load({ params: { condition: "ISOTHER='1'"} });
|
|
|
this.comboxOTHER = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.MaTou, //其他(码头)
|
|
|
store: this.storeOTHER,
|
|
|
// forceSelection: true,
|
|
|
id: 'MaTou',
|
|
|
name: 'MaTou',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName',
|
|
|
value:''
|
|
|
});
|
|
|
|
|
|
//键值维护表_贸易方式
|
|
|
this.storeCrmKeyCodeCode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CrmKeyCodeModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCrmKeyCodeList' }
|
|
|
});
|
|
|
this.storeCrmKeyCodeCode.load({ params: { condition: " and KEYTYPE='贸易方式'"} });
|
|
|
this.comboxTRADETYPE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.TRADETYPE, //'贸易方式',
|
|
|
store: this.storeCrmKeyCodeCode,
|
|
|
// forceSelection: true,
|
|
|
id: 'TRADETYPE',
|
|
|
name: 'TRADETYPE',
|
|
|
valueField: 'KEYVALUE',
|
|
|
displayField: 'KEYVALUE',
|
|
|
value:''
|
|
|
});
|
|
|
|
|
|
this.storeTRADETERM = Ext.create('DsExt.ux.RefEnumStore', {});
|
|
|
this.storeTRADETERM.load({ params: { enumTypeId: 97023} });
|
|
|
|
|
|
this.comboxTRADETERM = Ext.create('DsExt.ux.RefEnumCombox', {
|
|
|
fieldLabel: Zi.LAN.TRADETERM, //'贸易条款',
|
|
|
store: this.storeTRADETERM,
|
|
|
// forceSelection: true,
|
|
|
name: 'TRADETERM',
|
|
|
value:''
|
|
|
});
|
|
|
|
|
|
//键值维护表_仓储类型
|
|
|
this.storeCrmKeyCodeCode2 = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CrmKeyCodeModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCrmKeyCodeList' }
|
|
|
});
|
|
|
this.storeCrmKeyCodeCode2.load({ params: { condition: " and KEYTYPE='仓储类型'"} });
|
|
|
this.comboxWMSTYPE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.WMSTYPE, //'仓储类型',
|
|
|
store: this.storeCrmKeyCodeCode2,
|
|
|
forceSelection: true,
|
|
|
//flex: 0.7,
|
|
|
//labelWidth: 55,
|
|
|
id: 'WMSTYPE',
|
|
|
name: 'WMSTYPE',
|
|
|
valueField: 'KEYVALUE',
|
|
|
displayField: 'KEYVALUE',
|
|
|
value:''
|
|
|
});
|
|
|
|
|
|
//键值维护表_装运方式
|
|
|
//this.storeCrmKeyCodeCode3 = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
// model: 'DsShipping.ux.CrmKeyCodeModel',
|
|
|
// proxy: { url: '/CommMng/BasicDataRef/GetCrmKeyCodeList' }
|
|
|
//});
|
|
|
//this.storeCrmKeyCodeCode3.load({ params: { condition: " and KEYTYPE='装运方式'"} });
|
|
|
|
|
|
|
|
|
this.StoreBLTYPE = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsExtEnumModel',
|
|
|
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
|
|
|
});
|
|
|
this.StoreBLTYPE.load({ params: { enumTypeId: 97042 } });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.comboxBLTYPE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.BLTYPE, //'装运方式',
|
|
|
store: this.StoreBLTYPE,
|
|
|
forceSelection: true,
|
|
|
id: 'BLTYPE',
|
|
|
name: 'BLTYPE',
|
|
|
//flex: 0.5,
|
|
|
valueField: 'EnumValueName',
|
|
|
displayField: BLTYPEDFIELDNAME,
|
|
|
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.panelBodyChFee.hide();
|
|
|
}
|
|
|
this.formEdit.getForm().findField('CNTRTOTAL').setValue('LCL');
|
|
|
}
|
|
|
else {
|
|
|
this.panelBodyChFee.show();
|
|
|
}
|
|
|
//
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//键值维护表_委托单类型
|
|
|
this.storeCrmKeyCodeCode4 = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CrmKeyCodeModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCrmKeyCodeList' }
|
|
|
});
|
|
|
this.storeCrmKeyCodeCode4.load({ params: { condition: " and KEYTYPE='委托单类型'"} });
|
|
|
this.comboxBSTYPE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.BSTYPE, //'委托单类型',
|
|
|
store: this.storeCrmKeyCodeCode4,
|
|
|
forceSelection: true,
|
|
|
id: 'BSTYPE',
|
|
|
name: 'BSTYPE',
|
|
|
valueField: 'KEYVALUE',
|
|
|
displayField: 'KEYVALUE',
|
|
|
value: '普通货',
|
|
|
readOnly: true,
|
|
|
value:''
|
|
|
});
|
|
|
|
|
|
//品名类型
|
|
|
this.storeCodeGoodsType = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CodeGoodsTypeModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsTypeList' }
|
|
|
});
|
|
|
this.storeCodeGoodsType.load();
|
|
|
this.comboxGOODSTYPENAME = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.GOODSTYPENAME, //'品名类型',
|
|
|
store: this.storeCodeGoodsType,
|
|
|
forceSelection: true,
|
|
|
id: 'GOODSTYPENAME',
|
|
|
name: 'GOODSTYPENAME',
|
|
|
valueField: 'GoodsTypeName',
|
|
|
displayField: 'CodeAndName',
|
|
|
value:'',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
var data = combo.value;
|
|
|
var s = "GoodsTypeGID in (select gid from [code_goodsType] where GOODSTYPENAME='" + combo.value + "')";
|
|
|
this.storeCodeGoodsList.load({ params: { condition: s} });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//品名
|
|
|
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', {
|
|
|
fieldLabel: Zi.LAN.GOODSNAME, //'品名',
|
|
|
store: this.storeCodeGoodsList,
|
|
|
id: 'GOODSNAME',
|
|
|
name: 'GOODSNAME',
|
|
|
valueField: 'GOODNAME',
|
|
|
displayField: 'CodeAndName',
|
|
|
value:'',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
var Cargoinforecords = DsStoreQueryBy(this.storeCodeGoodsList, 'GOODNAME', records[0].data.GOODNAME);
|
|
|
if (Cargoinforecords.getCount() > 0) {
|
|
|
var Cargoinfodata = Cargoinforecords.getAt(0).data;
|
|
|
this.formEdit.getForm().findField('GOODSTYPENAME').setValue(Cargoinfodata.GoodsTypeName);
|
|
|
this.formEdit.getForm().findField('GOODSNAMEID').setValue(Cargoinfodata.GID);
|
|
|
} else {
|
|
|
this.formEdit.getForm().findField('GOODSTYPENAME').setValue('');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//业务来源
|
|
|
this.storeSource = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.SourceModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetSource' }
|
|
|
});
|
|
|
this.storeSource.load();
|
|
|
this.storeSourceDetail = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.SourceDetailModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetSourceDetail2' }
|
|
|
});
|
|
|
this.comboxBSSOURCE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.BSSOURCE, //'业务来源',
|
|
|
store: this.storeSource,
|
|
|
forceSelection: true,
|
|
|
id: 'BSSOURCE',
|
|
|
name: 'BSSOURCE',
|
|
|
valueField: 'SourceName',
|
|
|
displayField: 'SourceName',
|
|
|
value:'',
|
|
|
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: Zi.LAN.BSSOURCEDETAIL, //'来源明细',
|
|
|
store: this.storeSourceDetail,
|
|
|
forceSelection: true,
|
|
|
id: 'BSSOURCEDETAIL',
|
|
|
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: Zi.LAN.SALEDEPT2, //'所属部门',
|
|
|
store: this.storeDept,
|
|
|
forceSelection: true,
|
|
|
//labelWidth: 60,
|
|
|
//flex: 0.5,
|
|
|
id: 'SALEDEPT',
|
|
|
name: 'SALEDEPT',
|
|
|
valueField: 'DeptName',
|
|
|
displayField: 'DeptName',
|
|
|
value: DEPTNAME
|
|
|
//,hidden: true
|
|
|
});
|
|
|
|
|
|
//国际港口(进口装货港、出口卸货港)
|
|
|
this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CodeDisportModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' }
|
|
|
});
|
|
|
// this.storeCodeDisport.load();
|
|
|
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.PORTLOAD, //'装货港',
|
|
|
store: this.storeCodeDisport,
|
|
|
// forceSelection: true,
|
|
|
id: 'PORTLOAD',
|
|
|
name: 'PORTLOAD',
|
|
|
valueField: 'PORT',
|
|
|
displayField: 'CodeAndName',
|
|
|
queryMode: 'remote',
|
|
|
minChars: 1,
|
|
|
queryParam: 'PORT',
|
|
|
matchFieldWidth: false, //下拉款自适应宽度
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
this.formEdit.getForm().findField('LANE').setValue(records[0].data.LANE);
|
|
|
if (records[0].data.EDICODE.toString().trim() != "") {
|
|
|
this.formBill.getForm().findField('PORTLOADID').setValue(records[0].data.EDICODE);
|
|
|
}
|
|
|
//
|
|
|
var BLFRT = this.formBill.getForm().findField('BLFRT').getValue();
|
|
|
if (BLFRT.indexOf("PREPAID") > -1) {
|
|
|
this.formBill.getForm().findField('PREPARDAT').setValue(combo.value.toString()); //预付
|
|
|
this.formBill.getForm().findField('PAYABLEAT').setValue(''); //到付
|
|
|
this.formBill.getForm().findField('ISSUEPLACE').setValue(combo.value.toString()); //签单
|
|
|
//this.formBill.getForm().findField('ISSUEPLACEID').setValue(portloadid);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//
|
|
|
});
|
|
|
|
|
|
//国内港口(出口装货港、进口卸货港)
|
|
|
this.storeCodeLoadport = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CodeLoadportModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportListRm' }
|
|
|
});
|
|
|
// this.storeCodeLoadport.load();
|
|
|
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.PORTDISCHARGE, //'卸货港',
|
|
|
store: this.storeCodeLoadport,
|
|
|
//forceSelection: true,
|
|
|
id: 'PORTDISCHARGE',
|
|
|
name: 'PORTDISCHARGE',
|
|
|
valueField: 'PORT',
|
|
|
queryMode: 'remote',
|
|
|
minChars: 1,
|
|
|
queryParam: 'PORT',
|
|
|
displayField: 'CodeAndName',
|
|
|
matchFieldWidth: false, //下拉款自适应宽度
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
if (records[0].data.EDICODE.toString().trim() != "") {
|
|
|
this.formBill.getForm().findField('PORTDISCHARGEID').setValue(records[0].data.EDICODE);
|
|
|
this.formBill.getForm().findField('DESTINATIONID').setValue(records[0].data.EDICODE);
|
|
|
this.formBill.getForm().findField('PLACEDELIVERYID').setValue(records[0].data.EDICODE);
|
|
|
}
|
|
|
if (records[0].data.PORT.toString().trim() != "") {
|
|
|
this.formBill.getForm().findField('DESTINATION').setValue(records[0].data.PORT);
|
|
|
this.formBill.getForm().findField('PLACEDELIVERY').setValue(records[0].data.PORT);
|
|
|
}
|
|
|
//
|
|
|
var BLFRT = this.formBill.getForm().findField('BLFRT').getValue();
|
|
|
if (BLFRT.indexOf("COLLECT") > -1) {
|
|
|
this.formBill.getForm().findField('PREPARDAT').setValue(''); //预付
|
|
|
this.formBill.getForm().findField('PAYABLEAT').setValue(combo.value.toString()); //到付
|
|
|
this.formBill.getForm().findField('ISSUEPLACE').setValue(combo.value.toString()); //签单
|
|
|
//this.formBill.getForm().findField('ISSUEPLACEID').setValue(PORTDISCHARGEID);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//
|
|
|
});
|
|
|
|
|
|
//客户加载_场站
|
|
|
this.storeYARD = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
|
|
|
});
|
|
|
|
|
|
//船公司
|
|
|
this.comboxYARD = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.YARD, //'场站',
|
|
|
store: this.storeYARD,
|
|
|
forceSelection: true,
|
|
|
name: 'YARD',
|
|
|
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: Zi.LAN.FORWARDER, //'货代',
|
|
|
store: this.storeFORWARDER,
|
|
|
forceSelection: true,
|
|
|
name: 'FORWARDER',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName'
|
|
|
});
|
|
|
|
|
|
//客户加载_订舱代理
|
|
|
this.storeAGENT = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
|
|
|
});
|
|
|
|
|
|
//货代
|
|
|
this.comboxAGENT = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.AGENTID, //'国外代理',
|
|
|
store: this.storeAGENT,
|
|
|
forceSelection: true,
|
|
|
name: 'AGENTID',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName'
|
|
|
});
|
|
|
|
|
|
//件数包装
|
|
|
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: Zi.LAN.KINDPKGS, //'件数包装',
|
|
|
store: this.storeCodePackage,
|
|
|
// forceSelection: true,
|
|
|
id: 'KINDPKGS',
|
|
|
name: 'KINDPKGS',
|
|
|
valueField: 'PKGS',
|
|
|
displayField: 'PKGS'
|
|
|
});
|
|
|
//件数包装_集装箱列表中的下拉框加载
|
|
|
this.storeCodePackage_CTN = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CodePackageModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCodePackageList' }
|
|
|
});
|
|
|
this.storeCodePackage_CTN.load();
|
|
|
this.comboxKINDPKGS_CTN = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
//fieldLabel: Zi.LAN.KINDPKGS, //'件数包装',
|
|
|
store: this.storeCodePackage_CTN,
|
|
|
forceSelection: true,
|
|
|
id: 'KINDPKGS_CTN',
|
|
|
name: 'KINDPKGS_CTN',
|
|
|
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: Zi.LAN.CTNALL, //'箱型',
|
|
|
store: this.storeCodeCtn,
|
|
|
forceSelection: true,
|
|
|
id: 'CTNALL',
|
|
|
name: 'CTNALL',
|
|
|
valueField: 'CTN',
|
|
|
displayField: 'CTN'
|
|
|
});
|
|
|
|
|
|
//计费单位
|
|
|
Ext.define('UNITOFWEIGHTModel', {
|
|
|
extend: 'Ext.data.Model',
|
|
|
fields: [
|
|
|
{ name: 'Name', type: 'string' },
|
|
|
{ name: 'Value', type: 'string' }
|
|
|
]
|
|
|
});
|
|
|
var dataUNITOFWEIGHT = [{ "Name": Zi.LAN.TON, "Value": Zi.LAN.TON }, { "Name": "CBM", "Value": "CBM" }, { "Name": Zi.LAN.KG, "Value": Zi.LAN.KG }, { "Name": "", "Value":""}];
|
|
|
var storeUNITOFWEIGHT = Ext.create('Ext.data.Store', {
|
|
|
model: 'UNITOFWEIGHTModel',
|
|
|
data: dataUNITOFWEIGHT
|
|
|
});
|
|
|
this.comboxUNITOFWEIGHT = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.UNITOFWEIGHT, //'计费单位',
|
|
|
forceSelection: true,
|
|
|
store: storeUNITOFWEIGHT,
|
|
|
id: 'UNITOFWEIGHT',
|
|
|
name: 'UNITOFWEIGHT',
|
|
|
valueField: 'Value',
|
|
|
displayField: 'Name'
|
|
|
});
|
|
|
|
|
|
//币别
|
|
|
this.storeCodeCurrency = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CodeCurrencyModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCodeCurrencyList' }
|
|
|
});
|
|
|
this.storeCodeCurrency.load();
|
|
|
this.comboxCodeCurrency = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.CURRENCY, //'币别',
|
|
|
store: this.storeCodeCurrency,
|
|
|
// forceSelection: true,
|
|
|
// flex: 0.4,
|
|
|
//labelWidth: 40,
|
|
|
id: 'CURRENCY',
|
|
|
name: 'CURRENCY',
|
|
|
valueField: 'CODENAME',
|
|
|
displayField: 'CODENAME'
|
|
|
});
|
|
|
|
|
|
//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: Zi.LAN.STLNAME, //'结算方式',
|
|
|
// forceSelection: true,
|
|
|
// flex: 0.5,
|
|
|
// name: 'STLNAME',
|
|
|
// valueField: 'STLNAME',
|
|
|
// displayField: 'STLNAME'
|
|
|
//});
|
|
|
|
|
|
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: Zi.LAN.LANE, //'航线',
|
|
|
store: this.storeLANE,
|
|
|
// forceSelection: true,
|
|
|
name: 'LANE',
|
|
|
valueField: 'LANE',
|
|
|
displayField: 'LANE',
|
|
|
value:''
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
this.storeINSPECTSERVICE = Ext.create('DsExt.ux.RefEnumStore', {});
|
|
|
this.storeINSPECTSERVICE.load({ params: { enumTypeId: 97024} });
|
|
|
|
|
|
this.comboxINSPECTSERVICE = Ext.create('DsExt.ux.RefEnumCombox', {
|
|
|
fieldLabel: Zi.LAN.INSPECTSERVICE, //'报检项目',
|
|
|
store: this.storeINSPECTSERVICE,
|
|
|
forceSelection: true,
|
|
|
name: 'INSPECTSERVICE'
|
|
|
});
|
|
|
|
|
|
this.comboxFRCUSTSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel:Zi.LAN.FRCUSTSERVICE, //'客服',
|
|
|
store: this.storeOpCode5,
|
|
|
//flex: 0.8,
|
|
|
forceSelection: true,
|
|
|
// queryMode: 'remote',
|
|
|
// minChars: 0,
|
|
|
// queryParam: 'CODENAME',
|
|
|
name: 'FRCUSTSERVICE',
|
|
|
valueField: 'UserName',
|
|
|
displayField: 'CodeAndName'
|
|
|
});
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
this.storeSaleCompany = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'MsCompanysEntity',
|
|
|
proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' }
|
|
|
});
|
|
|
this.storeSaleCompany.load({ params: { condition: ""} });
|
|
|
|
|
|
this.comboxSaleCompany = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.SALECOMPANY, //'委托分公司',
|
|
|
store: this.storeSaleCompany,
|
|
|
// flex: 0.5,
|
|
|
forceSelection: true,
|
|
|
name: 'SALECORPID',
|
|
|
valueField: 'GID',
|
|
|
displayField: 'NAME'
|
|
|
});
|
|
|
this.StoreStlName = Ext.create('Ext.data.Store', {
|
|
|
fields: ['STLNAME', 'DISPLAYNAME']
|
|
|
});
|
|
|
this.StoreStlName.add({ "STLNAME": "月结", "DISPLAYNAME": Zi.LAN.YUEJIE });
|
|
|
this.StoreStlName.add({ "STLNAME": "半月结", "DISPLAYNAME": Zi.LAN.BANYUEJIE });
|
|
|
this.StoreStlName.add({ "STLNAME": "约定天数", "DISPLAYNAME": Zi.LAN.YUEDINGTIANSHU });
|
|
|
this.StoreStlName.add({ "STLNAME": "周结", "DISPLAYNAME": Zi.LAN.ZHOUJIE });
|
|
|
this.StoreStlName.add({ "STLNAME": "现结买单", "DISPLAYNAME": Zi.LAN.XIANJIEMAIDAN });
|
|
|
|
|
|
this.comboxStlName = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
store: this.StoreStlName,
|
|
|
fieldLabel: Zi.LAN.STLNAME, //'结算方式',
|
|
|
forceSelection: true, readOnly: true,
|
|
|
//flex: 0.5,
|
|
|
name: 'STLNAME',
|
|
|
valueField: 'STLNAME',
|
|
|
displayField: 'DISPLAYNAME'
|
|
|
});
|
|
|
|
|
|
this.StoreBSSTATUSREF = Ext.create('Ext.data.Store', {
|
|
|
fields: ['STLNAME', 'DISPLAYNAME']
|
|
|
});
|
|
|
this.StoreBSSTATUSREF.add({ "STLNAME": "锁定", "DISPLAYNAME": Zi.LAN.LOCK });
|
|
|
this.StoreBSSTATUSREF.add({ "STLNAME": "未锁定", "DISPLAYNAME": Zi.LAN.UNLOCK });
|
|
|
this.comboxBSSTATUSREF = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
store: this.StoreBSSTATUSREF,
|
|
|
fieldLabel: Zi.LAN.BSSTATUSREF, //'结算方式',
|
|
|
forceSelection: true, readOnly: true,
|
|
|
//flex: 0.5,
|
|
|
name: 'BSSTATUSREF',
|
|
|
valueField: 'STLNAME',
|
|
|
displayField: 'DISPLAYNAME'
|
|
|
});
|
|
|
this.comboxFEESTATUSREF = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
store: this.StoreBSSTATUSREF,
|
|
|
fieldLabel: Zi.LAN.FEESTATUSREF, //'结算方式',
|
|
|
forceSelection: true, readOnly: true,
|
|
|
//flex: 0.5,
|
|
|
name: 'FEESTATUSREF',
|
|
|
valueField: 'STLNAME',
|
|
|
displayField: 'DISPLAYNAME'
|
|
|
});
|
|
|
|
|
|
|
|
|
//#region 编辑formHead 基本信息
|
|
|
this.formHead = Ext.widget('form', {
|
|
|
region: 'north',
|
|
|
frame: true,
|
|
|
bodyPadding: 5,
|
|
|
collapsed: false,
|
|
|
collapsible: true,
|
|
|
trackResetOnLoad: true,
|
|
|
fieldDefaults: {
|
|
|
margins: '2 2 2 2',
|
|
|
labelAlign: 'right',
|
|
|
flex: 1,
|
|
|
labelWidth: 70,
|
|
|
msgTarget: 'qtip'
|
|
|
},
|
|
|
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.BSNO2, //'业务编号',
|
|
|
name: 'BSNO',
|
|
|
hidden: true,
|
|
|
value: 'topseai' + NewGuid().toString().replace(/-/g, '')
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.MASTERNO, //'业务编号',
|
|
|
name: 'MASTERNO', hidden: true
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.MSHIPPERID, //'MSHIPPERID',
|
|
|
name: 'MSHIPPERID', hidden: true
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.MCONSIGNEEID, //'MCONSIGNEEID',
|
|
|
name: 'MCONSIGNEEID', hidden: true
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.MNOTIFYPARTYID, //'MNOTIFYPARTYID',
|
|
|
name: 'MNOTIFYPARTYID', hidden: true
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.MSHIPPER, //'MSHIPPER',
|
|
|
xtype: 'textareafield',
|
|
|
name: 'MSHIPPER', hidden: true
|
|
|
}, {
|
|
|
fieldLabel: 'MDESCRIPTION', //'MSHIPPER',
|
|
|
xtype: 'textareafield',
|
|
|
name: 'MDESCRIPTION', hidden: true
|
|
|
},
|
|
|
//{
|
|
|
//fieldLabel: Zi.LAN.OPERATORTEL, //'TEL',
|
|
|
//name: 'OPERATORTEL', hidden: true
|
|
|
//},
|
|
|
{
|
|
|
fieldLabel: Zi.LAN.MCONSIGNEE, //'MCONSIGNEE',
|
|
|
xtype: 'textareafield',
|
|
|
name: 'MCONSIGNEE', hidden: true
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.MNOTIFYPARTY, //'MNOTIFYPARTY',
|
|
|
xtype: 'textareafield',
|
|
|
name: 'MNOTIFYPARTY', hidden: true
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.MBLFRT, //'MBLFRT',
|
|
|
name: 'MBLFRT', hidden: true
|
|
|
}
|
|
|
, this.comboxBSSTATUSREF, this.comboxFEESTATUSREF, {
|
|
|
fieldLabel: Zi.LAN.ACCDATE, //'会计期间',
|
|
|
xtype: 'monthfield',
|
|
|
editable: false,
|
|
|
name: 'ACCDATE',
|
|
|
value: Ext.util.Format.date(Ext.Date.add(new Date(), Ext.Date.MONTH - 1, 1), "Y-m")
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.BSDATE, //'接单日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'BSDATE',
|
|
|
value: Ext.util.Format.date(Ext.Date.add(new Date(), Ext.Date.MONTH - 1, 1), "Y-m-d")
|
|
|
}, this.comboxINPUTBY, this.comboxBLTYPE, this.comboxDept]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [this.comboxCustCode, this.comboxBSSOURCE, this.comboxBSSOURCEDETAIL, this.comboxStlName, {
|
|
|
fieldLabel: Zi.LAN.STLDATE, //'结算日期',
|
|
|
//format: 'Y-m-d',
|
|
|
//flex: 0.5,
|
|
|
//labelWidth: 55,
|
|
|
readOnly:true,
|
|
|
//xtype: 'datefield',
|
|
|
name: 'STLDATE'
|
|
|
}, this.comboxSaleCompany ]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
flex: 1,
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.CUSTNO, //'委托编号',
|
|
|
allowBlank: true,
|
|
|
name: 'CUSTNO'
|
|
|
}, {
|
|
|
xtype: 'button',
|
|
|
id: 'btnCUSTNO',
|
|
|
iconCls: "btncancel",
|
|
|
handler: function (button, event) {
|
|
|
this.ClearCustNo();
|
|
|
},
|
|
|
scope: this
|
|
|
}]
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.MBLNO, //'主提单号',
|
|
|
name: 'MBLNO',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
blur: function (field, The, eOpts) {
|
|
|
_this.formHead.getForm().findField('MBLNO').setValue(field.value.toUpperCase().trim());
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.HBLNO, //'分提单号',
|
|
|
name: 'HBLNO',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
blur: function (field, The, eOpts) {
|
|
|
_this.formHead.getForm().findField('HBLNO').setValue(field.value.toUpperCase().trim());
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.ORDERNO, //'业务编号',
|
|
|
name: 'ORDERNO'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.APPLYNO, //'申请放箱号',
|
|
|
name: 'APPLYNO'
|
|
|
}, {
|
|
|
fieldLabel: '发仓储状态', //'MBLFRT',
|
|
|
name: 'WMSSTATUS',
|
|
|
readOnly: true,
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [this.comboxOP, this.comboxSALE, this.comboxCUSTSERVICE, this.comboxDOC,this.comboxFRCUSTSERVICE,this.comboxInfoClientContact]
|
|
|
}]//end items(fieldset 1)
|
|
|
}); //end this.formEdit
|
|
|
//#endregion
|
|
|
|
|
|
var Formhead = this.formHead.getForm();
|
|
|
var _APPLYNO = Formhead.findField('APPLYNO');
|
|
|
_APPLYNO.addListener('dblclick', function () {
|
|
|
alert(3);
|
|
|
}
|
|
|
);
|
|
|
|
|
|
//#region 编辑formEdit 货物信息
|
|
|
|
|
|
|
|
|
this.storeTRANSKINDPKGS = Ext.create('DsExt.ux.RefEnumStore', {});
|
|
|
this.storeTRANSKINDPKGS.load({ params: { enumTypeId: 97047} });
|
|
|
|
|
|
this.comboxTRANSKINDPKGS = Ext.create('DsExt.ux.RefEnumCombox', {
|
|
|
fieldLabel: Zi.LAN.TRANSKINDPKGS,// '运输包装',
|
|
|
store: this.storeTRANSKINDPKGS,
|
|
|
forceSelection: true,
|
|
|
valueField: 'EnumValueId',
|
|
|
displayField: BLTYPEDFIELDNAME,
|
|
|
name: 'TRANSKINDPKGS'
|
|
|
});
|
|
|
|
|
|
this.storeISBONDED = Ext.create('Ext.data.Store', {
|
|
|
fields: ['FType', 'NAME']
|
|
|
});
|
|
|
this.storeISBONDED.add({ "FType": '1', "NAME": Zi.LAN.YES });
|
|
|
this.storeISBONDED.add({ "FType": '0', "NAME": Zi.LAN.NO});
|
|
|
|
|
|
this.comboxISBONDED = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
store: this.storeISBONDED,
|
|
|
fieldLabel: Zi.LAN.ISBONDED,// '是否保税业务',
|
|
|
labelWidth: 90,
|
|
|
valueField: 'FType',
|
|
|
displayField: 'NAME',
|
|
|
forceSelection: true,
|
|
|
name: 'ISBONDED'
|
|
|
});
|
|
|
|
|
|
|
|
|
this.storeVoyVeg = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.VesselModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetVesselList' }
|
|
|
});
|
|
|
this.comboxVoyVeg = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.VESSEL, //'船 名',
|
|
|
store: this.storeVoyVeg,
|
|
|
name: 'VESSEL',
|
|
|
valueField: 'VESSEL',
|
|
|
// flex: 2,
|
|
|
displayField: 'VESSEL',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
blur: function (field, The, eOpts) {
|
|
|
_this.formEdit.getForm().findField('VESSEL').setValue(field.rawValue.toUpperCase());
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
this.storeVoyNo = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.VoyNoModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetVoyNoList' }
|
|
|
});
|
|
|
|
|
|
this.comboxVoyNo = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.VOYNO, //'航次',
|
|
|
store: this.storeVoyNo,
|
|
|
name: 'VOYNO',
|
|
|
valueField: 'VOYNO',
|
|
|
forceSelection: false,
|
|
|
flex: 1,
|
|
|
displayField: 'VOYNO',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'focus': function (combo, The, eOpts) {
|
|
|
var VESSEL = this.formEdit.getForm().findField('VESSEL').getValue();
|
|
|
var conditionstr = " VSID IN (SELECT VSID from code_vessel where VESSEL='" + VESSEL + "') ";
|
|
|
_this.storeVoyNo.load({ params: { condition: conditionstr } });
|
|
|
},
|
|
|
blur: function (field, The, eOpts) {
|
|
|
_this.formEdit.getForm().findField('VOYNO').setValue(field.rawValue.toUpperCase());
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
});
|
|
|
this.storeVoyVeg.load({ params: { condition: "" } });
|
|
|
|
|
|
|
|
|
//仓库
|
|
|
this.storeCustWmsCode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
|
|
|
});
|
|
|
this.storeCustWmsCode.load({ params: { condition: "ISWAREHOUSE='1'" } });
|
|
|
this.comboxCustWmsCode = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.STORAGENAME,
|
|
|
store: this.storeCustWmsCode,
|
|
|
forceSelection: true,
|
|
|
id: 'STORAGENAME',
|
|
|
name: 'STORAGENAME',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName'
|
|
|
// allowBlank: false,
|
|
|
|
|
|
});
|
|
|
|
|
|
//#region 原产地
|
|
|
Ext.define('ConutryRef', {
|
|
|
extend: 'Ext.data.Model',
|
|
|
fields: [
|
|
|
{ name: 'countryid', type: 'string' },
|
|
|
{ name: 'country', type: 'string' },
|
|
|
{ name: 'country_idandname', type: 'string' }
|
|
|
]
|
|
|
});
|
|
|
this.storeCountry = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'ConutryRef',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCountryRefList' }
|
|
|
});
|
|
|
this.storeCountry.load({ params: { condition: "" } });
|
|
|
this.comboxCountry = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.COUNTRYOFORIGIN,
|
|
|
// forceSelection: true,
|
|
|
store: this.storeCountry,
|
|
|
name: 'COUNTRYOFORIGIN',
|
|
|
valueField: 'country',
|
|
|
displayField: 'country'
|
|
|
});
|
|
|
//#endregion
|
|
|
|
|
|
_this = this;
|
|
|
this.formEdit = Ext.widget('form', {
|
|
|
// title: Zi.LAN.HuoWuXinXi, //'货物信息',
|
|
|
region: 'north',
|
|
|
height: 350,
|
|
|
frame: true,
|
|
|
bodyPadding: 5,
|
|
|
trackResetOnLoad: true,
|
|
|
fieldDefaults: {
|
|
|
margins: '2 2 2 2',
|
|
|
labelAlign: 'right',
|
|
|
flex: 1,
|
|
|
labelWidth: 70,
|
|
|
msgTarget: 'qtip'
|
|
|
},
|
|
|
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [this.comboxVoyVeg, this.comboxVoyNo, this.comboxPORTLOAD, this.comboxPORTDISCHARGE, {
|
|
|
fieldLabel: Zi.LAN.ETD, //'到港日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'ETD',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'blur': function (field) {
|
|
|
this.getBMDDATE();
|
|
|
this.getMDTDATE();
|
|
|
}
|
|
|
}
|
|
|
},this.comboxOTHER]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.CHANGEDOCDATE, //'换单日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datetimefield',
|
|
|
name: 'CHANGEDOCDATE'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.FBP, //'免箱期',
|
|
|
name: 'FBP',
|
|
|
id: 'FBP',
|
|
|
value: 0,
|
|
|
blankText: Zi.LAN.QingTianXieShuZhi, //'请填写数值!',
|
|
|
regex: /^(0|[1-9][0-9]*)$/,
|
|
|
regexText: Zi.LAN.QingShuRuZhengQueDeShuZhi, //'请输入正确的数值!',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'blur': function (field) {
|
|
|
this.getBMDDATE();
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.BMDDATE, //'箱使到期日',
|
|
|
format: 'Y-m-d',
|
|
|
name: 'BMDDATE',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'onfocus': function (field) {
|
|
|
this.getBMDDATE2(field.getValue());
|
|
|
},
|
|
|
'blur': function (field) {
|
|
|
this.getBMDDATE2(field.getValue());
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.MDTDATE, //'搬倒日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'MDTDATE',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'onfocus': function (field) {
|
|
|
this.getMDTDATE2(field.getValue());
|
|
|
},
|
|
|
'blur': function (field) {
|
|
|
this.getMDTDATE2(field.getValue());
|
|
|
}
|
|
|
}
|
|
|
}, this.comboxYARD, this.comboxAGENT]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [this.comboxCARRIER, this.comboxLANE, this.comboxCustENTERP, this.comboxFORWARDER,this.comboxTRUCKER, this.comboxCARRIERAGENT]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [this.comboxGOODSTYPENAME, this.comboxGOODSNAME, this.comboxCountry, {
|
|
|
fieldLabel: Zi.LAN.NUMBERPLATE, //'牌号',
|
|
|
name: 'NUMBERPLATE'
|
|
|
},{
|
|
|
fieldLabel: Zi.LAN.PKGS, //'件数',
|
|
|
name: 'PKGS',
|
|
|
value: 0,
|
|
|
id: 'PKGS',
|
|
|
blankText: Zi.LAN.QingTianXieShuZhi, //'请填写数值!',
|
|
|
allowBlank: false,
|
|
|
regex: /^\d+(\.\d{1,4})?$/,
|
|
|
regexText: Zi.LAN.QingShuRuZhengQueDeShuZhi //'请输入正确的数值!'
|
|
|
}, this.comboxKINDPKGS]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [ {
|
|
|
fieldLabel: Zi.LAN.KGS2, //'毛重',
|
|
|
name: 'KGS',
|
|
|
value: 0,
|
|
|
id: 'KGS',
|
|
|
blankText: Zi.LAN.QingTianXieShuZhi, //'请填写数值!',
|
|
|
allowBlank: false,
|
|
|
regex: /^\d+(\.\d{1,5})?$/,
|
|
|
autoRender: true,
|
|
|
regexText: Zi.LAN.QingShuRuZhengQueDeShuZhi //'请输入正确的数值!'
|
|
|
//,
|
|
|
//listeners: {
|
|
|
// scope: this,
|
|
|
// render: function (field,eOpts) {
|
|
|
// var UNITOFWEIGHT = _this.formEdit.getForm().findField('UNITOFWEIGHT').getValue();
|
|
|
// if (UNITOFWEIGHT == '吨') {
|
|
|
// if (field.value != '0') { return Div(field.value, 1000); } else return field.value;
|
|
|
|
|
|
// } else return field.value;
|
|
|
|
|
|
// }
|
|
|
//}
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.NETWEIGHT, //'净重',
|
|
|
name: 'NETWEIGHT',
|
|
|
value: 0,
|
|
|
id: 'NETWEIGHT',
|
|
|
blankText: Zi.LAN.QingTianXieShuZhi, //'请填写数值!',
|
|
|
allowBlank: false,
|
|
|
autoRender:true,
|
|
|
regex: /^\d+(\.\d{1,5})?$/,
|
|
|
regexText: Zi.LAN.QingShuRuZhengQueDeShuZhi //'请输入正确的数值!'
|
|
|
//, //'请输入正确的数值!',
|
|
|
//render: function (value) {
|
|
|
// var UNITOFWEIGHT = _this.formEdit.getForm().findField('UNITOFWEIGHT').getValue();
|
|
|
// if (UNITOFWEIGHT == '吨') {
|
|
|
// if (value != '0') { return Div(value, 1000); } else return value;
|
|
|
|
|
|
// } else return value;
|
|
|
//}
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.CBM, //'尺码',
|
|
|
name: 'CBM',
|
|
|
value: 0,
|
|
|
id: 'CBM',
|
|
|
blankText: Zi.LAN.QingTianXieShuZhi, //'请填写数值!',
|
|
|
allowBlank: false,
|
|
|
regex: /^\d+(\.\d{1,4})?$/,
|
|
|
regexText: Zi.LAN.QingShuRuZhengQueDeShuZhi //'请输入正确的数值!'
|
|
|
}, this.comboxUNITOFWEIGHT, this.comboxTRANSKINDPKGS,{
|
|
|
fieldLabel: Zi.LAN.BALES2, //'BALES',
|
|
|
labelWidth: 120,
|
|
|
name: 'BALES'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.APPROVENO, //'审批单号',
|
|
|
name: 'APPROVENO'
|
|
|
}, this.comboxTRADETYPE, this.comboxTRADETERM, {
|
|
|
fieldLabel: Zi.LAN.CONTRACTNO, //'合同号',
|
|
|
name: 'CONTRACTNO'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.CONTRACTDATE, //'搬倒日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
//flex: 0.7,
|
|
|
//labelWidth: 55,
|
|
|
name: 'CONTRACTDATE'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.INVNO, //'发票号',
|
|
|
//labelWidth: 50,
|
|
|
//flex: 0.7,
|
|
|
name: 'INVNO'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [this.comboxCUSTOMSER, {
|
|
|
fieldLabel: Zi.LAN.CUSTOMNO, //'报关单号',
|
|
|
name: 'CUSTOMNO'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.CUSTOMDATE, //'通关日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datetimefield',
|
|
|
name: 'CUSTOMDATE'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.TARIFFS, //'报关单号',
|
|
|
name: 'TARIFFS'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.VAT, //'报关单号',
|
|
|
name: 'VAT'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.MARGIN, //'报关单号',
|
|
|
name: 'MARGIN'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.UPDATETIME, //'申报日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datetimefield',
|
|
|
name: 'UPDATETIME'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.TARRIFSPAIEDTIEM, //'交关税时间',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'TARRIFSPAIEDTIEM'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.CUSTOMSNUM, //'报关票数',
|
|
|
name: 'CUSTOMSNUM',
|
|
|
flex: 0.5,
|
|
|
value: 0,
|
|
|
regex: /^\d+(\.\d{1,4})?$/,
|
|
|
regexText: Zi.LAN.QingShuRuZhengQueDeShuZhi, //'请输入正确的数值!'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.PRERECORD, //'预录数',
|
|
|
flex: 0.5,
|
|
|
labelWidth: 40,
|
|
|
name: 'PRERECORD',
|
|
|
value: 0,
|
|
|
regex: /^\d+(\.\d{1,4})?$/,
|
|
|
regexText: Zi.LAN.QingShuRuZhengQueDeShuZhi, //'请输入正确的数值!'
|
|
|
},{
|
|
|
fieldLabel: Zi.LAN.IMPORTVALUE, //'货值',
|
|
|
name: 'IMPORTVALUE',
|
|
|
value: 0,
|
|
|
id: 'IMPORTVALUE',
|
|
|
blankText: Zi.LAN.QingTianXieShuZhi, //'请填写数值!',
|
|
|
allowBlank: false,
|
|
|
regex: /^\d+(\.\d{1,4})?$/,
|
|
|
regexText: Zi.LAN.QingShuRuZhengQueDeShuZhi, //'请输入正确的数值!',
|
|
|
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
|
try {
|
|
|
var lsValue = usMoney(value, 2, '', false);
|
|
|
if (lsValue != "NaN") {
|
|
|
value = lsValue; if (parseFloat(lsValue) < 0) {
|
|
|
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
return value;
|
|
|
}
|
|
|
}
|
|
|
catch (e) {
|
|
|
return value;
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.UNITPRICE, //'单价',
|
|
|
name: 'UNITPRICE',
|
|
|
/// flex: 0.6,
|
|
|
value: 0,
|
|
|
id: 'UNITPRICE',
|
|
|
blankText: Zi.LAN.QingTianXieShuZhi, //'请填写数值!',
|
|
|
allowBlank: false,
|
|
|
regex: /^\d+(\.\d{1,4})?$/,
|
|
|
regexText: Zi.LAN.QingShuRuZhengQueDeShuZhi, //'请输入正确的数值!',
|
|
|
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
|
try {
|
|
|
var lsValue = usMoney(value, 2, '', false);
|
|
|
if (lsValue != "NaN") {
|
|
|
value = lsValue; if (parseFloat(lsValue) < 0) {
|
|
|
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
return value;
|
|
|
}
|
|
|
}
|
|
|
catch (e) {
|
|
|
return value;
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
}, this.comboxCodeCurrency]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [this.comboxINSPECTION, {
|
|
|
fieldLabel: Zi.LAN.INSPECTIONNO, //'报检单号',
|
|
|
name: 'INSPECTIONNO'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.INSPECTIONDATE, //'报检日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'INSPECTIONDATE'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.YaXiangDate, //'押箱时间',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'YaXiangDate'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.YaXiangDiDian, //'押箱地点',
|
|
|
name: 'YaXiangDiDian'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.YaXiangJinE, //'押箱金额',
|
|
|
name: 'YaXiangJinE',
|
|
|
value: 0,
|
|
|
regex: /^\d+(\.\d{1,2})?$/,
|
|
|
regexText: Zi.LAN.QingShuRuZhengQueDeShuZhi //'请输入正确的数值!'
|
|
|
}]
|
|
|
}, {
|
|
|
//需求编号:SR2017071700004
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [this.comboxINSPECTSERVICE,{
|
|
|
fieldLabel: Zi.LAN.SJYHDATE, //'货物商检验货时间',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
labelWidth: 115,
|
|
|
name: 'SJYHDATE'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.SJCYXL, //'商检查验箱量',
|
|
|
labelWidth: 90,
|
|
|
name: 'SJCYXL'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.HGCYDATE, //'货物商检验货时间',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
labelWidth:90,
|
|
|
name: 'HGCYDATE'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.HGCYXL, //'商检查验箱量',
|
|
|
labelWidth: 90,
|
|
|
name: 'HGCYXL'
|
|
|
}, this.comboxWMSTYPE]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.ISMOREGOOD, //'是否多品名',
|
|
|
inputValue: true,
|
|
|
xtype: 'checkboxfield',
|
|
|
name: 'ISMOREGOOD'
|
|
|
}, this.comboxISBONDED, {
|
|
|
fieldLabel: Zi.LAN.CNTRTOTAL3, //'箱型箱量',
|
|
|
readOnly: true,
|
|
|
name: 'CNTRTOTAL'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.SJLCEVALIDITY, //'商检证书有效期',
|
|
|
labelWidth: 90,
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'SJLCEVALIDITY'
|
|
|
}, this.comboxCustWmsCode, {
|
|
|
fieldLabel: Zi.LAN.GOODSNAMEID,
|
|
|
hidden: true,
|
|
|
name: 'GOODSNAMEID'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.TIHUOTIME, //'换单日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datetimefield',
|
|
|
name: 'TIHUOTIME'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textarea',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.REMARK, //'备注',
|
|
|
height: 54,
|
|
|
name: 'REMARK',
|
|
|
flex: 4
|
|
|
},{
|
|
|
fieldLabel: Zi.LAN.REMARK2, //'备注',
|
|
|
height: 54,
|
|
|
name: 'REMARK2',
|
|
|
id:'REMARK2',
|
|
|
flex: 4
|
|
|
}]//, { xtype: 'hiddenfield'}
|
|
|
}]//end items(fieldset 1)
|
|
|
}); //end this.formEdit
|
|
|
//#endregion
|
|
|
|
|
|
//#region 空白form信息
|
|
|
this.formBlank = Ext.widget('form', {
|
|
|
region: 'south',
|
|
|
height: 50,
|
|
|
frame: true,
|
|
|
items: [{ xtype: 'container'}]
|
|
|
});
|
|
|
//#endregion
|
|
|
|
|
|
//#region 危险品信息
|
|
|
this.panelBodyDr = new Ext.Panel({
|
|
|
title: Zi.LAN.panelBodyDr, //'危险品信息',
|
|
|
layout: "border",
|
|
|
hidden: true,
|
|
|
height: 60,
|
|
|
frame: true,
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
defaults: {
|
|
|
anchor: '96%'
|
|
|
},
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.DCLASS, //'危险品等级',
|
|
|
flex: 1,
|
|
|
labelWidth: 70,
|
|
|
name: 'DCLASS'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.DUNNO, //'危险品编号',
|
|
|
flex: 1,
|
|
|
labelWidth: 70,
|
|
|
name: 'DUNNO'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.DPAGE, //'危险品页号',
|
|
|
flex: 1,
|
|
|
labelWidth: 70,
|
|
|
name: 'DPAGE'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.DLABEL, //'危险品标签',
|
|
|
flex: 1,
|
|
|
labelWidth: 70,
|
|
|
name: 'DLABEL'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.LINKMAN, //'危险品联系人',
|
|
|
flex: 1,
|
|
|
labelWidth: 90,
|
|
|
name: 'LINKMAN'
|
|
|
}]
|
|
|
}]
|
|
|
});
|
|
|
this.panelBodyRf = new Ext.Panel({
|
|
|
title: Zi.LAN.panelBodyRf, //'冻柜信息',
|
|
|
layout: "border",
|
|
|
hidden: true,
|
|
|
height: 60,
|
|
|
//margin: '5 10',
|
|
|
frame: true,
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.REEFERF, //'冷藏通风量',
|
|
|
name: 'REEFERF'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.TEMPSET, //'设置温度',
|
|
|
name: 'TEMPSET'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.TEMPID, //'温度单位',
|
|
|
name: 'TEMPID'
|
|
|
}]
|
|
|
}]
|
|
|
});
|
|
|
|
|
|
|
|
|
this.StoreCargoid = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsExtEnumModel',
|
|
|
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
|
|
|
});
|
|
|
this.StoreCargoid.load({ params: { enumTypeId: 96012 } });
|
|
|
|
|
|
|
|
|
//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: Zi.LAN.CARGOID, //'货物标示',
|
|
|
forceSelection: true,
|
|
|
name: 'CARGOID',
|
|
|
valueField: 'EnumValueId',
|
|
|
displayField: BLTYPEDFIELDNAME,
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
if (combo.value == 'R') {
|
|
|
this.panelBodyDr.setVisible(false);
|
|
|
this.panelBodyRf.setVisible(true);
|
|
|
} else if (combo.value == 'D') {
|
|
|
this.panelBodyDr.setVisible(true);
|
|
|
this.panelBodyRf.setVisible(false);
|
|
|
} else {
|
|
|
this.panelBodyDr.setVisible(false);
|
|
|
this.panelBodyRf.setVisible(false);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
//#endregion
|
|
|
|
|
|
//#region 收、发货人通知人
|
|
|
//客户加载_发货人
|
|
|
this.storeShipper = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'OpSeaeShipper',
|
|
|
proxy: { url: '/MvcShipping/MsOpSeae/GetShipperListRm' }
|
|
|
});
|
|
|
// this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} });
|
|
|
|
|
|
//发货人
|
|
|
this.comboxShipper = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.SHIPPERID, //'Shipper (发货人)',
|
|
|
store: this.storeShipper,
|
|
|
// forceSelection: true,
|
|
|
labelWidth: 150,
|
|
|
labelAlign: 'left',
|
|
|
queryMode: 'remote',
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
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.formBill.getForm().findField('SHIPPER').setValue(selectdata.SHIPPERDETAIL);
|
|
|
} else {
|
|
|
this.formBill.getForm().findField('SHIPPER').setValue('');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//客户加载_收货人
|
|
|
this.storeConsignee = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'OpSeaeShipper',
|
|
|
proxy: { url: '/MvcShipping/MsOpSeae/GetShipperListRm' }
|
|
|
});
|
|
|
// this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} });
|
|
|
|
|
|
//收货人
|
|
|
this.comboxConsignee = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.CONSIGNEEID, //'Consignee (收货人)',
|
|
|
labelWidth: 150,
|
|
|
labelAlign: 'left',
|
|
|
queryMode: 'remote',
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
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.formBill.getForm().findField('CONSIGNEE').setValue(selectdata.SHIPPERDETAIL);
|
|
|
} else {
|
|
|
this.formBill.getForm().findField('CONSIGNEE').setValue('');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//客户加载_通知人
|
|
|
this.storenotifyparty = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'OpSeaeShipper',
|
|
|
proxy: { url: '/MvcShipping/MsOpSeae/GetShipperListRm' }
|
|
|
});
|
|
|
// this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} });
|
|
|
|
|
|
//通知人
|
|
|
this.comboxNotifyParty = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.NOTIFYPARTYID, //'Notify Party (通知人)',
|
|
|
store: this.storenotifyparty,
|
|
|
labelWidth: 150,
|
|
|
labelAlign: 'left',
|
|
|
queryMode: 'remote',
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
// 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.formBill.getForm().findField('NOTIFYPARTY').setValue(selectdata.SHIPPERDETAIL);
|
|
|
} else {
|
|
|
this.formBill.getForm().findField('NOTIFYPARTY').setValue('');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
//付费方式
|
|
|
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: Zi.LAN.BLFRT, //'付费方式',
|
|
|
store: this.storeFrt,
|
|
|
forceSelection: true,
|
|
|
name: 'BLFRT',
|
|
|
valueField: 'FRT',
|
|
|
displayField: 'FRT',
|
|
|
value:'FREIGHT PREPAID',
|
|
|
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();
|
|
|
this.formBill.getForm().findField('PREPARDAT').setValue(portload);
|
|
|
this.formBill.getForm().findField('PAYABLEAT').setValue('');
|
|
|
} else if (combo.value == "FREIGHT COLLECT") {
|
|
|
var DESTINATION = this.formEdit.getForm().findField('DESTINATION').getValue();
|
|
|
this.formBill.getForm().findField('PAYABLEAT').setValue(DESTINATION);
|
|
|
this.formBill.getForm().findField('PREPARDAT').setValue('');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
//#region 编辑formbill 基本信息
|
|
|
|
|
|
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: Zi.LAN.ISSUETYPE, //'签单方式',
|
|
|
store: this.storeISSUETYPE,
|
|
|
forceSelection: true,
|
|
|
name: 'ISSUETYPE',
|
|
|
valueField: 'BLTYPE',
|
|
|
displayField: 'BLTYPE',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
if (combo.value == "正本") {
|
|
|
this.formBill.getForm().findField('NOBILL').setValue('THREE');
|
|
|
} else if (combo.value == "电放") {
|
|
|
this.formBill.getForm().findField('NOBILL').setValue('ONE');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
this.formBill = 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: 1,
|
|
|
defaultType: 'textfield',
|
|
|
items: [this.comboxShipper, {
|
|
|
xtype: 'textareafield',
|
|
|
grow: true,
|
|
|
labelWidth: 0,
|
|
|
height: 90,
|
|
|
name: 'SHIPPER',
|
|
|
anchor: '100%',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
change: function (field, newValue, oldValue, eOpts) {
|
|
|
if (newValue != oldValue) {
|
|
|
_this.formBill.getForm().findField('SHIPPER').setValue(newValue.toUpperCase());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, this.comboxConsignee, {
|
|
|
xtype: 'textareafield',
|
|
|
grow: true,
|
|
|
labelWidth: 0,
|
|
|
height: 90,
|
|
|
name: 'CONSIGNEE',
|
|
|
anchor: '100%',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
change: function (field, newValue, oldValue, eOpts) {
|
|
|
if (newValue != oldValue) {
|
|
|
_this.formBill.getForm().findField('CONSIGNEE').setValue(newValue.toUpperCase());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, this.comboxNotifyParty, {
|
|
|
xtype: 'textareafield',
|
|
|
grow: true,
|
|
|
labelWidth: 0,
|
|
|
height: 90,
|
|
|
name: 'NOTIFYPARTY',
|
|
|
anchor: '100%',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
change: function (field, newValue, oldValue, eOpts) {
|
|
|
if (newValue != oldValue) {
|
|
|
_this.formBill.getForm().findField('NOTIFYPARTY').setValue(newValue.toUpperCase());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'anchor',
|
|
|
flex: 1,
|
|
|
defaultType: 'textfield',
|
|
|
defaults: {
|
|
|
anchor: '99%'
|
|
|
},
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.ETA, //'开船日期',
|
|
|
format: 'Y-m-d',
|
|
|
flex: 1,
|
|
|
xtype: 'datefield',
|
|
|
name: 'ETA'//'ETD'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.PORTLOADID, //'装港代码',
|
|
|
name: 'PORTLOADID'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.PORTDISCHARGEID, //'卸港代码',
|
|
|
name: 'PORTDISCHARGEID'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.DESTINATIONID, //'目的代码',
|
|
|
name: 'DESTINATIONID'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.DESTINATION, //'目的地',
|
|
|
name: 'DESTINATION'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.PLACEDELIVERYID, //'交货代码',
|
|
|
name: 'PLACEDELIVERYID'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.PLACEDELIVERY, //'交货地',
|
|
|
name: 'PLACEDELIVERY'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.SHIPPERCODE, //'交货代码',
|
|
|
name: 'SHIPPERCODE'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.SHIPPERATTN, //'交货地',
|
|
|
labelWidth: 80,
|
|
|
name: 'SHIPPERATTN'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.SHIPPERTEL, //'交货代码',
|
|
|
name: 'SHIPPERTEL'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.SHIPPEREMAIL, //'交货地',
|
|
|
name: 'SHIPPEREMAIL'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.SHIPPERCOUNTRY, //'交货地',
|
|
|
name: 'SHIPPERCOUNTRY'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.CONSIGNEECODE, //'交货代码',
|
|
|
name: 'CONSIGNEECODE'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.CONSIGNEEATTN, //'交货地',
|
|
|
labelWidth: 80,
|
|
|
name: 'CONSIGNEEATTN'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.CONSIGNEETEL, //'交货代码',
|
|
|
name: 'CONSIGNEETEL'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.CONSIGNEEEMAIL, //'交货地',
|
|
|
name: 'CONSIGNEEEMAIL'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.CONSIGNEECOUNTRY, //'交货地',
|
|
|
name: 'CONSIGNEECOUNTRY'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.NOTIFYPARTYCODE, //'交货代码',
|
|
|
name: 'NOTIFYPARTYCODE'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.NOTIFYPARTYATTN, //'交货地',
|
|
|
labelWidth: 80,
|
|
|
name: 'NOTIFYPARTYATTN'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
items: [{
|
|
|
fieldLabel: Zi.LAN.NOTIFYPARTYTEL, //'交货代码',
|
|
|
name: 'NOTIFYPARTYTEL'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.NOTIFYPARTYEMAIL, //'交货地',
|
|
|
name: 'NOTIFYPARTYEMAIL'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.NOTIFYPARTYCOUNTRY, //'交货地',
|
|
|
name: 'NOTIFYPARTYCOUNTRY'
|
|
|
}]
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
|
|
|
]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'anchor',
|
|
|
flex: 1,
|
|
|
defaultType: 'textfield',
|
|
|
defaults: {
|
|
|
anchor: '99%'
|
|
|
},
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
layout: 'anchor',
|
|
|
flex: 1,
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
xtype: 'label',
|
|
|
html: Zi.LAN.MARKSSTR //'<html>Seal No.(封志号)<br> Marks & Nos.(标记与号码) </html>'
|
|
|
}, {
|
|
|
xtype: 'textareafield',
|
|
|
grow: true,
|
|
|
height: 250,
|
|
|
name: 'MARKS',
|
|
|
anchor: '100%',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
change: function (field, newValue, oldValue, eOpts) {
|
|
|
if (newValue != oldValue) {
|
|
|
_this.formBill.getForm().findField('MARKS').setValue(newValue.toUpperCase());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'anchor',
|
|
|
flex: 3,
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
defaults: {
|
|
|
anchor: '100%'
|
|
|
},
|
|
|
items: [this.comboxCargoid]
|
|
|
}, {
|
|
|
xtype: 'textareafield',
|
|
|
grow: true,
|
|
|
fieldLabel: '  ',
|
|
|
labelSeparator: '',
|
|
|
labelWidth: 20,
|
|
|
height: 250,
|
|
|
name: 'DESCRIPTION',
|
|
|
anchor: '100%',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
change: function (field, newValue, oldValue, eOpts) {
|
|
|
if (newValue != oldValue) {
|
|
|
_this.formBill.getForm().findField('DESCRIPTION').setValue(newValue.toUpperCase());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'anchor',
|
|
|
flex: 1,
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
xtype: 'label',
|
|
|
html: Zi.LAN.NOPKGS //'<html>         No.of containers or pkgs.<br>         (箱数或件数)</html>'
|
|
|
}, {
|
|
|
xtype: 'textareafield',
|
|
|
grow: true,
|
|
|
fieldLabel: '  ',
|
|
|
labelWidth: 20,
|
|
|
labelSeparator: '',
|
|
|
height: 40,
|
|
|
name: 'NOPKGS',
|
|
|
anchor: '100%'
|
|
|
}, {
|
|
|
xtype: 'label',
|
|
|
html: Zi.LAN.GROSSWEIGHT //'          Gross Weight 毛重(公斤)'
|
|
|
}, {
|
|
|
xtype: 'textareafield',
|
|
|
grow: true,
|
|
|
height: 40,
|
|
|
labelWidth: 20,
|
|
|
labelSeparator: '',
|
|
|
fieldLabel: '  ',
|
|
|
name: 'GROSSWEIGHT',
|
|
|
anchor: '100%'
|
|
|
}, {
|
|
|
xtype: 'label',
|
|
|
html: Zi.LAN.MEASUREMENT //'          Measurement 尺码(立方米)'
|
|
|
}, {
|
|
|
xtype: 'textareafield',
|
|
|
grow: true,
|
|
|
height: 40,
|
|
|
labelWidth: 20,
|
|
|
labelSeparator: '',
|
|
|
fieldLabel: '  ',
|
|
|
name: 'MEASUREMENT',
|
|
|
anchor: '100%'
|
|
|
}
|
|
|
|
|
|
]
|
|
|
}
|
|
|
|
|
|
|
|
|
]
|
|
|
}, this.panelBodyDr, this.panelBodyRf, {
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
items: [this.comboxISSUETYPE, {
|
|
|
fieldLabel: Zi.LAN.ISSUEDATE, //'签单日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'ISSUEDATE'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.ISSUEPLACE, //'签单地点',
|
|
|
name: 'ISSUEPLACE'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.NOBILL, //'提单份数',
|
|
|
name: 'NOBILL'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'hbox',
|
|
|
items: [this.comboxBLFRT, {
|
|
|
fieldLabel: Zi.LAN.PREPARDAT, //'预付地点',
|
|
|
name: 'PREPARDAT'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.PAYABLEAT, //'到付地点',
|
|
|
name: 'PAYABLEAT'
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.SERVICE, //'运输条款',
|
|
|
name: 'SERVICE'
|
|
|
}]
|
|
|
}]
|
|
|
}
|
|
|
]
|
|
|
}); //end this.formEdit
|
|
|
//#endregion
|
|
|
|
|
|
//#region 集装箱-数据集
|
|
|
this.storeBodyList = Ext.create('Ext.data.Store', {
|
|
|
model: 'MsOpSeaiDetail',
|
|
|
remoteSort: false,
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
url: '/MvcShipping/MsOpSeai/GetBodyList',
|
|
|
reader: {
|
|
|
id: 'BsNo,CTNCODE,CTN_ID',
|
|
|
root: 'data',
|
|
|
totalProperty: 'totalCount'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
//客户加载_车队
|
|
|
this.storeTRUCKERCTN = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListTRUCK' }
|
|
|
});
|
|
|
|
|
|
//车队
|
|
|
this.comboxTRUCKERCTN = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
store: this.storeTRUCKERCTN,
|
|
|
queryMode: 'remote',
|
|
|
minChars: 1,
|
|
|
queryParam: 'CODENAME',
|
|
|
name: 'TRUCKER',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName'
|
|
|
});
|
|
|
|
|
|
|
|
|
this.StoreCTNSTATUS = Ext.create('Ext.data.Store', {
|
|
|
fields: ['ID', 'NAME']
|
|
|
});
|
|
|
this.StoreCTNSTATUS.add({ "ID": "F", "NAME": Zi.LAN.ZhengXiang });
|
|
|
this.StoreCTNSTATUS.add({ "ID": "E", "NAME": Zi.LAN.KongXiang });
|
|
|
this.StoreCTNSTATUS.add({ "ID": "L", "NAME": Zi.LAN.PinXiang });
|
|
|
this.comboxCTNSTATUS = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
store: this.StoreCTNSTATUS,
|
|
|
forceSelection: true,
|
|
|
name: 'CTNSTATUS',
|
|
|
valueField: 'ID',
|
|
|
displayField: 'NAME'
|
|
|
});
|
|
|
|
|
|
this.StoreISTEMP = Ext.create('Ext.data.Store', {
|
|
|
fields: ['ID', 'NAME']
|
|
|
});
|
|
|
this.StoreISTEMP.add({ "ID": "1", "NAME": Zi.LAN.YES });
|
|
|
this.StoreISTEMP.add({ "ID": "0", "NAME": Zi.LAN.NO});
|
|
|
this.comboxISTEMP = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
store: this.StoreISTEMP,
|
|
|
forceSelection: true,
|
|
|
name: 'ISTEMP',
|
|
|
valueField: 'ID',
|
|
|
displayField: 'NAME'
|
|
|
});
|
|
|
|
|
|
|
|
|
//#region 集装箱-数据集
|
|
|
this.storeBodyList = Ext.create('Ext.data.Store', {
|
|
|
model: 'MsOpSeaiDetail',
|
|
|
remoteSort: false,
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
url: '/MvcShipping/MsOpSeai/GetBodyList',
|
|
|
reader: {
|
|
|
id: 'BsNo,CTNCODE,CTN_ID',
|
|
|
root: 'data',
|
|
|
totalProperty: 'totalCount'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
this.initctncolumns =[{
|
|
|
sortable: true,
|
|
|
dataIndex: 'CTN_ID',
|
|
|
header: Zi.LAN.CTN_ID, //'编号',
|
|
|
hidden: true,
|
|
|
width: 0
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'BSNO',
|
|
|
header: Zi.LAN.BSNO2, //'业务编号',
|
|
|
hidden: true,
|
|
|
width: 0
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'CTNCODE',
|
|
|
header: Zi.LAN.CTNCODE, //'序号',
|
|
|
width: 30
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'CTNALL',
|
|
|
header: Zi.LAN.CTNALL, //'箱型',
|
|
|
width: 70,
|
|
|
editor: this.comboxCTNALL
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'CTNNUM',
|
|
|
header: Zi.LAN.CTNNUM, //'箱量',
|
|
|
width: 50,
|
|
|
editor: {
|
|
|
xtype: 'numberfield',
|
|
|
allowBlank: false,
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 5)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 5)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'CNTRNO',
|
|
|
header: Zi.LAN.CNTRNO, //'箱号',
|
|
|
width: 100,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 6)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 6)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'SEALNO',
|
|
|
header: Zi.LAN.SEALNO, //'封号',
|
|
|
width: 80,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 7)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 7)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'PKGS',
|
|
|
header: Zi.LAN.PKGS, //'件数',
|
|
|
width: 60,
|
|
|
editor: {
|
|
|
xtype: 'numberfield',
|
|
|
allowBlank: false,
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 8)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 8)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'KINDPKGS',
|
|
|
header: Zi.LAN.KINDPKGS, //'件数包装',
|
|
|
width: 100,
|
|
|
editor: this.comboxKINDPKGS_CTN
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'KGS',
|
|
|
header: Zi.LAN.KGS, //'重量',
|
|
|
width: 60,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 10)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1,10)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'TAREWEIGHT',
|
|
|
header: Zi.LAN.TAREWEIGHT, //'箱皮重',
|
|
|
width: 60,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 11)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 11)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'CBM',
|
|
|
header: Zi.LAN.CBM, //'尺码',
|
|
|
width: 60,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 12)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 12)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'REMARK',
|
|
|
header: Zi.LAN.REMARK, //'备注',
|
|
|
width: 150,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 13)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 13)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'CTNSTATUS',
|
|
|
header: Zi.LAN.CTNSTATUS, //'箱状态',
|
|
|
width: 70,
|
|
|
editor: this.comboxCTNSTATUS,
|
|
|
renderer: function (value, p, record) {
|
|
|
if (value == 'E')
|
|
|
return Zi.LAN.KongXiang;
|
|
|
else if (value == 'L')
|
|
|
return Zi.LAN.PinXiang;
|
|
|
else return Zi.LAN.ZhengXiang;
|
|
|
}
|
|
|
}, {
|
|
|
dataIndex: 'ISTEMP',
|
|
|
header: Zi.LAN.ISTEMP, //'箱状态',
|
|
|
width: 70,
|
|
|
editor: this.comboxISTEMP,
|
|
|
renderer: function (value, p, record) {
|
|
|
if (value == '1')
|
|
|
return Zi.LAN.YES;
|
|
|
else return Zi.LAN.NO;
|
|
|
}
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'TRUCKER',
|
|
|
header: Zi.LAN.TRUCKER,
|
|
|
width: 65,
|
|
|
editor: this.comboxTRUCKERCTN
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'TRUCKNO',
|
|
|
header: Zi.LAN.TRUCKNO, //'备注',
|
|
|
width: 100,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 16)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 16)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'TRUCKFEE',
|
|
|
header: Zi.LAN.TRUCKFEE, //'运费',
|
|
|
editor: {
|
|
|
xtype: 'numberfield',
|
|
|
keyNavEnabled: false,
|
|
|
selectOnFocus: true,
|
|
|
hideTrigger: true,
|
|
|
mouseWheelEnabled: false,
|
|
|
decimalPrecision: 2,
|
|
|
enableKeyEvents: true
|
|
|
},
|
|
|
align: 'right',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'FREECTNDAY',
|
|
|
header: Zi.LAN.FREECTNDAY,
|
|
|
width: 60,
|
|
|
editor: {
|
|
|
xtype: 'numberfield',
|
|
|
allowBlank: false,
|
|
|
selectOnFocus: true
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'TIXIANGSHIJIAN',
|
|
|
header: Zi.LAN.TIXIANGSHIJIAN, //'提箱时间',
|
|
|
editor: {
|
|
|
xtype: 'datefield',
|
|
|
format: 'Y-m-d'
|
|
|
},
|
|
|
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
|
|
|
width: 100
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'CTNDAY',
|
|
|
header: Zi.LAN.CTNDAY,
|
|
|
width: 60,
|
|
|
editor: {
|
|
|
xtype: 'numberfield',
|
|
|
allowBlank: false,
|
|
|
selectOnFocus: true
|
|
|
}
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'CTNPRICE',
|
|
|
header: Zi.LAN.CTNPRICE, //'运费',
|
|
|
editor: {
|
|
|
xtype: 'numberfield',
|
|
|
keyNavEnabled: false,
|
|
|
selectOnFocus: true,
|
|
|
hideTrigger: true,
|
|
|
mouseWheelEnabled: false,
|
|
|
decimalPrecision: 2,
|
|
|
enableKeyEvents: true
|
|
|
},
|
|
|
align: 'right',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'CTNFEE',
|
|
|
header: Zi.LAN.CTNFEE, //'运费',
|
|
|
editor: {
|
|
|
xtype: 'numberfield',
|
|
|
keyNavEnabled: false,
|
|
|
selectOnFocus: true,
|
|
|
hideTrigger: true,
|
|
|
mouseWheelEnabled: false,
|
|
|
decimalPrecision: 2,
|
|
|
enableKeyEvents: true
|
|
|
},
|
|
|
align: 'right',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'MTMC',
|
|
|
header: Zi.LAN.MTMC, //'码头信息',
|
|
|
width: 120,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 22)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 22)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'SJRGSJ',
|
|
|
header: Zi.LAN.SJRGSJ, //'卸船时间',
|
|
|
width: 120,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 23)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 23)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
},{
|
|
|
sortable: false,
|
|
|
dataIndex: 'SJCGSJ',
|
|
|
header: Zi.LAN.SJCGSJ, //'出港时间',
|
|
|
width: 120,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 24)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 24)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
},{
|
|
|
sortable: true,
|
|
|
dataIndex: 'WMSDATE',
|
|
|
header: Zi.LAN.WMSDATE, //'入库时间',
|
|
|
width: 80,
|
|
|
editor: {
|
|
|
xtype: 'datefield',
|
|
|
format: 'Y-m-d',
|
|
|
selectOnFocus: true
|
|
|
},
|
|
|
renderer: Ext.util.Format.dateRenderer('Y-m-d')
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'ISWMS',
|
|
|
header: Zi.LAN.ISWMS, //'是否入库',
|
|
|
width: 60,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 26)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 26)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
},
|
|
|
renderer: function (value, cellmeta) {
|
|
|
if (value == '1' || value == true || value == 'True') {
|
|
|
return "已入库";
|
|
|
}
|
|
|
else if (value == '0' || value == '' || value == false || value == 'False') {
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: 'AREANAME',
|
|
|
header: Zi.LAN.AREANAME, //'储位',
|
|
|
width: 120,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true,
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keydown: function (textfield, e) {
|
|
|
if (e.getKey() == 40) {
|
|
|
_this.onNextKeyClick(1, 27)
|
|
|
} else if (e.getKey() == 38) {
|
|
|
_this.onUpKeyClick(1, 27)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}];
|
|
|
|
|
|
this.ctncolumns = this.initctncolumns;
|
|
|
//明细表表格
|
|
|
this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
|
|
|
clicksToEdit: 1
|
|
|
});
|
|
|
this.GridCheckBoxModelCtn = Ext.create('Ext.selection.CheckboxModel');
|
|
|
this.gridList = new Ext.grid.GridPanel({
|
|
|
store: this.storeBodyList,
|
|
|
enableHdMenu: false,
|
|
|
region: 'center',
|
|
|
loadMask: { msg: Zi.LAN.ShuJuJiaZaiZhongQingShaoDeng },
|
|
|
trackMouseOver: true,
|
|
|
disableSelection: false,
|
|
|
plugins: [this.gridListCellEditing],
|
|
|
selModel: this.GridCheckBoxModelCtn,
|
|
|
selType: 'cellmodel',
|
|
|
tbar: [{
|
|
|
xtype: 'label',
|
|
|
text: Zi.LAN.panelBodyCtn, //'集装箱信息',
|
|
|
style: 'font-size:13px',
|
|
|
labelColor: '#0000',
|
|
|
//style:'background-color: #4b9bf5',
|
|
|
x: '0%',
|
|
|
y: '0%'
|
|
|
}, {
|
|
|
text: Zi.LAN.btnadddetail, //'增加明细',
|
|
|
tooltip: Zi.LAN.btnadddetail, //'增加明细',
|
|
|
id: "btnadddetail",
|
|
|
iconCls: "btnadddetail",
|
|
|
handler: function (button, event) {
|
|
|
this.onAddDetailClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.btndeldetail, //'删除明细',
|
|
|
tooltip: Zi.LAN.btndeldetail, //'删除明细',
|
|
|
id: "btndeldetail",
|
|
|
iconCls: "btndeletedetail",
|
|
|
handler: function (button, event) {
|
|
|
this.onDelDetailClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.btnadddetail2, //'展开集装箱',
|
|
|
id: "btnadddetail2",
|
|
|
handler: function (button, event) {
|
|
|
this.onUpDetailClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.btnaddyarddata, //'引入场站数据',
|
|
|
id: "btnaddyarddata",
|
|
|
handler: function (button, event) {
|
|
|
this.onaddyarddataClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.btnaddexceldata, //'导入EXCEL',
|
|
|
id: "btnaddexceldata",
|
|
|
handler: function (button, event) {
|
|
|
this.onaddexceldataClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.btnaddwms, //'入库',
|
|
|
id: "btnaddwms",
|
|
|
handler: function (button, event) {
|
|
|
this.onaddwmsClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
},'-', {
|
|
|
text: Zi.LAN.CreateCtnFee, //'生成应付费用',
|
|
|
handler: function (button, event) {
|
|
|
this.CreateCtnFee();
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
text: Zi.LAN.btnprintctn, //'预览打印',
|
|
|
tooltip: Zi.LAN.btnprintctn, //'预览打印',
|
|
|
id: "btnprintctn",
|
|
|
iconCls: "btnprint",
|
|
|
handler: function (button, event) {
|
|
|
this.PrintCtn(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.btntest, //"保存列表样式",
|
|
|
menu: [
|
|
|
{
|
|
|
text: Zi.LAN.SaveGridPanel, //"保存",
|
|
|
handler: function (button, event) {
|
|
|
_this.ctncolumns = DsTruck.SaveGridPanel(USERID, 'SEAICTNCOLUMN', _this.gridList.columns, _this.ctncolumns, 0, true);
|
|
|
_this.gridListshow.reconfigure(this.storeBodyList, _this.ctncolumns);
|
|
|
|
|
|
}
|
|
|
}, {
|
|
|
text: Zi.LAN.SaveGridPanel2, //"初始化",
|
|
|
handler: function (menu, event) {
|
|
|
_this.gridList.reconfigure(this.storeBodyList, _this.initctncolumns);
|
|
|
_this.ctncolumns = DsTruck.SaveGridPanel(USERID, 'SEAICTNCOLUMN', _this.gridList.columns, _this.initctncolumns, 0, true);
|
|
|
}
|
|
|
}],
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.UPDATECTNTRUCK, //'展开集装箱',
|
|
|
handler: function (button, event) {
|
|
|
this.onUpDetailTruckClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.CTRNREFRESH, //'刷新',
|
|
|
handler: function (button, event) {
|
|
|
this.onCtrnRefreshClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}],
|
|
|
|
|
|
columns: this.ctncolumns,
|
|
|
bbar: [Ext.create('Ext.PagingToolbar', {
|
|
|
id: "bbar1",
|
|
|
store: this.storeBodyListGoods,
|
|
|
displayInfo: true,
|
|
|
displayMsg: Zi.LAN.displayMsg,
|
|
|
emptyMsg: Zi.LAN.emptyMsg
|
|
|
})]
|
|
|
});
|
|
|
|
|
|
this.ctncolumns = DsTruck.GetGridPanel(USERID, 'SEAICTNCOLUMN', this.ctncolumns, 1); //使用者id,表名,中间column数组,跳过一开始的几列
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
//#region 按钮Toolbar
|
|
|
this.panelBtn = new Ext.Panel({
|
|
|
region: "north",
|
|
|
tbar: [{
|
|
|
id: 'btnEPrev',
|
|
|
text: Zi.LAN.btnEPrev, //"上一票",
|
|
|
// iconCls: "btnsave",
|
|
|
handler: function (button, event) {
|
|
|
this.PrevRecord();
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
id: 'btnENext',
|
|
|
text: Zi.LAN.btnENext, //"下一票",
|
|
|
// iconCls: "btnsave",
|
|
|
handler: function (button, event) {
|
|
|
this.NextRecord();
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
id: 'btnESave',
|
|
|
text: Zi.LAN.SaveGridPanel, //"保存",
|
|
|
iconCls: "btnsave",
|
|
|
handler: function (button, event) {
|
|
|
this.Save('0');
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
id: 'btnESaveAndClose',
|
|
|
text: Zi.LAN.btnESaveAndClose, //"保存并关闭",
|
|
|
handler: function (button, event) {
|
|
|
this.Save('1');
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
id: 'btnESaveAndNew',
|
|
|
text: Zi.LAN.btnESaveAndNew, //"保存并新建",
|
|
|
handler: function (button, event) {
|
|
|
this.Save('2');
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
text: Zi.LAN.copyadd, //"国外舱单",
|
|
|
menu: [{
|
|
|
id: 'btnECopyNew',
|
|
|
text: Zi.LAN.copyadd, //"复制新建",
|
|
|
handler: function (button, event) {
|
|
|
var basicForm = this.formHead.getForm();
|
|
|
this.opStatus = 'add';
|
|
|
this.copyfee = false;
|
|
|
basicForm.findField('BSNO').setDisabled(false);
|
|
|
var field = basicForm.findField('BSNO');
|
|
|
var oldbsno = field.getValue();
|
|
|
this.LoadCopyData(oldbsno, false);
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
id: 'btnECopyNewFee',
|
|
|
text: Zi.LAN.copyadd + '(' + Zi.LAN.HANFEIYONG+')', //"复制新建",
|
|
|
handler: function (button, event) {
|
|
|
var basicForm = this.formHead.getForm();
|
|
|
this.opStatus = 'add';
|
|
|
this.copyfee = true;
|
|
|
basicForm.findField('BSNO').setDisabled(false);
|
|
|
var field = basicForm.findField('BSNO');
|
|
|
var oldbsno = field.getValue();
|
|
|
this.LoadCopyData(oldbsno, true);
|
|
|
},
|
|
|
scope: this
|
|
|
}]
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.GuanBi, //"关闭",
|
|
|
handler: function (button, event) {
|
|
|
window.close();
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
text: Zi.LAN.btnadd, //"新建",
|
|
|
id: 'btnaddbs',
|
|
|
handler: function (button, event) {
|
|
|
this.LoadData('add', '');
|
|
|
var basicForm = this.formHead.getForm();
|
|
|
basicForm.findField('BSNO').setDisabled(false);
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.btnprint, //"打印",
|
|
|
iconCls: "btnprint",
|
|
|
handler: function (button, event) {
|
|
|
this.Print();
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.OtherCaoZuo, //"其他操作",
|
|
|
menu: [{
|
|
|
text: Zi.LAN.SaveBG, //"生成报关业务",
|
|
|
handler: function (menu, event) {
|
|
|
_this.SaveBG();
|
|
|
}
|
|
|
},'-', {
|
|
|
text: Zi.LAN.YINRUBAOGUAN, //"引入报关信息/从报关业务引入",
|
|
|
handler: function (menu, event) {
|
|
|
_this.onImportApplyClick();
|
|
|
}
|
|
|
}, {
|
|
|
text: Zi.LAN.GETCARRIER, //"船公司数据",
|
|
|
handler: function (menu, event) {
|
|
|
_this.onGETCARRIERClick(menu, event);
|
|
|
}
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.BtnQYHSZSEND,
|
|
|
id: 'BtnQYHSZSEND',
|
|
|
hidden: _this.showQYSendBtn,
|
|
|
handler: function (menu, event) {
|
|
|
_this.onSendQY();
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
scope: this
|
|
|
}]
|
|
|
}); //end 按钮Toolbar
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
this.panelBodyCtn = new Ext.Panel({
|
|
|
// title: Zi.LAN.panelBodyCtn, //'集装箱信息',
|
|
|
layout: "border",
|
|
|
//height: 200,
|
|
|
//margin: '5 10',
|
|
|
region: 'center',
|
|
|
frame: true,
|
|
|
items: [this.gridList]
|
|
|
});
|
|
|
|
|
|
|
|
|
this.storeListGoodName = Ext.create('Ext.data.Store', {
|
|
|
fields: [
|
|
|
{ name: 'GID', type: 'string' },
|
|
|
{ name: 'GOODCODE', type: 'string' },
|
|
|
{ name: 'GOODNAME', type: 'string' },
|
|
|
{ name: 'GOODNO', type: 'string' },
|
|
|
{ name: 'DESCRIP', type: 'string' },
|
|
|
{ name: 'CODEANDNAME', type: 'string' },
|
|
|
{ name: 'GOODSTYPEGID', type: 'string' },
|
|
|
{ name: 'GOODSTYPE', type: 'string' },
|
|
|
{ name: 'CORPID', type: 'string' },
|
|
|
{ name: 'ISSTOP', type: 'string' }
|
|
|
|
|
|
],
|
|
|
pageSize:5000,
|
|
|
remoteSort: true,
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
url: '/MvcShipping/MsCodeGoods/GetDataList',
|
|
|
reader: {
|
|
|
id: '',
|
|
|
root: 'data',
|
|
|
totalProperty: 'totalCount'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
this.storeListGoodName.load({
|
|
|
params: { start: 0, limit:5000, sort: '', condition: '' },
|
|
|
waitMsg: "正在查询数据...",
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
|
|
|
this.comboxGoodCode = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
store: this.storeListGoodName,
|
|
|
forceSelection: true,
|
|
|
// name: 'GOODSNAME',
|
|
|
valueField: 'GOODCODE',
|
|
|
displayField: 'CODEANDNAME'
|
|
|
});
|
|
|
|
|
|
this.comboxGoodName = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
store: this.storeListGoodName,
|
|
|
forceSelection: true,
|
|
|
// name: 'GOODSNAME',
|
|
|
valueField: 'GOODNAME',
|
|
|
displayField: 'CODEANDNAME'
|
|
|
});
|
|
|
this.storeCodePackageGOODS = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CodePackageModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCodePackageList' }
|
|
|
});
|
|
|
this.storeCodePackageGOODS.load();
|
|
|
|
|
|
this.comboxKINDPKGS_GOODS = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
//fieldLabel: Zi.LAN.KINDPKGS, //'件数包装',
|
|
|
store: this.storeCodePackageGOODS,
|
|
|
// forceSelection: true,
|
|
|
name: 'KINDPKGS',
|
|
|
valueField: 'PKGS',
|
|
|
displayField: 'PKGS'
|
|
|
});
|
|
|
|
|
|
|
|
|
//商品信息
|
|
|
this.storeBodyListGoods = Ext.create('Ext.data.Store', {
|
|
|
model: 'MsOpApplyDetail',
|
|
|
remoteSort: true,
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
url: '/MvcShipping/MsOpApply/GetBodyList',
|
|
|
reader: {
|
|
|
id: 'BsNo,SerialNo',
|
|
|
root: 'data',
|
|
|
totalProperty: 'totalCount'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//明细表表格
|
|
|
this.gridListGoodsCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
|
|
|
clicksToEdit: 1
|
|
|
});
|
|
|
|
|
|
|
|
|
this.initgirdcolumsGoods = [{
|
|
|
sortable: true,
|
|
|
dataIndex: 'BsNo',
|
|
|
header: '业务编号',
|
|
|
hidden: true,
|
|
|
width: 120
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'SerialNo',
|
|
|
header: Zi.LAN.SerialNo,
|
|
|
width: 30
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'GoodsCode',
|
|
|
header: Zi.LAN.GoodsCode,
|
|
|
editor: this.comboxGoodCode,
|
|
|
width: 120
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'GoodsName',
|
|
|
header: Zi.LAN.GoodsName,
|
|
|
editor: this.comboxGoodName,
|
|
|
width: 120
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'GOODSSTANDARD',
|
|
|
header: Zi.LAN.GOODSSTANDARD,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true
|
|
|
},
|
|
|
width: 120
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'PONO',
|
|
|
header: Zi.LAN.PONO,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true
|
|
|
},
|
|
|
width: 120
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'PICINO',
|
|
|
header: Zi.LAN.PICINO,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true
|
|
|
},
|
|
|
width: 120
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'GOODSNUM',
|
|
|
header: Zi.LAN.GOODSNUM,
|
|
|
editor: {
|
|
|
xtype: 'numberfield',
|
|
|
allowBlank: false,
|
|
|
selectOnFocus: true
|
|
|
},
|
|
|
width: 80
|
|
|
}, {
|
|
|
dataIndex: 'KINDPKGS',
|
|
|
header: Zi.LAN.KINDPKGS,
|
|
|
width: 100,
|
|
|
editor:this.comboxKINDPKGS_GOODS
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'Pkgs',
|
|
|
header: Zi.LAN.Pkgs,
|
|
|
editor: {
|
|
|
xtype: 'numberfield',
|
|
|
allowBlank: false,
|
|
|
selectOnFocus: true
|
|
|
},
|
|
|
width: 120
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'KGS',
|
|
|
header: Zi.LAN.KGS,
|
|
|
editor: {
|
|
|
xtype: 'numberfield',
|
|
|
allowBlank: false,
|
|
|
decimalPrecision: 4,
|
|
|
selectOnFocus: true
|
|
|
},
|
|
|
width: 100
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'Price',
|
|
|
header: Zi.LAN.Price,
|
|
|
editor: {
|
|
|
xtype: 'numberfield',
|
|
|
allowBlank: false,
|
|
|
selectOnFocus: true
|
|
|
},
|
|
|
width: 100,
|
|
|
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
|
try {
|
|
|
var lsValue = usMoney(value, 2, '', false);
|
|
|
if (lsValue != "NaN") {
|
|
|
value = lsValue; if (parseFloat(lsValue) < 0) {
|
|
|
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
return value;
|
|
|
}
|
|
|
}
|
|
|
catch (e) {
|
|
|
return value;
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'Total',
|
|
|
header: Zi.LAN.Total,
|
|
|
editor: {
|
|
|
xtype: 'numberfield',
|
|
|
allowBlank: false,
|
|
|
decimalPrecision: 4,
|
|
|
selectOnFocus: true
|
|
|
},
|
|
|
width: 120,
|
|
|
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
|
try {
|
|
|
var lsValue = usMoney(value, 2, '', false);
|
|
|
if (lsValue != "NaN") {
|
|
|
value = lsValue; if (parseFloat(lsValue) < 0) {
|
|
|
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
return value;
|
|
|
}
|
|
|
}
|
|
|
catch (e) {
|
|
|
return value;
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'Currency',
|
|
|
header: Zi.LAN.Currency,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
allowBlank: false,
|
|
|
selectOnFocus: true
|
|
|
},
|
|
|
width: 60
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'Remark',
|
|
|
header: Zi.LAN.Other,
|
|
|
editor: {
|
|
|
xtype: 'textfield',
|
|
|
selectOnFocus: true
|
|
|
},
|
|
|
width: 110
|
|
|
}
|
|
|
];
|
|
|
|
|
|
|
|
|
this.girdcolumGoods = this.initgirdcolumsGoods;
|
|
|
|
|
|
this.gridListGoods = new Ext.grid.GridPanel({
|
|
|
store: this.storeBodyListGoods,
|
|
|
enableHdMenu: false,
|
|
|
region: 'center',
|
|
|
loadMask: { msg: "数据加载中,请稍等..." },
|
|
|
trackMouseOver: true,
|
|
|
disableSelection: false,
|
|
|
plugins: [this.gridListGoodsCellEditing],
|
|
|
selType: 'cellmodel',
|
|
|
tbar: [{
|
|
|
text: Zi.LAN.btnadddetail,
|
|
|
tooltip: Zi.LAN.btnadddetail,
|
|
|
id: "btnadddetailGoods",
|
|
|
iconCls: "btnadddetail",
|
|
|
handler: function (button, event) {
|
|
|
this.addDetailGoods();
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.btndeldetail,
|
|
|
tooltip: Zi.LAN.btndeldetail,
|
|
|
id: "btndeldetailGoods",
|
|
|
iconCls: "btndeletedetail",
|
|
|
handler: function (button, event) {
|
|
|
this.deleteDetailGoods();
|
|
|
},
|
|
|
scope: this
|
|
|
}],
|
|
|
columns: this.girdcolumGoods
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
this.gridListGoods.on('edit', function (editor, e, eOpts) {
|
|
|
this.gridGoodsAfterEdit(editor, e, eOpts);
|
|
|
}, this);
|
|
|
|
|
|
this.panelGoods = new Ext.Panel({
|
|
|
// title: Zi.LAN.panelManifest, //'舱单分票信息',
|
|
|
title: Zi.LAN.SPXX, //'舱单分票信息',
|
|
|
layout: "border",
|
|
|
region: 'center',
|
|
|
animate: true,
|
|
|
autoScroll: true,
|
|
|
// containerScroll: true,
|
|
|
frame: false,
|
|
|
items: [this.gridListGoods]
|
|
|
});
|
|
|
|
|
|
|
|
|
//#region MASTER单信息
|
|
|
//客户加载_发货人
|
|
|
this.MstoreShipper = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'OpSeaeShipper',
|
|
|
proxy: { url: '/MvcShipping/MsOpSeae/GetShipperListRm' }
|
|
|
});
|
|
|
// this.MstoreShipper.load({ params: { condition: "shippertype=2 AND ISPUBLIC=1 " } });
|
|
|
//发货人
|
|
|
this.McomboxShipper = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.SHIPPERID, //'Shipper (发货人)',
|
|
|
store: this.MstoreShipper,
|
|
|
labelWidth: 150,
|
|
|
labelAlign: 'left',
|
|
|
queryMode: 'remote',
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
name: 'MSHIPPERID',
|
|
|
valueField: 'SHORTNAME',
|
|
|
displayField: 'CodeAndName',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
var selectrecords = DsStoreQueryBy(this.MstoreShipper, 'SHORTNAME', combo.value);
|
|
|
if (selectrecords.getCount() > 0) {
|
|
|
var selectdata = selectrecords.getAt(0).data;
|
|
|
this.formMBL.getForm().findField('MSHIPPER').setValue(selectdata.SHIPPERDETAIL);
|
|
|
} else {
|
|
|
this.formMBL.getForm().findField('MSHIPPER').setValue('');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
//客户加载_收货人
|
|
|
this.MstoreConsignee = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'OpSeaeShipper',
|
|
|
proxy: { url: '/MvcShipping/MsOpSeae/GetShipperListRm' }
|
|
|
});
|
|
|
// this.MstoreConsignee.load({ params: { condition: "shippertype=1 AND ISPUBLIC=1 " } });
|
|
|
|
|
|
// this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} });
|
|
|
|
|
|
//收货人
|
|
|
this.McomboxConsignee = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.CONSIGNEEID, //'Consignee (收货人)',
|
|
|
labelWidth: 150,
|
|
|
labelAlign: 'left',
|
|
|
store: this.MstoreConsignee,
|
|
|
queryMode: 'remote',
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
// forceSelection: true,
|
|
|
name: 'MCONSIGNEEID',
|
|
|
valueField: 'SHORTNAME',
|
|
|
displayField: 'CodeAndName',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
var selectrecords = DsStoreQueryBy(this.MstoreConsignee, 'SHORTNAME', combo.value);
|
|
|
if (selectrecords.getCount() > 0) {
|
|
|
var selectdata = selectrecords.getAt(0).data;
|
|
|
this.formMBL.getForm().findField('MCONSIGNEE').setValue(selectdata.SHIPPERDETAIL);
|
|
|
} else {
|
|
|
this.formMBL.getForm().findField('MCONSIGNEE').setValue('');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//客户加载_通知人
|
|
|
this.Mstorenotifyparty = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'OpSeaeShipper',
|
|
|
proxy: { url: '/MvcShipping/MsOpSeae/GetShipperListRm' }
|
|
|
});
|
|
|
// this.Mstorenotifyparty.load({ params: { condition: "shippertype=3 AND ISPUBLIC=1 " } });
|
|
|
|
|
|
|
|
|
// this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} });
|
|
|
|
|
|
//通知人
|
|
|
this.McomboxNotifyParty = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.NOTIFYPARTYID, //'Notify Party (通知人)',
|
|
|
store: this.Mstorenotifyparty,
|
|
|
labelWidth: 150,
|
|
|
labelAlign: 'left',
|
|
|
queryMode: 'remote',
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
// forceSelection: true,
|
|
|
name: 'MNOTIFYPARTYID',
|
|
|
valueField: 'SHORTNAME',
|
|
|
displayField: 'CodeAndName',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
var selectrecords = DsStoreQueryBy(this.Mstorenotifyparty, 'SHORTNAME', combo.value);
|
|
|
if (selectrecords.getCount() > 0) {
|
|
|
var selectdata = selectrecords.getAt(0).data;
|
|
|
this.formMBL.getForm().findField('MNOTIFYPARTY').setValue(selectdata.SHIPPERDETAIL);
|
|
|
} else {
|
|
|
this.formMBL.getForm().findField('MNOTIFYPARTY').setValue('');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
this.storeMFrt = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'CODE_FRT',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCodeFrtList' }
|
|
|
});
|
|
|
this.storeMFrt.load({ params: { condition: "" } });
|
|
|
|
|
|
this.comboxMBLFRT = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.BLFRT, //'付费方式',
|
|
|
store: this.storeMFrt,
|
|
|
forceSelection: true,
|
|
|
name: 'MBLFRT',
|
|
|
valueField: 'FRT',
|
|
|
displayField: 'FRT'
|
|
|
});
|
|
|
|
|
|
this.formMBL = Ext.widget('form',
|
|
|
{
|
|
|
region: 'north',
|
|
|
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: [
|
|
|
{
|
|
|
xtype: 'container',
|
|
|
layout: 'anchor',
|
|
|
flex: 2,
|
|
|
defaultType: 'textfield',
|
|
|
items: [
|
|
|
{
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
flex: 1,
|
|
|
defaultType: 'textfield',
|
|
|
items: [
|
|
|
this.McomboxShipper
|
|
|
, {
|
|
|
xtype: 'label',
|
|
|
flex: 1,
|
|
|
id: 'MSHIPPERSTR',
|
|
|
html: "<font color='green'></font>"
|
|
|
}
|
|
|
]
|
|
|
|
|
|
}, {
|
|
|
xtype: 'textareafield',
|
|
|
grow: true,
|
|
|
height: 80,
|
|
|
name: 'MSHIPPER',
|
|
|
anchor: '100%'
|
|
|
}
|
|
|
]
|
|
|
}, { xtype: 'hiddenfield', flex: 0.2 }, {
|
|
|
xtype: 'container',
|
|
|
layout: 'anchor',
|
|
|
flex: 2,
|
|
|
defaultType: 'textfield',
|
|
|
items: [
|
|
|
{
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
flex: 1,
|
|
|
defaultType: 'textfield',
|
|
|
items: [
|
|
|
this.McomboxConsignee, {
|
|
|
xtype: 'label',
|
|
|
flex: 1,
|
|
|
id: 'MCONSIGNEESTR',
|
|
|
html: "<font color='green'></font>"
|
|
|
}
|
|
|
]
|
|
|
|
|
|
}, {
|
|
|
xtype: 'textareafield',
|
|
|
grow: true,
|
|
|
height: 80,
|
|
|
name: 'MCONSIGNEE',
|
|
|
anchor: '100%'
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
flex: 1,
|
|
|
defaultType: 'textfield',
|
|
|
items: [
|
|
|
{
|
|
|
xtype: 'container',
|
|
|
layout: 'anchor',
|
|
|
flex: 2,
|
|
|
defaultType: 'textfield',
|
|
|
items: [
|
|
|
{
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
flex: 1,
|
|
|
defaultType: 'textfield',
|
|
|
items: [
|
|
|
this.McomboxNotifyParty, {
|
|
|
xtype: 'label',
|
|
|
flex: 1,
|
|
|
id: 'MNOTIFYPARTYSTR',
|
|
|
html: "<font color='green'></font>"
|
|
|
}
|
|
|
]
|
|
|
|
|
|
}, {
|
|
|
xtype: 'textareafield',
|
|
|
grow: true,
|
|
|
height: 80,
|
|
|
name: 'MNOTIFYPARTY',
|
|
|
anchor: '100%'
|
|
|
}
|
|
|
]
|
|
|
}, { xtype: 'hiddenfield', flex: 0.2 }, {
|
|
|
xtype: 'container',
|
|
|
layout: 'anchor',
|
|
|
flex: 2,
|
|
|
defaultType: 'textfield',
|
|
|
items: [
|
|
|
{
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
flex: 1,
|
|
|
defaultType: 'textfield',
|
|
|
items: [this.comboxMBLFRT,]
|
|
|
}, {
|
|
|
xtype: 'textareafield',
|
|
|
fieldLabel: Zi.LAN.DESCRIPTION, //'付费方式',
|
|
|
grow: true,
|
|
|
height: 80,
|
|
|
name: 'MDESCRIPTION',
|
|
|
anchor: '100%'
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
});
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
//#region 框架结构
|
|
|
|
|
|
this.panelBody = new Ext.Panel({
|
|
|
title: Zi.LAN.HuoWuXinXi, //'舱单分票信息',
|
|
|
layout: "border",
|
|
|
region: 'center',
|
|
|
animate: true,
|
|
|
autoScroll: true,
|
|
|
// containerScroll: true,
|
|
|
frame: false,
|
|
|
items: [this.formEdit,this.panelBodyCtn]
|
|
|
});
|
|
|
|
|
|
this.panelMBL = new Ext.Panel({
|
|
|
title: Zi.LAN.panelMBL, //'MASTER单信息',
|
|
|
layout: "border",
|
|
|
region: 'center',
|
|
|
animate: true,
|
|
|
autoScroll: true,
|
|
|
// containerScroll: true,
|
|
|
frame: false,
|
|
|
items: [this.formMBL]
|
|
|
});
|
|
|
|
|
|
|
|
|
this.tabSeaiWTpanel = new Ext.TabPanel({
|
|
|
activeTab: 0,
|
|
|
autoWidth: true,
|
|
|
border: true,
|
|
|
frame: false,
|
|
|
region: 'center',
|
|
|
enableTabScroll: true,
|
|
|
items:
|
|
|
[
|
|
|
this.panelBody,
|
|
|
this.panelGoods,
|
|
|
this.panelMBL
|
|
|
]
|
|
|
});
|
|
|
|
|
|
|
|
|
this.panelSeai = new Ext.Panel({
|
|
|
title: Zi.LAN.panelSeai, //'委托信息',
|
|
|
id: 'pnlmodNewOpSeaiInfo',
|
|
|
layout: "border",
|
|
|
//region: 'center',
|
|
|
//animate: true,
|
|
|
autoScroll: true,
|
|
|
//height: 900,
|
|
|
//frame: false,
|
|
|
//closable:true,
|
|
|
items: [this.panelBtn, this.formHead,this.tabSeaiWTpanel]
|
|
|
});
|
|
|
|
|
|
this.panelBill = new Ext.Panel({
|
|
|
title: Zi.LAN.panelBill, //'舱单信息',
|
|
|
id: 'pnlmodNewOpSeaiBill',
|
|
|
layout: "border",
|
|
|
region: 'center',
|
|
|
animate: true,
|
|
|
autoScroll: true,
|
|
|
containerScroll: true,
|
|
|
frame: false,
|
|
|
items: [this.formBill]
|
|
|
});
|
|
|
|
|
|
this.treestore = new Ext.data.TreeStore({
|
|
|
model: 'DsShipping.ux.ModuleModel',
|
|
|
nodeParam: 'PARENTID',
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
url: '/MvcShipping/MsBaseInfo/GetModuTreeRefList',
|
|
|
reader: {
|
|
|
id: 'GID',
|
|
|
root: 'data',
|
|
|
totalProperty: 'totalCount'
|
|
|
}
|
|
|
},
|
|
|
autoLoad: true,
|
|
|
root: {
|
|
|
name: '根节点',
|
|
|
expanded: true,
|
|
|
id: 'FEDF4D2F-81E8-4C2C-9CAE-5B7A047C5483'
|
|
|
}
|
|
|
});
|
|
|
|
|
|
this.tabtree = new Ext.tree.Panel({
|
|
|
region: 'west',
|
|
|
title: Zi.LAN.tabtree, //'业务信息',
|
|
|
split: true,
|
|
|
width: 180,
|
|
|
collapsible: true,
|
|
|
margins: '0 0 0 0',
|
|
|
store: this.treestore,
|
|
|
rootVisible: false,
|
|
|
hideHeaders: true,
|
|
|
animate: false,
|
|
|
lines: false,
|
|
|
columns: [{
|
|
|
xtype: 'treecolumn',
|
|
|
text: Zi.LAN.DESCRIPTION2, //'模块名称',
|
|
|
width: 178,
|
|
|
dataIndex: 'DESCRIPTION'
|
|
|
}],
|
|
|
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'itemclick': function (_this, record, item, index, e, eOpts) {
|
|
|
var finded = false;
|
|
|
if (record.data.MODULEURL == '@') {
|
|
|
this.tabSeaipanel.setActiveTab(0);
|
|
|
} else if (record.data.MODULEURL != '#') {
|
|
|
var children = this.tabSeaipanel.items;
|
|
|
if (children) {
|
|
|
for (var i = 0, len = children.length; i < len; i++) {
|
|
|
if (children.items[i].id) {
|
|
|
if (children.items[i].id == 'pnl' + record.data.NAME) {
|
|
|
this.tabSeaipanel.setActiveTab(i);
|
|
|
finded = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (finded == false) {
|
|
|
if (this.formHead.getForm().findField('CUSTNO').getValue() == "") {
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianBaoCunYeWu, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });//'注意', '请先保存业务信息后再打开其他模块!'
|
|
|
} else {
|
|
|
if (record.data.NAME == 'modSeaiAllFee') {
|
|
|
var paneltabitems = new Shipping.SeaiFee({
|
|
|
id: 'pnl' + record.data.NAME,
|
|
|
layout: "border",
|
|
|
region: "center",
|
|
|
autoScroll: true,
|
|
|
frame: false,
|
|
|
closable: true,
|
|
|
title: record.data.DESCRIPTION
|
|
|
});
|
|
|
} else if (record.data.NAME == 'modSeaiAmendFee') {
|
|
|
var paneltabitems = new Shipping.SeaiAmendFee({
|
|
|
id: 'pnl' + record.data.NAME,
|
|
|
layout: "border",
|
|
|
region: "center",
|
|
|
autoScroll: true,
|
|
|
frame: false,
|
|
|
closable: true,
|
|
|
title: record.data.DESCRIPTION
|
|
|
});
|
|
|
} else if (record.data.NAME == 'modOpSeaiFenList') {
|
|
|
var paneltabitems = new Shipping.MsOpSeaiFenIndex({
|
|
|
id: 'pnl' + record.data.NAME,
|
|
|
layout: "border",
|
|
|
region: "center",
|
|
|
autoScroll: true,
|
|
|
frame: false,
|
|
|
closable: true,
|
|
|
title: record.data.DESCRIPTION
|
|
|
});
|
|
|
} else if (record.data.NAME == 'modOPWMSCHANGE') {
|
|
|
var paneltabitems = new Shipping.OPWMSCHANGEIndex({
|
|
|
id: 'pnl' + record.data.NAME,
|
|
|
layout: "border",
|
|
|
region: "center",
|
|
|
autoScroll: true,
|
|
|
frame: false,
|
|
|
closable: true,
|
|
|
title: record.data.DESCRIPTION
|
|
|
});
|
|
|
} else {
|
|
|
var paneltabitems = new Ext.Panel({
|
|
|
id: 'pnl' + record.data.NAME,
|
|
|
layout: "fit",
|
|
|
region: "center",
|
|
|
autoScroll: true,
|
|
|
frame: false,
|
|
|
closable: true,
|
|
|
title: record.data.DESCRIPTION,
|
|
|
html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + record.data.MODULEURL + '"> </iframe>'
|
|
|
});
|
|
|
}
|
|
|
this.tabSeaipanel.add(paneltabitems);
|
|
|
this.tabSeaipanel.setActiveTab(paneltabitems);
|
|
|
this.tabSeaipanel.doLayout();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
this.tabSeaipanel = new Ext.TabPanel({
|
|
|
activeTab: 0,
|
|
|
autoScroll: true,
|
|
|
autoWidth: true,
|
|
|
border: true,
|
|
|
frame: false,
|
|
|
region: 'center',
|
|
|
id: "TabSeaiPanel",
|
|
|
enableTabScroll: true,
|
|
|
items:
|
|
|
[
|
|
|
this.panelSeai,
|
|
|
this.panelBill
|
|
|
],
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'beforetabchange': function (tabPanel, newCard, oldCard, eOpts) {
|
|
|
if (oldCard.id == "pnlmodSeaiAllFee") {
|
|
|
var feemodify = oldCard.panelFee.getModifyStatus();
|
|
|
if (feemodify) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QingXianBaoCunFeiYong, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });//'警告', '费用未保存,请先保存费用!'
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
if (newCard.id == "pnlmodSeaiAllFee") {
|
|
|
newCard.panelFee.loadUnit();
|
|
|
}
|
|
|
if (oldCard.id == "pnlmodSeaiAmendFee") {
|
|
|
var feemodify = oldCard.panelAmendFee.getModifyStatus();
|
|
|
if (feemodify) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QingXianBaoCunGengGaiDan, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });//'警告', '更改单未保存,请先保存更改单!'
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
if (newCard.id == "pnlmodSeaiAmendFee") {
|
|
|
newCard.panelAmendFee.loadUnit();
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
Ext.apply(this, {
|
|
|
items: [this.tabtree, this.tabSeaipanel]
|
|
|
});
|
|
|
//#endregion
|
|
|
|
|
|
//#region 其他
|
|
|
// parentWin = window.parent.opener;
|
|
|
|
|
|
parentWin = window.parent.opener._thisfenlist;
|
|
|
if (parentWin == NaN || parentWin == null) {
|
|
|
parentWin = window.parent.opener._this;
|
|
|
|
|
|
} else {
|
|
|
this.isfen = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.InitData();
|
|
|
this.LoadMustBe();
|
|
|
|
|
|
this.storeYARD.load({ params: { condition: "ISYARD='1'"} });
|
|
|
this.storeAGENT.load({ params: { condition: "ISAGENT='1'"} });
|
|
|
this.storeFORWARDER.load({ params: { condition: "ISBOOKING='1'"} });
|
|
|
|
|
|
//绑定事件
|
|
|
this.gridList.on('edit', function (editor, e, eOpts) {
|
|
|
this.gridAfterEdit(editor, e, eOpts);
|
|
|
}, this);
|
|
|
|
|
|
this.gridList.reconfigure(this.storeBodyList, this.ctncolumns);
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '',
|
|
|
url: '/MvcShipping/MsSysParamSet/GetData',
|
|
|
params: {
|
|
|
condition: "PARAMNAME='ACCDATESAMEETD'"
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
if (result.Success != true) {
|
|
|
|
|
|
} else {
|
|
|
var data = result.data;
|
|
|
if (data.PARAMVALUE == '1') {
|
|
|
this.accdatesameetd = 1;
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '',
|
|
|
url: '/MvcShipping/MsSysParamSet/GetData',
|
|
|
params: {
|
|
|
condition: "PARAMNAME='SALEORDERDEPTBYOP'"
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
if (result.Success != true) {
|
|
|
|
|
|
} else {
|
|
|
var data = result.data;
|
|
|
if (data.PARAMVALUE == '1') {
|
|
|
this.SALEORDERDEPTBYOP = 1;
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
var btnaddbs = Ext.getCmp('btnaddbs');
|
|
|
var btnESaveAndNew = Ext.getCmp('btnESaveAndNew');
|
|
|
var btnECopyNew = Ext.getCmp('btnECopyNew');
|
|
|
var btnECopyNewFee = Ext.getCmp('btnECopyNewFee');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
|
|
|
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
|
|
|
params: {
|
|
|
modulename: 'SEAI-NOTADD'
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
if (result.Success) {
|
|
|
btnaddbs.hide();
|
|
|
btnESaveAndNew.hide();
|
|
|
btnECopyNew.hide();
|
|
|
btnECopyNewFee.hide();
|
|
|
} else {
|
|
|
btnaddbs.show();
|
|
|
btnESaveAndNew.show();
|
|
|
btnECopyNew.show();
|
|
|
btnECopyNewFee.show();
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
|
|
|
}, //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.isfen) this.MainEditRecord = ret[3];
|
|
|
this.showQYSendBtn = ret[4];
|
|
|
}
|
|
|
if (this.opStatus == 'copyaddfee') {
|
|
|
this.opStatus = 'copyadd';
|
|
|
this.copyfee = true;
|
|
|
}
|
|
|
|
|
|
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 = "海运进口-新增";
|
|
|
}
|
|
|
|
|
|
this.storecodeservice.load({ params: { condition: "OPTYPE='2'" },
|
|
|
callback: function (r, options, success) {
|
|
|
if (success) {
|
|
|
if (r.length != 0) {
|
|
|
|
|
|
var checkboxitems = "";
|
|
|
checkboxitems = "[";
|
|
|
for (i = 0; i < this.storecodeservice.getCount(); i += 1) {
|
|
|
var memberyf = this.storecodeservice.getAt(i);
|
|
|
if (strLANGUAGES == "en-us") {
|
|
|
if (i == 0) {
|
|
|
var checkboxSingleItem = "{boxLabel:'" + memberyf.data.ENAME + "',inputValue:true,name:'" + memberyf.data.OPField + "',id:'" + memberyf.data.OPField + "'";
|
|
|
checkboxSingleItem += "}";
|
|
|
} else {
|
|
|
var checkboxSingleItem = ",{boxLabel:'" + memberyf.data.ENAME + "',inputValue:true,name:'" + memberyf.data.OPField + "',id:'" + memberyf.data.OPField + "'";
|
|
|
checkboxSingleItem += "}";
|
|
|
}
|
|
|
} else {
|
|
|
if (i == 0) {
|
|
|
var checkboxSingleItem = "{boxLabel:'" + memberyf.data.SERVICENAME + "',inputValue:true,name:'" + memberyf.data.OPField + "',id:'" + memberyf.data.OPField + "'";
|
|
|
checkboxSingleItem += "}";
|
|
|
} else {
|
|
|
var checkboxSingleItem = ",{boxLabel:'" + memberyf.data.SERVICENAME + "',inputValue:true,name:'" + memberyf.data.OPField + "',id:'" + memberyf.data.OPField + "'";
|
|
|
checkboxSingleItem += "}";
|
|
|
}
|
|
|
}
|
|
|
checkboxitems += checkboxSingleItem;
|
|
|
};
|
|
|
checkboxitems += "]";
|
|
|
|
|
|
_this.myCheckboxGroup = new Ext.form.CheckboxGroup({
|
|
|
id: 'myGroup',
|
|
|
xtype: 'checkboxgroup',
|
|
|
fieldLabel: Zi.LAN.myGroup, //'服务项目',
|
|
|
columns: 8,
|
|
|
items: eval(checkboxitems)
|
|
|
});
|
|
|
|
|
|
this.formHead.add(_this.myCheckboxGroup);
|
|
|
this.formHead.doLayout();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.opStatus == 'edit' || this.opStatus == 'copyadd') {
|
|
|
condition = "BSNO='" + this.editRecord.get('BSNO') + "'";
|
|
|
if (this.opStatus == 'copyadd') {
|
|
|
this.LoadCopyData(this.editRecord.get('BSNO'), this.copyfee);
|
|
|
}
|
|
|
else
|
|
|
this.LoadData(this.opStatus, condition);
|
|
|
} else if (this.opStatus == 'add') {
|
|
|
this.LoadDefValue();
|
|
|
this.LoadPeriod(this.opStatus);
|
|
|
if (this.isfen && this.opStatus == 'add') {
|
|
|
this.formEdit.getForm().reset();
|
|
|
this.formEdit.getForm().setValues(this.MainEditRecord.data);
|
|
|
this.formHead.getForm().reset();
|
|
|
this.formHead.getForm().setValues(this.MainEditRecord.data);
|
|
|
this.formBill.getForm().reset();
|
|
|
this.formBill.getForm().setValues(this.MainEditRecord.data);
|
|
|
this.formMBL.getForm().reset();
|
|
|
this.formMBL.getForm().setValues(this.MainEditRecord.data);
|
|
|
var newBsNo = 'topseai' + NewGuid();
|
|
|
this.formHead.getForm().findField('BSNO').setValue(newBsNo);
|
|
|
this.formHead.getForm().findField('BLTYPE').setValue('拼箱分票');
|
|
|
this.formHead.getForm().findField('BLTYPE').readOnly = true;
|
|
|
this.formHead.getForm().findField('CUSTNO').setValue('');
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}, //end InitData
|
|
|
|
|
|
LoadData: function (opstatus, condition) {
|
|
|
this.serialNo = 0;
|
|
|
this.opStatus = opstatus;
|
|
|
if (this.isfen && this.opStatus == 'add') {
|
|
|
this.formEdit.getForm().reset();
|
|
|
this.formEdit.getForm().setValues(this.MainEditRecord.data);
|
|
|
this.formHead.getForm().reset();
|
|
|
this.formHead.getForm().setValues(this.MainEditRecord.data);
|
|
|
this.formBill.getForm().reset();
|
|
|
this.formBill.getForm().setValues(this.MainEditRecord.data);
|
|
|
this.formMBL.getForm().reset();
|
|
|
this.formMBL.getForm().setValues(this.MainEditRecord.data);
|
|
|
var newBsNo = 'topseai' + NewGuid();
|
|
|
this.formHead.getForm().findField('BSNO').setValue(newBsNo);
|
|
|
this.formHead.getForm().findField('BLTYPE').setValue('拼箱分票');
|
|
|
this.formHead.getForm().findField('BLTYPE').readOnly = true;
|
|
|
this.formHead.getForm().findField('CUSTNO').setValue('');
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询主表数据...',
|
|
|
url: '/MvcShipping/MsOpSeai/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: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
//
|
|
|
data = result.data;
|
|
|
//
|
|
|
var CUSTOMERNAME = data.CUSTOMERNAME;
|
|
|
var s = "LINKID in (select gid from [info_client] where SHORTNAME='" + CUSTOMERNAME + "')";
|
|
|
this.storeInfoClientContact.load({ params: { condition: s} });
|
|
|
//
|
|
|
this.LoadInit(data);
|
|
|
this.formHead.getForm().reset();
|
|
|
this.formHead.getForm().setValues(data);
|
|
|
this.formEdit.getForm().reset();
|
|
|
this.formEdit.getForm().setValues(data);
|
|
|
this.formBill.getForm().reset();
|
|
|
this.formBill.getForm().setValues(data);
|
|
|
this.formMBL.getForm().reset();
|
|
|
this.formMBL.getForm().setValues(data);
|
|
|
|
|
|
this.Editdata = data; //
|
|
|
if (opstatus == "add" || opstatus == 'copyadd') {
|
|
|
this.GetAddText();
|
|
|
}
|
|
|
|
|
|
|
|
|
this.GetEditStatus();
|
|
|
this.LoadPeriod(this.opStatus);
|
|
|
// var paneltabitems = new Ext.Panel({
|
|
|
// id: 'pnlTruckBLEdit' ,
|
|
|
// layout: "fit",
|
|
|
// region: "center",
|
|
|
// autoScroll: true,
|
|
|
// frame: false,
|
|
|
// closable: true,
|
|
|
// title:"派车通知",
|
|
|
// html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="/MvcShipping/MsOpLetter/TruckLSEdit"> </iframe>'
|
|
|
// });
|
|
|
// this.tabSeaipanel.add(paneltabitems);
|
|
|
// this.tabSeaipanel.doLayout();
|
|
|
|
|
|
} else {
|
|
|
Ext.MessageBox.alert(Zi.LAN.FuWuQiXiangYingChuCuo, 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} });
|
|
|
var billno = this.editRecord.get('BSNO');
|
|
|
this.storeBodyListGoods.load({ params: { BsNo: billno} });
|
|
|
}
|
|
|
}
|
|
|
}, // end LoadDate
|
|
|
|
|
|
|
|
|
LoadCopyData: function (bsno, CopyFee) {
|
|
|
this.serialNo = 0;
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询主表数据...',
|
|
|
url: '/MvcShipping/MsOpSeai/GetCopyData',
|
|
|
params: {
|
|
|
condition: "BSNO='" + bsno + "'",
|
|
|
copyfee: CopyFee
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
if (!result.Success) {
|
|
|
Ext.Msg.show({
|
|
|
title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
//
|
|
|
data = result.data;
|
|
|
//
|
|
|
var CUSTOMERNAME = data.CUSTOMERNAME;
|
|
|
var s = "LINKID in (select gid from [info_client] where SHORTNAME='" + CUSTOMERNAME + "')";
|
|
|
this.storeInfoClientContact.load({ params: { condition: s } });
|
|
|
//
|
|
|
this.LoadInit(data);
|
|
|
this.formHead.getForm().reset();
|
|
|
this.formHead.getForm().setValues(data);
|
|
|
this.formEdit.getForm().reset();
|
|
|
this.formEdit.getForm().setValues(data);
|
|
|
this.formBill.getForm().reset();
|
|
|
this.formBill.getForm().setValues(data);
|
|
|
this.formMBL.getForm().reset();
|
|
|
this.formMBL.getForm().setValues(data);
|
|
|
this.GetAddText();
|
|
|
_this.Editdata = data;
|
|
|
_this.opStatus = 'add';
|
|
|
this.GetEditStatus();
|
|
|
if (_this.isfen) {
|
|
|
_this.formHead.getForm().findField('BLTYPE').readOnly = true;
|
|
|
_this.formHead.getForm().findField('MASTERNO').setValue(_this.MainEditRecord.data.BSNO);
|
|
|
}
|
|
|
|
|
|
_this.formHead.getForm().findField('WMSSTATUS').setValue("");
|
|
|
|
|
|
|
|
|
this.LoadPeriod(this.opStatus);
|
|
|
|
|
|
} else {
|
|
|
Ext.MessageBox.alert(Zi.LAN.FuWuQiXiangYingChuCuo, response.responseText);
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}, // end LoadDate
|
|
|
|
|
|
LoadPeriod: function (opstatus) {
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询主表数据...',
|
|
|
url: '/Account/ChMonthClose/GetNowPeriod',
|
|
|
params: {
|
|
|
condition: ''
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
if (!result.Success) {
|
|
|
return;
|
|
|
}
|
|
|
data = result.data;
|
|
|
this.MsPeriod = data;
|
|
|
this.LoadPeriodStatus(opstatus);
|
|
|
|
|
|
} else {
|
|
|
Ext.MessageBox.alert(Zi.LAN.FuWuQiXiangYingChuCuo, response.responseText);
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
},
|
|
|
|
|
|
LoadPeriodStatus: function (opstatus) {
|
|
|
var ETD = this.formEdit.getForm().findField('ETD').getRawValue();
|
|
|
if (ETD == '') {
|
|
|
this.formEdit.getForm().findField('ETD').setMinValue(this.MsPeriod.FDAY);
|
|
|
this.formEdit.getForm().findField('ETD').setReadOnly(false);
|
|
|
} else {
|
|
|
var oDate1 = new Date(ETD);
|
|
|
var oDate2 = new Date(this.MsPeriod.FDAY);
|
|
|
if (oDate1.getTime() >= oDate2.getTime()) {
|
|
|
this.formEdit.getForm().findField('ETD').setMinValue(this.MsPeriod.FDAY);
|
|
|
this.formEdit.getForm().findField('ETD').setReadOnly(false);
|
|
|
} else {
|
|
|
if (opstatus == 'add' || opstatus == 'copyadd') {
|
|
|
this.formEdit.getForm().findField('ETD').setMinValue(this.MsPeriod.FDAY);
|
|
|
this.formEdit.getForm().findField('ETD').setReadOnly(false);
|
|
|
}
|
|
|
else {
|
|
|
this.formEdit.getForm().findField('ETD').setMinValue('');
|
|
|
this.formEdit.getForm().findField('ETD').setReadOnly(true);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
var ACCDATE = this.formHead.getForm().findField('ACCDATE').getValue();
|
|
|
var FEESTATUSREF = this.formHead.getForm().findField('FEESTATUSREF').getValue();
|
|
|
var oDate1 = new Date(ACCDATE + '-01');
|
|
|
var oDate2 = new Date(this.MsPeriod.PERIOD + '-01');
|
|
|
if (oDate1.getTime() >= oDate2.getTime()) {
|
|
|
this.formHead.getForm().findField('ACCDATE').setMinValue(this.MsPeriod.PERIOD);
|
|
|
this.formHead.getForm().findField('ACCDATE').setReadOnly(false);
|
|
|
this.formEdit.getForm().findField('ETD').setReadOnly(false);
|
|
|
} else {
|
|
|
if (opstatus == 'add' || opstatus == 'copyadd') {
|
|
|
this.formHead.getForm().findField('ACCDATE').setMinValue(this.MsPeriod.PERIOD);
|
|
|
this.formHead.getForm().findField('ACCDATE').setReadOnly(false);
|
|
|
}
|
|
|
else {
|
|
|
this.formHead.getForm().findField('ACCDATE').setMinValue('');
|
|
|
this.formHead.getForm().findField('ACCDATE').setReadOnly(true);
|
|
|
}
|
|
|
}
|
|
|
if (FEESTATUSREF == '锁定') {
|
|
|
this.formHead.getForm().findField('ACCDATE').setReadOnly(true);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
//#region 保存
|
|
|
Save: function (type) {
|
|
|
var basicForm = this.formEdit.getForm();
|
|
|
var basicForm2 = this.formHead.getForm();
|
|
|
if (!basicForm.isValid()) {
|
|
|
return;
|
|
|
}
|
|
|
if (!basicForm2.isValid()) {
|
|
|
return;
|
|
|
}
|
|
|
//
|
|
|
var bodydatas = [];
|
|
|
var iCount = this.storeBodyList.getCount();
|
|
|
for (var i = 1; i <= iCount; i++) {
|
|
|
var member = this.storeBodyList.getAt(i - 1);
|
|
|
var sn = i.toString();
|
|
|
var al = iCount.toString().length;
|
|
|
var bl = i.toString().length;
|
|
|
if (iCount.toString().length > i.toString().length) {
|
|
|
for (var j = 0; j < (iCount.toString().length - i.toString().length); j++) {
|
|
|
sn = "0" + i.toString().toString();
|
|
|
}
|
|
|
}
|
|
|
member.data.CTNCODE = sn;
|
|
|
var TIXIANGSHIJIAN = member.data.TIXIANGSHIJIAN;
|
|
|
if (TIXIANGSHIJIAN != '')
|
|
|
TIXIANGSHIJIAN = Ext.util.Format.date(TIXIANGSHIJIAN, 'Y-m-d');
|
|
|
member.data.TIXIANGSHIJIAN = TIXIANGSHIJIAN;
|
|
|
|
|
|
bodydatas.push(member);
|
|
|
}
|
|
|
|
|
|
if (this.accdatesameetd == 1) {
|
|
|
var ETD = this.formEdit.getForm().findField('ETD').getRawValue();
|
|
|
if (ETD == '') {
|
|
|
|
|
|
} else {
|
|
|
var oDate1 = new Date(ETD);
|
|
|
var oDate2 = new Date(_this.MsPeriod.FDAY);
|
|
|
if (oDate1.getTime() >= oDate2.getTime()) {
|
|
|
var mydatestr = Ext.util.Format.date(ETD, 'Y-m');
|
|
|
if (_this.MsPeriod.CLOSEDAY != 0) {
|
|
|
var myday = Ext.util.Format.date(ETD, 'd');
|
|
|
if (myday > _this.MsPeriod.CLOSEDAY) {
|
|
|
var lastMonthDate = new Date(ETD); //上月日期
|
|
|
lastMonthDate.setDate(1);
|
|
|
lastMonthDate.setMonth(lastMonthDate.getMonth() + 1);
|
|
|
var mymonth = Ext.util.Format.date(lastMonthDate, 'm');
|
|
|
var myyear = Ext.util.Format.date(lastMonthDate, 'Y');
|
|
|
var mymonthstr = mymonth.toString();
|
|
|
if (mymonthstr.length == 1) mymonthstr = '0' + mymonthstr;
|
|
|
mydatestr = myyear.toString() + '-' + mymonthstr;
|
|
|
}
|
|
|
} else {
|
|
|
}
|
|
|
var field = this.formHead.getForm().findField('ACCDATE');
|
|
|
field.setValue(mydatestr);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
this.formHead.getForm().findField('MSHIPPERID').setValue(this.formMBL.getForm().findField('MSHIPPERID').getValue());
|
|
|
this.formHead.getForm().findField('MCONSIGNEEID').setValue(this.formMBL.getForm().findField('MCONSIGNEEID').getValue());
|
|
|
this.formHead.getForm().findField('MNOTIFYPARTYID').setValue(this.formMBL.getForm().findField('MNOTIFYPARTYID').getValue());
|
|
|
this.formHead.getForm().findField('MSHIPPER').setValue(this.formMBL.getForm().findField('MSHIPPER').getValue());
|
|
|
this.formHead.getForm().findField('MDESCRIPTION').setValue(this.formMBL.getForm().findField('MDESCRIPTION').getValue());
|
|
|
this.formHead.getForm().findField('MCONSIGNEE').setValue(this.formMBL.getForm().findField('MCONSIGNEE').getValue());
|
|
|
this.formHead.getForm().findField('MNOTIFYPARTY').setValue(this.formMBL.getForm().findField('MNOTIFYPARTY').getValue());
|
|
|
this.formHead.getForm().findField('MBLFRT').setValue(this.formMBL.getForm().findField('MBLFRT').getValue());
|
|
|
//
|
|
|
var jsonBody = ConvertRecordsToJsonAll(bodydatas);
|
|
|
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.formBill.getForm().getValues(false, false, false);
|
|
|
this.formHead.getForm().findField('BSNO').setDisabled(true);
|
|
|
var bodyGoodsdatas = [];
|
|
|
for (var i = 0; i < this.storeBodyListGoods.getCount(); i += 1) {
|
|
|
var member = this.storeBodyListGoods.getAt(i);
|
|
|
bodyGoodsdatas.push(member);
|
|
|
}
|
|
|
var jsonBodyGoods = ConvertRecordsToJsonAll(bodyGoodsdatas);
|
|
|
//
|
|
|
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu); //'正在保存数据, 请稍侯..'
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, //'正在保存数据...',
|
|
|
url: '/MvcShipping/MsOpSeai/Save',
|
|
|
scope: this,
|
|
|
params: {
|
|
|
opstatus: this.opStatus,
|
|
|
data: Ext.JSON.encode(data),
|
|
|
data2: Ext.JSON.encode(data2),
|
|
|
data3: Ext.JSON.encode(data3),
|
|
|
body: jsonBody,
|
|
|
goodsbody:jsonBodyGoods
|
|
|
},
|
|
|
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.formBill.getForm().reset();
|
|
|
this.formBill.getForm().setValues(returnData);
|
|
|
this.formMBL.getForm().reset();
|
|
|
this.formMBL.getForm().setValues(returnData);
|
|
|
_this.Editdata = data;
|
|
|
bodydatas = [];
|
|
|
//
|
|
|
if (this.opStatus == 'add') {
|
|
|
var arrNewRecords = this.StoreList.add(returnData);
|
|
|
this.editRecord = arrNewRecords[0];
|
|
|
}
|
|
|
else if (this.opStatus == 'edit') {
|
|
|
var editp = Ext.create('MsOpSeaiModel', 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();
|
|
|
}
|
|
|
//
|
|
|
this.opStatus = 'edit';
|
|
|
if (type == '0') {
|
|
|
this.formHead.getForm().findField('BSNO').setDisabled(false);
|
|
|
this.formHead.getForm().findField('BSNO').setValue(returnData.BSNO);
|
|
|
this.formHead.getForm().findField('BSNO').setDisabled(true);
|
|
|
var condition = "BSNO='" + returnData.BSNO + "'";
|
|
|
this.storeBodyList.load({ params: { condition: condition} });
|
|
|
this.LoadPeriodStatus(this.opStatus);
|
|
|
this.storeBodyListGoods.load({ params: { BsNo: returnData.BSNO} });
|
|
|
|
|
|
} else if (type == '1') {
|
|
|
window.close();
|
|
|
} else if (type == '2') {
|
|
|
this.LoadData('add', '');
|
|
|
}
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });//'请重试', msg: Zi.LAN.FuWuQiXiangYingChuCuo
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}, //end save
|
|
|
//#endregion
|
|
|
|
|
|
//#region 集装箱按钮事件
|
|
|
onAddDetailClick: function (button, event) {
|
|
|
this.addDetail();
|
|
|
}, //end onAddDetailClick
|
|
|
|
|
|
onDelDetailClick: function (button, event) {
|
|
|
this.deleteDetail();
|
|
|
}, //onDelDetailClick
|
|
|
|
|
|
// gridAfterEdit: function (editor, e, eOpts) {
|
|
|
// if (e.field == 'Pkgs' || e.field == 'Price') {
|
|
|
// var Pkgs = e.record.data['Pkgs'];
|
|
|
// var Price = e.record.data['Price'];
|
|
|
// e.record.set('Total', (Pkgs * Price).toFixed(2));
|
|
|
// }
|
|
|
// },
|
|
|
|
|
|
|
|
|
onNextKeyClick: function (type, col) {
|
|
|
var rows = this.gridList.getSelectionModel().getSelection();
|
|
|
var row = rows[rows.length - 1];
|
|
|
var s = this.gridList.getStore();
|
|
|
var number = s.indexOf(row) + 1;
|
|
|
if (number == this.gridList.getStore().getCount()) {
|
|
|
var newSerialno = this.DsGetNewNo(this.storeBodyList);
|
|
|
var record = Ext.create('MsOpSeaiDetail', {
|
|
|
CTN_ID: '*',
|
|
|
CTNCODE: newSerialno,
|
|
|
CTNALL: row.data.CTNALL,
|
|
|
CTNNUM: 1,
|
|
|
CNTRNO: '',
|
|
|
SEALNO: '',
|
|
|
CTNSTATUS: 'F',
|
|
|
PKGS: 0,
|
|
|
KINDPKGS: '',
|
|
|
KGS: 0,
|
|
|
TAREWEIGHT: 0,
|
|
|
CBM: 0,
|
|
|
REMARK: '',
|
|
|
MTMC: '',
|
|
|
SJRGSJ: '',
|
|
|
SJCGSJ: '',
|
|
|
ISWMS: '0',
|
|
|
WMSDATE:''
|
|
|
|
|
|
});
|
|
|
this.storeBodyList.add(record);
|
|
|
var n = this.storeBodyList.getCount();
|
|
|
this.gridListCellEditing.startEditByPosition({ row: n - 1, column: 6 });
|
|
|
} else {
|
|
|
this.gridListCellEditing.startEditByPosition({ row: number, column: col });
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
onUpKeyClick: function (type, col) {
|
|
|
|
|
|
var rows = this.gridList.getSelectionModel().getSelection();
|
|
|
var row = rows[rows.length - 1];
|
|
|
var s = this.gridList.getStore();
|
|
|
var number = s.indexOf(row) - 1;
|
|
|
if (number < 0) number = 0;
|
|
|
this.gridListCellEditing.startEditByPosition({ row: number, column: col });
|
|
|
|
|
|
},
|
|
|
|
|
|
addDetail: function () {
|
|
|
var newSerialno = this.DsGetNewNo(this.storeBodyList);
|
|
|
//this.tabtree.expandAll(); //展开所有树节点
|
|
|
//collapseAll():收缩所有树节点
|
|
|
//getRootNode():获取根节点
|
|
|
var record = Ext.create('MsOpSeaiDetail', {
|
|
|
CTN_ID: '*',
|
|
|
CTNCODE: newSerialno,
|
|
|
CTNALL: '',
|
|
|
CTNNUM: 1,
|
|
|
CNTRNO: '',
|
|
|
CTNFEE:0.00,
|
|
|
SEALNO: '',
|
|
|
CTNSTATUS: 'F',
|
|
|
PKGS: 0,
|
|
|
KINDPKGS: '',
|
|
|
KGS: 0,
|
|
|
TAREWEIGHT: 0,
|
|
|
CBM: 0,
|
|
|
REMARK: '',
|
|
|
MTMC: '',
|
|
|
SJRGSJ: '',
|
|
|
SJCGSJ: '',
|
|
|
ISWMS: '0',
|
|
|
WMSDATE:''
|
|
|
});
|
|
|
this.storeBodyList.add(record);
|
|
|
var n = this.storeBodyList.getCount();
|
|
|
this.gridListCellEditing.startEditByPosition({ row: n - 1, column: 2 });
|
|
|
},
|
|
|
|
|
|
DsGetNewNo: function (store) {
|
|
|
var result = store.getCount();
|
|
|
if (result == 0) {
|
|
|
return 1;
|
|
|
}
|
|
|
var record = store.getAt(result - 1).data.CTNCODE;
|
|
|
result = parseInt(record) + 1;
|
|
|
return result;
|
|
|
},
|
|
|
|
|
|
deleteDetail: function () {
|
|
|
var BSSTATUS = this.formHead.getForm().findField('BSSTATUSREF').getValue();
|
|
|
if (BSSTATUS == '锁定') {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.YeWuYiSuoDingBuYunXuShanChu, 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.CTN_ID == "" || rec.data.CTN_ID == "*")//如果是新增但没有保存的数据,没有必要提交到后台
|
|
|
{
|
|
|
this.storeBodyList.remove(selectedRecords[i]);
|
|
|
}
|
|
|
else {
|
|
|
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
|
|
|
if (btn == 'yes') {
|
|
|
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu); //'正在删除数据...'
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, //'正在删除数据...',
|
|
|
url: '/MvcShipping/MsOpSeai/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();
|
|
|
this.Save("0");
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
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 });//'警告', msg: Zi.LAN.FuWuQiXiangYingChuCuo
|
|
|
},
|
|
|
scope: this
|
|
|
}); //end Ext.Ajax.request
|
|
|
}
|
|
|
}, this);
|
|
|
}
|
|
|
//this.storeBodyList.remove(selectedRecords[i]);
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
onaddCtnTkClick: function () {
|
|
|
|
|
|
Ext.Ajax.timeout = 6000000;
|
|
|
|
|
|
|
|
|
var APPLYNO = this.formHead.getForm().findField('APPLYNO').getValue();
|
|
|
if (APPLYNO == '' || APPLYNO == NaN || APPLYNO == null) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg:'放箱申请号不能为空!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });//'主提单号不能为空!'
|
|
|
return;
|
|
|
}
|
|
|
var sKINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue();
|
|
|
|
|
|
|
|
|
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
|
|
|
Ext.Msg.wait('正在提取数据, 请稍侯..');
|
|
|
Ext.define('MsOpCtnBsCard', {
|
|
|
extend: 'Ext.data.Model',
|
|
|
idProperty: 'GID',
|
|
|
fields: [
|
|
|
{ name: 'GID', type: 'string' },
|
|
|
{ name: 'CTNNO', type: 'string' },
|
|
|
{ name: 'APPLYNO', type: 'string' },
|
|
|
{ name: 'GOODSNAMEREF', type: 'string' }
|
|
|
]
|
|
|
});
|
|
|
|
|
|
var GOODSNAMEREF = '';
|
|
|
|
|
|
var storeyardctn = Ext.create('Ext.data.Store', {
|
|
|
model: 'MsOpCtnBsCard',
|
|
|
remoteSort: true,
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
timeout: 6000000,//60秒,
|
|
|
url: '/MvcContainer/MsOpCtnBsCard/GetDataList',
|
|
|
reader: {
|
|
|
id: 'GID',
|
|
|
root: 'data',
|
|
|
totalProperty: 'totalCount'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
storeyardctn.load({
|
|
|
params: { condition:"APPLYNO='"+APPLYNO+"'" },
|
|
|
timeout: 6000000,//60秒,
|
|
|
callback: function (r, options, success) {
|
|
|
if (success) {
|
|
|
var jsonresult = Ext.JSON.decode(options.response.responseText);
|
|
|
var sKINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue();
|
|
|
if (storeyardctn.getCount() > 0) {
|
|
|
var member = storeyardctn.getAt(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.CTNNO);
|
|
|
if (selectrecords.length > 0) {
|
|
|
|
|
|
} else {
|
|
|
var newSerialno = this.DsGetNewNo(this.storeBodyList);
|
|
|
this.serialNo = newSerialno;
|
|
|
var record = Ext.create('MsOpSeaiDetail', {
|
|
|
CTN_ID: '*',
|
|
|
CTNCODE: newSerialno,
|
|
|
CTNALL:'20TK',
|
|
|
CTNNUM: 1,
|
|
|
CNTRNO:member.data.CTNNO,
|
|
|
SEALNO: '',
|
|
|
PKGS: 0,
|
|
|
KINDPKGS: '',
|
|
|
KGS: 0,
|
|
|
TAREWEIGHT: 0,
|
|
|
CBM: 0,
|
|
|
REMARK: '',
|
|
|
MTMC: '',
|
|
|
SJRGSJ: '',
|
|
|
SJCGSJ: '',
|
|
|
ISWMS: '0',
|
|
|
WMSDATE: ''
|
|
|
});
|
|
|
|
|
|
this.storeBodyList.add(record);
|
|
|
|
|
|
}
|
|
|
GOODSNAMEREF = member.data.GOODSNAMEREF;
|
|
|
};
|
|
|
this.formEdit.getForm().findField('GOODSNAME').setValue(GOODSNAMEREF);
|
|
|
|
|
|
// 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 sKINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue();
|
|
|
// this.formEdit.getForm().findField('NOPKGS').setValue(PKGS + sKINDPKGS);
|
|
|
// this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(PKGS).toUpperCase() + ' ' + sKINDPKGS + ' ONLY.');
|
|
|
//
|
|
|
Ext.Msg.hide();
|
|
|
} else {
|
|
|
if (jsonresult.Success) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.emptyMsg, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });//'没有提取的相关数据!'
|
|
|
} else
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: jsonresult.Message, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
onImportApplyClick: function () {
|
|
|
|
|
|
var MBLNO = this.formHead.getForm().findField('MBLNO').getValue();
|
|
|
var CUSTOMNO = this.formEdit.getForm().findField('CUSTOMNO').getValue();
|
|
|
|
|
|
var condition = "";
|
|
|
//if (MBLNO && CUSTOMNO) {
|
|
|
// condition = "( (isnull(MBLNO,'')<>'' and MBLNO='" + MBLNO + "') and (isnull(CUSTOMNO,'')<>'' and CUSTOMNO='" + CUSTOMNO + "'))";
|
|
|
//} else if (CUSTOMNO) {
|
|
|
// condition = "(isnull(CUSTOMNO,'')<>'' and CUSTOMNO='" + CUSTOMNO + "'))";
|
|
|
//} else if (MBLNO) {
|
|
|
// condition = "(isnull(MBLNO,'')<>'' and MBLNO='" + MBLNO + "')";
|
|
|
//} else return;
|
|
|
|
|
|
if (CUSTOMNO) {
|
|
|
condition = "(isnull(CUSTOMNO,'')<>'' and CUSTOMNO='" + CUSTOMNO + "')";
|
|
|
} else if (MBLNO) {
|
|
|
condition = "(isnull(MBLNO,'')<>'' and MBLNO='" + MBLNO + "')";
|
|
|
} else return;
|
|
|
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在查询主表数据...',
|
|
|
url: '/MvcShipping/MsOpApply/GetOpseaiData',
|
|
|
params: {
|
|
|
handle: 'edit',
|
|
|
condition: condition
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
if (!result.Success) {
|
|
|
Ext.Msg.show({
|
|
|
title: '提示',
|
|
|
msg: result.Message,
|
|
|
icon: Ext.MessageBox.ERROR,
|
|
|
buttons: Ext.Msg.OK
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
data = result.data;
|
|
|
if (data.MBLNO != '') {
|
|
|
|
|
|
if (data.MBLNO != '' && data.MBLNO != null) {
|
|
|
_mblno = this.formHead.getForm().findField('MBLNO').getValue();
|
|
|
if (_mblno) {
|
|
|
|
|
|
} else {
|
|
|
this.formHead.getForm().findField('MBLNO').setValue(data.MBLNO);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
if (data.VESSEL != '' && data.VESSEL != null)
|
|
|
this.formEdit.getForm().findField('VESSEL').setValue(data.VESSEL);
|
|
|
if (data.VOYNO != '' && data.VOYNO != null)
|
|
|
this.formEdit.getForm().findField('VOYNO').setValue(data.VOYNO);
|
|
|
if (data.ETA != '' && data.ETA != null)
|
|
|
this.formEdit.getForm().findField('ETD').setValue(data.ETA);
|
|
|
if (data.PORTLOAD != '' && data.PORTLOAD != null)
|
|
|
this.formEdit.getForm().findField('PORTLOAD').setValue(data.PORTLOAD);
|
|
|
if (data.PORTDISCHARGE != '' && data.PORTDISCHARGE != null)
|
|
|
this.formEdit.getForm().findField('PORTDISCHARGE').setValue(data.PORTDISCHARGE);
|
|
|
if (data.ARCOUNTRY != '' && data.ARCOUNTRY != null)
|
|
|
this.formEdit.getForm().findField('COUNTRYOFORIGIN').setValue(data.ARCOUNTRY);
|
|
|
if (data.ENTERP != '' && data.ENTERP != null)
|
|
|
this.formEdit.getForm().findField('ENTERP').setValue(data.ENTERP);
|
|
|
if (data.CLEARCUSTOMDATE != '' && data.CLEARCUSTOMDATE != null)
|
|
|
this.formEdit.getForm().findField('CUSTOMDATE').setValue(data.CLEARCUSTOMDATE);
|
|
|
if (data.CUSTOMDATE != '' && data.CUSTOMDATE != null)
|
|
|
this.formEdit.getForm().findField('UPDATETIME').setValue(data.CUSTOMDATE);
|
|
|
if (data.CONTRACTNO != '' && data.CONTRACTNO != null)
|
|
|
this.formEdit.getForm().findField('CONTRACTNO').setValue(data.CONTRACTNO);
|
|
|
if (data.INVNO != '' && data.INVNO != null)
|
|
|
this.formEdit.getForm().findField('INVNO').setValue(data.INVNO);
|
|
|
if (data.PKGS != '' && data.PKGS != null)
|
|
|
this.formEdit.getForm().findField('PKGS').setValue(data.PKGS);
|
|
|
if (data.KGS != '' && data.KGS != null)
|
|
|
this.formEdit.getForm().findField('KGS').setValue(data.KGS);
|
|
|
if (data.CBM != '' && data.CBM != null)
|
|
|
this.formEdit.getForm().findField('CBM').setValue(data.CBM);
|
|
|
if (data.CUSTOMNO != '' && data.CUSTOMNO != null)
|
|
|
this.formEdit.getForm().findField('CUSTOMNO').setValue(data.CUSTOMNO);
|
|
|
if (data.CUSTOMSNUM != '' && data.CUSTOMSNUM != null)
|
|
|
this.formEdit.getForm().findField('CUSTOMSNUM').setValue(data.CUSTOMSNUM);
|
|
|
if (data.TRADETYPE != '' && data.TRADETYPE != null)
|
|
|
this.formEdit.getForm().findField('TRADETYPE').setValue(data.TRADETYPE);
|
|
|
if (data.TRADETERM != '' && data.TRADETERM != null)
|
|
|
this.formEdit.getForm().findField('TRADETERM').setValue(data.TRADETERM);
|
|
|
if (data.CARGOVALUE != '' && data.CARGOVALUE != null)
|
|
|
this.formEdit.getForm().findField('IMPORTVALUE').setValue(data.CARGOVALUE);
|
|
|
if (data.CURRENCY != '' && data.CURRENCY != null)
|
|
|
this.formEdit.getForm().findField('CURRENCY').setValue(data.CURRENCY);
|
|
|
if (data.ISMOREGOOD != '' && data.ISMOREGOOD != null)
|
|
|
this.formEdit.getForm().findField('ISMOREGOOD').setValue(data.ISMOREGOOD);
|
|
|
if (data.INSPECTIONNO != '' && data.INSPECTIONNO != null)
|
|
|
this.formEdit.getForm().findField('INSPECTIONNO').setValue(data.INSPECTIONNO);
|
|
|
if (data.INSPECTIONDATE != '' && data.INSPECTIONDATE != null)
|
|
|
this.formEdit.getForm().findField('INSPECTIONDATE').setValue(data.INSPECTIONDATE);
|
|
|
|
|
|
if (data.商品名称 != '' && data.商品名称 != null)
|
|
|
this.formEdit.getForm().findField('GOODSNAME').setValue(data.商品名称);
|
|
|
if (data.单价 != '' && data.单价 != null)
|
|
|
this.formEdit.getForm().findField('UNITPRICE').setValue(data.单价);
|
|
|
|
|
|
if (data.NETWEIGHT != '' && data.NETWEIGHT != null)
|
|
|
this.formEdit.getForm().findField('NETWEIGHT').setValue(data.NETWEIGHT);
|
|
|
|
|
|
//贸易条款
|
|
|
if (data.TRADETERM != '' && data.TRADETERM != null)
|
|
|
this.formEdit.getForm().findField('TRADETERM').setValue(data.TRADETERM);
|
|
|
//贸易方式
|
|
|
if (data.TRADETYPE != '' && data.TRADETYPE != null)
|
|
|
this.formEdit.getForm().findField('TRADETYPE').setValue(data.TRADETYPE);
|
|
|
|
|
|
if (data.TRADETYPE != '' && data.TRADETYPE != null)
|
|
|
this.formEdit.getForm().findField('TRADETYPE').setValue(data.TRADETYPE);
|
|
|
|
|
|
if (data.TRADETYPE != '' && data.TRADETYPE != null)
|
|
|
this.formEdit.getForm().findField('TRADETYPE').setValue(data.TRADETYPE);
|
|
|
|
|
|
if (data.REMARK2 != '' && data.REMARK2 != null)
|
|
|
this.formEdit.getForm().findField('REMARK2').setValue(data.REMARK2);
|
|
|
|
|
|
this.Save('0');
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
onCheckCtnApply: function () {
|
|
|
//恒成 操作模块 点击放箱号,可以跳出成本核算 /MvcContainer/MsOpCtnApply/CostEdit
|
|
|
APPLYNO = this.formHead.getForm().findField('APPLYNO').getValue();
|
|
|
DsOpenMultiEditWin('/MvcContainer/MsOpCtnApply/CostEdit?opener=OPSEAI&APPLYNO=' + APPLYNO);
|
|
|
},
|
|
|
onSendQY: function () {
|
|
|
|
|
|
if (this.opStatus == 'add') {
|
|
|
MsgTip("提示", "需要先保存业务", 1000);
|
|
|
return;
|
|
|
} else {
|
|
|
_this = this;
|
|
|
var headid = this.editRecord.get('BSNO');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询主表数据...',
|
|
|
url: '/MvcShipping/MsOpSeai/QY_addWarehouseNotice',
|
|
|
params: {
|
|
|
headid: headid
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
//显示成功
|
|
|
Ext.Msg.show({ title: '发送至仓储系统', msg: "发送成功:" + jsonresult.Message, icon: Ext.Msg.OK, buttons: Ext.Msg.OK });
|
|
|
|
|
|
condition = "BSNO='" + headid + "'";
|
|
|
|
|
|
this.LoadData(this.opStatus, condition);
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: '发送至仓储系统', msg: "发送失败:" + jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.ERROR });
|
|
|
}
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: '发送至仓储系统', msg: "发送失败", icon: Ext.Msg.ERROR, buttons: Ext.Msg.ERROR });
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
onaddYXClick: function () {
|
|
|
|
|
|
Ext.Ajax.timeout = 6000000;
|
|
|
|
|
|
|
|
|
var APPLYNO = this.formHead.getForm().findField('APPLYNO').getValue();
|
|
|
if (APPLYNO == '' || APPLYNO == NaN || APPLYNO == null) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: '放箱申请号不能为空!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });//'主提单号不能为空!'
|
|
|
return;
|
|
|
}
|
|
|
var sKINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue();
|
|
|
|
|
|
|
|
|
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
|
|
|
Ext.Msg.wait('正在提取数据, 请稍侯..');
|
|
|
Ext.define('MsOpCtnBsCard', {
|
|
|
extend: 'Ext.data.Model',
|
|
|
idProperty: 'GID',
|
|
|
fields: [
|
|
|
{ name: 'GID', type: 'string' },
|
|
|
{ name: 'CTNNO', type: 'string' },
|
|
|
{ name: 'APPLYNO', type: 'string' }
|
|
|
]
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var storeyardctn = Ext.create('Ext.data.Store', {
|
|
|
model: 'MsOpCtnBsCard',
|
|
|
remoteSort: true,
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
timeout: 6000000,//60秒,
|
|
|
url: '/MvcContainer/MsOpCtnBsCard/GetDataList',
|
|
|
reader: {
|
|
|
id: 'GID',
|
|
|
root: 'data',
|
|
|
totalProperty: 'totalCount'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
storeyardctn.load({
|
|
|
params: { condition: "APPLYNO='" + APPLYNO + "'" },
|
|
|
timeout: 6000000,//60秒,
|
|
|
callback: function (r, options, success) {
|
|
|
if (success) {
|
|
|
var jsonresult = Ext.JSON.decode(options.response.responseText);
|
|
|
var sKINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue();
|
|
|
if (storeyardctn.getCount() > 0) {
|
|
|
var member = storeyardctn.getAt(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.CTNNO);
|
|
|
if (selectrecords.length > 0) {
|
|
|
|
|
|
} else {
|
|
|
var newSerialno = this.DsGetNewNo(this.storeBodyList);
|
|
|
this.serialNo = newSerialno;
|
|
|
var record = Ext.create('MsOpSeaiDetail', {
|
|
|
CTN_ID: '*',
|
|
|
CTNCODE: newSerialno,
|
|
|
CTNALL: '20TK',
|
|
|
CTNNUM: 1,
|
|
|
CNTRNO: member.data.CTNNO,
|
|
|
SEALNO: '',
|
|
|
PKGS: 0,
|
|
|
KINDPKGS: '',
|
|
|
KGS: 0,
|
|
|
TAREWEIGHT: 0,
|
|
|
CBM: 0,
|
|
|
REMARK: '',
|
|
|
MTMC: '',
|
|
|
SJRGSJ: '',
|
|
|
SJCGSJ: '',
|
|
|
ISWMS: '0',
|
|
|
WMSDATE: ''
|
|
|
});
|
|
|
|
|
|
this.storeBodyList.add(record);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
Ext.Msg.hide();
|
|
|
} else {
|
|
|
if (jsonresult.Success) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.emptyMsg, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });//'没有提取的相关数据!'
|
|
|
} else
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: jsonresult.Message, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
CreateCtnFee: function (type) {
|
|
|
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
|
|
|
var BSSTATUS = this.formHead.getForm().findField('FEESTATUSREF').getValue();
|
|
|
if (BSSTATUS == '锁定') {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.YeWuYiSuoDingBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });//'业务已锁定,不允许操作!'
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var selectedRecords = this.gridList.selModel.getSelection();
|
|
|
|
|
|
var bodyList = [];
|
|
|
for (var i = 0; i < selectedRecords.length; i++) {
|
|
|
var rec = selectedRecords[i];
|
|
|
if (rec.data.CNTRNO!= ""&&rec.data.TRUCKER!= ""&&(rec.data.TRUCKFEE!=0||rec.data.CTNFEE!=0))
|
|
|
bodyList.push(rec);
|
|
|
}
|
|
|
|
|
|
var jsonBody = ConvertRecordsToJsonAll(bodyList);
|
|
|
if (jsonBody == '') {
|
|
|
Ext.Msg.show({ title: '提示', msg: '没有要生成费用的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, //'正在保存数据...',
|
|
|
url: '/MvcShipping/MsOpSeai/CreateCtnFee',
|
|
|
scope: this,
|
|
|
params: {
|
|
|
bsno: BSNO,
|
|
|
body: jsonBody
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
Ext.MessageBox.hide();
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
Ext.Msg.show({ title: '提示', msg: '生成费用成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
//#region 商品明细
|
|
|
|
|
|
addDetailGoods: function () {
|
|
|
|
|
|
var newSerialno = DsGetNewSerialNo(this.storeBodyListGoods, this.serialNo);
|
|
|
this.serialNo = newSerialno;
|
|
|
// this.tabtree.expandAll();
|
|
|
var record = Ext.create('MsOpApplyDetail', {
|
|
|
BsNo: '*',
|
|
|
SerialNo: newSerialno,
|
|
|
GoodsCode: '',
|
|
|
GoodsName: '',
|
|
|
Pkgs: 0,
|
|
|
Price: 0,
|
|
|
Total: 0,
|
|
|
Currency: '',
|
|
|
Remark: ''
|
|
|
});
|
|
|
|
|
|
this.storeBodyListGoods.add(record);
|
|
|
|
|
|
var n = this.storeBodyListGoods.getCount();
|
|
|
this.gridListGoodsCellEditing.startEditByPosition({ row: n - 1, column: 2 });
|
|
|
},
|
|
|
|
|
|
deleteDetailGoods: function () {
|
|
|
this.serialNo = DsGetCurSerialNo(this.storeBodyListGoods, this.serialNo);
|
|
|
|
|
|
var selectedRecords = this.gridListGoods.selModel.getSelection();
|
|
|
|
|
|
for (var i = 0; i < selectedRecords.length; i++) {
|
|
|
var rec = selectedRecords[i];
|
|
|
|
|
|
this.storeBodyListGoods.remove(selectedRecords[i]);
|
|
|
|
|
|
}
|
|
|
},
|
|
|
|
|
|
gridGoodsAfterEdit: function (editor, e, eOpts) {
|
|
|
if (e.field == 'Pkgs' || e.field == 'Price') {
|
|
|
|
|
|
var Pkgs = e.record.data['Pkgs'];
|
|
|
var Price = e.record.data['Price'];
|
|
|
e.record.set('Total', (Pkgs * Price).toFixed(2));
|
|
|
}else if (e.field=='GoodsCode'){
|
|
|
var records = DsStoreQueryBy(this.storeListGoodName, 'GOODCODE', e.value);
|
|
|
if (records.getCount() > 0) {
|
|
|
var data = records.getAt(0).data;
|
|
|
var GoodsName = data.GOODNAME;
|
|
|
e.record.set('GoodsName', GoodsName);
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (e.field=='GoodsName'){
|
|
|
var records = DsStoreQueryBy(this.storeListGoodName, 'GOODNAME', e.value);
|
|
|
if (records.getCount() > 0) {
|
|
|
var data = records.getAt(0).data;
|
|
|
var GOODCODE = data.GOODCODE;
|
|
|
e.record.set('GoodsCode', GOODCODE);
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
},
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
PrintCtn: function () {
|
|
|
|
|
|
var billNo = this.editRecord.data.BSNO.toString();
|
|
|
var selectedRecords = this.GridCheckBoxModelCtn.selected.items;
|
|
|
var feeGidSql = '';
|
|
|
for (var i = 0; i < selectedRecords.length; i++) {
|
|
|
var record = selectedRecords[i];
|
|
|
var feeGId = "'" + record.get('CTN_ID') + "'";
|
|
|
if (feeGidSql == '') {
|
|
|
feeGidSql = feeGId;
|
|
|
} else {
|
|
|
feeGidSql = feeGidSql + "," + feeGId;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
if (feeGidSql == '') feeGidSql="'aaaaa'";
|
|
|
|
|
|
var printType = 'MSOPSEAECTN';
|
|
|
var sql1 = "SET LANGUAGE 'us_english' SELECT * from op_ctn c WHERE c.BSNO = '" + billNo + "' order by c.CTNCODE,c.CNTRNO ";
|
|
|
var sql2 = "SET LANGUAGE 'us_english' SELECT * from op_ctn c WHERE c.BSNO = '" + billNo + "' and CTN_ID IN (" + feeGidSql + ") order by c.CTNCODE,c.CNTRNO ";
|
|
|
var sql3 = "select * from op_seai where bsno='"+billNo+"'";
|
|
|
var sql4 = "";
|
|
|
var sql5 = "";
|
|
|
var sql6 = "";
|
|
|
|
|
|
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6,'');
|
|
|
}
|
|
|
,
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
//#region 清空委托编号
|
|
|
ClearCustNo: function () {
|
|
|
var CUSTNO = this.formHead.getForm().findField('CUSTNO').getValue();
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询委托编号状态...',
|
|
|
url: '/MvcShipping/MsSysBillNoSet/DeleteBsNo',
|
|
|
params: {
|
|
|
custno: CUSTNO
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
if (result.Success != true) {
|
|
|
|
|
|
} else {
|
|
|
this.formHead.getForm().findField('CUSTNO').setValue('');
|
|
|
|
|
|
}
|
|
|
} else {
|
|
|
Ext.MessageBox.alert(Zi.LAN.FuWuQiXiangYingChuCuo, response.responseText);
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
//#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();
|
|
|
var btnCUSTNO = Ext.getCmp('btnCUSTNO');
|
|
|
_this = this;
|
|
|
if (BSSTATUS == '锁定') {
|
|
|
canedit = false;
|
|
|
this.setSaveBtnStatus(canedit);
|
|
|
} else {
|
|
|
this.StoreOpRange.load({ params: { optype: "modSeaImportList" },
|
|
|
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: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询委托编号状态...',
|
|
|
url: '/MvcShipping/MsSysBillNoSet/GetData',
|
|
|
params: {
|
|
|
condition: "OPLBNAME='海运进口' AND RULEBLNO='委托编号'",
|
|
|
handle: 'edit'
|
|
|
},
|
|
|
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);
|
|
|
btnCUSTNO.setVisible(true);
|
|
|
_this.GetFeeCustNoStatus();
|
|
|
} else {
|
|
|
var data = result.data;
|
|
|
if (data.ISEDIT == '1') {
|
|
|
var custno = _this.formHead.getForm().findField('CUSTNO');
|
|
|
custno.setReadOnly(false);
|
|
|
if (data.ISOPADD == '1')
|
|
|
btnCUSTNO.setVisible(true);
|
|
|
else btnCUSTNO.setVisible(false);
|
|
|
_this.GetFeeCustNoStatus();
|
|
|
|
|
|
} else {
|
|
|
if (data.RULEBLNO == '') {
|
|
|
var custno = _this.formHead.getForm().findField('CUSTNO');
|
|
|
custno.setReadOnly(false);
|
|
|
btnCUSTNO.setVisible(false);
|
|
|
|
|
|
} else {
|
|
|
var custno = _this.formHead.getForm().findField('CUSTNO');
|
|
|
custno.setReadOnly(true);
|
|
|
if (data.ISOPADD == '1')
|
|
|
btnCUSTNO.setVisible(true);
|
|
|
else btnCUSTNO.setVisible(false);
|
|
|
}
|
|
|
_this.GetFeeCustNoStatus();
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
} else {
|
|
|
Ext.MessageBox.alert(Zi.LAN.FuWuQiXiangYingChuCuo, response.responseText);
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询委托编号状态...',
|
|
|
url: '/MvcShipping/MsSysBillNoSet/GetData',
|
|
|
params: {
|
|
|
condition: "OPLBNAME='海运进口' AND RULEBLNO='分提单号'",
|
|
|
handle: 'edit'
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
if (result.Success != true) {
|
|
|
var custno = _this.formHead.getForm().findField('HBLNO');
|
|
|
custno.setReadOnly(true);
|
|
|
} else {
|
|
|
var data = result.data;
|
|
|
if (data.ISEDIT == '1') {
|
|
|
var custno = _this.formHead.getForm().findField('HBLNO');
|
|
|
custno.setReadOnly(false);
|
|
|
} else {
|
|
|
if (data.RULEBLNO == '') {
|
|
|
var custno = _this.formHead.getForm().findField('HBLNO');
|
|
|
custno.setReadOnly(false);
|
|
|
} else {
|
|
|
var custno = _this.formHead.getForm().findField('HBLNO');
|
|
|
custno.setReadOnly(true);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var headid = _this.editRecord.get('BSNO');
|
|
|
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询主表数据...',
|
|
|
url: '/MvcShipping/MsOpSeai/Needsend',
|
|
|
params: {
|
|
|
headid: headid
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
//显示给红柿子的 发送至仓储 按钮
|
|
|
var BtnQYHSZSEND = Ext.getCmp('BtnQYHSZSEND');
|
|
|
BtnQYHSZSEND.hidden = false;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
} else {
|
|
|
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
GetFeeCustNoStatus:function(){
|
|
|
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
|
|
|
var btnCUSTNO = Ext.getCmp('btnCUSTNO');
|
|
|
var custno = _this.formHead.getForm().findField('CUSTNO');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '',
|
|
|
url: '/MvcShipping/MsBaseInfo/GetFeeCustNoEnable',
|
|
|
params: {
|
|
|
bsno: BSNO,
|
|
|
custno:custno
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
if (result.Success == true) {
|
|
|
custno.setReadOnly(true);
|
|
|
btnCUSTNO.setVisible(false);
|
|
|
}
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
},
|
|
|
|
|
|
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');
|
|
|
|
|
|
if (enable) {
|
|
|
btnESave.enable();
|
|
|
btnESaveAndClose.enable();
|
|
|
btnESaveAndNew.enable();
|
|
|
|
|
|
btnEAddDetail.enable();
|
|
|
btnEDeleteDetail.enable();
|
|
|
} else {
|
|
|
btnESave.disable();
|
|
|
btnESaveAndClose.disable();
|
|
|
btnESaveAndNew.disable();
|
|
|
btnEAddDetail.disable();
|
|
|
btnEDeleteDetail.disable();
|
|
|
}
|
|
|
},
|
|
|
|
|
|
GetAddText: function () {
|
|
|
if (this.opStatus != 'edit') {
|
|
|
this.opStatus = 'add'
|
|
|
var basicForm = this.formHead.getForm();
|
|
|
if (!this.copyfee) {
|
|
|
basicForm.findField('BSNO').setDisabled(false);
|
|
|
var field = basicForm.findField('BSNO');
|
|
|
var oldbsno = field.getValue();
|
|
|
var oldmasterno = basicForm.findField('MASTERNO').getValue();
|
|
|
|
|
|
var strbsno = "topseai" + NewGuid().toString().replace(/-/g, '')
|
|
|
field.setValue(strbsno);
|
|
|
// var BSNO = 'topseae' + NewGuid();
|
|
|
|
|
|
// field.setValue(BSNO);
|
|
|
if (oldbsno == oldmasterno) {
|
|
|
field = basicForm.findField('MASTERNO');
|
|
|
field.setValue(strbsno);
|
|
|
}
|
|
|
//field.setValue('*');alert("abacacf".replace(/a/g,'9'));
|
|
|
basicForm.findField('BSNO').setDisabled(true);
|
|
|
}
|
|
|
|
|
|
field = basicForm.findField('CUSTNO');
|
|
|
field.setValue('');
|
|
|
field = basicForm.findField('MBLNO');
|
|
|
field.setValue('');
|
|
|
field = basicForm.findField('HBLNO');
|
|
|
field.setValue('');
|
|
|
field = basicForm.findField('OP');
|
|
|
field.setValue(SHOWNAME);
|
|
|
field = basicForm.findField('INPUTBY');
|
|
|
field.setValue(SHOWNAME);
|
|
|
|
|
|
var field = basicForm.findField('BSSTATUSREF');
|
|
|
field.setValue('未锁定');
|
|
|
var field = basicForm.findField('FEESTATUSREF');
|
|
|
field.setValue('未锁定');
|
|
|
//field = basicForm.findField('BSTYPE');
|
|
|
//field.setValue('普通货');
|
|
|
|
|
|
var myDate = new Date();
|
|
|
var mydatestr = Ext.util.Format.date(myDate, 'Y-m-d');
|
|
|
field = basicForm.findField('BSDATE');
|
|
|
field.setValue(mydatestr);
|
|
|
var mydatestr = Ext.util.Format.date(myDate, 'Y-m');
|
|
|
field = basicForm.findField('ACCDATE');
|
|
|
field.setValue(mydatestr);
|
|
|
|
|
|
this.storeBodyList.removeAll(); //清空所有;
|
|
|
//
|
|
|
var CUSTOMERNAME = this.formHead.getForm().findField('CUSTOMERNAME').getValue();
|
|
|
if (CUSTOMERNAME != null) {
|
|
|
var s = "LINKID in (select gid from [info_client] where SHORTNAME='" + CUSTOMERNAME + "')";
|
|
|
this.storeInfoClientContact.load({ params: { condition: s} });
|
|
|
}
|
|
|
else {
|
|
|
this.formHead.getForm().findField('SHOWNAME').setValue('');
|
|
|
}
|
|
|
|
|
|
this.storeBodyListGoods.removeAll(); //清空所有;
|
|
|
|
|
|
|
|
|
// for (var j = 0; j < this.storeBodyListGoods.getCount(); j += 1) {
|
|
|
// var memberbody = this.storeBodyListGoods.getAt(j);
|
|
|
// memberbody.set("BSNO", '*');
|
|
|
// memberbody.commit();
|
|
|
// };
|
|
|
//
|
|
|
this.GetEditStatus();
|
|
|
|
|
|
if (Ext.getCmp('pnlmodSeaiAllFee')) {
|
|
|
var pnlfee = Ext.getCmp('pnlmodSeaiAllFee');
|
|
|
pnlfee.close();
|
|
|
this.tabSeaipanel.doLayout();
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
//#endregion
|
|
|
|
|
|
//#region 联动事件集
|
|
|
getBMDDATE: function () {
|
|
|
//Ext.getCmp('text2').setValue(Ext.getCmp('text1').getValue());
|
|
|
//this.formHead.getForm().findField('EMAIL').setValue('');
|
|
|
//this.formHead.getForm().findField('EMAIL').getValue();
|
|
|
var tbETD = this.formEdit.getForm().findField('ETD').getRawValue();
|
|
|
var tbFBP = this.formEdit.getForm().findField('FBP').getValue();
|
|
|
//
|
|
|
if (tbETD == "") {
|
|
|
return;
|
|
|
}
|
|
|
if (tbFBP == "" || tbFBP == "0" || tbFBP == "1") {
|
|
|
this.formEdit.getForm().findField('BMDDATE').setValue(tbETD);
|
|
|
return;
|
|
|
}
|
|
|
//
|
|
|
// var myDate = new Date(Date.parse(tbETD.toString()));
|
|
|
// myDate.setDate(myDate.getDate() + (parseInt(tbFBP) - 1));
|
|
|
// var lsDate = Ext.util.Format.date(myDate, 'Y-m-d');
|
|
|
// if (lsDate.indexOf("-00-") > -1) {
|
|
|
// lsDate = (myDate.getFullYear() - 1) + "-12-" + myDate.getDate();
|
|
|
// }
|
|
|
|
|
|
var lsDate = getNewDay(tbETD,(tbFBP-1));
|
|
|
this.formEdit.getForm().findField('BMDDATE').setValue(lsDate);
|
|
|
|
|
|
var sjLceDate = getNewDay(tbETD, 61);
|
|
|
this.formEdit.getForm().findField('SJLCEVALIDITY').setValue(sjLceDate);
|
|
|
|
|
|
},
|
|
|
|
|
|
getMDTDATE: function () {
|
|
|
var tbETD = this.formEdit.getForm().findField('ETD').getRawValue();
|
|
|
if (tbETD == "") {
|
|
|
return;
|
|
|
}
|
|
|
var lsDate = getNewDay(tbETD, 9);
|
|
|
this.formEdit.getForm().findField('MDTDATE').setValue(lsDate);
|
|
|
|
|
|
var sjLceDate = getNewDay(tbETD, 61);
|
|
|
this.formEdit.getForm().findField('SJLCEVALIDITY').setValue(sjLceDate);
|
|
|
},
|
|
|
|
|
|
getBMDDATE2: function (tbBMDDATE) {
|
|
|
if (tbBMDDATE == "") {
|
|
|
this.getBMDDATE();
|
|
|
}
|
|
|
},
|
|
|
|
|
|
getMDTDATE2: function (tbMDTDATE) {
|
|
|
if (tbMDTDATE == "") {
|
|
|
this.getMDTDATE();
|
|
|
}
|
|
|
},
|
|
|
//#endregion
|
|
|
|
|
|
//#region 保存报关
|
|
|
SaveBG: function (type) {
|
|
|
var basicForm = this.formEdit.getForm();
|
|
|
var basicForm2 = this.formHead.getForm();
|
|
|
if (!basicForm.isValid()) {
|
|
|
return;
|
|
|
}
|
|
|
if (!basicForm2.isValid()) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
this.formHead.getForm().findField('BSNO').setDisabled(false);
|
|
|
var data = this.formHead.getForm().getValues(false, false, false);
|
|
|
var data2 = this.formEdit.getForm().getValues(false, false, false);
|
|
|
var data3 = this.formBill.getForm().getValues(false, false, false);
|
|
|
this.formHead.getForm().findField('BSNO').setDisabled(true);
|
|
|
|
|
|
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu); //'正在生成数据, 请稍侯..'
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, //'正在生成数据...',
|
|
|
url: '/MvcShipping/MsOpSeai/SaveBG',
|
|
|
scope: this,
|
|
|
params: {
|
|
|
data: Ext.JSON.encode(data),
|
|
|
data2: Ext.JSON.encode(data2),
|
|
|
data3: Ext.JSON.encode(data3)
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
Ext.MessageBox.hide();
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });//'请重试', msg: Zi.LAN.FuWuQiXiangYingChuCuo
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}, //end save
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
//#region 场站查询
|
|
|
|
|
|
onGETCARRIERClick: function (button, event) {
|
|
|
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
|
|
|
var MBLNO = this.formHead.getForm().findField('MBLNO').getValue();
|
|
|
var CARRIER = this.formEdit.getForm().findField('CARRIER').getValue();
|
|
|
|
|
|
if (MBLNO == "" || CARRIER == "") {
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.TiDanHaoHeChuanGongSiBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//'提单号和场站不能为空!'
|
|
|
return;
|
|
|
|
|
|
} else {
|
|
|
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, //'正在提取数据...',
|
|
|
url: '/MvcShipping/MsOpSeae/GetYunDangUrl',
|
|
|
params: {
|
|
|
bs: BSNO,
|
|
|
mblno: MBLNO,
|
|
|
carrier: CARRIER
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
var boxitems = "";
|
|
|
Ext.Msg.hide();
|
|
|
DsOpenEditWin(jsonresult.Data, '');
|
|
|
}
|
|
|
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 其他函数
|
|
|
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.formBill.getForm().findField(member.data.FIELDNAME);
|
|
|
if (headfield != NaN && headfield != null)
|
|
|
headfield.setValue(member.data.DEFVALUE);
|
|
|
};
|
|
|
} else { }
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
this.GetEditStatus();
|
|
|
},
|
|
|
|
|
|
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) {
|
|
|
if (member.data.ISMUST == "1")
|
|
|
headfield.allowBlank = false;
|
|
|
if (member.data.ISCOLOR == "1")
|
|
|
headfield.setFieldStyle({ background: '#ffc' });
|
|
|
if (member.data.ISREADONLY == "1")
|
|
|
headfield.setReadOnly(true);
|
|
|
|
|
|
}
|
|
|
var headfield = this.formEdit.getForm().findField(member.data.FIELDNAME);
|
|
|
if (headfield != NaN && headfield != null) {
|
|
|
if (member.data.ISMUST == "1")
|
|
|
headfield.allowBlank = false;
|
|
|
if (member.data.ISCOLOR == "1")
|
|
|
headfield.setFieldStyle({ background: '#ffc' });
|
|
|
if (member.data.ISREADONLY == "1")
|
|
|
headfield.setReadOnly(true);
|
|
|
|
|
|
}
|
|
|
var headfield = this.formBill.getForm().findField(member.data.FIELDNAME);
|
|
|
if (headfield != NaN && headfield != null) {
|
|
|
if (member.data.ISMUST == "1")
|
|
|
headfield.allowBlank = false;
|
|
|
if (member.data.ISCOLOR == "1")
|
|
|
headfield.setFieldStyle({ background: '#ffc' });
|
|
|
if (member.data.ISREADONLY == "1")
|
|
|
headfield.setReadOnly(true);
|
|
|
|
|
|
}
|
|
|
var headfield = this.formMBL.getForm().findField(member.data.FIELDNAME);
|
|
|
if (headfield != NaN && headfield != null) {
|
|
|
if (member.data.ISMUST == "1")
|
|
|
headfield.allowBlank = false;
|
|
|
if (member.data.ISCOLOR == "1")
|
|
|
headfield.setFieldStyle({ background: '#ffc' });
|
|
|
if (member.data.ISREADONLY == "1")
|
|
|
headfield.setReadOnly(true);
|
|
|
|
|
|
}
|
|
|
};
|
|
|
} else { }
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
},
|
|
|
//#endregion
|
|
|
|
|
|
//#region 打印
|
|
|
Print: function () {
|
|
|
|
|
|
var basicForm = this.formHead.getForm();
|
|
|
var billNo = basicForm.findField('BSNO').value;
|
|
|
if (billNo == '*' || billNo == '') {
|
|
|
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: Zi.LAN.QingXianBaoCunYeWu, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); //'错误', '单据还没有保存,请保存后再打印'
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var printType = 'MSOPSEAI';
|
|
|
var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM OP_SEAI WHERE BSNO= '" + billNo + "'";
|
|
|
var sql2 = "";
|
|
|
var sql3 = "";
|
|
|
var sql4 = "";
|
|
|
var sql5 = "";
|
|
|
var sql6 = "";
|
|
|
|
|
|
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
|
|
|
|
|
|
},
|
|
|
//#endregion
|
|
|
|
|
|
//#region 上一票,下一票
|
|
|
|
|
|
PrevRecord: function () {
|
|
|
var j = this.StoreList.indexOf(this.editRecord);
|
|
|
if (j == 0) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.YiShiZuiQianYiPiao, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); //'警告', '已是最前一票'
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
var children = this.tabSeaipanel.items;
|
|
|
if (children) {
|
|
|
for (var i = children.length - 1, len = 0; i >= len; i--) {
|
|
|
if (children.items[i].id) {
|
|
|
if (children.items[i].id == 'pnlmodNewOpSeaiInfo' || children.items[i].id == 'pnlmodNewOpSeaiBill') {
|
|
|
// this.tabSeaepanel.setActiveTab(i);
|
|
|
} else {
|
|
|
children.items[i].close();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
this.tabSeaipanel.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: Zi.LAN.JingGao, msg: Zi.LAN.YiShiZuiHouYiPiao, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); //'警告', '已是最后一票'
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
var children = this.tabSeaipanel.items;
|
|
|
if (children) {
|
|
|
for (var i = children.length - 1, len = 0; i >= len; i--) {
|
|
|
if (children.items[i].id) {
|
|
|
if (children.items[i].id == 'pnlmodNewOpSeaiInfo' || children.items[i].id == 'pnlmodNewOpSeaiBill') {
|
|
|
//this.tabSeaepanel.setActiveTab(i);
|
|
|
} else {
|
|
|
children.items[i].close();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
this.tabSeaipanel.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);
|
|
|
},
|
|
|
//#endregion
|
|
|
|
|
|
//#region 其他舱单信息
|
|
|
LoadInit: function (data) {
|
|
|
var CUSTOMERNAME = this.formHead.getForm().findField('CUSTOMERNAME').getValue();
|
|
|
|
|
|
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.formBill.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.formBill.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.formBill.getForm().findField('NOTIFYPARTYID').setValue(data.NOTIFYPARTYID);
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
if (data.CUSTOMERNAME != '') {
|
|
|
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
|
|
|
GId: NewGuid(),
|
|
|
CustCode: data.CUSTOMERNAME,
|
|
|
CustName: data.CUSTOMERNAME,
|
|
|
CodeAndName: data.CUSTOMERNAME
|
|
|
});
|
|
|
|
|
|
this.storeCustCode.add(recordCustCode);
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
getIsModify: function () {
|
|
|
|
|
|
var feepanel = Ext.getCmp('pnlmodSeaiAllFee');
|
|
|
|
|
|
if (feepanel != NaN && feepanel != null) {
|
|
|
var feemodify = feepanel.panelFee.getModifyStatus();
|
|
|
if (feemodify) {
|
|
|
return '费用信息';
|
|
|
}
|
|
|
}
|
|
|
var feeamendpanel = Ext.getCmp('pnlmodSeaiAmendFee');
|
|
|
|
|
|
if (feeamendpanel != NaN && feeamendpanel != null) {
|
|
|
var feemodify = feeamendpanel.panelFee.getModifyStatus();
|
|
|
if (feemodify) {
|
|
|
return '更改单信息';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (this.formHead.getForm().isDirty() == true || this.formEdit.getForm().isDirty() == true || this.formBill.getForm().isDirty() == true) {
|
|
|
return '业务信息';
|
|
|
}
|
|
|
else return '';
|
|
|
},
|
|
|
|
|
|
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.formBill.getForm().findField('GROSSWEIGHT').setValue(KGS + 'KGS');
|
|
|
}
|
|
|
if (e.field == 'CBM') {
|
|
|
var CBM = this.formEdit.getForm().findField('CBM').getValue();
|
|
|
this.formBill.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.formBill.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.formBill.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();
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
}else if (e.field == 'FREECTNDAY'||e.field == 'CTNDAY'||e.field == 'CTNPRICE') {
|
|
|
var FREECTNDAY = e.record.data['FREECTNDAY'];
|
|
|
var CTNDAY = e.record.data['CTNDAY'];
|
|
|
var CTNPRICE = e.record.data['CTNPRICE'];
|
|
|
var DAY = Add(CTNDAY,-FREECTNDAY);
|
|
|
if (DAY<0){
|
|
|
e.record.set('CTNFEE',0);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
var CTNFEE = Mul(CTNPRICE, DAY);
|
|
|
e.record.set('CTNFEE', CTNFEE);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
},
|
|
|
setAllTotal: function () {
|
|
|
this.setPKGSTotal();
|
|
|
this.setKGSTotal();
|
|
|
this.setCBMTotal();
|
|
|
},
|
|
|
setPKGSTotal: function () {
|
|
|
var total = this.calcDetailTotal('PKGS',0);
|
|
|
this.setHeadFieldValue('PKGS', total);
|
|
|
},
|
|
|
setKGSTotal: function () {
|
|
|
var total = this.calcDetailTotal('KGS',4);
|
|
|
this.setHeadFieldValue('KGS', total);
|
|
|
},
|
|
|
setCBMTotal: function () {
|
|
|
var total = this.calcDetailTotal('CBM',4);
|
|
|
this.setHeadFieldValue('CBM', total);
|
|
|
},
|
|
|
|
|
|
calcDetailTotal: function (fieldName,length) {
|
|
|
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,length);
|
|
|
}
|
|
|
|
|
|
return total;
|
|
|
},
|
|
|
setHeadFieldValue: function (fieldName, value) {
|
|
|
var field = this.formEdit.getForm().findField(fieldName);
|
|
|
field.setValue(value);
|
|
|
},
|
|
|
|
|
|
onaddyarddataClick: function () {
|
|
|
|
|
|
var BSSTATUS = this.formHead.getForm().findField('BSSTATUSREF').getValue();
|
|
|
if (BSSTATUS == '锁定') {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.YeWuYiSuoDingBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });//'业务已锁定,不允许操作!'
|
|
|
return;
|
|
|
}
|
|
|
Ext.Ajax.timeout = 6000000;
|
|
|
|
|
|
|
|
|
var MBLNO = this.formHead.getForm().findField('MBLNO').getValue();
|
|
|
if (MBLNO == '' || MBLNO == NaN || MBLNO == null) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.TiDanHaoBuNengWeiKong, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });//'主提单号不能为空!'
|
|
|
return;
|
|
|
}
|
|
|
var sKINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue();
|
|
|
var VESSEL = '';
|
|
|
var VOYNO = '';
|
|
|
var ETA = '';
|
|
|
|
|
|
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
|
|
|
Ext.Msg.wait('正在提取数据, 请稍侯..');
|
|
|
Ext.Ajax.request({
|
|
|
url: '/MvcShipping/MsOpSeae/GetyardctnList',
|
|
|
cors: true,
|
|
|
params: {
|
|
|
bsno:BSNO,
|
|
|
mblno: MBLNO,//查询类别:"ZTDH":主提单号;"FTDH":分提单号
|
|
|
yard: "YGT",//单票查询类型:"JK":进口;"CK":出口;"ZZ":中转
|
|
|
value: MBLNO,//值
|
|
|
jck:"jk"
|
|
|
},
|
|
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
|
method: 'post',
|
|
|
success: function (response) {
|
|
|
var resultData = eval('(' + response.responseText + ')');//JSON字符串=>JSON对象
|
|
|
if (resultData.Success) {
|
|
|
var result = eval('(' + resultData.data + ')');
|
|
|
var mtxxList = result.res[0].data;
|
|
|
if (mtxxList != null && mtxxList.length > 0) {
|
|
|
var member1 = mtxxList[0];
|
|
|
//var strETD = (member1.SJRGSJ1).substring(0, 10);
|
|
|
//_this.formEdit.getForm().findField('ETD').setValue(strETD);
|
|
|
for (var i = 0; i < mtxxList.length; i++) {
|
|
|
var member = mtxxList[i];
|
|
|
|
|
|
|
|
|
var selectrecords = DsStoreQueryBy(_this.storeBodyList, 'CNTRNO', member.XH);
|
|
|
if (selectrecords.length > 0) {
|
|
|
|
|
|
} else {
|
|
|
var newSerialno = _this.DsGetNewNo(_this.storeBodyList);
|
|
|
_this.serialNo = newSerialno;
|
|
|
var record = Ext.create('MsOpSeaiDetail', {
|
|
|
CTN_ID: '*',
|
|
|
CTNCODE: newSerialno,
|
|
|
CTNALL: member.CC + member.XX,
|
|
|
CTNNUM: 1,
|
|
|
CNTRNO: member.XH,
|
|
|
SEALNO: member.QFH1,
|
|
|
TRUCKNO: member.CGMX,
|
|
|
PKGS: 0,
|
|
|
KINDPKGS: sKINDPKGS,
|
|
|
KGS: 0,
|
|
|
TAREWEIGHT: 0,
|
|
|
CBM: 0,
|
|
|
REMARK: '',
|
|
|
MTMC: member.MTMC,
|
|
|
SJRGSJ: member.SJRGSJ,
|
|
|
SJCGSJ: member.SJCGSJ,
|
|
|
ISWMS: '0',
|
|
|
WMSDATE: ''
|
|
|
});
|
|
|
|
|
|
_this.storeBodyList.add(record);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
VESSEL = member.JKYWCM;
|
|
|
VOYNO = member.JKHC;
|
|
|
ETA=member.SJRGSJ;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var yscdList = result.res[1].data;
|
|
|
if (yscdList != null && yscdList.length > 0) {
|
|
|
for (var i = 0; i < yscdList.length; i++) {
|
|
|
var member = yscdList[i];
|
|
|
for (var j = 0; j < _this.storeBodyList.getCount(); j += 1) {
|
|
|
var memberdata = _this.storeBodyList.getAt(j);
|
|
|
if (memberdata.data.CNTRNO == member.CONTAINER_NO) {
|
|
|
memberdata.data.PKGS = member.CARGO_QUANTITY;
|
|
|
memberdata.data.KGS = member.TOTAL_GROSS_WEIGHT;
|
|
|
memberdata.data.CBM = member.TOTAL_VOLUMN;
|
|
|
memberdata.commit();
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var bgdfxList = result.res[7].data;
|
|
|
if (bgdfxList != null && bgdfxList.length > 0) {
|
|
|
var member = bgdfxList[0];
|
|
|
_this.formEdit.getForm().findField('CUSTOMNO').setValue(member.ENTRY_ID);
|
|
|
}
|
|
|
Ext.MessageBox.confirm(Zi.LAN.TiShi,'是否覆盖船名、航次及到港日期?', function (btn) {//'已经录入船名航次,是否要覆盖?'
|
|
|
if (btn == 'yes') {
|
|
|
this.formEdit.getForm().findField('VESSEL').setValue(VESSEL);
|
|
|
this.formEdit.getForm().findField('VOYNO').setValue(VOYNO);
|
|
|
this.formEdit.getForm().findField('ETD').setValue(ETA);
|
|
|
|
|
|
};
|
|
|
}, this);
|
|
|
|
|
|
|
|
|
Ext.Msg.hide();
|
|
|
// _this.setAllTotal();
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: resultData.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
onaddexceldataClick: function () {
|
|
|
|
|
|
var goodsName = this.formEdit.getForm().findField('GOODSNAME').getValue();
|
|
|
var storageName = this.formEdit.getForm().findField('STORAGENAME').getValue();
|
|
|
var chargeUnit = this.formEdit.getForm().findField('UNITOFWEIGHT').getValue();
|
|
|
if (storageName == '' || goodsName == '' || chargeUnit == '' || chargeUnit == null || storageName == null || goodsName == null) {
|
|
|
Ext.Msg.show({
|
|
|
title: '失败',
|
|
|
msg: '请检查品名和仓库,计费单位是否为空' ,
|
|
|
icon: Ext.Msg.NO,
|
|
|
buttons: Ext.Msg.OK
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var ctnrdatas = [];
|
|
|
var iCount = this.storeBodyList.getCount();
|
|
|
for (var i = 1; i <= iCount; i++) {
|
|
|
var member = this.storeBodyList.getAt(i - 1);
|
|
|
if (member.data.ISWMS == 'True') {
|
|
|
Ext.Msg.show({
|
|
|
title: '提示',
|
|
|
msg: '存在箱号已经入库,不允许此方式入库',
|
|
|
icon: Ext.Msg.NO,
|
|
|
buttons: Ext.Msg.OK
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
var sn = i.toString();
|
|
|
var al = iCount.toString().length;
|
|
|
var bl = i.toString().length;
|
|
|
if (iCount.toString().length > i.toString().length) {
|
|
|
for (var j = 0; j < (iCount.toString().length - i.toString().length); j++) {
|
|
|
sn = "0" + i.toString().toString();
|
|
|
}
|
|
|
}
|
|
|
member.data.CTNCODE = sn;
|
|
|
ctnrdatas.push(member);
|
|
|
}
|
|
|
var Cargoinforecords = DsStoreQueryBy(this.storeCodeGoodsList, 'GOODNAME', goodsName);
|
|
|
if (Cargoinforecords.getCount() > 0) {
|
|
|
var Cargoinfodata = Cargoinforecords.getAt(0).data;
|
|
|
|
|
|
this.formEdit.getForm().findField('GOODSNAMEID').setValue(Cargoinfodata.GID);
|
|
|
}
|
|
|
|
|
|
var _this = this;
|
|
|
var data = this.formHead.getForm().getValues(false, false, false);
|
|
|
var data2 = this.formEdit.getForm().getValues(false, false, false);
|
|
|
var data3 = this.formBill.getForm().getValues(false, false, false);
|
|
|
|
|
|
|
|
|
|
|
|
var imgform = new Ext.FormPanel({
|
|
|
region: 'center',
|
|
|
labelWidth: 20,
|
|
|
frame: true,
|
|
|
autoScroll: false,
|
|
|
border: false,
|
|
|
fileUpload: true,
|
|
|
items: [{
|
|
|
xtype: 'fileuploadfield',
|
|
|
id: 'LoadExcel',
|
|
|
name: 'LoadExcel',
|
|
|
emptyText: Zi.LAN.LoadExcel, //'请选择EXCEL文件',
|
|
|
fieldLabel: Zi.LAN.EXCEL, //'EXCEL',
|
|
|
buttonText: Zi.LAN.LoadExcel2, //'选择文件',
|
|
|
allowBlank: false,
|
|
|
width: 200,
|
|
|
buttonCfg:
|
|
|
{
|
|
|
iconCls: 'uploaddialog'
|
|
|
},
|
|
|
anchor: '98%'
|
|
|
}],
|
|
|
buttons: [{
|
|
|
text: Zi.LAN.submit, //'上传',
|
|
|
type: 'submit',
|
|
|
handler: function () {
|
|
|
|
|
|
|
|
|
var UserFilePath = Ext.getCmp('LoadExcel').getValue();
|
|
|
if (!CheckFileExt(UserFilePath, /.xls|.xlsx/i)) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: Zi.LAN.QingQueRenNiShangChuanDeWenJianWeiEXCELWenJian, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //'请确认你上传的文件为EXCEL文件!'
|
|
|
return;
|
|
|
}
|
|
|
if (!imgform.form.isValid()) { return; }
|
|
|
imgform.form.submit({
|
|
|
url: '/MvcShipping/MsOpSeai/ImportExcel',
|
|
|
waitMsg: Zi.LAN.ZhengZaiGengXinShuJu,
|
|
|
method: 'POST',
|
|
|
params: {
|
|
|
CtnrData: ConvertRecordsToJsonAll(ctnrdatas),
|
|
|
data: Ext.JSON.encode(data),
|
|
|
data2: Ext.JSON.encode(data2),
|
|
|
data3: Ext.JSON.encode(data3),
|
|
|
},
|
|
|
success: function (form, action) {
|
|
|
|
|
|
win.close(this);
|
|
|
var result = action.result;
|
|
|
if (result.success) {
|
|
|
|
|
|
condition = "BSNO='" + _this.editRecord.get('BSNO') + "'";
|
|
|
_this.LoadData('edit', condition);
|
|
|
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
|
|
|
} else {
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
failure: function (form, action) {
|
|
|
form.reset();
|
|
|
if (action.failureType == Ext.form.Action.SERVER_INVALID)
|
|
|
Ext.MessageBox.alert(Zi.LAN.JingGao, action.result.Message);
|
|
|
}
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
}, {
|
|
|
text: Zi.LAN.GuanBi, //'关闭',
|
|
|
type: 'submit',
|
|
|
handler: function () {
|
|
|
win.close(this);
|
|
|
}
|
|
|
}]
|
|
|
|
|
|
});
|
|
|
|
|
|
var win = new Ext.Window({
|
|
|
title: Zi.LAN.ShangChuanEXCEL, //"上传EXCEL",
|
|
|
width: 380,
|
|
|
height: 120,
|
|
|
modal: true,
|
|
|
resizable: false,
|
|
|
border: false,
|
|
|
items: imgform
|
|
|
|
|
|
});
|
|
|
win.show();
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onaddwmsClick: function () {
|
|
|
|
|
|
var goodsName = this.formEdit.getForm().findField('GOODSNAME').getValue();
|
|
|
var storageName = this.formEdit.getForm().findField('STORAGENAME').getValue();
|
|
|
var chargeUnit = this.formEdit.getForm().findField('UNITOFWEIGHT').getValue();
|
|
|
if (storageName == '' || goodsName == '' || chargeUnit == '' || chargeUnit == null|| storageName == null || goodsName == null) {
|
|
|
Ext.Msg.show({
|
|
|
title: '失败',
|
|
|
msg: '请检查品名和仓库计费单位是否为空',
|
|
|
icon: Ext.Msg.NO,
|
|
|
buttons: Ext.Msg.OK
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var ctnrdatas = [];
|
|
|
var selectedRecords = this.gridList.getSelectionModel().getSelection();
|
|
|
var iCount = selectedRecords.length;
|
|
|
if (iCount == 0) {
|
|
|
Ext.Msg.show({
|
|
|
title: '提示',
|
|
|
msg: '没有选择提单箱',
|
|
|
icon: Ext.Msg.NO,
|
|
|
buttons: Ext.Msg.OK
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
for (var i = 1; i <= iCount; i++) {
|
|
|
var member = selectedRecords[i-1];
|
|
|
if (member.data.ISWMS == 'True') {
|
|
|
Ext.Msg.show({
|
|
|
title: '提示',
|
|
|
msg: '存在箱号已经入库,不允许此方式入库',
|
|
|
icon: Ext.Msg.NO,
|
|
|
buttons: Ext.Msg.OK
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
var sn = i.toString();
|
|
|
var al = iCount.toString().length;
|
|
|
var bl = i.toString().length;
|
|
|
if (iCount.toString().length > i.toString().length) {
|
|
|
for (var j = 0; j < (iCount.toString().length - i.toString().length); j++) {
|
|
|
sn = "0" + i.toString().toString();
|
|
|
}
|
|
|
}
|
|
|
member.data.CTNCODE = sn;
|
|
|
member.data.ISWMS = '0';
|
|
|
ctnrdatas.push(member);
|
|
|
}
|
|
|
var Cargoinforecords = DsStoreQueryBy(this.storeCodeGoodsList, 'GOODNAME', goodsName);
|
|
|
if (Cargoinforecords.getCount() > 0) {
|
|
|
var Cargoinfodata = Cargoinforecords.getAt(0).data;
|
|
|
|
|
|
this.formEdit.getForm().findField('GOODSNAMEID').setValue(Cargoinfodata.GID);
|
|
|
}
|
|
|
|
|
|
var data = this.formHead.getForm().getValues(false, false, false);
|
|
|
var data2 = this.formEdit.getForm().getValues(false, false, false);
|
|
|
var data3 = this.formBill.getForm().getValues(false, false, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoWMS); //'正在生成入库数据'
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiCaoZuoWMS, //'正在生成入库数据',
|
|
|
url: '/MvcShipping/MsOpSeai/SaveCtrnToWMS',
|
|
|
scope: this,
|
|
|
params: {
|
|
|
CtnrData: ConvertRecordsToJsonAll(ctnrdatas),
|
|
|
data: Ext.JSON.encode(data),
|
|
|
data2: Ext.JSON.encode(data2),
|
|
|
data3: Ext.JSON.encode(data3)
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
Ext.MessageBox.hide();
|
|
|
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
var condition = "BSNO='" + data.BSNO + "'";
|
|
|
this.storeBodyList.load({ params: { condition: condition } });
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });//'请重试', msg: Zi.LAN.FuWuQiXiangYingChuCuo
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
onCtrnRefreshClick: function () {
|
|
|
var bsno = this.formHead.getForm().findField('BSNO').getValue();
|
|
|
var condition = "BSNO='" + bsno + "'";
|
|
|
this.storeBodyList.load({ params: { condition: condition } });
|
|
|
|
|
|
},
|
|
|
FixData:function(data) { //文件流转BinaryString
|
|
|
var o = "",
|
|
|
l = 0,
|
|
|
w = 10240;
|
|
|
for(; l<data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)));
|
|
|
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)));
|
|
|
return o;
|
|
|
},
|
|
|
onUpDetailTruckClick: function () {
|
|
|
var TRUCKER = this.formEdit.getForm().findField('TRUCKER').getValue();
|
|
|
|
|
|
for (i = 0; i < this.storeBodyList.getCount(); i += 1) {
|
|
|
var memberyf = this.storeBodyList.getAt(i);
|
|
|
memberyf.set("TRUCKER", TRUCKER);
|
|
|
// memberyf.commit();
|
|
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
onUpDetailClick: 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('MsOpSeaiDetail', {
|
|
|
CTN_ID: '*',
|
|
|
BSNO: '*',
|
|
|
CTNCODE: newSerialno,
|
|
|
CTNALL: memberbody.data.CTN,
|
|
|
CTNNUM: 0,
|
|
|
CNTRNO: '',
|
|
|
SEALNO: '',
|
|
|
PKGS: Div(pkgs, ctnnum),
|
|
|
KINDPKGS: kingpkgs,
|
|
|
KGS: Div(kgs, ctnnum),
|
|
|
TAREWEIGHT: 0,
|
|
|
CBM: Div(cbm, ctnnum),
|
|
|
REMARK: '',
|
|
|
ISWMS: '0',
|
|
|
WMSDATE: ''
|
|
|
});
|
|
|
this.storeBodyList.add(record);
|
|
|
var _c = this.storeBodyList.getCount() - 1;
|
|
|
var _d = this.storeBodyList.getAt(_c);
|
|
|
_d.set('CTNNUM', 1);
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
var n = this.storeBodyList.getCount();
|
|
|
this.gridListCellEditing.startEditByPosition({ row: n - 1, column: 2 });
|
|
|
}
|
|
|
//#endregion
|
|
|
});
|
|
|
|
|
|
|