Ext . namespace ( 'Shipping' ) ;
Shipping . MsSeaeOrderEdit = function ( config ) {
Ext . applyIf ( this , config ) ;
this . initUIComponents ( ) ;
window . Shipping . MsSeaeOrderEdit . superclass . constructor . call ( this ) ;
} ;
Ext . extend ( Shipping . MsSeaeOrderEdit , Ext . Panel , {
ParentWin : null ,
OpStatus : 'add' ,
StoreList : null ,
EditRecord : null ,
Editdata : null ,
isAudit : null ,
accdate : null ,
seaeop : "" ,
seaecustservice : "" ,
FORWARDER : "" ,
reason : "" ,
formTitle : "" ,
AUDITDATA : { } ,
AUDITDATA2 : { } ,
AUDITDATA3 : { } ,
AuditDuino : "" ,
copyfee : false ,
mainWin : { } ,
initUIComponents : function ( ) {
this . serialNo = 0 ;
//this.bodyDel = [];
this . itemindex = 1 ;
_thissaleorder = this ;
this . issubmit = true ;
this . SALEORDERDEPTBYOP = 0 ;
this . SaleOrderAuditSelf = 0 ;
this . ISMUSTBECNTR = '0' ;
parentWin = window . parent . opener ;
this . mainWin = getMainForm ( parentWin ) ;
//#region 信息加载
this . storeDefValue = Ext . create ( 'Ext.data.Store' , {
model : 'DsShipping.ux.OpDefValue' ,
remoteSort : true ,
proxy : {
type : 'ajax' ,
url : '/MvcShipping/MsCodeOpDef/GetDataList' ,
reader : {
id : 'GID' ,
root : 'data' ,
totalProperty : 'totalCount'
}
}
} ) ;
this . storeMustBe = Ext . create ( 'Ext.data.Store' , {
model : 'DsShipping.ux.OpDefValue' ,
remoteSort : true ,
proxy : {
type : 'ajax' ,
url : '/MvcShipping/MsCodeOpMustField/GetDataList' ,
reader : {
id : 'GID' ,
root : 'data' ,
totalProperty : 'totalCount'
}
}
} ) ;
//权限范围
this . StoreOpRange = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'MsOP' ,
proxy : { url : '/MvcShipping/MsBaseInfo/GetOpRang' }
} ) ;
this . StoreOpRange . load ( { params : { optype : "modSeaeOrderList" } } ) ;
//人员信息加载
this . storeSERVICECode = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.UserRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetUserRefList' }
} ) ;
this . storeSERVICECode . load ( ) ;
//客服
this . comboxCUSTSERVICE = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '客服' ,
store : this . storeSERVICECode ,
forceSelection : true ,
name : 'CUSTSERVICE' ,
valueField : 'UserName' ,
displayField : 'CodeAndName'
} ) ;
//揽货人
this . storeSaleCode = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.UserRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetUserRefList' }
} ) ;
this . storeSaleCode . load ( ) ;
this . comboxSALE = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '揽货人' ,
store : this . storeSaleCode ,
forceSelection : true ,
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.PubStore_CustomerAll = Ext.create('DsExt.ux.RefTableStore', {
// model: 'DsShipping.ux.CustomRefModel',
// proxy: { url: '/CommMng/BasicDataRef/GetCustomSimpleList' }
//});
//this.PubStore_CustomerAll.loadData(this.mainWin.GetPubStore("PubStore_CustomerAll").data.items);
//所属部门
this . storeDept = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.DeptModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetDeptList' }
} ) ;
this . storeDept . load ( ) ;
this . comboxDept = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '所属部门' , //'所属部门',
store : this . storeDept ,
// flex: 0.5,
forceSelection : true ,
name : 'SALEDEPT' ,
value : DEPTNAME ,
valueField : 'DeptName' ,
displayField : 'DeptName'
//,hidden: true
} ) ;
//操 作
this . storeOpCode = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.UserRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetUserRefList' }
} ) ;
this . storeOpCode . load ( ) ;
this . comboxOP = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '操 作' ,
store : this . storeOpCode ,
forceSelection : true ,
name : 'OP' ,
valueField : 'UserName' ,
displayField : 'CodeAndName' ,
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 ) ;
var Audit2 = this . formHead . getForm ( ) . findField ( 'AUDITOPERATOR2' ) . getValue ( ) ;
//if (!Audit2 || Audit2 == "" || Audit2==combo.originalValue) {
this . formHead . getForm ( ) . findField ( 'AUDITOPERATOR2' ) . setValue ( combo . value ) ;
//}
}
}
}
} ) ;
//单证
this . storeDocCode = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.UserRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetUserRefList' }
} ) ;
this . storeDocCode . load ( ) ;
this . comboxDOC = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '单证' ,
store : this . storeDocCode ,
forceSelection : true ,
name : 'DOC' ,
valueField : 'UserName' ,
displayField : 'CodeAndName'
} ) ;
this . comboxAUDITOPERATOR2 = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '确认接单' ,
store : this . storeAUDITOPERATOR2 ,
forceSelection : true ,
name : 'AUDITOPERATOR2' ,
valueField : 'UserName' ,
displayField : 'CodeAndName'
} ) ;
//单证
this . storeFRCUSTSERVICECode = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.UserRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetUserRefList' }
} ) ;
this . storeFRCUSTSERVICECode . load ( ) ;
this . comboxFRCUSTSERVICE = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '海外客服' ,
store : this . storeFRCUSTSERVICECode ,
forceSelection : true ,
name : 'FRCUSTSERVICE' ,
valueField : 'UserName' ,
displayField : 'CodeAndName'
} ) ;
this . storeAuditCode = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.UserRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetUserActionRefListRm' }
} ) ;
this . storeAuditCode . on ( 'beforeload' , function ( store ) {
Ext . apply ( store . proxy . extraParams , { MODULENAME : 'modSaleOrderAudit' } ) ;
} , this ) ;
this . storeAuditCode . load ( ) ;
this . comboxAUDITOPERATOR = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '审核人' ,
store : this . storeAuditCode ,
forceSelection : true ,
name : 'AUDITOPERATOR' ,
valueField : 'UserName' ,
displayField : 'CodeAndName'
} ) ;
//客户加载_委托单位
this . storeCustCode = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CustomRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCustomRefListController' }
} ) ;
this . storeCustCode _fen = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CustomRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCustomRefListController' }
} ) ;
// this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
//委托单位
this . comboxCustCode = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '下单客户' ,
store : this . storeCustCode ,
queryMode : 'remote' ,
forceSelection : true ,
minChars : 1 ,
queryParam : 'CODENAME' ,
name : 'CUSTOMERNAME' ,
valueField : 'CustName' ,
displayField : 'CodeAndName' ,
allowBlank : false ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var data = combo . value ;
if ( this . formBill . getForm ( ) . findField ( 'SHIPPER' ) . getValue ( ) == '' ) {
this . storeShipper . load ( {
params : { condition : " shippertype=2 " } //AND (CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + combo.value + "') )
,
callback : function ( r , options , success ) {
if ( success ) {
if ( this . storeShipper . getCount ( ) > 0 ) {
for ( var i = 0 ; i < this . storeShipper . length ; i += 1 ) {
var member = this . storeShipper [ i ] . data ;
if ( member . SHORTNAME == combo . value ) {
this . formBill . getForm ( ) . findField ( 'SHIPPERID' ) . setValue ( member . SHORTNAME ) ;
this . formBill . getForm ( ) . findField ( 'SHIPPER' ) . setValue ( member . SHIPPERDETAIL ) ;
}
}
} else {
this . formBill . getForm ( ) . findField ( 'SHIPPERID' ) . setValue ( '' ) ;
this . formBill . getForm ( ) . findField ( 'SHIPPER' ) . setValue ( '' ) ;
}
}
}
,
scope : this
} ) ;
}
this . formHead . getForm ( ) . findField ( 'SALE' ) . setValue ( records [ 0 ] . data . SALE ) ;
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 + "') )" } } ) ;
var s = " (ISOPERATOR=1 or ISSALEMAN=1) and LINKID in (select gid from [info_client] where SHORTNAME='" + combo . value + "')" ;
this . storeInfoClientContact . load ( {
params : { condition : s } ,
callback : function ( r , options , success ) {
if ( success ) {
if ( this . storeInfoClientContact . getCount ( ) > 0 ) {
var member = this . storeInfoClientContact . getAt ( 0 ) ;
this . formHead . getForm ( ) . findField ( 'OPERATOR' ) . setValue ( member . data . SHOWNAME ) ;
this . formHead . getForm ( ) . findField ( 'OPERATORTEL' ) . setValue ( member . data . TEL ) ;
this . formHead . getForm ( ) . findField ( 'OPERATOREMAIL' ) . setValue ( member . data . EMAIL ) ;
} else {
this . formHead . getForm ( ) . findField ( 'OPERATOR' ) . setValue ( '' ) ;
this . formHead . getForm ( ) . findField ( 'OPERATORTEL' ) . setValue ( '' ) ;
this . formHead . getForm ( ) . findField ( 'OPERATOREMAIL' ) . setValue ( '' ) ;
}
}
} ,
scope : this
} ) ;
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 ( '' ) ;
}
}
}
}
}
} ) ;
this . comboxCustCode _Fen = Ext . create ( 'DsExt.ux.RefTableCombox' , {
store : this . storeCustCode _fen ,
queryMode : 'remote' ,
forceSelection : true ,
minChars : 1 ,
queryParam : 'CODENAME' ,
name : 'CUSTOMERNAME' ,
valueField : 'CustName' ,
displayField : 'CodeAndName' ,
allowBlank : false ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
}
}
} ) ;
this . storeISEI = GetPublicStore ( 'ISEI' ) ;
this . comboxISEI = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : Zi . LAN . ISEI , //'委托分公司',
store : this . storeISEI ,
forceSelection : true ,
flex : 1 ,
name : 'ISEI' ,
valueField : 'GVALUE' ,
displayField : 'GVALUE' ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshClick ( ) ;
}
}
}
} ) ;
this . storeInfoClientContact = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.InfoClientContactModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetInfoClientContactList' }
} ) ;
this . comboxInfoClientContact = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '联系人' ,
store : this . storeInfoClientContact ,
name : 'OPERATOR' ,
valueField : 'SHOWNAME' ,
displayField : 'SHOWNAME' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
this . formHead . getForm ( ) . findField ( 'OPERATORTEL' ) . setValue ( records [ 0 ] . data . TEL ) ;
this . formHead . getForm ( ) . findField ( 'OPERATOREMAIL' ) . setValue ( records [ 0 ] . data . EMAIL ) ;
}
}
}
} ) ;
this . comboxInfoClientContact2 = Ext . create ( 'DsExt.ux.RefTableCombox' , {
//fieldLabel: '联系人',
store : this . storeInfoClientContact ,
name : 'OPERATOR' ,
valueField : 'SHOWNAME' ,
displayField : 'SHOWNAME' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
//if (records.length > 0) {
// this.formHead.getForm().findField('OPERATORTEL').setValue(records[0].data.TEL);
// this.formHead.getForm().findField('OPERATOREMAIL').setValue(records[0].data.EMAIL);
//}
}
}
} ) ;
//客户加载_船公司
this . storeCARRIER = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CustomRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCustomRefListCARRIER' }
} ) ;
// this.storeCARRIER.load({ params: { condition: "ISCARRIER='1'"} });
//船公司
this . comboxCARRIER = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '船公司' ,
store : this . storeCARRIER ,
matchFieldWidth : false ,
queryMode : 'remote' ,
forceSelection : true ,
minChars : 1 ,
queryParam : 'CODENAME' ,
name : 'CARRIER' ,
valueField : 'CustName' ,
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var FORWARDER = this . formEdit . getForm ( ) . findField ( 'FORWARDER' ) ;
let _this = this ;
var currFORWARDER = FORWARDER . getValue ( ) ;
if ( ! currFORWARDER || currFORWARDER == "" ) {
var forward = this . storeFORWARDER . findRecord ( 'CustName' , combo . value ) ;
if ( forward ) {
_this . formEdit . getForm ( ) . findField ( 'FORWARDER' ) . setValue ( combo . value ) ;
}
//this.storeFORWARDER.load({
// params: { condition: "ISBOOKING='1'" },
// callback: function (r, options, success) {
// if (success) {
// _this.formEdit.getForm().findField('FORWARDER').setValue(combo.value);
// }
// },
//});
}
//var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')";
//this.storeInfoClientContactCARRIER.load({ params: { condition: s },
// callback: function (r, options, success) {
// if (success) {
// if (this.storeInfoClientContactCARRIER.getCount() > 0) {
// var member = this.storeInfoClientContactCARRIER.getAt(0);
// this.formHead.getForm().findField('CARRIERATTN').setValue(member.data.SHOWNAME);
// this.formHead.getForm().findField('CARRIERTEL').setValue(member.data.TEL);
// this.formHead.getForm().findField('CARRIEREMAIL').setValue(member.data.EMAIL);
// } else {
// this.formHead.getForm().findField('CARRIERATTN').setValue('');
// this.formHead.getForm().findField('CARRIERTEL').setValue('');
// this.formHead.getForm().findField('CARRIEREMAIL').setValue('');
// }
// }
// },
// scope: this
//});
//载入航线
this . LoadLane ( combo . value ) ;
}
}
}
} ) ;
//航线
this . storeLANE = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.Lane' ,
proxy : { url : '/CommMng/BasicDataRef/GetCodeLaneList' }
} ) ;
//this.storeLANE.load();
this . comboxLANE = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '航线' ,
store : this . storeLANE ,
// forceSelection: true,
name : 'LANE' ,
valueField : 'LANE' ,
displayField : 'LANE' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
//combo.value
//var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')";
//this.storeInfoClientContactCARRIER.load({ params: { condition: s },
// callback: function (r, options, success) {
// if (success) {
// if (this.storeInfoClientContactCARRIER.getCount() > 0) {
// var member = this.storeInfoClientContactCARRIER.getAt(0);
// this.formHead.getForm().findField('CARRIERATTN').setValue(member.data.SHOWNAME);
// this.formHead.getForm().findField('CARRIERTEL').setValue(member.data.TEL);
// this.formHead.getForm().findField('CARRIEREMAIL').setValue(member.data.EMAIL);
// } else {
// this.formHead.getForm().findField('CARRIERATTN').setValue('');
// this.formHead.getForm().findField('CARRIERTEL').setValue('');
// this.formHead.getForm().findField('CARRIEREMAIL').setValue('');
// }
// }
// },
// scope: this
//});
//载入港口
this . LoadPort ( combo . value ) ;
}
}
}
} ) ;
this . storeInfoClientContactCARRIER = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.InfoClientContactModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetInfoClientContactList' }
} ) ;
this . comboxInfoClientContactCARRIER = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '联系人' ,
store : this . storeInfoClientContactCARRIER ,
name : 'CARRIERATTN' ,
valueField : 'SHOWNAME' ,
displayField : 'SHOWNAME' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
this . formHead . getForm ( ) . findField ( 'CARRIERTEL' ) . setValue ( records [ 0 ] . data . TEL ) ;
this . formHead . getForm ( ) . findField ( 'CARRIEREMAIL' ) . setValue ( records [ 0 ] . data . EMAIL ) ;
}
}
}
} ) ;
//客户加载_订舱代理
this . storeFORWARDER = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CustomRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCustomRefListFORWARDER' }
} ) ;
// this.storeFORWARDER.load({ params: { condition: "ISBOOKING='1'"} });
this . storeFORWARDER . loadData ( this . mainWin . GetPubStore ( "FORWARDER" ) . data . items ) ;
//船公司
this . comboxFORWARDER = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '订舱代理' ,
store : this . storeFORWARDER ,
//queryMode: 'remote',
forceSelection : true ,
matchFieldWidth : false ,
minChars : 1 ,
queryParam : 'CODENAME' ,
name : 'FORWARDER' ,
valueField : 'CustName' ,
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var s = " (ISOPERATOR=1 or ISSALEMAN=1) and LINKID in (select gid from [info_client] where SHORTNAME='" + combo . value + "')" ;
this . storeInfoClientContactFORWARDER . load ( {
params : { condition : s } ,
callback : function ( r , options , success ) {
if ( success ) {
if ( this . storeInfoClientContactFORWARDER . getCount ( ) > 0 ) {
var member = this . storeInfoClientContactFORWARDER . getAt ( 0 ) ;
this . formHead . getForm ( ) . findField ( 'FORWARDERATTN' ) . setValue ( member . data . SHOWNAME ) ;
this . formHead . getForm ( ) . findField ( 'FORWARDERTEL' ) . setValue ( member . data . TEL ) ;
this . formHead . getForm ( ) . findField ( 'FORWARDEREMAIL' ) . setValue ( member . data . EMAIL ) ;
} else {
this . formHead . getForm ( ) . findField ( 'FORWARDERATTN' ) . setValue ( '' ) ;
this . formHead . getForm ( ) . findField ( 'FORWARDERTEL' ) . setValue ( '' ) ;
this . formHead . getForm ( ) . findField ( 'FORWARDEREMAIL' ) . setValue ( '' ) ;
}
}
} ,
scope : this
} ) ;
}
}
}
} ) ;
this . storeInfoClientContactFORWARDER = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.InfoClientContactModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetInfoClientContactList' }
} ) ;
this . comboxInfoClientContactFORWARDER = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '联系人' ,
store : this . storeInfoClientContactFORWARDER ,
name : 'FORWARDERATTN' ,
valueField : 'SHOWNAME' ,
displayField : 'SHOWNAME' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
this . formHead . getForm ( ) . findField ( 'FORWARDERTEL' ) . setValue ( records [ 0 ] . data . TEL ) ;
this . formHead . getForm ( ) . findField ( 'FORWARDEREMAIL' ) . setValue ( records [ 0 ] . data . EMAIL ) ;
}
}
}
} ) ;
this . storePKGTYPE = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsExtEnumModel' ,
proxy : { url : '/CommMng/PubSys/GetEnumValueList' }
} ) ;
this . storePKGTYPE . load ( { params : { enumTypeId : 97011 } } ) ;
this . comboxPKGTYPE = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '装箱类型' ,
store : this . storePKGTYPE ,
forceSelection : true ,
name : 'PACKINGTYPE' ,
valueField : 'EnumValueName' ,
displayField : 'EnumValueName'
} ) ;
this . 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 : '货物标示' ,
flex : 2 ,
forceSelection : true ,
name : 'CARGOID' ,
valueField : 'ID' ,
displayField : 'NAME' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
if ( combo . value == 'R' ) {
this . 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 ) ;
}
}
}
}
} ) ;
//键值维护表_装运方式
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 : '装运方式' ,
store : this . StoreBLTYPE ,
forceSelection : true ,
name : 'BLTYPE' ,
valueField : 'EnumValueName' ,
displayField : 'EnumValueName' ,
value : '整箱' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
if ( combo . value == "拼箱单票" || combo . value == "拼箱分票" ) {
if ( this . storeBodyList . getCount ( ) > 0 ) {
combo . setValue ( combo . originalValue ) ;
alert ( "拼箱单票、拼箱分票是不允许添加集装箱信息的,因此请先删除集装箱信息!" ) ;
return ;
}
else {
this . panelBodyCtn . hide ( ) ;
}
}
else {
this . panelBodyCtn . show ( ) ;
}
}
}
}
} ) ;
//品名
this . storeCodeGoodsList = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CodeGoodsModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCodeGoodsList' }
} ) ;
this . storeCodeGoodsList . load ( ) ;
this . comboxGOODSNAME = Ext . create ( 'DsExt.ux.RefTableCombox' , {
//fieldLabel: 'Description of Goods (包装种类与货名)',
fieldLabel : '品名类型' ,
store : this . storeCodeGoodsList ,
matchFieldWidth : false ,
flex : 2 ,
//labelWidth: 250,
// forceSelection: true,
name : 'GOODSNAME' ,
valueField : 'GOODNAME' ,
displayField : 'CodeAndName'
} ) ;
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 : 'M付款方式' ,
forceSelection : true ,
name : 'STLNAME' ,
valueField : 'STLNAME' ,
displayField : 'STLNAME'
} ) ;
//件数包装
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 : '包 装' ,
store : this . storeCodePackage ,
forceSelection : true ,
name : 'KINDPKGS' ,
valueField : 'PKGS' ,
displayField : 'PKGS' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var str _num = this . formEdit . getForm ( ) . findField ( 'PKGS' ) . getValue ( ) ;
this . formBill . getForm ( ) . findField ( 'TOTALNO' ) . setValue ( 'SAY:' + ToEn ( str _num ) . toUpperCase ( ) + ' ' + combo . value + ' ONLY.' ) ;
}
}
}
} ) ;
//件数包装_集装箱列表中的下拉框加载
this . comboxKINDPKGS _CTN = Ext . create ( 'DsExt.ux.RefTableCombox' , {
//fieldLabel: '件数包装',
store : this . storeCodePackage ,
forceSelection : true ,
name : 'KINDPKGS' ,
valueField : 'PKGS' ,
displayField : 'PKGS'
} ) ;
//箱型_集装箱列表中的下拉框加载
this . storeCodeCtn = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CodeCtnModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCodeCtnList' }
} ) ;
this . storeCodeCtn . load ( ) ;
this . comboxCTNALL = Ext . create ( 'DsExt.ux.RefTableCombox' , {
//fieldLabel: '箱型',
store : this . storeCodeCtn ,
forceSelection : true ,
name : 'CTNALL' ,
valueField : 'CTN' ,
displayField : 'CTN'
} ) ;
//客户加载_发货人
this . 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 : 'Shipper (发货人)' ,
store : this . storeShipper ,
//forceSelection: true,
matchFieldWidth : false ,
queryMode : 'remote' ,
minChars : 2 ,
queryParam : 'CODENAME' ,
labelWidth : 150 ,
labelAlign : 'left' ,
name : 'SHIPPERID' ,
valueField : 'SHORTNAME' ,
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var selectrecords = DsStoreQueryBy ( this . storeShipper , 'SHORTNAME' , combo . value ) ;
if ( selectrecords . getCount ( ) > 0 ) {
var selectdata = selectrecords . getAt ( 0 ) . data ;
this . formBill . getForm ( ) . findField ( 'SHIPPER' ) . setValue ( selectdata . SHIPPERDETAIL ) ;
} else {
this . formBill . getForm ( ) . findField ( 'SHIPPER' ) . setValue ( '' ) ;
}
}
}
}
} ) ;
this . storeShipper _fen = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'OpSeaeShipper' ,
proxy : { url : '/MvcShipping/MsOpSeae/GetShipperListRm' }
} ) ;
this . comboxShipper _Fen = Ext . create ( 'DsExt.ux.RefTableCombox' , {
store : this . storeShipper _fen ,
forceSelection : true ,
matchFieldWidth : false ,
queryMode : 'remote' ,
minChars : 2 ,
queryParam : 'CODENAME' ,
labelAlign : 'left' ,
name : 'SHIPPERID' ,
valueField : 'SHORTNAME' ,
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
}
}
} ) ;
//客户加载_收货人
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 : 'Consignee (收货人)' ,
labelWidth : 150 ,
labelAlign : 'left' ,
store : this . storeConsignee ,
forceSelection : true ,
matchFieldWidth : false ,
queryMode : 'remote' ,
minChars : 2 ,
queryParam : 'CODENAME' ,
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 . comboxConsignee _Fen = Ext . create ( 'DsExt.ux.RefTableCombox' , {
labelAlign : 'left' ,
store : this . storeConsignee ,
forceSelection : true ,
matchFieldWidth : false ,
queryMode : 'remote' ,
minChars : 2 ,
queryParam : 'CODENAME' ,
name : 'CONSIGNEEID' ,
valueField : 'SHORTNAME' ,
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
}
}
} ) ;
//客户加载_通知人
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 : 'Notify Party (通知人)' ,
store : this . storenotifyparty ,
labelWidth : 150 ,
labelAlign : 'left' ,
forceSelection : true ,
matchFieldWidth : false ,
queryMode : 'remote' ,
minChars : 2 ,
queryParam : 'CODENAME' ,
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 ( '' ) ;
}
}
}
}
} ) ;
this . comboxNotifyParty _Fen = Ext . create ( 'DsExt.ux.RefTableCombox' , {
store : this . storenotifyparty ,
labelAlign : 'left' ,
forceSelection : true ,
matchFieldWidth : false ,
queryMode : 'remote' ,
minChars : 2 ,
queryParam : 'CODENAME' ,
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('');
// }
//}
}
}
} ) ;
this . myCheckboxService = new Ext . form . CheckboxGroup ( {
id : 'myService' ,
xtype : 'checkboxgroup' ,
fieldLabel : '服务项目' ,
columns : 8 ,
items : [ {
boxLabel : '熏蒸' ,
inputValue : true ,
name : 'ISFUMIGATION' ,
id : 'ISFUMIGATION'
} , {
boxLabel : '仓储' ,
inputValue : true ,
name : 'ISSTORAGE' ,
id : 'ISSTORAGE'
} , {
boxLabel : '陆运' ,
inputValue : true ,
name : 'ISLAND' ,
id : 'ISLAND'
} , {
boxLabel : '报关' ,
inputValue : true ,
name : 'ISCUSTOMS' ,
id : 'ISCUSTOMS'
} , {
boxLabel : '报检' ,
inputValue : true ,
name : 'ISINSPECTION' ,
id : 'ISINSPECTION'
} , {
boxLabel : '订舱' ,
inputValue : true ,
name : 'ISBOOKING' ,
id : 'ISBOOKING'
} , {
boxLabel : '使用代理' ,
inputValue : true ,
name : 'ISAGENT' ,
id : 'ISAGENT'
} , {
boxLabel : '分单签单' ,
inputValue : true ,
name : 'ISHBLNO' ,
id : 'ISHBLNO'
}
]
} ) ;
//付费方式
this . storeFrt = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'CODE_FRT' ,
proxy : { url : '/CommMng/BasicDataRef/GetCodeFrtList' }
} ) ;
this . storeFrt . load ( { params : { condition : "" } } ) ;
this . comboxBLFRT = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '付费方式' ,
store : this . storeFrt ,
forceSelection : true ,
name : 'BLFRT' ,
valueField : 'FRT' ,
displayField : 'FRT' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
if ( combo . value == "FREIGHT PREPAID" ) {
var portload = this . formEdit . getForm ( ) . findField ( 'PORTLOAD' ) . getValue ( ) ;
this . formBill . getForm ( ) . findField ( 'PREPARDAT' ) . setValue ( portload ) ;
this . formBill . getForm ( ) . findField ( 'PAYABLEAT' ) . setValue ( '' ) ;
} else if ( combo . value == "FREIGHT COLLECT" ) {
var PORTDISCHARGE = this . formEdit . getForm ( ) . findField ( 'PORTDISCHARGE' ) . getValue ( ) ;
this . formBill . getForm ( ) . findField ( 'PREPARDAT' ) . setValue ( '' ) ;
this . formBill . getForm ( ) . findField ( 'PAYABLEAT' ) . setValue ( PORTDISCHARGE ) ;
}
}
}
}
} ) ;
this . comboxStlName2 = Ext . create ( 'DsExt.ux.RefTableCombox' , {
store : this . storeFrt ,
fieldLabel : 'H付款方式' ,
forceSelection : true ,
name : 'STLNAME2' ,
valueField : 'FRT' ,
displayField : 'FRT'
} ) ;
//客户加载_代理
this . storeagent = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'OpSeaeShipper' ,
proxy : { url : '/MvcShipping/MsOpSeae/GetShipperListRm' }
} ) ;
this . storeagent . load ( {
params : { condition : "shippertype=4 " } ,
callback : function ( r , options , success ) {
if ( success ) {
// this.formEdit.getForm().findField('AGENTID').setValue(data.AGENTID);
}
} ,
scope : this
} ) ;
// this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} });
//收货人
this . comboxAgent = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '国外代理' , //'代 理',
store : this . storeagent ,
// forceSelection: true,
name : 'AGENTID' ,
valueField : 'SHORTNAME' ,
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var selectrecords = DsStoreQueryBy ( this . storeagent , 'SHORTNAME' , combo . value ) ;
if ( selectrecords . getCount ( ) > 0 ) {
var selectdata = selectrecords . getAt ( 0 ) . data ;
this . formBill . getForm ( ) . findField ( 'AGENT' ) . setValue ( selectdata . SHIPPERDETAIL ) ;
} else {
this . formBill . getForm ( ) . findField ( 'AGENT' ) . setValue ( '' ) ;
}
}
}
}
} ) ;
//#endregion
//运输条款
this . storeSERVICE = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'CODE_SERVICE' ,
proxy : { url : '/CommMng/BasicDataRef/GetCodeServiceList' }
} ) ;
this . storeSERVICE . load ( { params : { condition : "" } } ) ;
this . comboxSERVICE = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '运输条款' ,
store : this . storeSERVICE ,
forceSelection : true ,
flex : 2 ,
name : 'SERVICE' ,
valueField : 'SERVICE' ,
displayField : 'SERVICE'
} ) ;
this . ORREMARK = '' ;
//客户加载_场站
this . storeYARD = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CustomRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCustomRefListYARD' }
} ) ;
this . storeYARD . load ( ) ;
//
this . comboxYARD = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '场站' , //'场站',
store : this . storeYARD ,
forceSelection : true ,
queryMode : 'remote' ,
minChars : 0 ,
queryParam : 'CODENAME' ,
name : 'YARD' ,
valueField : 'CustName' ,
displayField : 'CodeAndName'
} ) ;
//业务来源
this . storeSource = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.SourceModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetSource' }
} ) ;
this . storeSource . load ( ) ;
this . storeSourceDetail = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.SourceDetailModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetSourceDetail2' }
} ) ;
this . comboxBSSOURCE = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '合约类型' , //'业务来源',
store : this . storeSource ,
// forceSelection: true,
name : 'BSSOURCE' ,
valueField : 'SourceName' ,
displayField : 'SourceName' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var recs = DsStoreQueryBy ( this . storeSource , 'SourceID' , records [ 0 ] . data . SourceID ) ;
if ( recs . getCount ( ) > 0 ) {
var data = recs . getAt ( 0 ) . data ;
var s = "SOURCEID='" + data . SourceID + "'" ;
this . storeSourceDetail . load ( { params : { condition : s } } ) ;
} else {
var BSSOURCEDETAIL = this . formHead . getForm ( ) . findField ( 'BSSOURCEDETAIL' ) ;
BSSOURCEDETAIL . setValue ( '' ) ;
}
}
}
}
} ) ;
this . comboxBSSOURCE2 = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '合约类型' , //'业务来源',
store : this . storeSource ,
id : "Audit_BSSOURCE" ,
name : 'BSSOURCE' ,
valueField : 'SourceName' ,
displayField : 'SourceName'
} ) ;
this . storeSourceDetail . load ( ) ;
//this.comboxBSSOURCEDETAIL = Ext.create('DsExt.ux.RefTableCombox', {
// fieldLabel: '贸易条款', //'来源明细',贸易条款,交易类型
// store: this.storeSourceDetail,
// // forceSelection: true,
// name: 'BSSOURCEDETAIL',
// valueField: 'SourceDetail',
// displayField: 'SourceDetail'
//});
this . storeTRADETERM = Ext . create ( 'DsExt.ux.RefEnumStore' , { } ) ;
this . storeTRADETERM . load ( { params : { enumTypeId : 97023 } } ) ;
this . comboxTRADETERM = Ext . create ( 'DsExt.ux.RefEnumCombox' , {
fieldLabel : "贸易条款" , //'贸易条款',
store : this . storeTRADETERM ,
forceSelection : true ,
//flex: 0.5,
name : 'TRADETERM'
} ) ;
this . storeSaleCompany = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'MsCompanysEntity' ,
proxy : { url : '/MvcShipping/MsCompanys/GetNoPicDataList' }
} ) ;
this . storeSaleCompany . load ( { params : { condition : "" } } ) ;
this . comboxSaleCompany = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '所属分部' , //'委托分公司',
store : this . storeSaleCompany ,
forceSelection : true ,
readOnly : true ,
name : 'SALECORPID' ,
valueField : 'GID' ,
displayField : 'NAME'
} ) ;
//#region 编辑formHead 基本信息
this . formHead = Ext . widget ( 'form' , {
region : 'north' ,
frame : true ,
bodyPadding : 5 ,
// collapsed: false,
// collapsible: true,
trackResetOnLoad : true ,
fieldDefaults : {
margins : '2 2 2 2' ,
labelAlign : 'right' ,
flex : 1 ,
labelWidth : 70 ,
msgTarget : 'qtip'
} ,
items : [ {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [ {
fieldLabel : '业务编号' ,
name : 'BSNO' , hidden : true
} , {
fieldLabel : 'ORSTATUS' ,
name : 'ORSTATUS' , hidden : true
} , {
fieldLabel : 'DEFSALE' ,
name : 'DEFSALE' , hidden : true
} , {
fieldLabel : 'CONFIRMOP' ,
name : 'CONFIRMOP' , hidden : true
} , {
fieldLabel : 'CONFIRMDATE' ,
name : 'CONFIRMDATE' , hidden : true
} , {
fieldLabel : 'TEU' ,
name : 'TEU' , hidden : true
} , {
fieldLabel : '订单号' ,
readOnly : true ,
disabled : true ,
name : 'ORDNO'
} , {
fieldLabel : '委托编号' ,
readOnly : true ,
disabled : true ,
name : 'CUSTNO'
} , {
fieldLabel : '订单状态' ,
readOnly : true ,
name : 'ORSTATUSREF'
} ,
//{
//fieldLabel: '主提单号',
//name: 'MBLNO'
//},
this . comboxBLTYPE
//, this.comboxBSSOURCEDETAIL
, this . comboxTRADETERM
, this . comboxSaleCompany
, this . comboxAUDITOPERATOR
//, this.comboxBLFRT
]
} , {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [ this . comboxSALE , this . comboxDept , this . comboxOP , this . comboxCUSTSERVICE , this . comboxDOC
, {
fieldLabel : '录入人' ,
readOnly : true ,
name : 'INPUTBY'
} , {
fieldLabel : '确认接单' ,
readOnly : true ,
name : 'AUDITOPERATOR2'
}
//, this.comboxFRCUSTSERVICE
]
} , this . myCheckboxService , {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [
this . comboxISEI ,
this . comboxCustCode ,
{
fieldLabel : '参考号' ,
name : 'SERVICECONTRACTNO'
} ,
this . comboxInfoClientContact ,
{
fieldLabel : '电话' ,
name : 'OPERATORTEL'
} , {
fieldLabel : '邮箱' ,
name : 'OPERATOREMAIL' ,
flex : 2
} , {
fieldLabel : '审核日期' ,
hidden : true ,
readOnly : true ,
name : 'AUDITDATE'
}
// ,
// {
// fieldLabel: '结算方式',
// readOnly: true,
// disabled: true,
// name: 'STLNAME'
//}, {
// fieldLabel: '结算日期',
// disabled: true,
// name: 'STLDATE'
// }
]
} ,
// {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [this.comboxCARRIER, this.comboxInfoClientContactCARRIER, {
// fieldLabel: '电话',
// name: 'CARRIERTEL'
// }, {
// fieldLabel: '邮箱',
// name: 'CARRIEREMAIL'
// }, this.comboxAUDITOPERATOR, {
// fieldLabel: '审核日期',
// readOnly: true,
// name: 'AUDITDATE'
// }]
//}, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [this.comboxFORWARDER, this.comboxInfoClientContactFORWARDER, {
// fieldLabel: '电话',
// name: 'FORWARDERTEL'
// }, {
// fieldLabel: '发票号',
// name: 'INVNO'
// }, {
// fieldLabel: '参考号',
// name: 'SERVICECONTRACTNO'
// }, {
// xtype: 'container',
// layout: 'hbox',
// flex: 1,
// defaultType: 'textfield',
// items: [{
// fieldLabel: '合约号',
// name: 'CONTRACTNO'
// }, {
// xtype: 'button',
// iconCls: "btnedit",
// handler: function (button, event) {
// this.GetContractFee();
// },
// scope: this
// }]
// }]
// },
// {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [this.comboxBSSOURCE, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }]
// }
] //end items(fieldset 1)
} ) ; //end this.formEdit
//#endregion
//#region 集装箱-数据集
this . storeBodyList = Ext . create ( 'Ext.data.Store' , {
model : 'MsSeaeOrderCtn' ,
remoteSort : true ,
proxy : {
type : 'ajax' ,
url : '/MvcShipping/MsSeaeOrder/GetBodyList' ,
reader : {
id : 'ORDNO,CTN_ID' ,
root : 'data' ,
totalProperty : 'totalCount'
}
}
} ) ;
//明细表表格
this . gridListCellEditing = Ext . create ( 'Ext.grid.plugin.CellEditing' , {
clicksToEdit : 1
} ) ;
this . gridList = new Ext . grid . GridPanel ( {
store : this . storeBodyList ,
enableHdMenu : false ,
region : 'center' ,
loadMask : { msg : "数据加载中,请稍等..." } ,
trackMouseOver : true ,
disableSelection : false ,
plugins : [ this . gridListCellEditing ] ,
selType : 'cellmodel' ,
tbar : [
{
xtype : 'label' ,
text : '集装箱信息' , //'应收费用',
style : 'font-size:14px' ,
labelColor : '#000' ,
id : 'ctntitle' ,
//style:'background-color: #4b9bf5',
x : '5%' ,
y : '5%'
} ,
{
text : '增加明细' ,
tooltip : '增加明细' ,
id : "btnadddetail" ,
iconCls : "btnadddetail" ,
handler : function ( button , event ) {
this . onAddDetailClick ( button , event ) ;
} ,
scope : this
} , '-' , {
text : '删除明细' ,
tooltip : '删除明细' ,
id : "btndeldetail" ,
iconCls : "btndeletedetail" ,
handler : function ( button , event ) {
this . onDelDetailClick ( button , event ) ;
} ,
scope : this
} ] ,
columns : [ {
sortable : true ,
dataIndex : 'CTN_ID' ,
header : '编号' ,
hidden : true ,
width : 0
} , {
sortable : true ,
dataIndex : 'ORDNO' ,
header : '业务编号' ,
hidden : true ,
width : 0
} , {
dataIndex : 'CTNALL' , //CTNEXHIBIT
header : '箱型' ,
width : 70 ,
editor : this . comboxCTNALL
} , {
dataIndex : 'CTNNUM' ,
header : '箱量' ,
width : 50 ,
editor : {
xtype : 'numberfield' ,
allowBlank : false ,
selectOnFocus : true
}
} , {
dataIndex : 'KGS' ,
header : '单箱重量' ,
width : 60 ,
editor : {
xtype : 'numberfield' ,
allowBlank : false ,
selectOnFocus : true
}
} , {
dataIndex : 'REMARK' ,
header : '备注' ,
width : 150 ,
editor : {
xtype : 'textfield' ,
selectOnFocus : true
}
} ]
} ) ;
//#endregion
this . panelBodyCtn = new Ext . Panel ( {
//title: '集装箱信息',
layout : "border" ,
height : 130 ,
//margin: '5 10',
frame : true ,
items : [ this . gridList ]
} ) ;
// this.panelORREASON = new Ext.Panel({
// title: "<a href='#'><font color='#FF0000'>驳回原因</font></a>",
// layout: "border",
// height: 60,
// flex: 1,
// //margin: '5 10',
// frame: true,
// items: [{
// xtype: 'textareafield',
// grow: true,
// fieldLabel: '',
// labelSeparator: '',
// labelWidth: 0,
// height: 100,
// name: 'ORREASON',
// anchor: '100%'
// }]
// });
this . panelBodyDr = new Ext . Panel ( {
title : '危险品信息' ,
layout : "border" ,
hidden : true ,
height : 60 ,
frame : true ,
items : [ {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
defaults : {
anchor : '96%'
} ,
items : [ {
fieldLabel : '危险品等级' ,
flex : 1 ,
labelWidth : 70 ,
name : 'DCLASS'
} , {
fieldLabel : '危险品编号' ,
flex : 1 ,
labelWidth : 70 ,
name : 'DUNNO'
} , {
fieldLabel : '危险品页号' ,
flex : 1 ,
labelWidth : 70 ,
name : 'DPAGE'
} , {
fieldLabel : '危险品标签' ,
flex : 1 ,
labelWidth : 70 ,
name : 'DLABEL'
} , {
fieldLabel : '危险品联系人' ,
flex : 1 ,
labelWidth : 90 ,
name : 'LINKMAN'
} ]
} ]
} ) ;
this . StoreTemp = Ext . create ( 'Ext.data.Store' , {
fields : [ 'ID' , 'NAME' ]
} ) ;
this . StoreTemp . add ( { "ID" : "C" , "NAME" : "C摄氏" } ) ;
this . StoreTemp . add ( { "ID" : "F" , "NAME" : "F华氏" } ) ;
this . comboxTemp = Ext . create ( 'DsExt.ux.RefTableCombox' , {
store : this . StoreTemp ,
fieldLabel : '温度单位' ,
forceSelection : true ,
name : 'TEMPID' ,
valueField : 'ID' ,
displayField : 'NAME'
} ) ;
this . panelBodyRf = new Ext . Panel ( {
title : '冻柜信息' ,
layout : "border" ,
hidden : true ,
height : 60 ,
//margin: '5 10',
frame : true ,
items : [ {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [ {
fieldLabel : '冷藏通风量' ,
name : 'REEFERF'
} , {
fieldLabel : '设置温度' ,
name : 'TEMPSET'
} , this . comboxTemp ]
} ]
} ) ;
this . storeVoyVeg = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.VesselModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetVesselList' }
} ) ;
this . storeVoyVeg . load ( { params : { condition : "" } } ) ;
this . comboxVoyVeg = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '船 名' ,
store : this . storeVoyVeg ,
matchFieldWidth : false ,
name : 'VESSEL' ,
valueField : 'VESSEL' ,
flex : 1 ,
displayField : 'VESSEL' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var selectrecords = DsStoreQueryBy ( this . storeVoyVeg , 'VoyName' , combo . value ) ;
if ( selectrecords . getCount ( ) > 0 ) {
var selectdata = selectrecords . getAt ( 0 ) . data ;
this . formBill . getForm ( ) . findField ( 'VESSELID' ) . setValue ( selectdata . EDICODE ) ;
} else {
this . formBill . getForm ( ) . findField ( 'VESSELID' ) . setValue ( '' ) ;
}
}
}
}
} ) ;
//国际港口(进口装货港、出口卸货港)
this . storeCodeDisport = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CodeDisportModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCodeDisportListRm' }
} ) ;
// this.storeCodeDisport.load();
this . storeCodeDisport2 = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CodeDisportModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCodeDisportListRm' }
} ) ;
// this.storeCodeDisport2.load();
this . storeCodeDisport3 = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CodeDisportModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCodeDisportListRm' }
} ) ;
// this.storeCodeDisport3.load();
this . storeCodeDisport4 = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CodeDisportModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCodeDisportListRm' }
} ) ;
this . storeCodeDisport5 = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CodeDisportModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCodeDisportListRm' }
} ) ;
// this.storeCodeDisport4.load();
//国内港口(出口装货港、进口卸货港)
this . storeCodeLoadport = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CodeLoadportModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCodeLoadportList' }
} ) ;
this . storeCodeLoadport . load ( ) ;
this . comboxPORTLOAD = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '起运港' ,
store : this . storeCodeLoadport ,
// queryMode: 'remote',
// minChars: 1,
name : 'PORTLOAD' ,
valueField : 'PORT' ,
displayField : 'CodeAndName' ,
forceSelection : true ,
matchFieldWidth : false ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var selectrecords = DsStoreQueryBy ( this . storeCodeLoadport , 'PORT' , combo . value ) ;
if ( selectrecords . getCount ( ) > 0 ) {
var selectdata = selectrecords . getAt ( 0 ) . data ;
this . formBill . getForm ( ) . findField ( 'PORTLOADID' ) . setValue ( selectdata . EDICODE ) ;
} else {
this . formBill . getForm ( ) . findField ( 'PORTLOADID' ) . setValue ( '' ) ;
}
}
}
}
} ) ;
this . comboxPORTDISCHARGE = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '卸货港' ,
store : this . storeCodeDisport ,
name : 'PORTDISCHARGE' ,
valueField : 'PORT' ,
//queryMode: 'remote',
//queryParam: 'PORT',
forceSelection : true ,
matchFieldWidth : false ,
//minChars: 1,
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
beforequery : function ( e ) {
return FilterCombox ( e ) ;
} ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var selectrecords = DsStoreQueryBy ( this . storeCodeDisport , 'PORT' , combo . value ) ;
if ( selectrecords . getCount ( ) > 0 ) {
var selectdata = selectrecords . getAt ( 0 ) . data ;
this . formBill . getForm ( ) . findField ( 'PORTDISCHARGEID' ) . setValue ( selectdata . EDICODE ) ;
var DESTINATION = this . formBill . getForm ( ) . findField ( 'DESTINATIONID' ) . getValue ( ) ;
if ( DESTINATION == null || DESTINATION == '' ) {
this . formEdit . getForm ( ) . findField ( 'DESTINATION' ) . setValue ( combo . value ) ;
this . formBill . getForm ( ) . findField ( 'DESTINATIONID' ) . setValue ( selectdata . EDICODE ) ;
}
var PLACEDELIVERY = this . formBill . getForm ( ) . findField ( 'PLACEDELIVERYID' ) . getValue ( ) ;
if ( PLACEDELIVERY == null || PLACEDELIVERY == '' ) {
this . formEdit . getForm ( ) . findField ( 'PLACEDELIVERY' ) . setValue ( combo . value ) ;
this . formBill . getForm ( ) . findField ( 'PLACEDELIVERYID' ) . setValue ( selectdata . EDICODE ) ;
}
this . formEdit . getForm ( ) . findField ( 'LANE' ) . setValue ( records [ 0 ] . data . LANE ) ;
} else {
this . formBill . getForm ( ) . findField ( 'PORTDISCHARGEID' ) . setValue ( '' ) ;
}
}
} ,
change : function ( field , newValue , oldValue , eOpts ) {
if ( newValue == null || newValue == '' ) {
this . formBill . getForm ( ) . findField ( 'PORTDISCHARGEID' ) . setValue ( '' ) ;
}
}
}
} ) ;
this . comboxDESTINATION = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '目的地' ,
store : this . storeCodeDisport2 ,
name : 'DESTINATION' ,
//queryMode: 'remote',
//minChars: 1,
matchFieldWidth : false ,
forceSelection : true ,
queryParam : 'PORT' ,
valueField : 'PORT' ,
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
beforequery : function ( e ) {
return FilterCombox ( e ) ;
} ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var selectrecords = DsStoreQueryBy ( this . storeCodeDisport2 , 'PORT' , combo . value ) ;
if ( selectrecords . getCount ( ) > 0 ) {
var selectdata = selectrecords . getAt ( 0 ) . data ;
this . formBill . getForm ( ) . findField ( 'DESTINATIONID' ) . setValue ( selectdata . EDICODE ) ;
var PLACEDELIVERY = this . formBill . getForm ( ) . findField ( 'PLACEDELIVERYID' ) . getValue ( ) ;
if ( PLACEDELIVERY == null || PLACEDELIVERY == '' ) {
this . formEdit . getForm ( ) . findField ( 'PLACEDELIVERY' ) . setValue ( combo . value ) ;
this . formBill . getForm ( ) . findField ( 'PLACEDELIVERYID' ) . setValue ( selectdata . EDICODE ) ;
}
} else {
this . formBill . getForm ( ) . findField ( 'DESTINATIONID' ) . setValue ( '' ) ;
}
}
} ,
change : function ( field , newValue , oldValue , eOpts ) {
if ( newValue == null || newValue == '' ) {
this . formBill . getForm ( ) . findField ( 'DESTINATIONID' ) . setValue ( '' ) ;
}
}
}
} ) ;
this . comboxPLACEDELIVERY = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '交货地' ,
store : this . storeCodeDisport3 ,
name : 'PLACEDELIVERY' ,
matchFieldWidth : false ,
forceSelection : true ,
queryMode : 'remote' ,
minChars : 1 ,
queryParam : 'PORT' ,
valueField : 'PORT' ,
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var selectrecords = DsStoreQueryBy ( this . storeCodeDisport3 , 'PORT' , combo . value ) ;
if ( selectrecords . getCount ( ) > 0 ) {
var selectdata = selectrecords . getAt ( 0 ) . data ;
this . formBill . getForm ( ) . findField ( 'PLACEDELIVERYID' ) . setValue ( selectdata . EDICODE ) ;
} else {
this . formBill . getForm ( ) . findField ( 'PLACEDELIVERYID' ) . setValue ( '' ) ;
}
}
} ,
change : function ( field , newValue , oldValue , eOpts ) {
if ( newValue == null || newValue == '' ) {
this . formBill . getForm ( ) . findField ( 'PLACEDELIVERYID' ) . setValue ( '' ) ;
}
}
}
} ) ;
this . comboxPLACERECEIPT = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '收货地' ,
store : this . storeCodeDisport3 ,
name : 'PLACERECEIPT' ,
queryMode : 'remote' ,
matchFieldWidth : false ,
forceSelection : true ,
minChars : 1 ,
queryParam : 'PORT' ,
valueField : 'PORT' ,
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var selectrecords = DsStoreQueryBy ( this . storeCodeDisport3 , 'PORT' , combo . value ) ;
if ( selectrecords . getCount ( ) > 0 ) {
var selectdata = selectrecords . getAt ( 0 ) . data ;
this . formBill . getForm ( ) . findField ( 'PLACERECEIPTID' ) . setValue ( selectdata . EDICODE ) ;
} else {
this . formBill . getForm ( ) . findField ( 'PLACERECEIPTID' ) . setValue ( '' ) ;
}
}
} ,
change : function ( field , newValue , oldValue , eOpts ) {
if ( newValue == null || newValue == '' ) {
this . formBill . getForm ( ) . findField ( 'PLACERECEIPTID' ) . setValue ( '' ) ;
}
}
}
} ) ;
this . comboxTRANSPORT = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '中转港' ,
store : this . storeCodeDisport5 ,
matchFieldWidth : false ,
forceSelection : true ,
name : 'TRANSPORT' ,
valueField : 'PORT' ,
//queryMode: 'remote',
//minChars: 1,
//queryParam: 'PORT',
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
beforequery : function ( e ) {
return FilterCombox ( e ) ;
} ,
}
} ) ;
this . comboxISSUEPLACE = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '签单地点' ,
store : this . storeCodeDisport3 ,
name : 'ISSUEPLACE' ,
queryMode : 'remote' ,
minChars : 1 ,
queryParam : 'PORT' ,
valueField : 'PORT' ,
displayField : 'PORT' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
var selectrecords = DsStoreQueryBy ( this . storeCodeDisport3 , 'PORT' , combo . value ) ;
if ( selectrecords . getCount ( ) > 0 ) {
var selectdata = selectrecords . getAt ( 0 ) . data ;
this . formBill . getForm ( ) . findField ( 'ISSUEPLACEID' ) . setValue ( selectdata . EDICODE ) ;
} else {
this . formBill . getForm ( ) . findField ( 'ISSUEPLACEID' ) . setValue ( '' ) ;
}
}
}
}
} ) ;
//签单方式
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 : 'M签单方式' ,
store : this . storeISSUETYPE ,
forceSelection : true ,
name : 'ISSUETYPE' ,
valueField : 'BLTYPE' ,
displayField : 'BLTYPE'
} ) ;
this . storeISSUETYPE2 = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'CODE_BLTYPE' ,
proxy : { url : '/CommMng/BasicDataRef/GetCodeBLTYPEList' }
} ) ;
this . storeISSUETYPE2 . load ( { params : { condition : "" } } ) ;
this . comboxISSUETYPE2 = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : 'H签单方式' ,
store : this . storeISSUETYPE2 ,
forceSelection : true ,
name : 'ISSUETYPE2' ,
valueField : 'BLTYPE' ,
displayField : 'BLTYPE'
} ) ;
this . StoreBLNUM = Ext . create ( 'Ext.data.Store' , {
fields : [ 'NUM' ]
} ) ;
this . StoreBLNUM . add ( { "NUM" : "ZERO" } ) ;
this . StoreBLNUM . add ( { "NUM" : "ONE" } ) ;
this . StoreBLNUM . add ( { "NUM" : "TWO" } ) ;
this . StoreBLNUM . add ( { "NUM" : "THREE" } ) ;
this . StoreBLNUM . add ( { "NUM" : "FOUR" } ) ;
this . StoreBLNUM . add ( { "NUM" : "FIVE" } ) ;
this . StoreBLNUM . add ( { "NUM" : "SIX" } ) ;
this . StoreBLNUM . add ( { "NUM" : "SEVEN" } ) ;
this . StoreBLNUM . add ( { "NUM" : "EIGHT" } ) ;
this . StoreBLNUM . add ( { "NUM" : "NINE" } ) ;
this . StoreBLNUM . add ( { "NUM" : "TEN" } ) ;
this . comboxBLNUM = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '提单份数' ,
store : this . StoreBLNUM ,
forceSelection : true ,
name : 'NOBILL' ,
valueField : 'NUM' ,
displayField : 'NUM'
} ) ;
this . StoreTIDANLEIXING = Ext . create ( 'Ext.data.Store' , {
fields : [ 'value' , 'text' ]
} ) ;
this . StoreTIDANLEIXING . add ( { 'value' : 'MBL' , 'text' : 'MBL' } ) ;
this . StoreTIDANLEIXING . add ( { 'value' : 'HBL' , 'text' : 'HBL' } ) ;
this . comboxTIDANLEIXING = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '提单类型' ,
store : this . StoreTIDANLEIXING ,
forceSelection : true ,
name : 'TIDANLEIXING' ,
valueField : 'value' ,
displayField : 'text'
} ) ;
//#region 编辑formEdit 基本信息
this . formEdit = Ext . widget ( 'form' , {
region : 'north' ,
frame : true ,
bodyPadding : 5 ,
height : 250 ,
layout : 'anchor' ,
trackResetOnLoad : true ,
fieldDefaults : {
margins : '2 2 2 2' ,
labelAlign : 'right' ,
flex : 1 ,
labelWidth : 70 ,
msgTarget : 'qtip'
} ,
items : [
{
xtype : 'container' , //fieldset 小框线
defaultType : 'textfield' ,
layout : 'hbox' ,
defaults : {
anchor : '100%'
} ,
items : [ {
xtype : 'container' ,
layout : 'anchor' ,
flex : 3 ,
defaultType : 'textfield' ,
items : [ {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [
this . comboxCARRIER ,
this . comboxVoyVeg ,
this . comboxPORTLOAD ,
this . comboxTRANSPORT ,
//
{
fieldLabel : '大船ETD' ,
format : 'Y-m-d' ,
xtype : 'datefield' ,
name : 'ETD'
} ,
//
]
} , {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [
{
fieldLabel : '合约号' ,
name : 'CONTRACTNO'
} ,
{
fieldLabel : '航次' ,
flex : 1 ,
name : 'VOYNO'
} ,
this . comboxPORTDISCHARGE ,
this . comboxDESTINATION ,
{
fieldLabel : '驳船ETD' ,
format : 'Y-m-d' ,
xtype : 'datefield' ,
name : 'ETD2'
} ,
]
} , {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [
this . comboxBSSOURCE ,
this . comboxLANE ,
{
fieldLabel : '目的地免箱天数' ,
labelWidth : 100 ,
// flex: 0.8,
name : 'DESTFBP'
} ,
this . comboxSERVICE
// , this.comboxPKGTYPE,
// {
// fieldLabel: '免箱天数',
// // flex: 0.5,
// name: 'FBP'
// }, {
// fieldLabel: '限重',
//// flex: 0.7,
// name: 'MAXWEIGHT'
// }
]
} , {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [
//{
//fieldLabel: '预计利润',
//name: 'PLANPROFIT'
//}
//, this.comboxAgent
//, this.comboxYARD
]
} , {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [ {
xtype : 'textareafield' ,
grow : true ,
flex : 3 ,
fieldLabel : '订舱备注' ,
height : 40 ,
name : 'REMARK' ,
anchor : '100%'
} , {
xtype : 'textareafield' ,
grow : true ,
flex : 2 ,
fieldLabel : '驳回原因' ,
height : 40 ,
name : 'ORREASON' ,
anchor : '100%'
} ]
}
]
} , {
xtype : 'container' ,
layout : 'anchor' ,
flex : 1 ,
defaultType : 'textfield' ,
items : [
this . panelBodyCtn
]
}
]
} ,
{
xtype : 'container' , //fieldset 小框线
defaultType : 'textfield' ,
layout : 'hbox' ,
defaults : {
anchor : '100%'
} ,
items : [
{
xtype : 'container' ,
layout : 'anchor' ,
flex : 3 ,
defaultType : 'textfield' ,
items : [
{
//一行
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [
this . comboxFORWARDER , //
this . comboxISSUETYPE ,
this . comboxBLFRT
]
} , {
//一行
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [
this . comboxTIDANLEIXING ,
this . comboxISSUETYPE2 ,
this . comboxStlName2
]
} , {
//一行
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [
{
flex : 3 ,
fieldLabel : 'BC' ,
name : 'BCNO'
}
]
} , {
//一行
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [
{
fieldLabel : '电商订单号' ,
name : 'DIANSHANGORDERNO'
}
]
}
]
} ,
{
xtype : 'container' ,
layout : 'anchor' ,
flex : 3 ,
defaultType : 'textfield' ,
items : [
{
//一行
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [
this . comboxCargoid ,
this . comboxGOODSNAME
]
}
,
{
xtype : 'textareafield' ,
grow : true ,
fieldLabel : '英文品名' ,
labelSeparator : '' ,
//labelWidth: 20,
height : 40 ,
name : 'DESCRIPTION' ,
anchor : '100%'
}
, {
//一行
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [
{
labelWidth : 70 ,
xtype : 'numberfield' ,
fieldLabel : '体积' ,
name : 'CBM'
} ,
//this.comboxPLACEDELIVERY,
{
fieldLabel : '总件数' ,
labelWidth : 70 ,
xtype : 'numberfield' ,
name : 'PKGS' ,
listeners : {
scope : this ,
blur : function ( field , The , eOpts ) {
var str _num = this . formEdit . getForm ( ) . findField ( 'PKGS' ) . getValue ( ) ;
var KINDPKGS = this . formEdit . getForm ( ) . findField ( 'KINDPKGS' ) . getValue ( ) ;
this . formBill . getForm ( ) . findField ( 'TOTALNO' ) . setValue ( 'SAY:' + ToEn ( str _num ) . toUpperCase ( ) + ' ' + KINDPKGS + ' ONLY.' ) ;
}
}
} ,
this . comboxKINDPKGS ,
{
labelWidth : 70 ,
xtype : 'numberfield' ,
fieldLabel : '总重量' ,
name : 'KGS'
}
]
}
]
}
]
}
]
} ) ; //end this.formEdit
//#endregion
//#region 编辑formbill 基本信息
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%'
} , this . comboxConsignee , {
xtype : 'textareafield' ,
grow : true ,
labelWidth : 0 ,
height : 90 ,
name : 'CONSIGNEE' ,
anchor : '100%'
} , this . comboxNotifyParty , {
xtype : 'textareafield' ,
grow : true ,
labelWidth : 0 ,
height : 90 ,
name : 'NOTIFYPARTY' ,
anchor : '100%'
}
]
} , {
xtype : 'container' ,
layout : 'anchor' ,
flex : 1 ,
defaultType : 'textfield' ,
defaults : {
anchor : '99%'
} ,
items : [ {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [
//this.comboxVoyVeg,
]
} , {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [ this . comboxPLACERECEIPT , {
fieldLabel : '收货地代码' ,
name : 'PLACERECEIPTID'
} ]
} , {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [ {
fieldLabel : '交货代码' ,
name : 'PLACEDELIVERYID'
} , { xtype : 'hiddenfield' } ]
} , {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [ {
fieldLabel : '装港代码' ,
name : 'PORTLOADID'
} , {
fieldLabel : '卸港代码' ,
name : 'PORTDISCHARGEID'
} ]
} , {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [ {
fieldLabel : '目的代码' ,
name : 'DESTINATIONID'
} ]
} , {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [ {
xtype : 'textareafield' ,
grow : true ,
fieldLabel : '国外代理' ,
labelSeparator : '' ,
// labelWidth: 20,
height : 120 ,
name : 'AGENT' ,
anchor : '100%'
} ]
}
]
}
]
} ,
{
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 : '<html>Seal No.(封志号)<br> Marks & Nos.(标记与号码) </html>' //'<html>Seal No.(封志号)<br> Marks & Nos.(标记与号码) </html>'
} , {
xtype : 'textareafield' ,
grow : true ,
height : 250 ,
name : 'MARKS' ,
anchor : '100%'
}
]
} , {
xtype : 'container' ,
layout : 'anchor' ,
flex : 3 ,
defaultType : 'textfield' ,
items : [ {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
defaults : {
anchor : '100%'
} ,
items : [
]
}
]
} , {
xtype : 'container' ,
layout : 'anchor' ,
flex : 1 ,
defaultType : 'textfield' ,
items : [ {
xtype : 'label' ,
html : '<html>         No.of containers or pkgs.<br>         ( 箱数或件数)</html>' //'<html>         No.of containers or pkgs.<br>         ( 箱数或件数)</html>'
} , {
xtype : 'textareafield' ,
grow : true ,
fieldLabel : '  ' ,
labelWidth : 20 ,
labelSeparator : '' ,
height : 40 ,
name : 'NOPKGS' ,
anchor : '100%' ,
listeners : {
scope : this ,
change : function ( field , newValue , oldValue , eOpts ) {
if ( newValue == null || newValue == '' ) return ;
if ( newValue != oldValue ) {
var SS = newValue ;
var i = SS . indexOf ( "\n" ) ;
var num = 0 ;
if ( i > 0 ) {
var slist = SS . split ( "\n" ) ;
for ( var i = 0 ; i < slist . length ; i += 1 ) {
var member = slist [ i ] ;
var str _num = this . GetStringNum ( member ) ;
if ( i == 0 ) {
var str _kind = member . substring ( str _num . length ) ;
}
num = parseFloat ( num ) . add ( parseFloat ( str _num ) ) ;
}
this . formEdit . getForm ( ) . findField ( 'PKGS' ) . setValue ( num ) ;
this . formEdit . getForm ( ) . findField ( 'KINDPKGS' ) . setValue ( str _kind ) ;
this . formBill . getForm ( ) . findField ( 'TOTALNO' ) . setValue ( 'SAY:' + ToEn ( num ) . toUpperCase ( ) + ' ' + str _kind + ' ONLY.' ) ;
} else {
var str _num = this . GetStringNum ( SS ) ;
var str _kind = SS . substring ( str _num . length ) ;
this . formEdit . getForm ( ) . findField ( 'PKGS' ) . setValue ( str _num ) ;
this . formEdit . getForm ( ) . findField ( 'KINDPKGS' ) . setValue ( str _kind ) ;
this . formBill . getForm ( ) . findField ( 'TOTALNO' ) . setValue ( 'SAY:' + ToEn ( str _num ) . toUpperCase ( ) + ' ' + str _kind + ' ONLY.' ) ;
}
}
}
}
} , {
xtype : 'label' ,
html : '          Gross Weight 毛重(公斤)' //'          Gross Weight 毛重(公斤)'
} , {
xtype : 'textareafield' ,
grow : true ,
height : 40 ,
labelWidth : 20 ,
labelSeparator : '' ,
fieldLabel : '  ' ,
name : 'GROSSWEIGHT' ,
anchor : '100%' ,
listeners : {
scope : this ,
change : function ( field , newValue , oldValue , eOpts ) {
if ( newValue == null || newValue == '' ) return ;
if ( newValue != oldValue ) {
var SS = newValue ;
var i = SS . indexOf ( "\n" ) ;
var num = 0 ;
if ( i > 0 ) {
var slist = SS . split ( "\n" ) ;
for ( var i = 0 ; i < slist . length ; i += 1 ) {
var member = slist [ i ] ;
var str _num = this . GetStringNum ( member ) ;
num = parseFloat ( num ) . add ( parseFloat ( str _num ) ) ;
}
this . formEdit . getForm ( ) . findField ( 'KGS' ) . setValue ( num ) ;
} else {
var str _num = this . GetStringNum ( SS ) ;
this . formEdit . getForm ( ) . findField ( 'KGS' ) . setValue ( str _num ) ;
}
}
}
}
} , {
xtype : 'label' ,
html : '          Measurement 尺码(立方米)' //'          Measurement 尺码(立方米)'
} , {
xtype : 'textareafield' ,
grow : true ,
height : 40 ,
labelWidth : 20 ,
labelSeparator : '' ,
fieldLabel : '  ' ,
name : 'MEASUREMENT' ,
anchor : '100%' ,
listeners : {
scope : this ,
change : function ( field , newValue , oldValue , eOpts ) {
if ( newValue == null || newValue == '' ) return ;
if ( newValue != oldValue ) {
var SS = newValue ;
var i = SS . indexOf ( "\n" ) ;
var num = 0 ;
if ( i > 0 ) {
var slist = SS . split ( "\n" ) ;
for ( var i = 0 ; i < slist . length ; i += 1 ) {
var member = slist [ i ] ;
var str _num = this . GetStringNum ( member ) ;
num = parseFloat ( num ) . add ( parseFloat ( str _num ) ) ;
}
this . formEdit . getForm ( ) . findField ( 'CBM' ) . setValue ( num ) ;
} else {
var str _num = this . GetStringNum ( SS ) ;
this . formEdit . getForm ( ) . findField ( 'CBM' ) . setValue ( str _num ) ;
}
}
}
}
}
]
}
]
} , {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [ {
fieldLabel : '件数大写' ,
name : 'TOTALNO'
} ]
} , this . panelBodyDr , this . panelBodyRf , {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [ {
fieldLabel : '签单日期' , //'签单日期',
format : 'Y-m-d' ,
xtype : 'datefield' ,
name : 'ISSUEDATE'
} , this . comboxISSUEPLACE , {
fieldLabel : '签单地代码' , //'签单地点',
name : 'ISSUEPLACEID'
} , this . comboxBLNUM ]
} , {
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
items : [ {
fieldLabel : '预付地点' , //'预付地点',
name : 'PREPARDAT'
} , {
fieldLabel : '到付地点' , //'到付地点',
name : 'PAYABLEAT'
} ]
} ]
}
]
} ) ; //end this.formEdit
//#endregion
this . panelBtn2 = new Ext . Panel ( {
region : "north" ,
tbar : [ {
id : 'btnESave2' ,
text : "保存" ,
iconCls : "btnsave" ,
handler : function ( button , event ) {
this . Save ( '0' ) ;
} ,
scope : this
} , {
id : 'btnESaveAndClose2' ,
text : "保存并关闭" ,
handler : function ( button , event ) {
this . Save ( '1' ) ;
} ,
scope : this
} ]
} ) ;
this . panelBill = new Ext . Panel ( {
title : '船东单' , //'舱单信息',委托信息
layout : "border" ,
region : 'center' ,
animate : true ,
autoScroll : true ,
containerScroll : true ,
frame : false ,
items : [ this . panelBtn2 , this . formBill ]
} ) ;
//#region 分票列表
this . storeFenList = Ext . create ( 'Ext.data.Store' , {
model : 'MsSeaeOrderModel' ,
remoteSort : false ,
proxy : {
type : 'ajax' ,
url : '/MvcShipping/MsSeaeOrder/GetFenList' ,
reader : {
id : 'ORDNO,CTN_ID' ,
root : 'data' ,
totalProperty : 'totalCount'
}
}
} ) ;
this . FenListCellEditing = Ext . create ( 'Ext.grid.plugin.CellEditing' , {
clicksToEdit : 1
} ) ;
this . FenList = new Ext . grid . GridPanel ( {
store : this . storeFenList ,
height : 260 ,
width : 700 ,
enableHdMenu : false ,
region : 'center' ,
loadMask : { msg : "数据加载中,请稍等..." } ,
trackMouseOver : true ,
disableSelection : false ,
singleSelect : true ,
plugins : [ this . FenListCellEditing ] ,
selType : 'cellmodel' ,
tbar : [
{
text : '增加明细' ,
tooltip : '增加明细' ,
id : "btnaddfen" ,
iconCls : "btnadddetail" ,
handler : function ( button , event ) {
this . onAddFenClick ( button , event ) ;
} ,
scope : this
} , {
text : '删除明细' ,
tooltip : '删除明细' ,
id : "btndelfen" ,
iconCls : "btndeletedetail" ,
handler : function ( button , event ) {
this . onDelFenClick ( button , event ) ;
} ,
scope : this
} , '-' , {
id : 'btnFenSave' ,
text : "保存分票信息" ,
iconCls : "btnsave" ,
handler : function ( button , event ) {
this . SaveFen ( ) ;
} ,
scope : this
} , {
xtype : 'label' ,
text : '注意,选中左边分票信息时,右边集装箱信息会相应切换为该分票当前集装箱信息。请及时保存集装箱信息。' , //'应收费用',
style : 'font-size:12px' ,
labelColor : '#000' ,
id : 'fennotice' ,
//style:'background-color: #4b9bf5',
x : '30%' ,
y : '5%'
}
] ,
columns : [ {
sortable : true ,
dataIndex : 'CTN_ID' ,
header : '编号' ,
hidden : true ,
width : 0
} , {
sortable : true ,
dataIndex : 'ORDNO' ,
header : '业务编号' ,
width : 0
} , {
dataIndex : 'CUSTOMERNAME' , //CTNEXHIBIT
header : '委托单位' ,
width : 120 ,
editor : this . comboxCustCode _Fen
}
//this.comboxInfoClientContact,
//{
// fieldLabel: '电话',
// name: 'OPERATORTEL'
//}, {
// fieldLabel: '邮箱',
// name: 'OPERATOREMAIL',
// flex: 3
//}
, {
dataIndex : 'OPERATOR' ,
header : '联系人' ,
width : 80 ,
editor : this . comboxInfoClientContact2
} , {
dataIndex : 'OPERATORTEL' ,
header : '电话' ,
width : 80 ,
editor : {
xtype : 'textfield' ,
//allowBlank: false,
selectOnFocus : true
}
} , {
dataIndex : 'OPERATOREMAIL' ,
header : '邮箱' ,
width : 80 ,
editor : {
xtype : 'textfield' ,
//allowBlank: false,
selectOnFocus : true
}
}
, {
dataIndex : 'SHIPPERID' ,
header : '发货人' ,
width : 120 ,
editor : this . comboxShipper _Fen
} , {
dataIndex : 'CONSIGNEEID' ,
header : '收货人' ,
width : 120 ,
editor : this . comboxConsignee _Fen
} , {
dataIndex : 'NOTIFYPARTYID' ,
header : '通知人' ,
width : 50 ,
editor : this . comboxNotifyParty _Fen
} , {
dataIndex : 'PKGS' ,
header : '件数' ,
width : 90 ,
editor : {
xtype : 'numberfield' ,
allowBlank : false ,
selectOnFocus : true
}
} , {
dataIndex : 'KGS' ,
header : '毛重' ,
width : 90 ,
editor : {
xtype : 'numberfield' ,
allowBlank : false ,
selectOnFocus : true
}
} , {
dataIndex : 'CBM' ,
header : '尺码' ,
width : 90 ,
editor : {
xtype : 'numberfield' ,
allowBlank : false ,
selectOnFocus : true
}
} , {
dataIndex : 'MARKS' ,
header : 'MARKS' ,
width : 150 ,
editor : {
height : 120 ,
xtype : 'textareafield' ,
selectOnFocus : true
}
} , {
dataIndex : 'DESCRIPTION' ,
header : '货描' ,
width : 150 ,
editor : {
height : 120 ,
xtype : 'textareafield' ,
selectOnFocus : true
}
}
]
} ) ;
this . FenList . getSelectionModel ( ) . on ( 'select' , function ( button , event ) {
this . onSelectFen ( button , event ) ;
} , this ) ;
this . storeFenCtnList = Ext . create ( 'Ext.data.Store' , {
model : 'MsSeaeOrderCtn' ,
remoteSort : true ,
proxy : {
type : 'ajax' ,
url : '/MvcShipping/MsSeaeOrder/GetBodyList' ,
reader : {
id : 'ORDNO,CTN_ID' ,
root : 'data' ,
totalProperty : 'totalCount'
}
}
} ) ;
this . FenCtnListCellEditing = Ext . create ( 'Ext.grid.plugin.CellEditing' , {
clicksToEdit : 1
} ) ;
this . FenCtnList = new Ext . grid . GridPanel ( {
store : this . storeFenCtnList ,
enableHdMenu : false ,
height : 260 ,
region : 'center' ,
loadMask : { msg : "数据加载中,请稍等..." } ,
trackMouseOver : true ,
disableSelection : false ,
plugins : [ this . FenCtnListCellEditing ] ,
selType : 'cellmodel' ,
tbar : [
{
xtype : 'label' ,
text : '集装箱信息' , //'应收费用',
style : 'font-size:14px' ,
labelColor : '#000' ,
//style:'background-color: #4b9bf5',
x : '5%' ,
y : '5%'
} ,
{
text : '增加明细' ,
tooltip : '增加明细' ,
id : "btnadddetail2" ,
iconCls : "btnadddetail" ,
handler : function ( button , event ) {
this . onAddDetailClick _Fen ( button , event ) ;
} ,
scope : this
} , {
text : '删除明细' ,
tooltip : '删除明细' ,
id : "btndeldetail2" ,
iconCls : "btndeletedetail" ,
handler : function ( button , event ) {
this . onDelDetailClick _Fen ( button , event ) ;
} ,
scope : this
} , '-' , {
id : 'btnFenCtnSave' ,
text : "保存分票箱信息" ,
iconCls : "btnsave" ,
handler : function ( button , event ) {
this . SaveFenCtn ( ) ;
} ,
scope : this
} ] ,
columns : [ {
sortable : true ,
dataIndex : 'CTN_ID' ,
header : '编号' ,
hidden : true ,
width : 0
} , {
sortable : true ,
dataIndex : 'ORDNO' ,
header : '业务编号' ,
hidden : true ,
width : 0
} , {
dataIndex : 'CTNALL' , //CTNEXHIBIT
header : '箱型' ,
width : 80 ,
editor : this . comboxCTNALL
} , {
dataIndex : 'CTNNUM' ,
header : '箱量' ,
width : 60 ,
editor : {
xtype : 'numberfield' ,
allowBlank : false ,
selectOnFocus : true
}
} , {
dataIndex : 'KGS' ,
header : '单箱重量' ,
width : 60 ,
editor : {
xtype : 'numberfield' ,
allowBlank : false ,
selectOnFocus : true
}
} , {
dataIndex : 'REMARK' ,
header : '备注' ,
width : 190 ,
editor : {
xtype : 'textfield' ,
selectOnFocus : true
}
} ]
} ) ;
this . formFen = 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 : 'container' ,
defaultType : 'textfield' ,
layout : 'hbox' ,
height : 280 ,
defaults : {
anchor : '96%'
} ,
items : [
this . FenList ,
this . FenCtnList
]
} ]
} ) ;
//#endregion
this . panelFenPiao = new Ext . Panel ( {
title : '货代单' , //'分票信息',
layout : "border" ,
region : 'center' ,
animate : true ,
autoScroll : true ,
containerScroll : true ,
frame : false ,
items : [
this . formFen
]
} ) ;
//#region 审核或驳回界面
this . storeUser = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.UserRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetUserRefList' }
} ) ;
this . storeUser . load ( { params : { condition : "" } } ) ;
this . comboxSeaeOp = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '操作' ,
store : this . storeUser ,
name : 'OP' ,
valueField : 'UserName' ,
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
//this.formHead.getForm().findField('AUDITOPERATOR2').setValue(combo.value);
}
}
}
//,
//listeners: {
// scope: this,
// 'select': function (combo, records, eOpts) {
// if (records.length > 0) {
// this.formHead.getForm().findField('AUDITOPERATOR2').setValue(combo.value);
// }
// }
//}
} ) ;
this . comboxSeaeOp2 = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '操作' ,
store : this . storeUser ,
id : "Audit_OP" ,
name : 'OP' ,
valueField : 'UserName' ,
displayField : 'CodeAndName' ,
listeners : {
scope : this ,
'select' : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
//this.formHead.getForm().findField('AUDITOPERATOR2').setValue(combo.value);
}
}
}
} ) ;
this . comboxSeaeCustService = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '客服' ,
store : this . storeUser ,
name : 'CUSTSERVICE' ,
valueField : 'UserCode' ,
displayField : 'CodeAndName'
} ) ;
//客户加载_订舱代理
this . storeFORWARDER2 = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CustomRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCustomRefList' }
} ) ;
//this.storeFORWARDER2.load({ params: { condition: "ISBOOKING='1'"} });
this . storeFORWARDER2 . loadData ( this . mainWin . GetPubStore ( "FORWARDER" ) . data . items ) ;
//船公司
this . comboxFORWARDER2 = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '订舱代理' ,
store : this . storeFORWARDER2 ,
matchFieldWidth : false ,
forceSelection : true ,
name : 'FORWARDER' ,
valueField : 'CustName' ,
displayField : 'CodeAndName'
} ) ;
this . formAudit = Ext . widget ( 'form' , {
frame : true ,
region : 'center' ,
bodyPadding : 5 ,
fieldDefaults : {
margins : '2 2 2 2' ,
labelAlign : 'right' ,
flex : 1 ,
labelWidth : 90 ,
msgTarget : 'qtip'
} ,
items : [
{ //fieldset 1
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'anchor' ,
defaults : {
anchor : '100%'
} ,
items : [ {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [ {
fieldLabel : '会计期间' ,
xtype : 'monthfield' ,
name : 'ACCDATE'
} , this . comboxSeaeOp
]
} , {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [ this . comboxSeaeCustService
]
} , {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [ this . comboxFORWARDER2
]
} , {
xtype : 'textareafield' ,
grow : true ,
fieldLabel : '备注' ,
labelWidth : 0 ,
height : 90 ,
name : 'REMARK' ,
anchor : '100%'
}
] //end items(fieldset 1)
} //end fieldset 1
] //end root items
} ) ;
me = this ;
this . winAuditShow = Ext . create ( 'Ext.window.Window' , {
title : "接受销售订舱" ,
width : 450 ,
//height : 120,
//plain : true,
iconCls : "addicon" ,
resizable : false ,
// 是否可以拖动
// draggable:false,
collapsible : true , // 允许缩放条
closeAction : 'close' ,
closable : true ,
modal : 'true' ,
buttonAlign : "center" ,
bodyStyle : "padding:0 0 0 0" ,
items : [ this . formAudit ] ,
buttons : [ {
text : "确认接受" ,
minWidth : 70 ,
handler : function ( ) {
var form = me . formAudit . getForm ( ) ;
var ACCDATE = form . findField ( 'ACCDATE' ) . getRawValue ( ) ;
if ( ACCDATE == '' || ACCDATE == null || ACCDATE == undefined ) {
Ext . Msg . show ( { title : '提示' , msg : '会计期间为必填!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
} ;
me . accdate = ACCDATE ;
var User = me . comboxSeaeOp . getValue ( ) ;
if ( User == '' || User == null || User == undefined ) {
Ext . Msg . show ( { title : '提示' , msg : '操作员为必填!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
} ;
me . seaeop = User ;
me . seaecustservice = me . comboxSeaeCustService . getValue ( ) ;
me . FORWARDER = me . comboxFORWARDER2 . getValue ( ) ;
me . ORREMARK = form . findField ( 'REMARK' ) . getValue ( ) ;
me . onAuditPassClick ( ) ;
}
} , {
text : "关闭" ,
minWidth : 70 ,
handler : function ( ) {
me . winAuditShow . close ( ) ;
}
} ]
} ) ;
this . formAuditBack = Ext . widget ( 'form' , {
frame : true ,
region : 'center' ,
title : "<a href='#'><font color='#FF0000'>驳回原因</font></a>" ,
bodyPadding : 5 ,
fieldDefaults : {
margins : '2 2 2 2' ,
labelAlign : 'right' ,
flex : 1 ,
labelWidth : 90 ,
msgTarget : 'qtip'
} ,
items : [ {
xtype : 'textareafield' ,
grow : true ,
fieldLabel : '' ,
labelSeparator : '' ,
labelWidth : 0 ,
height : 100 ,
name : 'ORREASON' ,
anchor : '100%'
}
] //end root items
} ) ;
me = this ;
this . winAuditBackShow = Ext . create ( 'Ext.window.Window' , {
title : "驳回销售订舱" ,
width : 450 ,
//height : 120,
//plain : true,
iconCls : "addicon" ,
resizable : false ,
// 是否可以拖动
// draggable:false,
collapsible : true , // 允许缩放条
closeAction : 'close' ,
closable : true ,
modal : 'true' ,
buttonAlign : "center" ,
bodyStyle : "padding:0 0 0 0" ,
items : [ this . formAuditBack ] ,
buttons : [ {
text : "确认驳回" ,
minWidth : 70 ,
handler : function ( ) {
var form = me . formAuditBack . getForm ( ) ;
var ORREASON = form . findField ( 'ORREASON' ) . getRawValue ( ) ;
if ( ORREASON == '' || ORREASON == null || ORREASON == undefined ) {
Ext . Msg . show ( { title : '提示' , msg : '驳回原因为必填!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
} ;
me . reason = ORREASON ;
me . onAuditBack ( ) ;
}
} , {
text : "关闭" ,
minWidth : 70 ,
handler : function ( ) {
me . winAuditBackShow . close ( ) ;
}
} ]
} ) ;
//#endregion
//#region
this . panelFee = new Shipping . OrderFeeGrid ( {
region : 'center' ,
layout : 'border'
} ) ;
this . panelFee . StoreCustType . add ( { "SCUSTTYPE" : "WTDW-委托单位" , "CUSTTYPE" : "委托单位" , "CUSTNAME" : "CUSTOMERNAME" } ) ;
this . panelFee . StoreCustType . add ( { "SCUSTTYPE" : "CGS-船公司" , "CUSTTYPE" : "船公司" , "CUSTNAME" : "CARRIER" } ) ;
this . panelFee . StoreCustType . add ( { "SCUSTTYPE" : "DCDL-订舱代理" , "CUSTTYPE" : "订舱代理" , "CUSTNAME" : "FORWARDER" } ) ;
this . panelFee . StoreCustType . add ( { "SCUSTTYPE" : "FHR-发货人" , "CUSTTYPE" : "发货人" , "CUSTNAME" : "SHIPPERID" } ) ;
this . panelFee . StoreCustType . add ( { "SCUSTTYPE" : "SHR-收货人" , "CUSTTYPE" : "收货人" , "CUSTNAME" : "CONSIGNEEID" } ) ;
this . panelFee . StoreCustType . add ( { "SCUSTTYPE" : "TZR-通知人" , "CUSTTYPE" : "通知人" , "CUSTNAME" : "NOTIFYPARTYID" } ) ;
this . panelFee . StoreDrOpRange . load ( { params : { optype : "modSeaeOrderList" } } ) ;
this . panelFee . StoreCrOpRange . load ( { params : { optype : "modSeaeOrderList" } } ) ;
//this.panelFee.storeFeeNameRef.load({ params: { condition: "ISSEA='1' "} });
//this.panelFee.storeFeeNameRefCr.load({ params: { condition: "ISSEA='1' "} });
this . panelFee . storeFeeNameRef . loadData ( this . mainWin . GetPubStore ( "PubStore_SeaFee" ) . data . items ) ;
this . panelFee . storeFeeNameRefCr . loadData ( this . mainWin . GetPubStore ( "PubStore_SeaFee" ) . data . items ) ;
//this.panelFee.storeCustomerNameRef.loadData(this.mainWin.GetPubStore("PubStore_CustomerAll").data.items);
//this.panelFee.storeCustomerNameRefCr.loadData(this.mainWin.GetPubStore("PubStore_CustomerAll").data.items);
//#endregion
//#region 按钮Toolbar
this . panelBtn = new Ext . Panel ( {
region : "north" ,
tbar : [
{
id : 'btnEPrev' ,
text : '上一票' , //"上一票",
// iconCls: "btnsave",
handler : function ( button , event ) {
this . PrevRecord ( ) ;
} ,
scope : this
} , {
id : 'btnENext' ,
text : '下一票' , //"下一票",
// iconCls: "btnsave",
handler : function ( button , event ) {
this . NextRecord ( ) ;
} ,
scope : this
} ,
{
id : 'btnESave' ,
text : "保存" ,
iconCls : "btnsave" ,
handler : function ( button , event ) {
this . Save ( '0' ) ;
} ,
scope : this
} , {
id : 'btnESaveAndClose' ,
text : "保存并关闭" ,
handler : function ( button , event ) {
this . Save ( '1' ) ;
} ,
scope : this
} , {
id : 'btnESaveAndNew' ,
text : "保存并新建" ,
handler : function ( button , event ) {
this . Save ( '2' ) ;
this . panelOcr . hide ( ) ;
} ,
scope : this
} , {
id : 'btnECopyNew' ,
text : "复制新建" ,
handler : function ( button , event ) {
var basicForm = this . formHead . getForm ( ) ;
//var editForm = this.formEdit.getForm();
this . opStatus = 'add' ;
//basicForm.findField('BSNO').setDisabled(false);
var field = basicForm . findField ( 'BSNO' ) ;
var BSNO = me . GetNewBSNO ( ) ;
field . setValue ( BSNO ) ;
//basicForm.findField('BSNO').setDisabled(true);
field = basicForm . findField ( 'ORDNO' ) ;
field . setValue ( '' ) ;
field = basicForm . findField ( 'INPUTBY' ) ;
field . setValue ( SHOWNAME ) ;
field = basicForm . findField ( 'ORSTATUS' ) ;
field . setValue ( '9' ) ;
field = basicForm . findField ( 'ORSTATUSREF' ) ;
field . setValue ( '录入状态' ) ;
//field = basicForm.findField('MBLNO');
//field.setValue('');
this . panelFee . strBSNO = BSNO ;
for ( var j = 0 ; j < this . storeBodyList . getCount ( ) ; j += 1 ) {
var memberbody = this . storeBodyList . getAt ( j ) ;
memberbody . set ( "ORDNO" , '*' ) ;
memberbody . commit ( ) ;
} ;
//for (var j = 0; j < this.panelFee.storeDrChFee.getCount(); j += 1) {
// var memberbody = this.panelFee.storeDrChFee.getAt(j);
// memberbody.set("GId", NewGuid());
// memberbody.set("BsNo", '*');
// memberbody.commit();
//};
//for (var j = 0; j < this.panelFee.storeCrChFee.getCount(); j += 1) {
// var memberbody = this.panelFee.storeCrChFee.getAt(j);
// memberbody.set("GId", NewGuid());
// memberbody.set("BsNo", '*');
// memberbody.commit();
//};
this . panelFee . storeDrChFee . removeAll ( ) ;
this . panelFee . storeCrChFee . removeAll ( ) ;
this . GetEditStatus ( ) ;
var children = this . tabSeaepanel . items ;
if ( children ) {
for ( var i = children . length - 1 , len = 0 ; i >= len ; i -- ) {
if ( children . items [ i ] . id ) {
if ( children . items [ i ] . id == 'pnlmodSeaeOrderInfo' ) {
this . tabSeaepanel . setActiveTab ( i ) ;
}
}
}
}
//this.storeFenList.removeAll();
this . SetCopyNewFen ( ) ;
this . storeFenCtnList . removeAll ( ) ;
this . tabSeaepanel . doLayout ( ) ;
this . panelOcr . hide ( ) ;
//this.setSaveBtnStatus(true);
} ,
scope : this
} , {
id : 'btnECopyNew_withfee' ,
text : "复制新建(含费用)" ,
handler : function ( button , event ) {
var basicForm = this . formHead . getForm ( ) ;
//var editForm = this.formEdit.getForm();
this . opStatus = 'add' ;
//basicForm.findField('BSNO').setDisabled(false);
var field = basicForm . findField ( 'BSNO' ) ;
var BSNO = me . GetNewBSNO ( ) ;
field . setValue ( BSNO ) ;
//basicForm.findField('BSNO').setDisabled(true);
field = basicForm . findField ( 'ORDNO' ) ;
field . setValue ( '' ) ;
field = basicForm . findField ( 'INPUTBY' ) ;
field . setValue ( SHOWNAME ) ;
field = basicForm . findField ( 'ORSTATUS' ) ;
field . setValue ( '9' ) ;
field = basicForm . findField ( 'ORSTATUSREF' ) ;
field . setValue ( '录入状态' ) ;
//field = basicForm.findField('MBLNO');
//field.setValue('');
this . panelFee . strBSNO = BSNO ;
for ( var j = 0 ; j < this . storeBodyList . getCount ( ) ; j += 1 ) {
var memberbody = this . storeBodyList . getAt ( j ) ;
memberbody . set ( "ORDNO" , '*' ) ;
memberbody . commit ( ) ;
} ;
for ( var j = 0 ; j < this . panelFee . storeDrChFee . getCount ( ) ; j += 1 ) {
var memberbody = this . panelFee . storeDrChFee . getAt ( j ) ;
memberbody . set ( "GId" , NewGuid ( ) ) ;
memberbody . set ( "FeeStatus" , 1 ) ;
memberbody . set ( "BsNo" , '*' ) ;
memberbody . commit ( ) ;
} ;
for ( var j = 0 ; j < this . panelFee . storeCrChFee . getCount ( ) ; j += 1 ) {
var memberbody = this . panelFee . storeCrChFee . getAt ( j ) ;
memberbody . set ( "GId" , NewGuid ( ) ) ;
memberbody . set ( "BsNo" , '*' ) ;
memberbody . set ( "FeeStatus" , 1 ) ;
memberbody . commit ( ) ;
} ;
this . GetEditStatus ( ) ;
var children = this . tabSeaepanel . items ;
if ( children ) {
for ( var i = children . length - 1 , len = 0 ; i >= len ; i -- ) {
if ( children . items [ i ] . id ) {
if ( children . items [ i ] . id == 'pnlmodSeaeOrderInfo' ) {
this . tabSeaepanel . setActiveTab ( i ) ;
}
}
}
}
//this.storeFenList.removeAll();
this . SetCopyNewFen ( ) ;
this . storeFenCtnList . removeAll ( ) ;
this . tabSeaepanel . doLayout ( ) ;
this . panelOcr . hide ( ) ;
//this.setSaveBtnStatus(true);
} ,
scope : this
} , '-' , {
text : "关闭" ,
handler : function ( button , event ) {
window . close ( ) ;
} ,
scope : this
} , {
id : 'btnENew' ,
text : "新建" ,
handler : function ( button , event ) {
this . LoadData ( 'add' , '' ) ;
var basicForm = this . formEdit . getForm ( ) ;
//basicForm.findField('BsNo').setDisabled(false);
this . panelOcr . hide ( ) ;
} ,
scope : this
} , '-' , {
id : 'btnSubmitAudit' ,
text : '提交审核' ,
tooltip : '提交审核' ,
handler : function ( button , event ) {
this . onSubmitAuditClick ( ) ;
} ,
scope : this
} , {
id : 'btnSubmitAuditBack' ,
text : '撤销提交' ,
tooltip : '撤销提交' ,
handler : function ( button , event ) {
this . onSubmitAuditBackClick ( ) ;
} ,
scope : this
} , '-' , {
id : 'btnAccAudit' ,
text : '审核通过' ,
tooltip : '审核通过' ,
handler : function ( button , event ) {
this . onAccAudit ( ) ;
} ,
scope : this
} ,
{
text : "驳回提交" ,
id : 'btnAuditBack' ,
iconCls : "btndelete" ,
handler : function ( button , event ) {
var billstatus = this . formHead . getForm ( ) . findField ( 'ORSTATUS' ) . getValue ( ) ;
if ( ( billstatus != "1" ) && ( billstatus != "0" ) ) {
Ext . Msg . show ( { title : '提示' , msg : '当前状态无法驳回!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
}
this . winAuditBackShow . show ( ) ;
} ,
scope : this
} , {
text : "确认订舱" ,
id : 'btnAudit' ,
iconCls : "btnadd" ,
handler : function ( button , event ) {
var billstatus = this . formHead . getForm ( ) . findField ( 'ORSTATUS' ) . getValue ( ) ;
if ( billstatus != "0" ) {
Ext . Msg . show ( { title : '提示' , msg : '当前状态无法确认接单!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
}
var form = this . formAudit . getForm ( ) ;
var VoucherDate = form . findField ( 'ACCDATE' ) ;
var thisday = this . getToMonth ( ) ;
VoucherDate . setRawValue ( thisday )
var basicForm = this . formHead . getForm ( ) ;
this . comboxSeaeOp . setValue ( basicForm . findField ( 'OP' ) . getValue ( ) ) ;
this . comboxSeaeCustService . setValue ( basicForm . findField ( 'CUSTSERVICE' ) . getValue ( ) ) ;
var editForm = this . formEdit . getForm ( ) ;
this . comboxFORWARDER2 . setValue ( editForm . findField ( 'FORWARDER' ) . getValue ( ) ) ;
this . winAuditShow . show ( ) ;
} ,
scope : this
} , {
id : 'btnEPrint' ,
text : "打印" ,
iconCls : "btnprint" ,
handler : function ( button , event ) {
this . Print ( ) ;
} ,
scope : this
} , '-' , {
text : '查看联系方式' ,
handler : function ( menu , event ) {
_this . ShowUserInfo ( ) ;
}
} , '-' , {
text : 'OCR' , //快速录入,
handler : function ( button , event ) {
this . tabtree . hide ( ) ;
this . tabSeaepanel . setActiveTab ( 1 ) ;
this . panelOcr . body . dom . children [ 0 ] . src = "/MvcShipping/Ocr/UpOcrAuto" ;
if ( this . panelOcr . isHidden ( ) ) {
this . panelOcr . show ( ) ;
}
if ( this . panelOcr . width < 2 ) {
var wSeaePanel = this . tabSeaepanel . getWidth ( ) ;
this . panelOcr . setWidth ( wSeaePanel * 0.6 ) ;
}
} ,
scope : this
} ]
} ) ; //end 按钮Toolbar
//#endregion
//#region 框架结构
this . panelpage = new Ext . Panel ( {
// title: '订舱说明',
layout : "border" ,
region : 'center' ,
animate : true ,
autoScroll : true ,
// containerScroll: true,
frame : false ,
items : [ this . formEdit , this . panelFee ]
} ) ;
this . panelSeae = new Ext . Panel ( {
title : '订舱信息' ,
id : 'pnlmodSeaeOrderInfo' ,
layout : "border" ,
region : 'center' ,
animate : true ,
autoScroll : true ,
frame : false ,
//closable:true,
items : [ this . panelBtn , this . formHead , this . panelpage ]
} ) ;
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 : 'A619ED40-4F44-4330-9208-5114F173B934'
}
} ) ;
this . tabtree = new Ext . tree . Panel ( {
region : 'west' ,
title : '业务信息' ,
split : true ,
width : 180 ,
collapsible : true ,
margins : '0 0 0 0' ,
store : this . treestore ,
rootVisible : false ,
hideHeaders : true ,
animate : false ,
lines : false ,
columns : [ {
xtype : 'treecolumn' ,
text : '模块名称' ,
width : 178 ,
dataIndex : 'DESCRIPTION'
} ] ,
listeners : {
scope : this ,
'itemclick' : function ( _this , record , item , index , e , eOpts ) {
var finded = false ;
if ( record . data . MODULEURL == '@' ) {
this . tabSeaepanel . setActiveTab ( 0 ) ;
} else if ( record . data . MODULEURL != '#' ) {
var children = this . tabSeaepanel . items ;
if ( children ) {
for ( var i = 0 , len = children . length ; i < len ; i ++ ) {
if ( children . items [ i ] . id ) {
if ( children . items [ i ] . id == 'pnl' + record . data . NAME ) {
this . tabSeaepanel . setActiveTab ( i ) ;
finded = true ;
}
}
}
}
if ( finded == false ) {
if ( this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) == "" ) {
Ext . Msg . show ( { title : '注意' , msg : '请先保存业务信息后再打开其他模块!' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
} else {
if ( record . data . NAME == 'modSeaeOrderFee' ) {
var paneltabitems = new Shipping . SeaeFee ( {
id : 'pnl' + record . data . NAME ,
layout : "border" ,
region : "center" ,
autoScroll : true ,
frame : true ,
closable : true ,
title : record . data . DESCRIPTION
} ) ;
} else {
var paneltabitems = new Ext . Panel ( {
id : 'pnl' + record . data . NAME ,
layout : "fit" ,
region : "center" ,
autoScroll : true ,
frame : false ,
closable : true ,
title : record . data . DESCRIPTION ,
html : ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + record . data . MODULEURL + '"> </iframe>'
} ) ;
}
this . tabSeaepanel . add ( paneltabitems ) ;
this . tabSeaepanel . setActiveTab ( paneltabitems ) ;
this . tabSeaepanel . doLayout ( ) ;
}
}
}
}
}
} ) ;
this . tabSeaepanel = new Ext . TabPanel ( {
activeTab : 0 ,
autoWidth : true ,
border : true ,
frame : false ,
region : 'center' ,
id : "TabSeaePanel" ,
enableTabScroll : true ,
items :
[
this . panelSeae ,
this . panelBill ,
this . panelFenPiao
]
} ) ;
this . panelOcr = new Ext . Panel ( {
title : 'OCR' ,
id : 'panelOcr' ,
width : 0 ,
visible : false ,
region : 'east' ,
animate : true ,
autoScroll : true ,
split : true ,
closeAction : 'hide' ,
closable : true ,
html : '<iframe src="" width="100%" height="100%"></iframe>'
} ) ;
this . panelOcr . on ( {
hide : function ( ) {
this . tabtree . show ( ) ;
} ,
scope : this
} ) ;
Ext . apply ( this , {
items : [ this . tabtree , this . tabSeaepanel , this . panelOcr ]
} ) ;
//#endregion
//#region 其他
parentWin = window . parent . opener ;
this . InitData ( ) ;
Ext . Ajax . request ( {
waitMsg : '' ,
url : '/MvcShipping/MsBaseInfo/GetUserModuleEnable' ,
params : {
modulename : "modSaleOrderNoSaleFEE"
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( result . Success == true ) {
_this . panelFee . setVisible ( false ) ;
} 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
} ) ;
Ext . Ajax . request ( {
waitMsg : '' ,
url : '/MvcShipping/MsBaseInfo/GetUserModuleEnable' ,
params : {
modulename : "modSaleOrderAuditSelf"
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( result . Success != true ) {
this . SaleOrderAuditSelf = 0 ;
} else {
this . SaleOrderAuditSelf = 1 ;
}
} else {
}
} ,
scope : this
} ) ;
this . FenList . on ( 'edit' , function ( editor , e , eOpts ) {
this . FenAfterEdit ( editor , e , eOpts ) ;
} , this ) ;
this . gridList . on ( 'edit' , function ( editor , e , eOpts ) {
this . CtnAfterEdit ( editor , e , eOpts ) ;
} , this ) ;
//#endregion
//#region 审核通过时填写四个字段
//合约类型 合约号 BC号 电商订单号
//
this . formAuditEdit = Ext . widget ( 'form' , {
frame : true ,
region : 'center' ,
bodyPadding : 5 ,
fieldDefaults : {
margins : '2 2 2 2' ,
labelAlign : 'right' ,
flex : 2 ,
labelWidth : 90 ,
msgTarget : 'qtip'
} ,
items : [
{ //fieldset 1
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'anchor' ,
defaults : {
anchor : '100%'
} ,
items : [
this . comboxBSSOURCE2
, {
fieldLabel : '合约号' ,
id : "Audit_CONTRACTNO" ,
name : 'CONTRACTNO'
} ,
{
fieldLabel : 'BC' ,
id : "Audit_BCNO" ,
name : 'BCNO'
} , {
fieldLabel : '电商订单号' ,
id : "Audit_DIANSHANGORDERNO" ,
name : 'DIANSHANGORDERNO'
} , this . comboxSeaeOp2
// {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [
// this.comboxBSSOURCE
// , {
// fieldLabel: '合约号',
// id:"Audit_CONTRACTNO",
// name: 'CONTRACTNO'
// }
// ]
//}, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [
// {
// fieldLabel: 'BC号',
// id: "Audit_BSNO",
// name: 'BSNO'
// }, {
// fieldLabel: '电商订单号',
// id: "Audit_DIANSHANGORDERNO",
// name: 'DIANSHANGORDERNO'
// }
// ]
// }
] //end items(fieldset 1)
} //end fieldset 1
] //end root items
} ) ;
me = this ;
this . winAuditEdit = Ext . create ( 'Ext.window.Window' , {
title : "审核通过" ,
width : 450 ,
height : 300 ,
//plain : true,
iconCls : "addicon" ,
resizable : false ,
// 是否可以拖动
// draggable:false,
collapsible : true , // 允许缩放条
closeAction : 'close' ,
closable : true ,
modal : 'true' ,
buttonAlign : "center" ,
bodyStyle : "padding:0 0 0 0" ,
items : [ this . formAuditEdit ] ,
buttons : [ {
text : "审核通过" , //"确定发送",
minWidth : 70 ,
handler : function ( ) {
me . AUDITDATA2 . BSSOURCE = Ext . getCmp ( "Audit_BSSOURCE" ) . getValue ( ) ;
me . AUDITDATA2 . CONTRACTNO = Ext . getCmp ( "Audit_CONTRACTNO" ) . getValue ( ) ;
me . AUDITDATA2 . BCNO = Ext . getCmp ( "Audit_BCNO" ) . getValue ( ) ;
me . AUDITDATA2 . DIANSHANGORDERNO = Ext . getCmp ( "Audit_DIANSHANGORDERNO" ) . getValue ( ) ;
me . AUDITDATA2 . OP = Ext . getCmp ( "Audit_OP" ) . getValue ( ) ;
me . doAccAudit ( ) ;
}
} , {
text : "关闭" , //"关闭",
minWidth : 70 ,
handler : function ( ) {
me . winAuditEdit . close ( ) ;
}
} ]
} ) ;
//#endregion
} , //end initUIComponents
//#region 加载事件
InitData : function ( ) {
this . opStatus = 'add' ;
var condition = '' ;
_this = this ;
if ( parentWin ) {
var ret = parentWin . OprationSwap ( ) ;
this . opStatus = ret [ 0 ] ;
this . StoreList = ret [ 1 ] ;
this . editRecord = ret [ 2 ] ;
this . isAudit = ret [ 3 ] ;
this . formTitle = ret [ 4 ] ;
this . copyfee = ret [ 5 ] ;
}
this . setAuditBtnStatus ( this . isAudit ) ;
if ( this . opStatus == 'edit' || this . opStatus == 'copyadd' ) {
//condition = "ORDNO='" + this.editRecord.get('ORDNO') + "'";
////2018年2月6日10:56:45 李进举 鼎世 集装箱列表不可见
//this.storeBodyList.load({ params: { condition: condition } });
this . LoadCtn ( this . editRecord . get ( 'ORDNO' ) ) ;
}
if ( this . opStatus == 'edit' ) {
document . title = this . formTitle + "-" + this . editRecord . get ( 'MBLNO' ) . toString ( ) . trim ( ) ;
}
else {
document . title = "销售订舱-新增" ;
}
if ( this . editRecord ) {
this . LoadData ( this . opStatus , this . editRecord . get ( 'BSNO' ) ) ;
} else {
this . LoadData ( this . opStatus , '' ) ;
}
this . LoadMustBe ( ) ;
} , //end InitData
LoadData : function ( opstatus , BSNO ) {
this . serialNo = 0 ;
condition = "BSNO='" + BSNO + "'" ;
this . opStatus = opstatus ;
var _this = this ;
Ext . Ajax . request ( {
waitMsg : '正在查询主表数据...' ,
url : '/MvcShipping/MsSeaeOrder/GetData' ,
params : {
handle : opstatus ,
condition : condition
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( ! result . Success ) {
Ext . Msg . show ( {
title : '提示' ,
msg : result . Message ,
icon : Ext . MessageBox . ERROR ,
buttons : Ext . Msg . OK
} ) ;
return ;
}
data = result . data ;
if ( this . opStatus == 'copyadd' ) {
//复制新建时不保留主提单号,审核日期 确认日期
data . MBLNO = "" ;
data . AUDITDATE = "" ;
data . CONFIRMDATE = "" ;
//alert(this.editRecord.data.BSNO);
//载入原业务的费用 将状态置为1 BSNO置为* GID置为新
if ( this . copyfee ) {
this . LoadCopyFee ( this . editRecord . data . BSNO ) ;
}
}
this . LoadInit ( data ) ;
condition2 = "ORDNO=(select ORDNO from crm_seaeorder where BSNO='" + BSNO + "')" ;
if ( data . SHIPPERID ) {
//name: 'SHIPPERID',
// valueField: 'SHORTNAME',
// displayField: 'CodeAndName',
var currSHIPPERID = { SHORTNAME : data . SHIPPERID , CodeAndName : data . SHIPPERID }
this . storeShipper . add ( currSHIPPERID ) ;
}
if ( data . CONSIGNEEID ) {
var currCONSIGNEEID = { SHORTNAME : data . CONSIGNEEID , CodeAndName : data . CONSIGNEEID }
this . storeConsignee . add ( currCONSIGNEEID ) ;
}
if ( data . NOTIFYPARTYID ) {
var currNOTIFYPARTYID = { SHORTNAME : data . NOTIFYPARTYID , CodeAndName : data . NOTIFYPARTYID }
this . storenotifyparty . add ( currNOTIFYPARTYID ) ;
}
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 . GetEditStatus ( ) ;
if ( this . opStatus == 'add' ) {
this . LoadDefValue ( ) ;
}
if ( this . opStatus == 'add' ) {
this . ClearFen ( ) ;
} else if ( this . opStatus == 'edit' ) {
this . LoadFen ( data . BSNO ) ;
}
if ( this . opStatus == 'copyadd' ) {
this . storeBodyList . load ( {
params : { condition : condition2 } ,
callback : function ( r , options , success ) {
if ( success ) {
if ( this . storeBodyList . getCount ( ) > 0 ) {
for ( var j = 0 ; j < _this . storeBodyList . getCount ( ) ; j += 1 ) {
var memberbody = _this . storeBodyList . getAt ( j ) ;
memberbody . set ( "CTN_ID" , NewGuid ( ) ) ;
memberbody . set ( "ORDNO" , "*" ) ;
memberbody . commit ( ) ;
}
} else {
_this . storeBodyList . removeAll ( ) ;
}
}
} ,
scope : this
} ) ;
//var fencondition = " MASTERNO='" + BSNO + "' ";;
this . storeFenList . load ( {
params : { MASTERNO : BSNO } ,
callback : function ( r , options , success ) {
if ( success ) {
this . SetCopyNewFen ( ) ;
}
} ,
scope : this
} ) ;
this . opStatus = 'add' ;
} else if ( this . opStatus == 'edit' ) {
this . LoadCtn ( data . ORDNO ) ;
} else if ( this . opStatus == 'add' ) {
this . storeBodyList . removeAll ( ) ;
}
this . panelFee . EditRecord = this . editRecord ;
this . panelFee . stroplb = 'op_Seae' ;
if ( this . opStatus == 'add' ) this . panelFee . strBSNO = "" ;
else
this . panelFee . strBSNO = this . editRecord . get ( 'BSNO' ) ;
this . panelFee . StoreDateCurr . load ( { params : { optype : "op_Seae" , bsno : data . ORDNO } } ) ;
this . panelFee . StoreUnit . load ( { params : { bsno : data . ORDNO , bstype : "op_SeaeOrder" } } ) ;
if ( this . copyfee ) {
} else {
this . panelFee . storeDrChFee . load ( { params : { billno : data . BSNO , type : 1 , optype : "op_Seae" } } ) ;
this . panelFee . storeCrChFee . load ( { params : { billno : data . BSNO , type : 2 , optype : "op_Seae" } } ) ;
}
this . panelFee . storeBodySum . load ( {
params : { bsno : data . BSNO } ,
callback : function ( r , options , success ) {
if ( success ) {
_this . panelFee . setTotalHead ( ) ;
}
}
} ) ;
this . SetStatusColor ( ) ;
} else {
Ext . MessageBox . alert ( '请求出现错误,请重试' , response . responseText ) ;
}
} ,
scope : this
} ) ;
} , // end LoadDate
//#endregion
//#region 保存
Save : function ( type ) {
var basicForm = this . formEdit . getForm ( ) ;
var basicForm2 = this . formHead . getForm ( ) ;
var basicForm3 = this . formBill . getForm ( ) ;
var btnSubmitAudit = Ext . getCmp ( 'btnSubmitAudit' ) ;
btnSubmitAudit . disable ( ) ;
if ( ! basicForm . isValid ( ) ) {
Ext . Msg . show ( { title : '警告' , msg : '基本信息有必须项目不能为空!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
if ( ! basicForm2 . isValid ( ) ) {
Ext . Msg . show ( { title : '警告' , msg : '基本信息有必须项目不能为空!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
if ( ! basicForm3 . isValid ( ) ) {
Ext . Msg . show ( { title : '警告' , msg : '委托信息有必须项目不能为空!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
//
var bodydatas = [ ] ;
var isnoctn = false ;
for ( var i = 0 ; i < this . storeBodyList . getCount ( ) ; i += 1 ) {
var member = this . storeBodyList . getAt ( i ) ;
if ( member . data . CTNALL == '' ) {
isnoctn = true ;
}
bodydatas . push ( member ) ;
}
if ( this . ISMUSTBECNTR == '1' ) {
if ( this . storeBodyList . getCount ( ) == 0 ) {
Ext . Msg . show ( { title : '警告' , msg : '集装箱信息为必填,不能为空!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
}
if ( isnoctn ) {
Ext . Msg . show ( { title : '警告' , msg : '集装箱信息,箱型不能为空!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
//
var jsonBody = ConvertRecordsToJsonAll ( bodydatas ) ;
//var jsonDelBody = ConvertRecordsToJsonAll(this.bodyDel);
this . formHead . getForm ( ) . findField ( 'ORDNO' ) . 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 ( 'ORDNO' ) . setDisabled ( true ) ;
//
Ext . Msg . wait ( '正在保存数据, 请稍侯..' ) ;
Ext . Ajax . request ( {
waitMsg : '正在保存数据...' ,
url : '/MvcShipping/MsSeaeOrder/Save' ,
scope : this ,
params : {
opstatus : this . opStatus ,
data : Ext . JSON . encode ( data ) ,
data2 : Ext . JSON . encode ( data2 ) ,
data3 : Ext . JSON . encode ( data3 ) ,
body : jsonBody
} ,
callback : function ( options , success , response ) {
if ( success ) {
Ext . MessageBox . hide ( ) ;
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
var returnData = jsonresult . Data ;
this . formEdit . getForm ( ) . reset ( ) ;
this . formEdit . getForm ( ) . setValues ( returnData ) ;
this . formHead . getForm ( ) . reset ( ) ;
this . formHead . getForm ( ) . setValues ( returnData ) ;
this . formBill . getForm ( ) . reset ( ) ;
this . formBill . getForm ( ) . setValues ( returnData ) ;
//
if ( this . opStatus == 'add' ) {
var arrNewRecords = this . StoreList . add ( returnData ) ;
this . editRecord = arrNewRecords [ 0 ] ;
}
else if ( this . opStatus == 'edit' ) {
var editp = Ext . create ( 'MsSeaeOrderModel' , returnData ) ;
this . editRecord . fields . each ( function ( field ) {
if ( field . persist ) {
name = field . name ;
if ( name != 'id' )
this . editRecord . set ( name , editp . get ( name ) ) ;
}
} , this ) ;
this . editRecord . commit ( ) ;
}
if ( this . issubmit )
btnSubmitAudit . enable ( ) ;
// var feemodify = this.panelFee.getModifyStatus();
// if (feemodify) {
// this.panelFee..onPostDetailClick(button, event, 1);
// this.panelFee..onPostDetailClick(button, event, 1);
// }
if ( type == '0' ) {
this . opStatus = 'edit' ;
basicForm2 . findField ( 'ORDNO' ) . setDisabled ( true ) ;
for ( var j = 0 ; j < this . storeBodyList . getCount ( ) ; j += 1 ) {
var memberbody = this . storeBodyList . getAt ( j ) ;
memberbody . set ( "ORDNO" , this . editRecord . get ( 'ORDNO' ) ) ;
memberbody . commit ( ) ;
} ;
this . panelFee . EditRecord = this . editRecord ;
this . panelFee . stroplb = 'op_Seae' ;
this . panelFee . strBSNO = this . editRecord . get ( 'BSNO' ) ;
this . panelFee . StoreUnit . load ( { params : { bsno : this . editRecord . get ( 'ORDNO' ) , bstype : "op_SeaeOrder" } } ) ;
this . panelFee . StoreDateCurr . load ( { params : { optype : "op_Seae" , bsno : this . editRecord . get ( 'ORDNO' ) } } ) ;
} else if ( type == '1' ) {
window . close ( ) ;
} else if ( type == '2' ) {
this . LoadData ( 'add' , '' ) ;
}
this . SaveFen ( ) ;
this . panelFee . onPostDetailClick ( '' , '' , 1 ) ;
this . panelFee . onPostDetailClick ( '' , '' , 2 ) ;
} else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
} else {
Ext . Msg . show ( {
title : '请重试' ,
msg : '服务器响应出错' ,
icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK
} ) ;
}
}
} ) ;
} , //end save
//#endregion
//#region 集装箱按钮事件
onAddDetailClick : function ( button , event ) {
this . addDetail ( ) ;
} , //end onAddDetailClick
onDelDetailClick : function ( button , event ) {
this . deleteDetail ( ) ;
} , //onDelDetailClick
addDetail : function ( ) {
var record = Ext . create ( 'MsSeaeOrderCtn' , {
CTN _ID : NewGuid ( ) ,
ORDNO : '*' ,
CTNALL : '' ,
CTNNUM : 0 ,
KGS : 0 ,
REMARK : ''
} ) ;
this . storeBodyList . add ( record ) ;
var n = this . storeBodyList . getCount ( ) ;
this . gridListCellEditing . startEditByPosition ( { row : n - 1 , column : 2 } ) ;
} ,
deleteDetail : function ( ) {
var ORSTATUS = this . formHead . getForm ( ) . findField ( 'ORSTATUS' ) . getValue ( ) ;
if ( ORSTATUS == '0' ) {
Ext . Msg . show ( { title : '警告' , msg : '业务已提交审核,不允许操作!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
//this.serialNo = DsGetCurSerialNo(this.storeBodyList, this.serialNo);
var selectedRecords = this . gridList . selModel . getSelection ( ) ;
for ( var i = 0 ; i < selectedRecords . length ; i ++ ) {
var rec = selectedRecords [ i ] ;
if ( rec . data . ORDNO == "" || rec . data . ORDNO == "*" ) //如果是新增但没有保存的数据,没有必要提交到后台
{
this . storeBodyList . remove ( selectedRecords [ i ] ) ;
}
else {
Ext . MessageBox . confirm ( '提示' , '确定删除该记录吗?' , function ( btn ) {
if ( btn == 'yes' ) {
Ext . Msg . wait ( '正在删除数据...' ) ;
Ext . Ajax . request ( {
waitMsg : '正在删除数据...' ,
url : '/MvcShipping/MsSeaeOrder/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 ) ;
Ext . Msg . show ( { title : '提示' , msg : jsonresult . Message , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
}
else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
}
} ,
failure : function ( response , options ) {
Ext . Msg . show ( { title : '警告' , msg : '服务器响应出错,请重试' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
} ,
scope : this
} ) ; //end Ext.Ajax.request
}
} , this ) ;
}
//this.storeBodyList.remove(selectedRecords[i]);
}
} ,
GetContractFee : function ( ) {
var ORSTATUS = this . formHead . getForm ( ) . findField ( 'ORSTATUS' ) . getValue ( ) ;
if ( ORSTATUS == '0' ) {
Ext . Msg . show ( { title : '警告' , msg : '业务已提交审核,不允许操作!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
if ( this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) == "" ) {
Ext . Msg . show ( { title : '注意' , msg : '请先保存业务信息后再提取费用!' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
return ;
}
var CONTRACTNO = this . formHead . getForm ( ) . findField ( 'CONTRACTNO' ) . getValue ( ) ;
if ( CONTRACTNO == '' ) {
Ext . Msg . show ( { title : '警告' , msg : '约号为空,不能提取费用!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
var CARRIER = this . formHead . getForm ( ) . findField ( 'CARRIER' ) . getValue ( ) ;
if ( CARRIER == '' ) {
Ext . Msg . show ( { title : '警告' , msg : '船公司为空,不能提取费用!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
var PORTLOAD = this . formEdit . getForm ( ) . findField ( 'PORTLOAD' ) . getValue ( ) ;
if ( PORTLOAD == '' ) {
Ext . Msg . show ( { title : '警告' , msg : '装货港为空,不能提取费用!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
var PORTDISCHARGE = this . formEdit . getForm ( ) . findField ( 'PORTDISCHARGE' ) . getValue ( ) ;
if ( PORTDISCHARGE == '' ) {
Ext . Msg . show ( { title : '警告' , msg : '卸货港为空,不能提取费用!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
if ( this . storeBodyList . getCount ( ) == 0 ) {
Ext . Msg . show ( { title : '警告' , msg : '集装箱信息为空,不能提取费用!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
var bodydatas = [ ] ;
var isnoctn = false ;
for ( var i = 0 ; i < this . storeBodyList . getCount ( ) ; i += 1 ) {
var member = this . storeBodyList . getAt ( i ) ;
if ( member . data . CTNALL == '' ) {
isnoctn = true ;
}
bodydatas . push ( member ) ;
}
if ( isnoctn ) {
Ext . Msg . show ( { title : '警告' , msg : '集装箱信息,箱型不能为空!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
// DsOpenEditWin('/MvcShipping/MsCrmPriceCarrierList/ImpIndex');
DsOpenEditWin ( '/MvcShipping/MsCrmPriceCarrierList/ImpIndex' , "" , "400" , "1300" ) ; //this.editRecord.get('BSNO').toString()
} ,
//#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 . storeShipper . loadData ( this . mainWin . GetPubStore ( "PubStore_Shipper" ) . data . items ) ;
//this.storeShipper.load({
// params: { condition: " shippertype=2 " },
// callback: function (r, options, success) {
// if (success) {
// this.formBill.getForm().findField('SHIPPERID').setValue(data.SHIPPERID);
// }
// },
// scope: this
//});
this . storeShipper _fen . loadData ( this . mainWin . GetPubStore ( "PubStore_Shipper" ) . data . items ) ;
//this.storeShipper_fen.load({
// params: { condition: " shippertype=2 " },
// 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
} ) ;
var BLTYPE = this . formHead . getForm ( ) . findField ( 'BLTYPE' ) . getValue ( ) ;
if ( BLTYPE == "拼箱单票" || BLTYPE == "拼箱分票" ) {
this . panelBodyCtn . hide ( ) ;
}
else {
this . panelBodyCtn . show ( ) ;
}
var ORSTATUS = this . formHead . getForm ( ) . findField ( 'ORSTATUS' ) . getValue ( ) ;
// if (ORSTATUS == "2") {
// this.panelORREASON.show();
// }
// else {
// this.panelORREASON.hide();
// }
var CARGOID = this . formEdit . getForm ( ) . findField ( 'CARGOID' ) . getValue ( ) ;
if ( CARGOID == 'R' ) {
this . panelBodyDr . setVisible ( false ) ;
this . panelBodyRf . setVisible ( true ) ;
} else if ( CARGOID == 'D' ) {
this . panelBodyDr . setVisible ( true ) ;
this . panelBodyRf . setVisible ( false ) ;
} else {
this . panelBodyDr . setVisible ( false ) ;
this . panelBodyRf . setVisible ( false ) ;
}
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 ) ;
}
if ( data . CARRIER != '' ) {
var recordCustCode = Ext . create ( 'DsShipping.ux.CustomRefModel' , {
GId : NewGuid ( ) ,
CustCode : data . CARRIER ,
CustName : data . CARRIER ,
CodeAndName : data . CARRIER
} ) ;
this . storeCARRIER . add ( recordCustCode ) ;
}
if ( data . FORWARDER != '' ) {
var recordCustCode = Ext . create ( 'DsShipping.ux.CustomRefModel' , {
GId : NewGuid ( ) ,
CustCode : data . FORWARDER ,
CustName : data . FORWARDER ,
CodeAndName : data . FORWARDER
} ) ;
this . storeFORWARDER . add ( recordCustCode ) ;
}
this . LoadLane ( data . CARRIER ) ;
if ( data . LANE ) {
this . LoadPort ( data . LANE ) ;
} else {
this . LoadPort ( "-" ) ;
}
} ,
//#endregion
onSubmitAuditClick : function ( ) {
//var btnESave = Ext.getCmp('btnESave');
//var btnESaveAndClose = Ext.getCmp('btnESaveAndClose');
//var btnESaveAndNew = Ext.getCmp('btnESaveAndNew');
//var btnESave2 = Ext.getCmp('btnESave2');
//var btnESaveAndClose2 = Ext.getCmp('btnESaveAndClose2');
//btnESave.disable();
//btnESaveAndClose.disable();
//btnESaveAndNew.disable();
//btnESave2.disable();
//btnESaveAndClose2.disable();
var BSNO = this . formHead . getForm ( ) . findField ( 'BSNO' ) . getValue ( ) ;
var billstatus = this . formHead . getForm ( ) . findField ( 'ORSTATUS' ) . getValue ( ) ;
if ( ( billstatus != "9" ) && ( billstatus != "2" ) ) {
Ext . Msg . show ( { title : '提示' , msg : '当前状态无法提交审核!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
}
var isnoctn = false ;
var bodydatas = [ ] ;
for ( var i = 0 ; i < this . storeBodyList . getCount ( ) ; i += 1 ) {
var member = this . storeBodyList . getAt ( i ) ;
if ( member . data . CTNALL == '' ) {
isnoctn = true ;
}
bodydatas . push ( member ) ;
}
//
var jsonBody = ConvertRecordsToJsonAll ( bodydatas ) ;
if ( isnoctn ) {
Ext . Msg . show ( { title : '警告' , msg : '集装箱信息,箱型不能为空!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
//var jsonDelBody = ConvertRecordsToJsonAll(this.bodyDel);
this . formHead . getForm ( ) . findField ( 'ORDNO' ) . setDisabled ( false ) ;
//this.formEdit.getForm().findField('STLNAME').setDisabled(false);
//this.formEdit.getForm().findField('STLDATE').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 ( 'ORDNO' ) . setDisabled ( true ) ;
//this.formHead.getForm().findField('STLNAME').setDisabled(true);
//this.formHead.getForm().findField('STLDATE').setDisabled(true);
var basicForm = this . formEdit . getForm ( ) ;
var basicForm2 = this . formHead . getForm ( ) ;
var basicForm3 = this . formBill . getForm ( ) ;
if ( ! basicForm . isValid ( ) ) {
return ;
}
if ( ! basicForm2 . isValid ( ) ) {
return ;
}
if ( ! basicForm3 . isValid ( ) ) {
return ;
}
_this = this ;
Ext . Ajax . request ( {
waitMsg : '正在添加数据...' ,
url : '/MvcShipping/MsSeaeOrder/SubmitAuditForm' ,
params : {
opstatus : this . opStatus ,
data : Ext . JSON . encode ( data ) ,
data2 : Ext . JSON . encode ( data2 ) ,
data3 : Ext . JSON . encode ( data3 ) ,
body : jsonBody
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( ! result . Success ) {
Ext . Msg . show ( {
title : '提示' ,
msg : result . Message ,
icon : Ext . MessageBox . ERROR ,
buttons : Ext . Msg . OK
} ) ;
return ;
} else {
_this . opStatus = 'edit' ;
Ext . Ajax . request ( {
waitMsg : '正在查询主表数据...' ,
url : '/MvcShipping/MsSeaeOrder/GetData' ,
params : {
handle : 'edit' ,
condition : " ORDNO='" + result . Data + "'"
} ,
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 ;
}
var data = result . 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 ) ;
var editp = Ext . create ( 'MsSeaeOrderModel' , data ) ;
_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 ( ) ;
for ( var j = 0 ; j < _this . storeBodyList . getCount ( ) ; j += 1 ) {
var memberbody = _this . storeBodyList . getAt ( j ) ;
memberbody . set ( "ORDNO" , _this . editRecord . get ( 'ORDNO' ) ) ;
memberbody . commit ( ) ;
} ;
//btnESave.enable();
//btnESaveAndClose.enable();
//btnESaveAndNew.enable();
//btnESave2.enable();
//btnESaveAndClose2.enable();
_this . GetEditStatus ( ) ;
_this . panelFee . EditRecord = _this . editRecord ;
_this . panelFee . stroplb = 'op_Seae' ;
_this . panelFee . strBSNO = _this . editRecord . get ( 'BSNO' ) ;
_this . panelFee . StoreUnit . load ( { params : { bsno : _this . editRecord . get ( 'ORDNO' ) , bstype : "op_SeaeOrder" } } ) ;
_this . panelFee . StoreDateCurr . load ( { params : { optype : "op_Seae" , bsno : _this . editRecord . get ( 'ORDNO' ) } } ) ;
_this . SetStatusColor ( ) ;
} else {
Ext . MessageBox . alert ( '请求出现错误,请重试' , response . responseText ) ;
}
} ,
scope : this
} ) ;
}
} else {
Ext . MessageBox . alert ( '请求出现错误,请重试' , response . responseText ) ;
}
} ,
scope : this
} ) ;
} ,
onSubmitAuditBackClick : function ( ) {
var Duino = this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) ;
var billstatus = this . formHead . getForm ( ) . findField ( 'ORSTATUS' ) . getValue ( ) ;
if ( Duino == '*' ) {
Ext . Msg . show ( { title : '提示' , msg : '请先保存付费申请,然后才能提交审核!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
} ;
if ( billstatus != "1" ) {
Ext . Msg . show ( { title : '提示' , msg : '当前状态无法撤销提交!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
}
var bodydatas = [ ] ;
for ( var i = 0 ; i < this . storeBodyList . getCount ( ) ; i += 1 ) {
var member = this . storeBodyList . getAt ( i ) ;
bodydatas . push ( member ) ;
}
var jsonBody = ConvertRecordsToJsonAll ( bodydatas ) ;
this . formHead . getForm ( ) . findField ( 'ORDNO' ) . 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 ( 'ORDNO' ) . setDisabled ( true ) ;
_this = this ;
Ext . Ajax . request ( {
waitMsg : '正在添加数据...' ,
url : '/MvcShipping/MsSeaeOrder/SubmitAuditBackForm' ,
params : {
data : Ext . JSON . encode ( data ) ,
data2 : Ext . JSON . encode ( data2 ) ,
data3 : Ext . JSON . encode ( data3 ) ,
body : jsonBody
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( ! result . Success ) {
Ext . Msg . show ( {
title : '提示' ,
msg : result . Message ,
icon : Ext . MessageBox . ERROR ,
buttons : Ext . Msg . OK
} ) ;
return ;
} else {
Ext . Ajax . request ( {
waitMsg : '正在查询主表数据...' ,
url : '/MvcShipping/MsSeaeOrder/GetData' ,
params : {
handle : 'edit' ,
condition : " ORDNO='" + Duino + "'"
} ,
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 ;
}
var data = result . 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 ) ;
var editp = Ext . create ( 'MsSeaeOrderModel' , data ) ;
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 . GetEditStatus ( ) ;
_this . SetStatusColor ( ) ;
} else {
Ext . MessageBox . alert ( '请求出现错误,请重试' , response . responseText ) ;
}
} ,
scope : this
} ) ;
}
} else {
Ext . MessageBox . alert ( '请求出现错误,请重试' , response . responseText ) ;
}
} ,
scope : this
} ) ;
} ,
onAuditPassClick : function ( ) {
var SALE = this . formHead . getForm ( ) . findField ( 'SALE' ) . getValue ( ) ;
var DEFSALE = this . formHead . getForm ( ) . findField ( 'DEFSALE' ) . getValue ( ) ;
if ( this . SaleOrderAuditSelf == 1 ) {
if ( DEFSALE == '' || DEFSALE == SALE || SALE == SHOWNAME ) {
} else {
Ext . Msg . show ( { title : '警告' , msg : '你仅能接受揽货人和默认揽货人是自己的业务!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
}
var Duino = this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) ;
this . formHead . getForm ( ) . findField ( 'ORDNO' ) . 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 ( 'ORDNO' ) . setDisabled ( true ) ;
_this = this ;
Ext . MessageBox . confirm ( '提示' , '确定审核通过选中的业务吗?' , function ( btn ) {
if ( btn == 'yes' ) {
Ext . Msg . wait ( '正在审核数据...' ) ;
Ext . Ajax . request ( {
waitMsg : '正在审核数据...' ,
url : '/MvcShipping/MsSeaeOrder/AuditOrderForm' ,
params : {
data : Ext . JSON . encode ( data ) ,
data2 : Ext . JSON . encode ( data2 ) ,
data3 : Ext . JSON . encode ( data3 ) ,
accdate : _this . accdate ,
op : _this . seaeop ,
custservice : _this . seaecustservice ,
FORWARDER : _this . FORWARDER ,
ORREMARK : _this . ORREMARK
} ,
callback : function ( options , success , response ) {
if ( success ) {
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
Ext . Ajax . request ( {
waitMsg : '正在查询主表数据...' ,
url : '/MvcShipping/MsSeaeOrder/GetData' ,
params : {
handle : 'edit' ,
condition : " ORDNO='" + Duino + "'"
} ,
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 ;
}
var data = result . 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 ) ;
var editp = Ext . create ( 'MsSeaeOrderModel' , data ) ;
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 . GetEditStatus ( ) ;
} else {
Ext . MessageBox . alert ( '请求出现错误,请重试' , response . responseText ) ;
}
} ,
scope : this
} ) ;
Ext . Msg . show ( { title : '提示' , msg : '审核成功!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
}
else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
_this . winAuditShow . close ( )
}
} ,
failure : function ( response , options ) {
Ext . Msg . show ( { title : '警告' , msg : '服务器响应出错,请重试' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
} ,
success : function ( response , options ) {
} ,
scope : this
} ) ; //end Ext.Ajax.request
}
} , this ) ;
} ,
onAuditBack : function ( ) {
var Duino = this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) ;
this . formHead . getForm ( ) . findField ( 'ORDNO' ) . 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 ( 'ORDNO' ) . setDisabled ( true ) ;
_this = this ;
Ext . MessageBox . confirm ( '提示' , '确定驳回选中的业务吗?' , function ( btn ) {
if ( btn == 'yes' ) {
Ext . Msg . wait ( '正在驳回数据...' ) ;
Ext . Ajax . request ( {
waitMsg : '正在驳回数据...' ,
url : '/MvcShipping/MsSeaeOrder/AuditBackOrderForm' ,
params : {
data : Ext . JSON . encode ( data ) ,
data2 : Ext . JSON . encode ( data2 ) ,
data3 : Ext . JSON . encode ( data3 ) ,
orreason : _this . reason
} ,
callback : function ( options , success , response ) {
if ( success ) {
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
Ext . Ajax . request ( {
waitMsg : '正在查询主表数据...' ,
url : '/MvcShipping/MsSeaeOrder/GetData' ,
params : {
handle : 'edit' ,
condition : " ORDNO='" + Duino + "'"
} ,
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 ;
}
var data = result . 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 ) ;
var editp = Ext . create ( 'MsSeaeOrderModel' , data ) ;
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 . GetEditStatus ( ) ;
} else {
Ext . MessageBox . alert ( '请求出现错误,请重试' , response . responseText ) ;
}
} ,
scope : this
} ) ;
Ext . Msg . show ( { title : '提示' , msg : '驳回成功!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
}
else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
_this . winAuditBackShow . close ( ) ;
}
} ,
failure : function ( response , options ) {
Ext . Msg . show ( { title : '警告' , msg : '服务器响应出错,请重试' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
} ,
success : function ( response , options ) {
} ,
scope : this
} ) ; //end Ext.Ajax.request
}
} , this ) ;
} ,
///编辑页面审核通过 销售订舱审核通过
onAccAudit : function ( ) {
var billstatus = this . formHead . getForm ( ) . findField ( 'ORSTATUS' ) . getValue ( ) ;
if ( billstatus != "1" ) {
Ext . Msg . show ( { title : '提示' , msg : '当前状态无法审核通过!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
}
var SALE = this . formHead . getForm ( ) . findField ( 'SALE' ) . getValue ( ) ;
var DEFSALE = this . formHead . getForm ( ) . findField ( 'DEFSALE' ) . getValue ( ) ;
if ( this . SaleOrderAuditSelf == 1 ) {
if ( DEFSALE == '' || DEFSALE == SALE || SALE == SHOWNAME ) {
} else {
Ext . Msg . show ( { title : '警告' , msg : '你仅能接受揽货人和默认揽货人是自己的业务!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
}
this . formHead . getForm ( ) . findField ( 'ORDNO' ) . setDisabled ( false ) ;
this . AUDITDATA = this . formHead . getForm ( ) . getValues ( false , false , false ) ;
this . AUDITDATA2 = this . formEdit . getForm ( ) . getValues ( false , false , false ) ;
this . AUDITDATA3 = this . formBill . getForm ( ) . getValues ( false , false , false ) ;
this . formHead . getForm ( ) . findField ( 'ORDNO' ) . setDisabled ( true ) ;
this . AuditDuino = this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) ;
this . winAuditEdit . show ( ) ;
this . setAuditEditValue ( ) ;
} ,
setAuditEditValue ( ) {
Ext . getCmp ( "Audit_BSSOURCE" ) . setValue ( this . AUDITDATA2 . BSSOURCE ) ;
Ext . getCmp ( "Audit_CONTRACTNO" ) . setValue ( this . AUDITDATA2 . CONTRACTNO ) ;
Ext . getCmp ( "Audit_BCNO" ) . setValue ( this . AUDITDATA2 . BCNO ) ;
Ext . getCmp ( "Audit_DIANSHANGORDERNO" ) . setValue ( this . AUDITDATA2 . DIANSHANGORDERNO ) ;
Ext . getCmp ( "Audit_OP" ) . setValue ( this . AUDITDATA . OP ) ;
} ,
doAccAudit : function ( ) {
let _this = this ;
Ext . MessageBox . confirm ( '提示' , '确定审核通过此票业务吗?' , function ( btn ) {
if ( btn == 'yes' ) {
Ext . Msg . wait ( '正在审核数据...' ) ;
Ext . Ajax . request ( {
waitMsg : '正在审核数据...' ,
url : '/MvcShipping/MsSeaeOrder/AccAuditForm' ,
params : {
data : Ext . JSON . encode ( _this . AUDITDATA ) ,
data2 : Ext . JSON . encode ( _this . AUDITDATA2 ) ,
data3 : Ext . JSON . encode ( _this . AUDITDATA3 )
} ,
callback : function ( options , success , response ) {
if ( success ) {
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
Ext . Ajax . request ( {
waitMsg : '正在查询主表数据...' ,
url : '/MvcShipping/MsSeaeOrder/GetData' ,
params : {
handle : 'edit' ,
condition : " ORDNO='" + _this . AuditDuino + "'"
} ,
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 ;
}
var data = result . 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 ) ;
var editp = Ext . create ( 'MsSeaeOrderModel' , data ) ;
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 . GetEditStatus ( ) ;
_this . winAuditEdit . close ( ) ;
} else {
Ext . MessageBox . alert ( '请求出现错误,请重试' , response . responseText ) ;
}
} ,
scope : this
} ) ;
Ext . Msg . show ( { title : '提示' , msg : '审核成功!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
}
else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
}
} ,
failure : function ( response , options ) {
Ext . Msg . show ( { title : '警告' , msg : '服务器响应出错,请重试' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
} ,
success : function ( response , options ) {
} ,
scope : this
} ) ; //end Ext.Ajax.request
}
} , this ) ;
} ,
getToMonth : function ( ) {
var now = new Date ( ) ;
var year = now . getFullYear ( ) ; //年
var month = now . getMonth ( ) + 1 ; //月
var clock = year + "-" ;
if ( month < 10 )
clock = clock + "0" + month ;
else
clock = clock + month ;
return ( clock ) ;
} ,
//#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 fieldname = member . data . FIELDNAME ;
if ( fieldname == 'PlACERECEIPT' ) fieldname = 'PLACERECEIPT' ;
if ( fieldname == 'PlACERECEIPTID' ) fieldname = 'PLACERECEIPTID' ;
var headfield = this . formBill . getForm ( ) . findField ( fieldname ) ;
if ( headfield != NaN && headfield != null )
headfield . setValue ( member . data . DEFVALUE ) ;
} ;
} else {
}
}
} ,
scope : this
} ) ;
} ,
LoadMustBe : function ( ) {
this . storeMustBe . load ( {
params : { condition : "BSTYPE='销售订舱'" } ,
callback : function ( r , options , success ) {
if ( success ) {
if ( this . storeMustBe . getCount ( ) > 0 ) {
for ( var j = 0 ; j < this . storeMustBe . getCount ( ) ; j += 1 ) {
var member = this . storeMustBe . getAt ( j ) ;
var headfield = this . formHead . getForm ( ) . findField ( member . data . FIELDNAME ) ;
if ( headfield != NaN && headfield != null ) {
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 fieldname = member . data . FIELDNAME ;
if ( fieldname == 'PlACERECEIPT' ) fieldname = 'PLACERECEIPT' ;
var headfield = this . formBill . getForm ( ) . findField ( 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 ) ;
}
if ( fieldname == 'CNTRTOTAL' ) {
if ( member . data . ISMUST == "1" ) {
this . ISMUSTBECNTR = '1' ;
}
}
} ;
} else {
}
this . SetStatusColor ( ) ;
}
} ,
scope : this
} ) ;
} ,
//#endregion
//#region 编辑时按钮等的状态
GetEditStatus : function ( ) {
var canedit = false ;
var BSSTATUS = this . formHead . getForm ( ) . findField ( 'ORSTATUS' ) . getValue ( ) ;
var inputby = this . formHead . getForm ( ) . findField ( 'INPUTBY' ) . getValue ( ) ;
var op = this . formHead . getForm ( ) . findField ( 'OP' ) . getValue ( ) ;
_this = this ;
if ( BSSTATUS == "0" || BSSTATUS == "1" || BSSTATUS == "8" ) {
canedit = false ;
this . setSaveBtnStatus ( canedit ) ;
} else {
this . StoreOpRange . load ( {
params : { optype : "modSeaeOrderList" } ,
callback : function ( r , options , success ) {
if ( success ) {
if ( r . length != 0 ) {
var records = DsStoreQueryBy ( _this . StoreOpRange , 'OPID' , inputby ) ;
if ( records . getCount ( ) > 0 ) {
canedit = true ;
} else {
var recordins = DsStoreQueryBy ( _this . StoreOpRange , 'OPID' , op ) ;
if ( recordins . getCount ( ) > 0 ) {
canedit = true ;
} else {
canedit = false ;
}
}
} else { canedit = false ; }
//alert(_this.opStatus);
if ( _this . opStatus == 'add' ) {
//此时应为列表上点击复制添加的
canedit = true ;
}
_this . setSaveBtnStatus ( canedit ) ;
}
}
} ) ;
}
} ,
GetStringNum : function ( str ) {
var num = 0 ;
if ( str == null || str == '' ) return num ;
if ( str . length == 0 ) return num ;
var if _find = false ;
var str _num = '' ;
for ( var i = 0 ; i < str . length ; i += 1 ) {
var member = str . substr ( i , 1 ) ;
if ( ( member == '0' ) || ( member == '1' ) || ( member == '2' ) || ( member == '3' )
|| ( member == '4' ) || ( member == '5' ) || ( member == '6' ) || ( member == '7' )
|| ( member == '8' ) || ( member == '9' ) || ( member == '.' ) || ( member == '-' ) ) {
if ( ! if _find ) {
str _num = str _num + member ;
}
} else {
if _find = true ;
}
}
return str _num ;
} ,
OprationSwap : function ( ) {
var ret = new Array ( ) ;
ret [ 0 ] = this . editRecord ;
ret [ 1 ] = this . storeBodyList ;
ret [ 2 ] = '销售管理' ;
return ret ;
} ,
setAuditBtnStatus : function ( enable ) {
var btnESave = Ext . getCmp ( 'btnESave' ) ;
var btnESaveAndClose = Ext . getCmp ( 'btnESaveAndClose' ) ;
var btnESaveAndNew = Ext . getCmp ( 'btnESaveAndNew' ) ;
var btnESave2 = Ext . getCmp ( 'btnESave2' ) ;
var btnESaveAndClose2 = Ext . getCmp ( 'btnESaveAndClose2' ) ;
var btnEAddDetail = Ext . getCmp ( 'btnadddetail' ) ;
var btnEDeleteDetail = Ext . getCmp ( 'btndeldetail' ) ;
var btnENew = Ext . getCmp ( 'btnENew' ) ;
var btnECopyNew = Ext . getCmp ( 'btnECopyNew' ) ;
var btnSubmitAudit = Ext . getCmp ( 'btnSubmitAudit' ) ;
var btnSubmitAuditBack = Ext . getCmp ( 'btnSubmitAuditBack' ) ;
//var btnEPrint = Ext.getCmp('btnEPrint');
var btnAudit = Ext . getCmp ( 'btnAudit' ) ;
var btnAuditBack = Ext . getCmp ( 'btnAuditBack' ) ;
var btnAccAudit = Ext . getCmp ( 'btnAccAudit' ) ;
btnESave . setVisible ( ! enable ) ; ;
btnESaveAndClose . setVisible ( ! enable ) ;
btnESaveAndNew . setVisible ( ! enable ) ;
btnESave2 . setVisible ( ! enable ) ; ;
btnESaveAndClose2 . setVisible ( ! enable ) ; ;
btnEAddDetail . setVisible ( ! enable ) ;
btnEDeleteDetail . setVisible ( ! enable ) ;
btnENew . setVisible ( ! enable ) ; ;
btnECopyNew . setVisible ( ! enable ) ;
btnSubmitAudit . setVisible ( ! enable ) ;
btnSubmitAuditBack . setVisible ( ! enable ) ;
//btnEPrint.setVisible(!enable);
btnAccAudit . setVisible ( enable ) ;
btnAudit . setVisible ( enable ) ;
btnAuditBack . setVisible ( enable ) ;
if ( enable ) {
Ext . Ajax . request ( {
waitMsg : '' ,
url : '/MvcShipping/MsBaseInfo/GetUserModuleEnable' ,
params : {
modulename : "modSaleOrderAudit"
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( result . Success != true ) {
btnAuditBack . disable ( ) ;
} else {
btnAuditBack . enable ( ) ;
}
} else {
}
} ,
scope : this
} ) ;
Ext . Ajax . request ( {
waitMsg : '' ,
url : '/MvcShipping/MsBaseInfo/GetUserModuleEnable' ,
params : {
modulename : "modSaleOrderAuditBack"
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( result . Success != true ) {
btnAuditBack . disable ( ) ;
} else {
btnAuditBack . enable ( ) ;
}
} else {
}
} ,
scope : this
} ) ;
Ext . Ajax . request ( {
waitMsg : '' ,
url : '/MvcShipping/MsBaseInfo/GetUserModuleEnable' ,
params : {
modulename : "modSaleOrderConfirm"
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( result . Success != true ) {
btnAudit . disable ( ) ;
} else {
btnAudit . enable ( ) ;
}
} else {
}
} ,
scope : this
} ) ;
} ;
} ,
setSaveBtnStatus : function ( enable ) {
var btnESave = Ext . getCmp ( 'btnESave' ) ;
var btnESaveAndClose = Ext . getCmp ( 'btnESaveAndClose' ) ;
var btnESave2 = Ext . getCmp ( 'btnESave2' ) ;
var btnESaveAndClose2 = Ext . getCmp ( 'btnESaveAndClose2' ) ;
var btnESaveAndNew = Ext . getCmp ( 'btnESaveAndNew' ) ;
var btnEAddDetail = Ext . getCmp ( 'btnadddetail' ) ;
var btnEDeleteDetail = Ext . getCmp ( 'btndeldetail' ) ;
var btnadddrfee = Ext . getCmp ( 'btnadddrfee' ) ;
var btnpostdrfee = Ext . getCmp ( 'btnpostdrfee' ) ;
var btndeldrfee = Ext . getCmp ( 'btndeldrfee' ) ;
var btnaddhsdrfee = Ext . getCmp ( 'btnaddhsdrfee' ) ;
var btnaddcrfee = Ext . getCmp ( 'btnaddcrfee' ) ;
var btnpostcrfee = Ext . getCmp ( 'btnpostcrfee' ) ;
var btndelcrfee = Ext . getCmp ( 'btndelcrfee' ) ;
var btnaddhscrfee = Ext . getCmp ( 'btnaddhscrfee' ) ;
var btnFenSave = Ext . getCmp ( 'btnFenSave' ) ;
var btnFenCtnSave = Ext . getCmp ( 'btnFenCtnSave' ) ;
var btndeldetail2 = Ext . getCmp ( 'btndeldetail2' ) ;
var btnadddetail2 = Ext . getCmp ( 'btnadddetail2' ) ;
var btnaddfen = Ext . getCmp ( 'btnaddfen' ) ;
var btndelfen = Ext . getCmp ( 'btndelfen' ) ;
if ( enable ) {
btnESave . enable ( ) ;
btnESaveAndClose . enable ( ) ;
btnESaveAndNew . enable ( ) ;
btnESave2 . enable ( ) ;
btnESaveAndClose2 . enable ( ) ;
btnEAddDetail . enable ( ) ;
btnEDeleteDetail . enable ( ) ;
// btnadddrfee.enable();
// btnpostdrfee.enable();
// btndeldrfee.enable();
// btnaddhsdrfee.enable();
// btnaddcrfee.enable();
// btnpostcrfee.enable();
// btndelcrfee.enable();
// btnaddhscrfee.enable();
btnFenSave . enable ( ) ;
btnFenCtnSave . enable ( ) ;
btndeldetail2 . enable ( ) ;
btnadddetail2 . enable ( ) ;
btnaddfen . enable ( ) ;
btndelfen . enable ( ) ;
} else {
btnESave . disable ( ) ;
btnESaveAndClose . disable ( ) ;
btnESaveAndNew . disable ( ) ;
btnESave2 . disable ( ) ;
btnESaveAndClose2 . disable ( ) ;
btnEAddDetail . disable ( ) ;
btnEDeleteDetail . disable ( ) ;
// btnadddrfee.disable();
// btnpostdrfee.disable();
// btndeldrfee.disable();
// btnaddhsdrfee.disable();
// btnaddcrfee.disable();
// btnpostcrfee.disable();
// btndelcrfee.disable();
// btnaddhscrfee.disable();
btnFenSave . disable ( ) ;
btnFenCtnSave . disable ( ) ;
btndeldetail2 . disable ( ) ;
btnadddetail2 . disable ( ) ;
btnaddfen . disable ( ) ;
btndelfen . disable ( ) ;
}
Ext . Ajax . request ( {
waitMsg : '' ,
url : '/MvcShipping/MsBaseInfo/GetUserModuleEnable' ,
params : {
modulename : "modSaleOrderNoSubMit"
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( result . Success == true ) {
Ext . getCmp ( 'btnSubmitAudit' ) . disable ( ) ;
Ext . getCmp ( 'btnSubmitAuditBack' ) . disable ( ) ;
this . issubmit = false ;
} else {
//
}
} else {
}
} ,
scope : this
} ) ;
} ,
setEIStatus : function ( ) {
if ( this . opStatus == "add" ) {
}
} ,
//#endregion
//#region 打印
Print : function ( ) {
var basicForm = this . formHead . getForm ( ) ;
var billNo = basicForm . findField ( 'BSNO' ) . value ;
if ( billNo == '*' || billNo == '' ) {
Ext . Msg . show ( { title : '错误' , msg : '单据还没有保存,请保存后再打印' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
return ;
}
var printType = 'MSOPSEAEORDER' ;
var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM crm_seaeorder WHERE BSNO = '" + billNo + "'" ;
var sql2 = "" ;
var sql3 = "" ;
var sql4 = "" ;
var sql5 = "" ;
var sql6 = "" ;
PrintComm ( printType , sql1 , sql2 , sql3 , sql4 , sql5 , sql6 ) ;
} ,
//#endregion
//#region 载入航线和港口
LoadLane : function ( CUSTOMERNAME ) {
this . storeLANE . load ( { params : { CUSTOMERNAME : CUSTOMERNAME } } ) ;
} ,
LoadPort : function ( LANE ) {
this . storeCodeDisport . load ( { params : { PORT : "" , LANE : LANE } } ) ;
this . storeCodeDisport2 . load ( { params : { PORT : "" , LANE : LANE } } ) ;
this . storeCodeDisport5 . load ( { params : { PORT : "" , LANE : LANE } } ) ;
} ,
//#endregion
//#region 保存、载入分票信息和分票箱信息
onAddFenClick : function ( ) {
_this = this ;
if ( this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) == "" ) {
Ext . Msg . show ( { title : '注意' , msg : '请先保存业务信息后再录入分票信息!' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
return ;
}
let dirtycount = 0 ;
for ( var i = 0 ; i < this . storeFenList . getCount ( ) ; i += 1 ) {
var member = this . storeFenList . getAt ( i ) ;
if ( member . dirty ) {
dirtycount ++ ;
}
}
if ( dirtycount > 0 ) {
Ext . MessageBox . alert ( '请先保存未保存的分票信息' , response . responseText ) ;
return ;
}
else {
var record = Ext . create ( 'MsSeaeOrderModel' , {
BSNO : _this . GetNewBSNO ( ) ,
ORDNO : '*' ,
PKGS : 0 ,
KGS : 0 ,
CBM : 0
} ) ;
this . storeFenList . add ( record ) ;
var n = this . storeFenList . getCount ( ) ;
this . FenListCellEditing . startEditByPosition ( { row : n - 1 , column : 2 } ) ;
}
} ,
onDelFenClick : function ( ) {
var ORSTATUS = this . formHead . getForm ( ) . findField ( 'ORSTATUS' ) . getValue ( ) ;
if ( ORSTATUS == '0' ) {
Ext . Msg . show ( { title : '警告' , msg : '业务已提交审核,不允许操作!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
//this.serialNo = DsGetCurSerialNo(this.storeBodyList, this.serialNo);
var selectedRecords = this . FenList . selModel . getSelection ( ) ;
var dellist = [ ] ;
for ( var i = 0 ; i < selectedRecords . length ; i ++ ) {
var rec = selectedRecords [ i ] ;
if ( rec . data . ORDNO == "" || rec . data . ORDNO == "*" ) //如果是新增但没有保存的数据,没有必要提交到后台
{
this . storeFenList . remove ( selectedRecords [ i ] ) ;
}
else {
dellist . push ( rec )
}
}
if ( dellist . length == 0 ) return ;
var jsonFen = ConvertRecordsToJsonAll ( dellist ) ;
Ext . MessageBox . confirm ( '提示' , '确定删除这些记录吗?' , function ( btn ) {
if ( btn == 'yes' ) {
Ext . Msg . wait ( '正在删除数据...' ) ;
Ext . Ajax . request ( {
waitMsg : '正在删除数据...' ,
url : '/MvcShipping/MsSeaeOrder/DeleteFen' ,
params : {
fen : jsonFen
} ,
callback : function ( options , success , response ) {
if ( success ) {
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
this . storeFenList . remove ( rec ) ;
this . LoadCtn ( this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) ) ;
Ext . Msg . show ( { title : '提示' , msg : jsonresult . Message , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
}
else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
}
} ,
failure : function ( response , options ) {
Ext . Msg . show ( { title : '警告' , msg : '服务器响应出错,请重试' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
} ,
scope : this
} ) ; //end Ext.Ajax.request
}
} , this ) ;
//this.storeBodyList.remove(selectedRecords[i]);
} ,
onAddDetailClick _Fen : function ( ) {
if ( ! this . GetSelectedFenORDNO ( ) ) {
Ext . Msg . show ( { title : '警告' , msg : '请先选中一行已保存的分票信息!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
} else {
var record = Ext . create ( 'MsSeaeOrderCtn' , {
CTN _ID : NewGuid ( ) ,
ORDNO : '*' ,
CTNALL : '' ,
CTNNUM : 0 ,
REMARK : ''
} ) ;
this . storeFenCtnList . add ( record ) ;
var n = this . storeFenCtnList . getCount ( ) ;
this . FenCtnListCellEditing . startEditByPosition ( { row : n - 1 , column : 2 } ) ;
}
} ,
onDelDetailClick _Fen : function ( ) {
var ORSTATUS = this . formHead . getForm ( ) . findField ( 'ORSTATUS' ) . getValue ( ) ;
if ( ORSTATUS == '0' ) {
Ext . Msg . show ( { title : '警告' , msg : '业务已提交审核,不允许操作!' , icon : Ext . Msg . WARNING , buttons : Ext . Msg . OK } ) ;
return ;
}
var HeadORDNO = this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) ;
//this.serialNo = DsGetCurSerialNo(this.storeBodyList, this.serialNo);
var selectedRecords = this . FenCtnList . selModel . getSelection ( ) ;
for ( var i = 0 ; i < selectedRecords . length ; i ++ ) {
var rec = selectedRecords [ i ] ;
if ( rec . data . ORDNO == "" || rec . data . ORDNO == "*" ) //如果是新增但没有保存的数据,没有必要提交到后台
{
this . storeFenCtnList . remove ( selectedRecords [ i ] ) ;
}
else {
Ext . MessageBox . confirm ( '提示' , '确定删除该记录吗?' , function ( btn ) {
if ( btn == 'yes' ) {
Ext . Msg . wait ( '正在删除数据...' ) ;
Ext . Ajax . request ( {
waitMsg : '正在删除数据...' ,
url : '/MvcShipping/MsSeaeOrder/DeleteFenCtn' ,
params : {
HeadORDNO : HeadORDNO ,
data : Ext . JSON . encode ( rec . data )
} ,
callback : function ( options , success , response ) {
if ( success ) {
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
this . storeFenCtnList . remove ( rec ) ;
this . LoadFen ( ) ;
this . LoadCtn ( HeadORDNO ) ;
Ext . Msg . show ( { title : '提示' , msg : jsonresult . Message , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
}
else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
}
} ,
failure : function ( response , options ) {
Ext . Msg . show ( { title : '警告' , msg : '服务器响应出错,请重试' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
} ,
scope : this
} ) ; //end Ext.Ajax.request
}
} , this ) ;
}
//this.storeBodyList.remove(selectedRecords[i]);
}
} ,
onSelectFen : function ( button , event ) {
//选中分票时 载入分票箱信息
this . LoadFenCtn ( this . GetSelectedFenORDNO ( ) ) ;
} ,
GetSelectedFenORDNO ( ) {
var selectedRecords = this . FenList . selModel . getSelection ( ) ;
var record = selectedRecords [ 0 ] ;
if ( record ) {
return record . data . ORDNO ;
} else {
return null ;
}
} ,
LoadCopyFee ( OLDBSNO ) {
//for (var j = 0; j < this.panelFee.storeDrChFee.getCount(); j += 1) {
// var memberbody = this.panelFee.storeDrChFee.getAt(j);
// memberbody.set("GId", NewGuid());
// memberbody.set("FeeStatus", 1);
// memberbody.set("BsNo", '*');
// memberbody.commit();
//};
//for (var j = 0; j < this.panelFee.storeCrChFee.getCount(); j += 1) {
// var memberbody = this.panelFee.storeCrChFee.getAt(j);
// memberbody.set("GId", NewGuid());
// memberbody.set("BsNo", '*');
// memberbody.set("FeeStatus", 1);
// memberbody.commit();
//};
let _this = this ;
this . panelFee . storeDrChFee . load ( {
params : { billno : OLDBSNO , type : 1 , optype : "op_Seae" } ,
callback : function ( result , i , success ) {
if ( success ) {
//var jsonresult = Ext.JSON.decode(response.responseText);
//if (jsonresult.Success) {
//for (var j = 0; j < _this.panelFee.storeDrChFee.getCount(); j += 1) {
// var memberbody = _this.panelFee.storeDrChFee.getAt(j);
// memberbody.set("GId", NewGuid());
// memberbody.set("FeeStatus", 1);
// memberbody.set("BsNo", '*');
// memberbody.commit();
//};
for ( var j = 0 ; j < _this . panelFee . storeCrChFee . getCount ( ) ; j += 1 ) {
var memberbody = _this . panelFee . storeCrChFee . getAt ( j ) ;
memberbody . set ( "GId" , NewGuid ( ) ) ;
memberbody . set ( "FeeStatus" , 1 ) ;
memberbody . set ( "BsNo" , '*' ) ;
memberbody . commit ( ) ;
} ;
//} else {
// Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
//}
} else {
Ext . Msg . show ( {
title : '请重试' ,
msg : '服务器响应出错' ,
icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK
} ) ;
}
}
} ) ;
this . panelFee . storeCrChFee . load ( {
params : { billno : OLDBSNO , type : 2 , optype : "op_Seae" }
,
callback : function ( result , i , success ) {
if ( success ) {
for ( var j = 0 ; j < _this . panelFee . storeCrChFee . getCount ( ) ; j += 1 ) {
var memberbody = _this . panelFee . storeCrChFee . getAt ( j ) ;
memberbody . set ( "GId" , NewGuid ( ) ) ;
memberbody . set ( "FeeStatus" , 1 ) ;
memberbody . set ( "BsNo" , '*' ) ;
memberbody . commit ( ) ;
} ;
} else {
Ext . Msg . show ( {
title : '请重试' ,
msg : '服务器响应出错' ,
icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK
} ) ;
}
}
} ) ;
} ,
LoadFen ( ) {
//载入分票信息
let BSNO = this . editRecord . get ( 'BSNO' ) . toString ( ) ;
this . storeFenList . load ( {
params : { MASTERNO : BSNO } ,
callback : function ( options , success , response ) {
if ( success ) {
_this . SumHeadKGS ( ) ;
} else {
Ext . Msg . show ( {
title : '请重试' ,
msg : '服务器响应出错' ,
icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK
} ) ;
}
}
} ) ;
} ,
ClearFen ( ) {
this . storeFenList . removeAll ( ) ;
} ,
SetCopyNewFen ( ) {
//var oldfenlist = JSON.parse(JSON.stringify(obj));
if ( this . storeFenList . getCount ( ) > 0 ) {
for ( var j = 0 ; j < this . storeFenList . getCount ( ) ; j += 1 ) {
var memberbody = _this . storeFenList . getAt ( j ) ;
memberbody . set ( "ORDNO" , "*" ) ;
memberbody . set ( "BSNO" , NewGuid ( ) ) ;
memberbody . set ( "MASTERNO" , '' ) ;
//memberbody.set("", '');
//memberbody.commit();
}
} else {
this . storeFenList . removeAll ( ) ;
}
} ,
LoadFenCtn ( FenORDNO ) {
//载入
this . storeFenCtnList . load ( { params : { condition : " ORDNO='" + FenORDNO + "' " } } ) ;
} ,
LoadCtn ( ORDNO ) {
condition = "ORDNO='" + ORDNO + "'" ;
let _this = this ;
this . storeBodyList . load ( {
params : { condition : condition } ,
callback : function ( options , success , response ) {
if ( success ) {
_this . SumHeadKGS ( ) ;
} else {
Ext . Msg . show ( {
title : '请重试' ,
msg : '服务器响应出错' ,
icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK
} ) ;
}
}
} ) ;
} ,
SaveFen : function ( ) {
if ( this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) == "" ) {
Ext . Msg . show ( { title : '注意' , msg : '请先保存业务信息后再录入分票信息!' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
return ;
} else {
var HeadORDNO = this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) ;
//var jsonDelBody = ConvertRecordsToJsonAll(this.bodyDel);
this . formHead . getForm ( ) . findField ( 'ORDNO' ) . 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 ( 'ORDNO' ) . setDisabled ( true ) ;
var bodydatas = [ ] ;
for ( var i = 0 ; i < this . storeFenList . getCount ( ) ; i += 1 ) {
var member = this . storeFenList . getAt ( i ) ;
bodydatas . push ( member ) ;
}
var jsonFen = ConvertRecordsToJson ( bodydatas ) ;
if ( jsonFen == "" ) return ;
var fenctndatas = [ ] ;
for ( var i = 0 ; i < this . storeFenCtnList . getCount ( ) ; i += 1 ) {
var member = this . storeFenCtnList . getAt ( i ) ;
fenctndatas . push ( member ) ;
}
var jsonFenctn = ConvertRecordsToJson ( fenctndatas ) ;
Ext . Msg . wait ( '正在保存数据, 请稍侯..' ) ;
Ext . Ajax . request ( {
waitMsg : '正在保存数据...' ,
url : '/MvcShipping/MsSeaeOrder/SaveFen' ,
scope : this ,
params : {
data : Ext . JSON . encode ( data ) ,
data2 : Ext . JSON . encode ( data2 ) ,
data3 : Ext . JSON . encode ( data3 ) ,
fen : jsonFen ,
fenctn : jsonFenctn
} ,
callback : function ( options , success , response ) {
if ( success ) {
Ext . MessageBox . hide ( ) ;
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
this . LoadFen ( ) ;
//this.LoadData(this.opStatus, " ORDNO='" + HeadORDNO + "'");
} else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
} else {
Ext . Msg . show ( {
title : '请重试' ,
msg : '服务器响应出错' ,
icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK
} ) ;
}
}
} ) ;
}
} ,
SaveFenCtn : function ( ) {
if ( this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) == "" ) {
Ext . Msg . show ( { title : '注意' , msg : '请先保存业务信息后再录入分票信息!' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
return ;
} else {
var fenORDNO = this . GetSelectedFenORDNO ( ) ;
var HeadORDNO = this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) ;
if ( ! fenORDNO ) {
Ext . Msg . show ( { title : '注意' , msg : '请先保存分票信息后再录入它的集装箱信息!' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
return ;
} else {
}
var fenctndatas = [ ] ;
for ( var i = 0 ; i < this . storeFenCtnList . getCount ( ) ; i += 1 ) {
var member = this . storeFenCtnList . getAt ( i ) ;
fenctndatas . push ( member ) ;
}
var jsonFenctn = ConvertRecordsToJson ( fenctndatas ) ;
if ( jsonFenctn == "" ) return ;
Ext . Msg . wait ( '正在保存数据, 请稍侯..' ) ;
Ext . Ajax . request ( {
waitMsg : '正在保存数据...' ,
url : '/MvcShipping/MsSeaeOrder/SaveFenCtn' ,
scope : this ,
params : {
fenORDNO : fenORDNO ,
HeadORDNO : HeadORDNO ,
fenCtn : jsonFenctn
} ,
callback : function ( options , success , response ) {
if ( success ) {
Ext . MessageBox . hide ( ) ;
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
this . LoadFenCtn ( fenORDNO ) ;
this . LoadFen ( ) ;
this . LoadCtn ( this . formHead . getForm ( ) . findField ( 'ORDNO' ) . getValue ( ) ) ;
} else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
} else {
Ext . Msg . show ( {
title : '请重试' ,
msg : '服务器响应出错' ,
icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK
} ) ;
}
}
} ) ;
}
}
,
SetStatusColor ( ) {
//if (value == '审核通过') {
// meta.tdCls = 'feestatus_pass'; #9ACD32
//} else if (value == '录入状态') {
//} else if (value == '提交审核') {
// meta.tdCls = 'feestatus_refer'; #FFE37E
//} else if (value == '确认订舱') {
// meta.tdCls = 'feestatus_settle'; #87CEFA
//} else if (value == '驳回') {
// meta.tdCls = 'feestatus_nopass'; #FF4500
//} else if (value == '退舱') {
// meta.tdCls = 'feestatus_Del';#FF4500
//}
// .x - grid - row.feestatus_refer.x - grid - cell
//{
// background- color: #FFE37E;
//}
//.x - grid - row.feestatus_pass.x - grid - cell
//{
// background - color: #9ACD32;
//}
//.x - grid - row.feestatus_nopass.x - grid - cell
//{
// background - color: #FF4500;
//}
//.x - grid - row.feestatus_settle.x - grid - cell
//{
// background - color: #87CEFA;
//}
let value = this . formHead . getForm ( ) . findField ( "ORSTATUSREF" ) . getValue ( )
var headfield = this . formHead . getForm ( ) . findField ( "ORSTATUSREF" ) ;
if ( headfield != NaN && headfield != null ) {
let color = "#FFFFFF" ;
if ( value == '审核通过' ) {
headfield . setFieldStyle ( { background : '#9ACD32' } ) ;
//meta.tdCls = 'feestatus_pass'; //#9ACD32
} else if ( value == '录入状态' ) {
headfield . setFieldStyle ( { background : '#FFFFFF' } ) ;
} else if ( value == '提交审核' ) {
headfield . setFieldStyle ( { background : '#FFE37E' } ) ;
//meta.tdCls = 'feestatus_refer'; //#FFE37E
} else if ( value == '确认订舱' ) {
headfield . setFieldStyle ( { background : '#87CEFA' } ) ;
//meta.tdCls = 'feestatus_settle'; //#87CEFA
} else if ( value == '驳回' ) {
headfield . setFieldStyle ( { background : '#FF4500' } ) ;
//meta.tdCls = 'feestatus_nopass'; //#FF4500
} else if ( value == '退舱' ) {
headfield . setFieldStyle ( { background : '#FF4500' } ) ;
//meta.tdCls = 'feestatus_Del';//#FF4500
}
}
}
//#endregion
, FenAfterEdit : function ( editor , e , eOpts ) {
//选择委托单位后自动填联系人电话邮箱
if ( e . value == e . originalValue ) return ;
if ( e . field == 'CUSTOMERNAME' ) {
var s = " (ISOPERATOR=1 or ISSALEMAN=1) and LINKID in (select gid from [info_client] where SHORTNAME='" + e . value + "')" ;
this . storeInfoClientContact . load ( {
params : { condition : s } ,
callback : function ( r , options , success ) {
if ( success ) {
if ( this . storeInfoClientContact . getCount ( ) > 0 ) {
var member = this . storeInfoClientContact . getAt ( 0 ) ;
e . record . set ( 'OPERATOR' , member . data . SHOWNAME ) ;
e . record . set ( 'OPERATORTEL' , member . data . TEL ) ;
e . record . set ( 'OPERATOREMAIL' , member . data . EMAIL ) ;
//this.formHead.getForm().findField('OPERATOR').setValue(member.data.SHOWNAME);
//this.formHead.getForm().findField('OPERATORTEL').setValue(member.data.TEL);
//this.formHead.getForm().findField('OPERATOREMAIL').setValue(member.data.EMAIL);
} else {
e . record . set ( 'OPERATOR' , "" ) ;
e . record . set ( 'OPERATORTEL' , "" ) ;
e . record . set ( 'OPERATOREMAIL' , "" ) ;
//this.formHead.getForm().findField('OPERATOR').setValue('');
//this.formHead.getForm().findField('OPERATORTEL').setValue('');
//this.formHead.getForm().findField('OPERATOREMAIL').setValue('');
}
}
} ,
scope : this
} ) ;
//var records = DsStoreQueryBy(this.storeInfoClientContact, 'CNTRNO', e.value);
//if (records.getCount() > 0) {
// var data = records.getAt(0).data;
// e.record.set('SEALNO', data.SEALNO);
// e.record.set('KINDPKGS', data.KINDPKGS);
// var PKGS = data.PKGS;
// var KGS = data.KGS;
// var CBM = data.CBM;
// var GID = e.record.data['GID'];
// for (var i = 0; i < this.storeManifestList.getCount(); i += 1) {
// var member = this.storeManifestList.getAt(i);
// if (member.data.CNTRNO == e.value && member.data.GID != GID) {
// PKGS = PKGS.add(-member.data.PKGS);
// KGS = KGS.add(-member.data.KGS);
// CBM = CBM.add(-member.data.CBM);
// }
// }
// e.record.set('PKGS', PKGS);
// e.record.set('KGS', KGS);
// e.record.set('CBM', CBM);
//} else {
// // e.record.set('CustomerName', 0);
//}
}
}
, CtnAfterEdit : function ( editor , e , eOpts ) {
//选择委托单位后自动填联系人电话邮箱
if ( e . value == e . originalValue ) return ;
if ( e . field == 'KGS' || e . field == 'CTNNUM' ) {
var KGS = 0 ;
this . SumHeadKGS ( ) ;
}
}
, SumHeadKGS : function ( ) {
KGS = 0 ;
for ( var i = 0 ; i < this . storeBodyList . getCount ( ) ; i += 1 ) {
var member = this . storeBodyList . getAt ( i ) ;
KGS += parseFloat ( member . data . KGS ) * parseFloat ( member . data . CTNNUM ) ;
}
this . formEdit . getForm ( ) . findField ( 'KGS' ) . setValue ( KGS ) ;
}
, GetNewBSNO ( ) {
return 'topseae' + NewGuid ( ) . toLowerCase ( ) ;
}
,
PrevRecord : function ( ) {
var modifystr = this . getIsModify ( ) ;
if ( modifystr != "" ) {
Ext . Msg . show ( { title : '警告' , msg : modifystr + '未保存,如果离开此页,将丢失未保存的更改 ! ! ! ' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ; //'未保存,如果离开此页,将丢失未保存的更改 ! ! ! '
return ;
}
var j = this . StoreList . indexOf ( this . editRecord ) ;
if ( j == 0 ) {
Ext . Msg . show ( { title : '警告' , msg : '已是最前一票' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ; //'已是最前一票'
return ;
}
if ( j == this . StoreList . count ) {
Ext . Msg . show ( { title : '警告' , msg : '已是最后一票' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ; //'已是最后一票'
return ;
}
var children = this . tabSeaepanel . items ;
if ( children ) {
for ( var i = children . length - 1 , len = 0 ; i >= len ; i -- ) {
if ( children . items [ i ] . id ) {
if ( children . items [ i ] . id == 'pnlmodSeaeOrderInfo' ) {
} else {
//children.items[i].close();
}
}
}
}
this . tabSeaepanel . doLayout ( ) ;
j = j - 1 ;
this . editRecord = this . StoreList . getAt ( j ) ;
BSNO = "" ;
if ( this . opStatus == 'edit' ) {
BSNO = this . editRecord . get ( 'BSNO' ) ;
//this.storeBodyList.load({ params: { condition: condition} });
}
this . LoadData ( this . opStatus , BSNO ) ;
} ,
NextRecord : function ( ) {
var modifystr = this . getIsModify ( ) ;
if ( modifystr != "" ) {
Ext . Msg . show ( { title : '警告' , msg : modifystr + '未保存,如果离开此页,将丢失未保存的更改 ! ! ! ' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ; //'未保存,如果离开此页,将丢失未保存的更改 ! ! ! '
return ;
}
var j = this . StoreList . indexOf ( this . editRecord ) ;
if ( j == ( this . StoreList . data . length - 1 ) ) {
Ext . Msg . show ( { title : '警告' , msg : '已是最后一票' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ; //'已是最后一票'
return ;
}
var children = this . tabSeaepanel . items ;
if ( children ) {
for ( var i = children . length - 1 , len = 0 ; i >= len ; i -- ) {
if ( children . items [ i ] . id ) {
if ( children . items [ i ] . id == 'pnlmodSeaeOrderInfo' ) {
// this.tabSeaepanel.setActiveTab(i);
} else {
//children.items[i].close();
}
}
}
}
this . tabSeaepanel . doLayout ( ) ;
j = j + 1 ;
this . editRecord = this . StoreList . getAt ( j ) ;
BSNO = "" ;
if ( this . opStatus == 'edit' ) {
BSNO = this . editRecord . get ( 'BSNO' ) ;
//this.storeBodyList.load({ params: { condition: condition} });
}
this . LoadData ( this . opStatus , BSNO ) ;
} ,
getIsModify : function ( ) {
var feemodify = this . panelFee . getModifyStatus ( ) ;
if ( feemodify ) {
return '费用信息' ;
}
var drmodify = this . storeBodyList . getModifiedRecords ( ) ;
if ( this . formEdit . getForm ( ) . isDirty ( ) == true || this . formHead . getForm ( ) . isDirty ( ) == true || drmodify . length != 0 ) {
return '业务信息' ;
}
else return '' ;
}
, ShowUserInfo ( ) {
BSNO = this . editRecord . get ( 'BSNO' ) ;
ShowSeaeSaleOrderUSERINFO ( BSNO ) ;
}
} ) ;