You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/formDjyOrder_COSCO.js

2177 lines
88 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Ext.namespace('Shipping');
Shipping.formDjyOrder_COSCO = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.formDjyOrder_COSCO.superclass.constructor.call(this);
};
Ext.extend(Shipping.formDjyOrder_COSCO, Ext.Panel, {
ParentWin: null,
MParentWin: null,
OpStatus: 'add',
StoreList: null,
EditRecord: null,
Editdata: null,
MainEditRecord: null,
seaeHeadData:null,
initUIComponents: function () {
_this = this;
this.carrier = "COSCO";
var parentWin = window.parent.opener._this;
var ret = parentWin.DjyOrderSwap();
this.seaeHeadData = ret[0].data;
this.storeDJYService = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsExtEnumModel',
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
});
this.storeDJYService.load({ params: { enumTypeId: 81010 } });
//alert(Zi.LAN.CTNALL);
//#region 向大简云发订舱邮件
this.storeDocList = Ext.create('Ext.data.Store', {
model: 'ReceiptDocmb',
remoteSort: false,
pageSize: this.PageSize,
proxy: {
type: 'ajax',
url: '/Import/ReceiptDoc/GetDocList',
reader: {
idProperty: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.DocListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.DocCM = Ext.create('Ext.selection.CheckboxModel');
this.gridDocList = new Ext.grid.GridPanel({
title: "附件信息(选择上传)",
store: this.storeDocList,
enableHdMenu: false,
region: 'center',
width: 450,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.DocListCellEditing],
selModel: this.DocCM,
selType: 'cellmodel',
tbar: [{
text: '删除',
tooltip: '删除',
iconCls: "btndeletedetail",
handler: function (button, event) {
this.onDelFileClick(button, event);
},
scope: this
}, '-', {
text: '上传附件',
tooltip: '上传附件',
iconCls: "btnadddetail",
handler: function (button, event) {
this.onUpLoadFileClick(button, event);
},
scope: this
}, {
text: '批量上传附件',
tooltip: '批量上传附件',
iconCls: "btnadddetail",
handler: function (button, event) {
this.UploadFile("", "");
},
scope: this
}
//, '-', {
// text: '保存',
// tooltip: '保存',
// // iconCls: "btnadddetail",
// handler: function (button, event) {
// this.onPostFileClick(button, event);
// },
// scope: this
//}
],
columns: [{
sortable: true, hidden: true,
dataIndex: 'GID',
header: 'GID',
width: 80
},
{
sortable: true,
dataIndex: 'RECEIPTTYPE',
header: '单据类型',
editor: this.comboxReceiptid_DOC,
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'R_GID',
header: 'R_GID',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'BSNO',
header: 'BSNO',
width: 80
},
{
sortable: true,
dataIndex: 'URL',
header: '文件名',
width: 340,
editor: {
xtype: 'textfield'
}
},
{
sortable: true, hidden: true,
dataIndex: 'Driect_URL',
header: 'Driect_URL',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'MODIFIEDUSER',
header: 'MODIFIEDUSER',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'MODIFIEDUSERRef',
header: '修改人',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'MODIFIEDTIME',
header: '修改时间',
width: 85
}
]
});
this.ctncolumns_Order = [{
sortable: true,
dataIndex: 'CTN_ID',
header: Zi.LAN.CTN_ID, //'编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'BSNO',
header: Zi.LAN.BSNO2, //'业务编号',
hidden: true,
width: 0
}, {
dataIndex: 'CTNALL',
header: Zi.LAN.CTNALL, //'箱型',
width: 100
}, {
dataIndex: 'CTNNUM',
header: Zi.LAN.CTNNUM, //'箱量',
width: 100
}, {
dataIndex: 'KGS',
header: Zi.LAN.KGS3, //'重量',
width: 100
}];
this.storeBodyList = Ext.create('Ext.data.Store', {
model: 'MsOpSeaeDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeae/GetBodyList',
reader: {
id: 'BSNO,CTNCODE,CTN_ID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridList_OrderCtn = new Ext.grid.GridPanel({
title: "箱信息",
store: this.storeBodyList,
enableHdMenu: false,
width: 310,
region: 'west',
loadMask: { msg: Zi.LAN.ShuJuJiaZaiZhongQingShaoDeng },//"数据加载中,请稍等..."
trackMouseOver: true,
disableSelection: false,
//selModel: this.GridCheckBoxModelCtn,
plugins: [],
selType: 'cellmodel',
tbar: [],
columns: this.ctncolumns_Order
});
this.formSendResult = Ext.widget('form', {
frame: true,
//region: 'border',
id: "formSendResult",
//bodyPadding: 2,
layout: 'anchor',
height: 70,
width: 500,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [
{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
fieldLabel: "发送时间",
format: 'Y-m-d H:i:s',
xtype: 'datefield',
name: 'CreateTime',
readOnly: true
},
{
fieldLabel: "发送人",
xtype: 'textfield',
name: 'Creator',
readOnly: true
}]
},
{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
fieldLabel: "发送结果",
xtype: 'textfield',
name: 'SENDSUCCESS',
readOnly: true
},
{
fieldLabel: "提示信息",
xtype: 'textfield',
name: 'SENDRESULTINFO',
readOnly: true
}
]
}
]
});
this.panel_DjyOrderBody = new Ext.Panel({
//id: 'panel_DjyOrderBody',
region: 'center',
//height: 150,
layout: "hbox",
frame: false,
//closable:true,
items: [
this.gridList_OrderCtn
, this.gridDocList
, this.formSendResult
]
});
this.storeThirdAccount = Ext.create('DsExt.ux.RefTableStore', {
model: 'DJYORDER_ACCOUNTINFOmb',
proxy: { url: '/MvcShipping/DJYORDER_ACCOUNTINFO/GetAccStore' }
});
this.comboxTHIRDACCOUNT = Ext.create('DsExt.ux.RefTableCombox', {//Ext.ux.form.field.BoxSelect
fieldLabel: '订舱账号',
allowBlank: false,
forceSelection: true,
name: 'THIRDACCOUNT',
id: 'THIRDACCOUNT',
flex: 1,
store: this.storeThirdAccount,
queryMode: 'local',
triggerOnClick: false,
valueField: 'ACCOUNT',
displayField: 'ACCOUNT',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
Ext.MessageBox.confirm(Zi.LAN.TiShi, "是否要用选定账号的联系信息覆盖订舱方信息?", function (btn) {
if (btn == 'yes') {
var rec = records[0].data;
_this.formDjyOrder.getForm().findField('BookingName').setValue(rec.BookingName);
_this.formDjyOrder.getForm().findField('BookingAddress').setValue(rec.BookingAddress);
//_this.formDjyOrder.getForm().findField('BookingCountry').setValue(rec.BookingCountry);
_this.formDjyOrder.getForm().findField('BookingProvince').setValue(rec.BookingProvince);
_this.formDjyOrder.getForm().findField('BookingCity').setValue(rec.BookingCity);
_this.formDjyOrder.getForm().findField('BookingCounty').setValue(rec.BookingCounty);
_this.formDjyOrder.getForm().findField('BookingPostCode').setValue(rec.BookingPostCode);
_this.formDjyOrder.getForm().findField('BookingFirstName').setValue(rec.BookingFirstName);
_this.formDjyOrder.getForm().findField('BookingLastName').setValue(rec.BookingLastName);
_this.formDjyOrder.getForm().findField('BookingPhoneCountryCode').setValue(rec.BookingPhoneCountryCode);
_this.formDjyOrder.getForm().findField('BookingPhoneCode').setValue(rec.BookingPhoneCode);
_this.formDjyOrder.getForm().findField('BookingPhone').setValue(rec.BookingPhone);
_this.formDjyOrder.getForm().findField('BookingSex').setValue(rec.BookingCONTACTTITLE);
_this.formDjyOrder.getForm().findField('BookingPhoneExtension').setValue(rec.BookingPhoneExtension);
}
})
}
}
}
});
this.storeDJYContractno = Ext.create('DsExt.ux.RefTableStore', {
model: 'DJYORDER_CONTRACTNOmb',
proxy: { url: '/MvcShipping/DJYORDER_CONTRACTNO/GetCarrierContractnoStore' }
});
this.comboxPilCode2 = Ext.create('DsExt.ux.RefTableCombox', {//Ext.ux.form.field.BoxSelect
fieldLabel: '合约号',
allowBlank: false,
forceSelection: true,
name: 'PILCODE',
id: 'PILCODE2',
flex: 1,
store: this.storeDJYContractno,
queryMode: 'local',
triggerOnClick: false,
valueField: 'CONTRACTNO',
displayField: 'CONTRACTNO',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
Ext.MessageBox.confirm(Zi.LAN.TiShi, "是否要用选定账号的联系信息覆盖发货人信息?", function (btn) {
if (btn == 'yes') {
var rec = records[0].data;
_this.formDjyOrder.getForm().findField('ShipperName').setValue(rec.ShipperName);
_this.formDjyOrder.getForm().findField('ShipperAddress').setValue(rec.ShipperAddress);
_this.formDjyOrder.getForm().findField('ShipperCountry').setValue(rec.ShipperCountry);
_this.formDjyOrder.getForm().findField('ShipperProvince').setValue(rec.ShipperProvince);
_this.formDjyOrder.getForm().findField('ShipperCity').setValue(rec.ShipperCity);
_this.formDjyOrder.getForm().findField('ShipperCounty').setValue(rec.ShipperCounty);
_this.formDjyOrder.getForm().findField('ShipperPostCode').setValue(rec.ShipperPostCode);
_this.formDjyOrder.getForm().findField('ShipperFirstName').setValue(rec.ShipperFirstName);
_this.formDjyOrder.getForm().findField('ShipperLastName').setValue(rec.ShipperLastName);
_this.formDjyOrder.getForm().findField('ShipperPhoneCountryCode').setValue(rec.ShipperPhoneCountryCode);
_this.formDjyOrder.getForm().findField('ShipperPhoneCode').setValue(rec.ShipperPhoneCode);
_this.formDjyOrder.getForm().findField('ShipperPhone').setValue(rec.ShipperPhone);
}
})
}
}
}
});
this.StoreCargoid = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsExtEnumModel',
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
});
this.StoreCargoid.load({ params: { enumTypeId: 96012 } });
this.comboxCargoid2 = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCargoid,
labelWidth:60,
fieldLabel: "<a><font color='#000000'>货物类型</font></a>",
forceSelection: true,
allowBlank: true,
flex:0.70,
//width: 1200,
name: 'CARGOID',
valueField: 'EnumValueId',
displayField: 'EnumValueName',
listeners: {
scope: this,
//'select': function (combo, records, eOpts) {
// if (records.length > 0) {
// if (combo.value == 'R') {
// this.panelBodyDr2.setVisible(false);
// this.panelBodyRf2.setVisible(true);
// this.winCargoShow.setWidth(700);
// this.winCargoShow.show();
// } else if (combo.value == 'D') {
// this.panelBodyDr2.setVisible(true);
// this.panelBodyRf2.setVisible(false);
// this.winCargoShow.setWidth(1200);
// // this.winCargoShow.width = 1200;
// this.winCargoShow.show();
// } else {
// this.panelBodyDr.setVisible(false);
// this.panelBodyRf.setVisible(false);
// }
// }
//}
}
});
this.storeCodeLoadport_Order = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeLoadportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportList_EDI' }
});
this.comboxPORTLOAD2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PORTLOAD, //'装货港',
labelWidth: 50,
store: this.storeCodeLoadport_Order,
name: 'PORTLOADID',
valueField: 'EDICODE',
displayField: 'CodeAndName',
queryMode: 'remote',
minChars: 2,
queryParam: 'PORT',
forceSelection: true,
allowBlank: false,
matchFieldWidth: false, //下拉款自适应宽度
listeners: {
scope: this,
blur: function (field, The, eOpts) {
//field.setRawValue(field.value);
}, 'select': function (combo, records, eOpts) {
if (records.length > 0) {
//if (this.SALEORDERDEPTBYOP == 0)
// this.formHead.getForm().findField('SALEDEPT').setValue(records[0].data.DEPTNAME);
//this.formHead.getForm().findField('SALECORPID').setValue(records[0].data.CORPID);
}
}
}
});
this.storeCodeLoadport_Order2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeLoadportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportList_EDI' }
});
this.comboxPLACERECEIPTID = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: "收货地", //'装货港',
labelWidth: 50,
store: this.storeCodeLoadport_Order2,
name: 'PLACERECEIPTID',
valueField: 'EDICODE',
displayField: 'CodeAndName',
queryMode: 'remote',
minChars: 2,
queryParam: 'PORT',
forceSelection: true,
allowBlank: false,
matchFieldWidth: false, //下拉款自适应宽度
listeners: {
scope: this,
blur: function (field, The, eOpts) {
//field.setRawValue(field.value);
}, 'select': function (combo, records, eOpts) {
if (records.length > 0) {
//if (this.SALEORDERDEPTBYOP == 0)
// this.formHead.getForm().findField('SALEDEPT').setValue(records[0].data.DEPTNAME);
//this.formHead.getForm().findField('SALECORPID').setValue(records[0].data.CORPID);
}
}
}
});
this.storeCodeDisport_Order = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' }
});
this.comboxPORTDISCHARGE2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PORTDISCHARGE, //'卸货港',
labelWidth: 50,
store: this.storeCodeDisport_Order,
name: 'PORTDISCHARGEID',
matchFieldWidth: false,
forceSelection: true,
allowBlank: false,
valueField: 'EDICODE',
queryMode: 'remote',
minChars: 2,
queryParam: 'PORT',
displayField: 'CodeAndName',
listeners: {
scope: this,
//blur: function (field, The, eOpts) {
// field.setRawValue(field.value);
//}
}
});
this.storeCodeDisport_Order2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' }
});
this.comboxDESTINATION2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.DESTINATION, //'目的地',
labelWidth: 50,
store: this.storeCodeDisport_Order2,
name: 'DESTINATIONID',
forceSelection: true,
allowBlank: false,
queryMode: 'remote',
minChars: 2,
queryParam: 'PORT',
valueField: 'EDICODE',
displayField: 'CodeAndName',
listeners: {
scope: this,
//blur: function (field, The, eOpts) {
// field.setRawValue(field.value);
//}
}
});
//近期使用过的发货人
this.storeLASTShipper = Ext.create('DsExt.ux.RefTableStore', {
model: 'LASTShippermb',
proxy: { url: '/MvcShipping/DJYORDER_CONTRACTNO/GetLASTShipper' }
});
this.comboxLASTShipper = Ext.create('DsExt.ux.RefTableCombox', {//Ext.ux.form.field.BoxSelect
//fieldLabel: '发货人',
allowBlank: false,
forceSelection: false,
name: 'ShipperName',
emptyText: '发货人名称',
blankText: '发货人名称',
flex: 1,
store: this.storeLASTShipper,
queryMode: 'remote',
minChars: 0,
queryParam: 'ShipperName',
triggerOnClick: false,
valueField: 'ShipperName',
displayField: 'ShipperName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
Ext.MessageBox.confirm(Zi.LAN.TiShi, "是否要用选定的联系信息覆盖发货人信息?", function (btn) {
if (btn == 'yes') {
var rec = records[0].data;
//_this.formDjyOrder.getForm().findField('ShipperName').setValue(rec.ShipperName);
_this.formDjyOrder.getForm().findField('ShipperAddress').setValue(rec.ShipperAddress);
_this.formDjyOrder.getForm().findField('ShipperCountry').setValue(rec.ShipperCountry);
_this.formDjyOrder.getForm().findField('ShipperProvince').setValue(rec.ShipperProvince);
_this.formDjyOrder.getForm().findField('ShipperCity').setValue(rec.ShipperCity);
_this.formDjyOrder.getForm().findField('ShipperCounty').setValue(rec.ShipperCounty);
_this.formDjyOrder.getForm().findField('ShipperPostCode').setValue(rec.ShipperPostCode);
_this.formDjyOrder.getForm().findField('ShipperFirstName').setValue(rec.ShipperFirstName);
_this.formDjyOrder.getForm().findField('ShipperLastName').setValue(rec.ShipperLastName);
_this.formDjyOrder.getForm().findField('ShipperPhoneCountryCode').setValue(rec.ShipperPhoneCountryCode);
_this.formDjyOrder.getForm().findField('ShipperPhoneCode').setValue(rec.ShipperPhoneCode);
_this.formDjyOrder.getForm().findField('ShipperPhone').setValue(rec.ShipperPhone);
}
})
}
}
}
});
//近期使用过的收货人
this.storeLASTConsignee = Ext.create('DsExt.ux.RefTableStore', {
model: 'LASTConsigneemb',
proxy: { url: '/MvcShipping/DJYORDER_CONTRACTNO/GetLASTConsignee' }
});
this.comboxLASTConsignee = Ext.create('DsExt.ux.RefTableCombox', {//Ext.ux.form.field.BoxSelect
//fieldLabel: '收货人',
allowBlank: false,
forceSelection: false,
name: 'ConsigneeName',
emptyText: '收货人名称',
blankText: '收货人名称',
flex: 1,
store: this.storeLASTConsignee,
queryMode: 'remote',
minChars: 0,
queryParam: 'ConsigneeName',
triggerOnClick: false,
valueField: 'ConsigneeName',
displayField: 'ConsigneeName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
Ext.MessageBox.confirm(Zi.LAN.TiShi, "是否要用选定的联系信息覆盖收货人信息?", function (btn) {
if (btn == 'yes') {
var rec = records[0].data;
//_this.formDjyOrder.getForm().findField('ShipperName').setValue(rec.ShipperName);
_this.formDjyOrder.getForm().findField('ConsigneeAddress').setValue(rec.ConsigneeAddress);
_this.formDjyOrder.getForm().findField('ConsigneeCountry').setValue(rec.ConsigneeCountry);
_this.formDjyOrder.getForm().findField('ConsigneeProvince').setValue(rec.ConsigneeProvince);
_this.formDjyOrder.getForm().findField('ConsigneeCity').setValue(rec.ConsigneeCity);
_this.formDjyOrder.getForm().findField('ConsigneeCounty').setValue(rec.ConsigneeCounty);
_this.formDjyOrder.getForm().findField('ConsigneePostCode').setValue(rec.ConsigneePostCode);
_this.formDjyOrder.getForm().findField('ConsigneeFirstName').setValue(rec.ConsigneeFirstName);
_this.formDjyOrder.getForm().findField('ConsigneeLastName').setValue(rec.ConsigneeLastName);
_this.formDjyOrder.getForm().findField('ConsigneePhoneCountryCode').setValue(rec.ConsigneePhoneCountryCode);
_this.formDjyOrder.getForm().findField('ConsigneePhoneCode').setValue(rec.ConsigneePhoneCode);
_this.formDjyOrder.getForm().findField('ConsigneePhone').setValue(rec.ConsigneePhone);
}
})
}
}
}
});
//近期使用过的通知人
this.storeLASTNotifypart = Ext.create('DsExt.ux.RefTableStore', {
model: 'LASTNotifypartmb',
proxy: { url: '/MvcShipping/DJYORDER_CONTRACTNO/GetLASTNotifypart' }
});
this.comboxLASTNotifypart = Ext.create('DsExt.ux.RefTableCombox', {//Ext.ux.form.field.BoxSelect
//fieldLabel: '通知人',
//allowBlank: false,
forceSelection: false,
name: 'NotifypartName',
emptyText: '通知人名称',
blankText: '通知人名称',
flex: 1,
store: this.storeLASTNotifypart,
queryMode: 'remote',
minChars: 0,
queryParam: 'NotifypartName',
triggerOnClick: false,
valueField: 'NotifypartName',
displayField: 'NotifypartName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
Ext.MessageBox.confirm(Zi.LAN.TiShi, "是否要用选定的联系信息覆盖通知人信息?", function (btn) {
if (btn == 'yes') {
var rec = records[0].data;
//_this.formDjyOrder.getForm().findField('ShipperName').setValue(rec.ShipperName);
//_this.formDjyOrder.getForm().findField('NotifypartAddress').setValue(rec.NotifypartAddress);
//_this.formDjyOrder.getForm().findField('NotifypartCountry').setValue(rec.NotifypartCountry);
//_this.formDjyOrder.getForm().findField('NotifypartProvince').setValue(rec.NotifypartProvince);
//_this.formDjyOrder.getForm().findField('NotifypartCity').setValue(rec.NotifypartCity);
//_this.formDjyOrder.getForm().findField('NotifypartCounty').setValue(rec.NotifypartCounty);
//_this.formDjyOrder.getForm().findField('NotifypartPostCode').setValue(rec.NotifypartPostCode);
//_this.formDjyOrder.getForm().findField('NotifypartFirstName').setValue(rec.NotifypartFirstName);
//_this.formDjyOrder.getForm().findField('NotifypartLastName').setValue(rec.NotifypartLastName);
//_this.formDjyOrder.getForm().findField('NotifypartPhoneCountryCode').setValue(rec.NotifypartPhoneCountryCode);
//_this.formDjyOrder.getForm().findField('NotifypartPhoneCode').setValue(rec.NotifypartPhoneCode);
//_this.formDjyOrder.getForm().findField('NotifypartPhone').setValue(rec.NotifypartPhone);
}
})
}
}
}
});
this.comboxLANE2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.LANE, //'航线',
store: this.storeLANE,
forceSelection: false,
id: "DJYORDER_LANE",
name: 'LANE',
valueField: 'LANE',
displayField: 'LANE',
listeners: {
scope: this,
//'select': function (combo, records, eOpts) {
// if (records.length > 0) {
// if (records[0].data.OP != '')
// this.formHead.getForm().findField('OP').setValue(records[0].data.OP);
// if (records[0].data.DOC != '')
// this.formHead.getForm().findField('DOC').setValue(records[0].data.DOC);
// if (records[0].data.CUSTSERVICE != '')
// this.formHead.getForm().findField('CUSTSERVICE').setValue(records[0].data.CUSTSERVICE);
// }
//}
}
});
this.formDjyOrder = Ext.widget('form', {
frame: true,
region: 'north',
height: 400,
id: "formDjyOrder",
bodyPadding: 2,
layout: 'anchor',
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{
xtype: 'container',
id: 'formDjyOrder_1',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxTHIRDACCOUNT
, this.comboxPilCode2
, this.comboxCargoid2
]
}
//, {
// xtype: 'container',
// id: 'formDjyOrder_2',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [
// ]
//}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
flex: 1,
xtype: 'label',
html: '发货人'
},
{
flex: 1,
xtype: 'label',
html: '订舱方'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
//{
// xtype: 'textfield',
// //fieldLabel: '发货人名称',
// allowBlank:false,
// emptyText: '发货人名称',
// blankText: '发货人名称',
// name: 'ShipperName'
//},
this.comboxLASTShipper,
{
xtype: 'textfield',
//fieldLabel: '订舱方名称',
allowBlank: false,
emptyText: '订舱方名称',
blankText: '订舱方名称',
name: 'BookingName'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
xtype: 'textfield',
allowBlank: false,
emptyText: '发货人地址',
blankText: '发货人地址',
name: 'ShipperAddress'
},
{
xtype: 'textfield',
allowBlank: false,
emptyText: '订舱方地址',
blankText: '订舱方地址',
name: 'BookingAddress'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxCountryFa2,
{
xtype: 'textfield',
emptyText: '省份',
blankText: '省份',
name: 'ShipperProvince'
},
{
xtype: 'textfield',
allowBlank: false,
emptyText: '城市',
blankText: '城市',
name: 'ShipperCity'
},
{
xtype: 'textfield',
//allowBlank: false,
emptyText: '县/区',
blankText: '县/区',
name: 'ShipperCounty'
},
{
xtype: 'textfield',
//allowBlank: false,
emptyText: '邮编',
blankText: '邮编',
name: 'ShipperPostCode'
}
,
this.comboxCountryDing,
{
xtype: 'textfield',
emptyText: '省份',
blankText: '省份',
name: 'BookingProvince'
},
{
xtype: 'textfield',
allowBlank: false,
emptyText: '城市',
blankText: '城市',
name: 'BookingCity'
},
{
xtype: 'textfield',
//allowBlank: false,
emptyText: '县/区',
blankText: '县/区',
name: 'BookingCounty'
},
{
xtype: 'textfield',
//allowBlank: false,
emptyText: '邮编',
blankText: '邮编',
name: 'BookingPostCode'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
xtype: 'textfield',
emptyText: '姓',
blankText: '姓',
name: 'ShipperLastName'
},
{
xtype: 'textfield',
emptyText: '名',
blankText: '名',
name: 'ShipperFirstName'
},
{
xtype: 'textfield',
emptyText: '国家区号',
blankText: '国家区号',
name: 'ShipperPhoneCountryCode'
},
{
xtype: 'textfield',
emptyText: '省市区号',
blankText: '省市区号',
name: 'ShipperPhoneCode'
},
{
xtype: 'textfield',
emptyText: '电话',
blankText: '电话',
name: 'ShipperPhone'
}
,
{
xtype: 'textfield',
emptyText: '姓',
blankText: '姓',
name: 'BookingLastName'
},
{
xtype: 'textfield',
emptyText: '名',
blankText: '名',
name: 'BookingFirstName'
},
{
xtype: 'textfield',
emptyText: '国家区号',
blankText: '国家区号',
name: 'BookingPhoneCountryCode'
},
{
xtype: 'textfield',
emptyText: '省市区号',
blankText: '省市区号',
name: 'BookingPhoneCode'
},
{
xtype: 'textfield',
emptyText: '电话',
blankText: '电话',
name: 'BookingPhone'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
flex: 1,
xtype: 'label',
html: '收货人'
},
{
flex: 1,
xtype: 'label',
html: '通知人'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
//{
// xtype: 'textfield',
// //fieldLabel: '发货人名称',
// allowBlank: false,
// emptyText: '收货人名称',
// blankText: '收货人名称',
// name: 'ConsigneeName'
//},
this.comboxLASTConsignee,
//{
// xtype: 'textfield',
// //fieldLabel: '订舱方名称',
// emptyText: '通知人名称',
// blankText: '通知人名称',
// name: 'NotifypartName'
//}
this.comboxLASTNotifypart
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
xtype: 'textfield',
allowBlank: false,
emptyText: '收货人地址',
blankText: '收货人地址',
name: 'ConsigneeAddress'
},
{
xtype: 'textfield',
emptyText: '通知人地址',
blankText: '通知人地址',
name: 'NotifypartAddress'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxCountryShou_2,
{
xtype: 'textfield',
emptyText: '省份',
blankText: '省份',
name: 'ConsigneeProvince'
},
{
xtype: 'textfield',
allowBlank: false,
emptyText: '城市',
blankText: '城市',
name: 'ConsigneeCity'
},
{
xtype: 'textfield',
//allowBlank: false,
emptyText: '县/区',
blankText: '县/区',
name: 'ConsigneeCounty'
},
{
xtype: 'textfield',
//allowBlank: false,
emptyText: '邮编',
blankText: '邮编',
name: 'ConsigneePostCode'
}
,
this.comboxCountryTong_2,
{
xtype: 'textfield',
emptyText: '省份',
blankText: '省份',
name: 'NotifypartProvince'
},
{
xtype: 'textfield',
allowBlank: false,
emptyText: '城市',
blankText: '城市',
name: 'NotifypartCity'
},
{
xtype: 'textfield',
//allowBlank: false,
emptyText: '县/区',
blankText: '县/区',
name: 'NotifypartCounty'
},
{
xtype: 'textfield',
//allowBlank: false,
emptyText: '邮编',
blankText: '邮编',
name: 'NotifypartPostCode'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
xtype: 'textfield',
emptyText: '姓',
blankText: '姓',
name: 'ConsigneeLastName'
},
{
xtype: 'textfield',
emptyText: '名',
blankText: '名',
name: 'ConsigneeFirstName'
},
{
xtype: 'textfield',
emptyText: '国家区号',
blankText: '国家区号',
name: 'ConsigneePhoneCountryCode'
},
{
xtype: 'textfield',
emptyText: '省市区号',
blankText: '省市区号',
name: 'ConsigneePhoneCode'
},
{
xtype: 'textfield',
emptyText: '电话',
blankText: '电话',
name: 'ConsigneePhone'
}
,
{
xtype: 'textfield',
emptyText: '姓',
blankText: '姓',
name: 'NotifypartLastName'
},
{
xtype: 'textfield',
emptyText: '名',
blankText: '名',
name: 'NotifypartFirstName'
},
{
xtype: 'textfield',
emptyText: '国家区号',
blankText: '国家区号',
name: 'NotifypartPhoneCountryCode'
},
{
xtype: 'textfield',
emptyText: '省市区号',
blankText: '省市区号',
name: 'NotifypartPhoneCode'
},
{
xtype: 'textfield',
emptyText: '电话',
blankText: '电话',
name: 'NotifypartPhone'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxPORTLOAD2
, this.comboxPORTDISCHARGE2
, this.comboxDESTINATION2
, this.comboxSERVICE2
, this.comboxBLFRT2
, {
xtype: 'textfield',
hidden: true,
id: "DJYORDER_PORTLOAD",
name: 'PORTLOAD'
}, {
xtype: 'textfield',
hidden: true,
id: "DJYORDER_PORTLOAD",
name: 'PORTDISCHARGE'
}, {
xtype: 'textfield',
hidden: true,
id: "DJYORDER_PORTLOAD",
name: 'DESTINATION'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
labelWidth: 50,
fieldLabel: '船名',
id: "DJYORDER_VESSEL",
//emptyText: '品名',
blankText: '船名',
name: 'VESSEL'
},
{
labelWidth: 50,
fieldLabel: '航次',
id: "DJYORDER_VOYNO",
//emptyText: '品名',
blankText: '航次',
name: 'VOYNO'
},
this.comboxLANE2,
{
xtype: 'datefield',
labelWidth: 50,
format: 'Y-m-d',
allowBlank: false,
fieldLabel: 'ETD',
id: "DJYORDER_ETD",
//emptyText: '品名',
blankText: 'ETD',
name: 'ETD'
},
{
labelWidth: 50, hidden: true,
fieldLabel: 'PolPortName',
id: "DJYORDER_PolPortName",
blankText: 'PolPortName',
name: 'PolPortName'
},
{
labelWidth: 50, hidden: true,
fieldLabel: 'PodPortName',
id: "DJYORDER_PodPortName",
blankText: 'PodPortName',
name: 'PodPortName'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textarea',
items: [
{
xtype: 'textarea',
//grow: true,
labelWidth: 50,
fieldLabel: '品名',
//emptyText: '品名',
blankText: '品名',
name: 'DESCRIPTION'
},
{
xtype: 'textarea',
//grow: true,
labelWidth: 50,
fieldLabel: '唛头',
//emptyText: '唛头',
blankText: '唛头',
name: 'MARKS'
},
{
xtype: 'textarea',
//grow: true,
labelWidth: 80,
name: 'DCYQ',
//width: 800,
//height:120,
id: 'DCYQ',
emptyText: '订舱备注',
fieldLabel: Zi.LAN.DjyDCYQ
}
]
}
//, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [
// {
// xtype: 'textarea',
// grow: true,
// name: 'DCYQ',
// width: 800,
// //height:120,
// id: 'DCYQ',
// fieldLabel: Zi.LAN.DjyDCYQ
// }
// ]
//}
]
});
//this.formDjyOrder.add(this.comboxTHIRDACCOUNT);
//this.formDjyOrder.add(this.comboxPilCode);
//this.formDjyOrder.add(this.comboxCargoid);
var checkboxitems2 = "";
checkboxitems2 = "[";
for (i = 0; i < this.storeDJYService.getCount(); i += 1) {
var memberyf = this.storeDJYService.getAt(i);
if (memberyf.data.EnumValueName != "") {
checked = false
if (memberyf.data.EnumValueName_2 != "") {
checked = true
}
var checkboxSingleItem = "{boxLabel:'" + memberyf.data.EnumValueName + "',inputValue:true,checked:" + checked + ",name:'" + memberyf.data.EnumValueId + "',id:'" + memberyf.data.EnumValueId + "'";
checkboxSingleItem += "}";
if (checkboxitems2 != "[") {
checkboxitems2 += ",";
}
checkboxitems2 += checkboxSingleItem;
}
};
checkboxitems2 += "]";
this.DjyServiceCheckboxGroup = new Ext.form.CheckboxGroup({
id: 'DjyServiceGroup',
xtype: 'checkboxgroup',
//fieldLabel: Zi.LAN.myService, //'大简云服务项目',
flex: 3,
columns: 8,
items: eval(checkboxitems2)
});
//this.formDjyOrder.add(this.DjyServiceCheckboxGroup);
Ext.getCmp('formDjyOrder_1').add(this.DjyServiceCheckboxGroup);
this.formDjyOrder.doLayout();
this.storeVesselVoyno_Cosco = Ext.create('DsExt.ux.RefTableStore', {
model: 'VesselVoyno_Cosco_md',
proxy: { url: '' }
});
var grid_VesselVoyno_Cosco = Ext.create('Ext.grid.Panel', {
store: _this.storeVesselVoyno_Cosco,
viewConfig: {
enableTextSelection: true, //允许复制数据
},
columns: [
{
dataIndex: 'allowBooking',
header: Zi.LAN.allowBooking, //'允许订舱'
width: 60
},
{
dataIndex: 'cargoNatureList',
header: Zi.LAN.HWLX, //'货物类型'
width: 80
}, {
dataIndex: 'YJLG',
header: Zi.LAN.YJLG, //'预计离港'
width: 80
}, {
dataIndex: 'estimatedTransitTimeInDays',
header: Zi.LAN.ZT, //'在途'
width: 80
}, {
dataIndex: 'CMHCHX',
header: Zi.LAN.CMHCHX, //'船名/航次/航线'
width: 230
}, {
dataIndex: 'vesselName', hidden: true,
header: 'vesselName', //'船名'
width: 230
}, {
dataIndex: 'voyageNumber', hidden: true,
header: 'voyageNumber', //'航次'
width: 230
}, {
dataIndex: 'TJGK',
header: Zi.LAN.TJGK, //'途径港口'
width: 180
}, {
dataIndex: 'podETAOrder',
header: Zi.LAN.YJDD, //'预计到达'
width: 80
}, {
dataIndex: 'originHaulageIndicator',
header: Zi.LAN.CFDFW, //'出发地服务'
width: 80
}, {
dataIndex: 'fndHaulageIndicator',
header: Zi.LAN.DDDFW, //'目的地服务'
width: 80
}
],
forceFit: true,
split: true,
region: 'center'
});
grid_VesselVoyno_Cosco.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
if (record.data.allowBooking == "√") {
//双击时 将船名航次写入 并关闭win_VesselVoyno_Cosco
Ext.getCmp("DJYORDER_VESSEL").setValue(record.data.vesselName);
Ext.getCmp("DJYORDER_VOYNO").setValue(record.data.voyageNumber);
Ext.getCmp("DJYORDER_ETD").setValue(record.data.YJLG);
Ext.getCmp("DJYORDER_LANE").setValue(record.data.serviceCode);
Ext.getCmp("DJYORDER_PolPortName").setValue(record.data.PolPortName);
Ext.getCmp("DJYORDER_PodPortName").setValue(record.data.PodPortName);
this.win_VesselVoyno_Cosco.close();
}
}, this);
this.win_VesselVoyno_Cosco = Ext.create('Ext.window.Window', {
title: "中远船期",
width: 1000,
height: 550,
plain: true,
layout: "border",
iconCls: "addicon",
resizable: false,
draggable: false,
collapsible: true,
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [grid_VesselVoyno_Cosco],
buttons: [{
text: Zi.LAN.GuanBi, //"关闭",
minWidth: 70,
handler: function () {
me.win_VesselVoyno_Cosco.close();
}
}]
});
//#region 按钮Toolbar
this.panelBtn = new Ext.Panel({
region: "south",
height: 35,
buttonAlign: 'center',
buttons: [
{
text: Zi.LAN.QueDingFaSong, //"确定发送",
minWidth: 70,
handler: function () {
_this.DoSendDjyOrder();
}
}
, '-'
, {
text: Zi.LAN.GuanBi, //"关闭",
minWidth: 70,
handler: function () {
window.close();
}
}
]
}); //end 按钮Toolbar
//#endregion
Ext.apply(this, {
items: [
this.formDjyOrder
,this.panel_DjyOrderBody
,this.panelBtn
]
});
//#endregion
this.LoadData();
}, //end initUIComponents
LoadData() {
_this = this;
_count = 0;
this.storeThirdAccount.load({
async: false,
params: {
CARRIER: _this.carrier
},
//_this.storeChFeeModify.getAt(0) // _this.storeBodySum.getCount()
callback: function (r, options, success) {
if (success) {
//if (_this.storeThirdAccount.getCount() == 2) {
// var rec = _this.storeThirdAccount.getAt(0).data;
// Ext.getCmp("THIRDACCOUNT").setValue(rec.ACCOUNT);
// _this.formDjyOrder.getForm().findField('BookingName').setValue(rec.BookingName);
// _this.formDjyOrder.getForm().findField('BookingAddress').setValue(rec.BookingAddress);
// //_this.formDjyOrder.getForm().findField('BookingCountry').setValue(rec.BookingCountry);
// _this.formDjyOrder.getForm().findField('BookingProvince').setValue(rec.BookingProvince);
// _this.formDjyOrder.getForm().findField('BookingCity').setValue(rec.BookingCity);
// _this.formDjyOrder.getForm().findField('BookingCounty').setValue(rec.BookingCounty);
// _this.formDjyOrder.getForm().findField('BookingPostCode').setValue(rec.BookingPostCode);
// _this.formDjyOrder.getForm().findField('BookingFirstName').setValue(rec.BookingFirstName);
// _this.formDjyOrder.getForm().findField('BookingLastName').setValue(rec.BookingLastName);
// _this.formDjyOrder.getForm().findField('BookingPhoneCountryCode').setValue(rec.BookingPhoneCountryCode);
// _this.formDjyOrder.getForm().findField('BookingPhoneCode').setValue(rec.BookingPhoneCode);
// _this.formDjyOrder.getForm().findField('BookingPhone').setValue(rec.BookingPhone);
// resultData.data.BookingSex = firstrec.data.CONTACTTITLE;
// resultData.data.BookingPhoneExtension = firstrec.data.BookingPhoneExtension;
//}
_count++;
if (_count == 2) {
_this.GetDjyOrderDataBySeae();
}
} else {
Ext.Msg.show({
title: '提示',
msg: "请在【系统配置-参数设置-大简云订舱_账号密码设置】中增加船公司[" + _this.carrier + "]的账号与密码",
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
}
});
this.storeDJYContractno.load({
async: false,
params: {
CARRIER: _this.carrier
},
//_this.storeChFeeModify.getAt(0) // _this.storeBodySum.getCount()
callback: function (r, options, success) {
if (success) {
//if (_this.storeDJYContractno.getCount() == 2) {
// var rec = _this.storeDJYContractno.getAt(0).data;
// Ext.getCmp("PILCODE2").setValue(rec.CONTRACTNO);
// _this.formDjyOrder.getForm().findField('ShipperName').setValue(rec.ShipperName);
// _this.formDjyOrder.getForm().findField('ShipperAddress').setValue(rec.ShipperAddress);
// _this.formDjyOrder.getForm().findField('ShipperCountry').setValue(rec.ShipperCountry);
// _this.formDjyOrder.getForm().findField('ShipperProvince').setValue(rec.ShipperProvince);
// _this.formDjyOrder.getForm().findField('ShipperCity').setValue(rec.ShipperCity);
// _this.formDjyOrder.getForm().findField('ShipperCounty').setValue(rec.ShipperCounty);
// _this.formDjyOrder.getForm().findField('ShipperPostCode').setValue(rec.ShipperPostCode);
// _this.formDjyOrder.getForm().findField('ShipperFirstName').setValue(rec.ShipperFirstName);
// _this.formDjyOrder.getForm().findField('ShipperLastName').setValue(rec.ShipperLastName);
// _this.formDjyOrder.getForm().findField('ShipperPhoneCountryCode').setValue(rec.ShipperPhoneCountryCode);
// _this.formDjyOrder.getForm().findField('ShipperPhoneCode').setValue(rec.ShipperPhoneCode);
// _this.formDjyOrder.getForm().findField('ShipperPhone').setValue(rec.ShipperPhone);
// _this.formDjyOrder.getForm().findField('ShipperSex').setValue(rec.CONTACTTITLE);
// _this.formDjyOrder.getForm().findField('ShipperPhoneExtension').setValue(rec.ShipperAddress);
//}
_count++;
if (_count == 2) {
_this.GetDjyOrderDataBySeae();
}
} else {
Ext.Msg.show({
title: '提示',
msg: "请在【系统配置-参数设置-大简云订舱_合约号设置】中增加船公司[" + _this.carrier + "]的合约号",
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
}
});
var BSNO = this.seaeHeadData.BSNO;
this.storeBodyList.load({
params: { condition: "BSNO='" + BSNO + "'" }
});
this.LoadUploadFile(BSNO);
//this.GetDjyOrderDataBySeae();
}
, GetLogic() {
let _bsno = this.seaeHeadData.BSNO;
//SetBsnoLogicInfo(_bsno, this.formHead, "大简云订舱邮件", "DJYMAILINFO");
//SetBsnoLogicInfo(_bsno, this.formHead, "大简云订舱要求", "DCYQ", true);
//SetBsnoLogicInfo(_bsno, this.formHead, "大简云订舱服务项目", "DJYSERVICE");
SetBsnoLogicInfo(_bsno, this.formDjyOrder, "大简云订舱要求", "DCYQ", true);
//SetBsnoLogicInfo(_bsno, this.formHead, "大简云订舱审批", "DjyDCSPJG");
//SetBsnoLogicInfo(_bsno, this.formDjyOrder, "大简云订舱服务项目", "DJYSERVICE",true);
Ext.Ajax.request({
waitMsg: '正在查询数据...',
url: '/CommMng/BasicDataRef/GetLogicInfo',
async: false,
params: {
BSNO: _bsno,
PROPNAME: "大简云订舱服务项目"
},
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;
//return "";
} else {
//return result.Data;
//alert(result.Data);
var salemailinfo = "";
for (i in result.Data) {
//
//if (salemailinfo != "") salemailinfo += ";"
//i:服务项目
// result.Data[i]:订舱,AMS...
//if (!NoFieldName) salemailinfo += i + ":";
salemailinfo = result.Data[i];
}
var _form = this.formDjyOrder.getForm();
SERVICENAMEList = salemailinfo.split(",");
//const arr = [45, 60, 88, 90, 20]
//SERVICENAMEList.forEach((item, index) => {
// //console.log(item, index)
//});
for (i = 0; i < this.storeDJYService.getCount(); i += 1) {
var memberyf = this.storeDJYService.getAt(i);
if (memberyf.data.EnumValueName != "") {
let result = SERVICENAMEList.find(ele => ele === memberyf.data.EnumValueName)
if (result) {
var field = _form.findField(memberyf.data.EnumValueId);
field.setValue(true);
} else {
var field = _form.findField(memberyf.data.EnumValueId);
field.setValue(false);
}
}
};
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
,
GetDjyOrderDataBySeae: function () {
_this = this;
var BSNO = this.seaeHeadData.BSNO;
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
//Ext.Msg.show({ title: '提示', msg: str, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK });
Ext.Ajax.request({
//waitMsg: '正在发送请求',
url: '/MvcShipping/MsOpSeae/GetDjyOrderDataBySeae',
cors: true,
params: {
BSNO: BSNO,
CARRIER:"COSCO"
},
//method: 'post',
success: function (response) {
Ext.MessageBox.hide();
var resultData = eval('(' + response.responseText + ')');//JSON字符串=>JSON对象
if (!resultData.Success) {
//失败
this.Ext.Msg.show({
title: '提示',
msg: resultData.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
else {
Ext.Msg.hide();
Ext.MessageBox.hide();
_this.GetLogic();
if (resultData.data.ETD && resultData.data.ETD.includes(" 00:00:00")) {
resultData.data.ETD = resultData.data.ETD.replace(" 00:00:00", "");
}
//if (resultData.data.acceptNotify == null || resultData.data.acceptNotify == false) {
// resultData.data.acceptNotify = "0";
//}
//if (resultData.data.acceptNotify == true) {
// resultData.data.acceptNotify = "1";
//}
_this.storeCodeLoadport_Order.load({ async: true, params: { PORT: resultData.data.PORTLOADID } });
_this.storeCodeLoadport_Order2.load({ async: true, params: { PORT: resultData.data.PLACERECEIPTID } });
_this.storeCodeDisport_Order.load({ async: true, params: { PORT: resultData.data.PORTDISCHARGEID } });
_this.storeCodeDisport_Order2.load({ async: true, params: { PORT: resultData.data.DESTINATIONID } });
_this.formDjyOrder.getForm().setValues(resultData.data);
if (resultData.data.acceptNotify == null || resultData.data.acceptNotify == false) {
Ext.getCmp("acceptNotify").setValue(({ acceptNotify: "0" }));
}
if (resultData.data.acceptNotify == true) {
Ext.getCmp("acceptNotify").setValue(({ acceptNotify: "1" }));
}
if (resultData.data.SENDSUCCESS == true) {
resultData.data.SENDSUCCESS = "成功";
}
else if (resultData.data.SENDSUCCESS == false) {
resultData.data.SENDSUCCESS = "失败";
}
else {
resultData.data.SENDSUCCESS = "";
}
_this.formSendResult.getForm().setValues(resultData.data);
//如果
//if (resultData.data.THIRDACCOUNT == "" && _this.storeThirdAccount.getCount() == 2) {
// var firstrec = _this.storeThirdAccount.getAt(0)
// //Ext.getCmp("THIRDACCOUNT").setValue(firstrec.data.ACCOUNT);
// resultData.data.THIRDACCOUNT = firstrec.data.ACCOUNT;
// if (!resultData.data.BookingName) {
// resultData.data.BookingName = firstrec.data.BookingName;
// resultData.data.BookingAddress = firstrec.data.BookingAddress;
// resultData.data.BookingCountry = firstrec.data.BookingCountry;
// resultData.data.BookingProvince = firstrec.data.BookingProvince;
// resultData.data.BookingCity = firstrec.data.BookingCity;
// resultData.data.BookingCounty = firstrec.data.BookingCounty;
// resultData.data.BookingPostCode = firstrec.data.BookingPostCode;
// resultData.data.BookingFirstName = firstrec.data.BookingFirstName;
// resultData.data.BookingLastName = firstrec.data.BookingLastName;
// resultData.data.BookingPhoneCountryCode = firstrec.data.BookingPhoneCountryCode;
// resultData.data.BookingPhoneCode = firstrec.data.BookingPhoneCode;
// resultData.data.BookingSex = firstrec.data.CONTACTTITLE;
// resultData.data.BookingPhoneExtension = firstrec.data.BookingPhoneExtension;
// }
//}
//if (_this.storeDJYContractno.getCount() == 2) {
// var firstrec = _this.storeDJYContractno.getAt(0)
// //Ext.getCmp("PILCODE").setValue(firstrec.data.CONTRACTNO);
// resultData.data.PILCODE = firstrec.data.CONTRACTNO;
// //if (!resultData.data.ShipperName) {
// // resultData.data.ShipperName = firstrec.data.ShipperName;
// // resultData.data.ShipperAddress = firstrec.data.ShipperAddress;
// // resultData.data.ShipperCountry = firstrec.data.ShipperCountry;
// // resultData.data.ShipperProvince = firstrec.data.ShipperProvince;
// // resultData.data.ShipperCounty = firstrec.data.ShipperCounty;
// // resultData.data.ShipperPostCode = firstrec.data.ShipperPostCode;
// // resultData.data.ShipperFirstName = firstrec.data.ShipperFirstName;
// // resultData.data.ShipperLastName = firstrec.data.ShipperLastName;
// // resultData.data.ShipperPhoneCountryCode = firstrec.data.ShipperPhoneCountryCode;
// // resultData.data.ShipperPhoneCode = firstrec.data.ShipperPhoneCode;
// //}
//}
var _DCYQ = Ext.getCmp("DCYQ");
if (!_DCYQ.getValue()) {
var headdataService = _this.seaeHeadData.SERVICE;
if (headdataService != "CY-CY") {
_DCYQ.setValue(headdataService);
}
//var headdataService = me.formDjyOrder.getForm().findField('SERVICE').getValue();
//if (headdataService != "CY-CY")
//{
// _DCYQ.setValue(headdataService);
//}
}
}
}
});
},
DoSendDjyOrder()
{
me = this;
var BSNO = this.seaeHeadData.BSNO;
var _form = Ext.getCmp("formDjyOrder");
if (!_form.getForm().isValid()) {
return;
}
var data = _form.getForm().getValues(false, false, false);
var str = Ext.JSON.encode(data);
if (!data.THIRDACCOUNT) {
Ext.Msg.show({
title: '提示',
msg: "必须选择船公司账号。如果没有,需要在第三方账号当中进行维护",
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
var feeGidSql = '';
var selectedRecords = [];
selectedRecords = me.DocCM.selected.items;
if (selectedRecords.length > 0) {
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.GID == "*") //如果是新增但没有保存的数据,没有必要提交到后台
{
me.storeDocList.remove(selectedRecords[i]);
}
else
{
var feeGId = "" + rec.data.GID + "";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
}
}
}
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
//Ext.Msg.show({ title: '提示', msg: str, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK });
Ext.Ajax.request({
//waitMsg: '正在发送请求',
url: '/MvcShipping/MsOpSeae/SendOpseaeEmailToDjy',
cors: true,
params: {
BSNO: BSNO,
str: str,
CARRIER: "COSCO",
FileGidList: feeGidSql
},
//method: 'post',
success: function (response) {
Ext.MessageBox.hide();
var resultData = eval('(' + response.responseText + ')');//JSON字符串=>JSON对象
if (!resultData.Success) {
if (resultData.Message == "船名航次错误") {
_this.storeVesselVoyno_Cosco.removeAll();
for (var i = 0; i < resultData.Data.length; i += 1) {
var rec = resultData.Data[i];
var allowBooking = "";
if (rec.allowBooking == true) {
allowBooking = "√";
}
var cnl = "";
if (rec.cargoNatureList && rec.cargoNatureList.length > 0) {
for (var j = 0; j < rec.cargoNatureList.length; j += 1) {
if (cnl != "") cnl += " ";
cnl += rec.cargoNatureList[j];
}
}
var CMHCHX = "";
var YJLG = "";
var TJGK = "";
var vesselName = "";
var voyageNumber = "";
var serviceCode = "";
var 直达 = false;
var 中转 = false;
var PolPortName = "";
var PodPortName = "";
if (rec.oceanLegLength == 1) {
直达 = true;
} else {
中转 = true;
}
if (rec.oceanLegs && rec.oceanLegs.length > 0) {
var _startinfo = rec.oceanLegs[0];
PolPortName = _startinfo.polPortName;
var _lastinfo = rec.oceanLegs[rec.oceanLegs.length - 1];
PodPortName = _lastinfo.podPortName;
CMHCHX = _startinfo.vesselName + "/" + _startinfo.voyageNumber + "/" + _startinfo.serviceCode;
YJLG = _this.strtodatastr(_startinfo.polETDOrder);
vesselName = _startinfo.vesselName;
voyageNumber = _startinfo.voyageNumber;
serviceCode = _startinfo.serviceCode;
for (var j = 0; j < rec.oceanLegs.length; j += 1) {
if (TJGK != "") TJGK += "/";
var _gk = rec.oceanLegs[j];
TJGK += _gk.podPortName;
}
}
if (直达) {
TJGK = "(直达)" + TJGK;
}
if (中转) {
TJGK = "(中转)" + TJGK;
}
var CFDFW = "";
if (rec.originHaulageIndicator == "C") {
CFDFW = "CY"
}
if (rec.originHaulageIndicator == "D") {
CFDFW = "Door"
}
if (rec.originHaulageIndicator == "B") {
CFDFW = "CY/Door"
}
var DDDFW = "";
if (rec.fndHaulageIndicator == "C") {
DDDFW = "CY"
}
if (rec.fndHaulageIndicator == "D") {
DDDFW = "Door"
}
if (rec.fndHaulageIndicator == "B") {
DDDFW = "CY/Door"
}
var podETAOrder = _this.strtodatastr(rec.eatAtFNDOrder);
var record = Ext.create('VesselVoyno_Cosco_md', {
allowBooking: allowBooking,
cargoNatureList: cnl,
YJLG: YJLG,
estimatedTransitTimeInDays: rec.estimatedTransitTimeInDays,
CMHCHX: CMHCHX,
vesselName: vesselName,
voyageNumber: voyageNumber,
serviceCode: serviceCode,
TJGK: TJGK,
podETAOrder: podETAOrder,
originHaulageIndicator: CFDFW,
fndHaulageIndicator: DDDFW,
PolPortName: PolPortName,
PodPortName: PodPortName
});
_this.storeVesselVoyno_Cosco.add(record);
}
//_this.storeVesselVoyno.loadData(resultData.Data);
//_this.win_VesselVoyno.setTitle("中远订舱:" + resultData.Message2 + "");
_this.win_VesselVoyno.title = "中远订舱:<a><font color='#FF0000'>" + resultData.Message2 + "</font></a>";
_this.win_VesselVoyno.doLayout();
_this.win_VesselVoyno.show();
} else {
//失败
Ext.Msg.show({
title: '提示',
msg: resultData.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
//Ext.MessageBox.getDialog().getEl().setStyle('z-index', '80000');
me.GetLogic();
//return;
//me.winDjyOrderShow_COSCO.close();
}
}
else {
//成功
//Ext.Msg.show({
// title: '提示',
// msg: resultData.Message,
// icon: Ext.MessageBox.OK,
// buttons: Ext.Msg.OK
//});
//MsgTip("提示", resultData.Message,1500);
Ext.Msg.hide();
Ext.MessageBox.hide();
me.GetLogic();
Ext.Msg.show({
title: "提示",
msg: resultData.Message,
modal: false,
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.INFO
});
//me.winDjyOrderShow_COSCO.close();
//Ext.MessageBox.getDialog().getEl().setStyle('z-index', '80000');
//MsgTip("提示", "发送成功",3500);
}
}
});
},
onUpLoadFileClick: function (button, event) {
var billno = this.seaeHeadData.CUSTNO;
var BSNO = this.seaeHeadData.BSNO;
//var FILETYPE = "订舱附件";
//枚举维护表tSysEnumValue_附件类型97048 //需求编号SR2017081100003
this.storeFileType = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.TSysEnumValueDataModel',
proxy: { url: '/CommMng/BasicDataRef/GetTSysEnumValueList' }
});
this.storeFileType.load({ params: { condition: " and EnumTypeID=97048" } });
var comboxFileType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '附件类型',
store: this.storeFileType,
forceSelection: true,
id: 'FILETYPE',
name: 'FILETYPE',
valueField: 'EnumValueName',
displayField: 'EnumValueName'
});
_this = this;
var imgform = new Ext.FormPanel({
region: 'center',
labelWidth: 40,
frame: true,
//bodyStyle: 'padding:5px 5px 0',
//autoScroll: true,
border: false,
fileUpload: true,
items: [{
xtype: 'fileuploadfield',
id: 'LoadFile',
name: 'LoadFile',
emptyText: '请选择文件',
fieldLabel: '文件',
buttonText: '选择文件',
allowBlank: false,
buttonCfg: { iconCls: 'uploaddialog' },
anchor: '98%'
}, comboxFileType
, {
xtype: 'textfield', hidden: true,
id: 'DOCUMENTATTACHEDCODE',
name: 'DOCUMENTATTACHEDCODE',
fieldLabel: '随附单证代码'//需求编号SR2017081100003
}, {
xtype: 'textfield', hidden: true,
id: 'DOCUMENTATTACHEDNO',
name: 'DOCUMENTATTACHEDNO',
fieldLabel: '随附单证编号'//需求编号SR2017081100003
}
],
buttons: [{
text: '上传',
type: 'submit',
handler: function () {
var UserFilePath = Ext.getCmp('LoadFile').getValue();
// if (!CheckFileExt(UserFilePath, /.jpg|.gif|.png|.bmp|.pdf/i)) {
// Ext.Msg.show({ title: '错误', msg: '请确认你上传的文件为图片文件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
// }
if (!imgform.form.isValid()) { return; }
imgform.form.submit({
url: '/MvcShipping/MsOpReceipt/UploadFile',
waitMsg: '正在上传',
method: 'POST',
submitEmptyText: false,
async: false,
params: {
CUSTNO: billno,
BSNO: BSNO,
TYPE: comboxFileType.getRawValue(),
DOCUMENTATTACHEDCODE: Ext.getCmp('DOCUMENTATTACHEDCODE').getValue(), //需求编号SR2017081100003
DOCUMENTATTACHEDNO: Ext.getCmp('DOCUMENTATTACHEDNO').getValue() //需求编号SR2017081100003
},
success: function (form, action) {
win.close(this);
Ext.Msg.show({ title: '提示', msg: '上传成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
//var condition = _this.strBSNO;
_this.Loading = true;
_this.LoadUploadFile(BSNO);
},
failure: function (form, action) {
form.reset();
// if (action.failureType == Ext.form.Action.SERVER_INVALID) {
// Ext.MessageBox.alert('警告', action.result.errors.msg);
// }
}
});
}
}, {
text: '关闭',
type: 'submit',
handler: function () {
win.close(this);
}
}]
});
var win = new Ext.Window({
title: "上传文件",
width: 360,
height: 200,
modal: true,
resizable: false,
border: false,
items: imgform
});
win.show();
}
, LoadUploadFile: function (BSNO) {
var condition2 = " BSNO='" + BSNO + "' ";
this.storeDocList.load({
params: { condition: condition2 },
waitMsg: "正在查询数据...",
scope: this,
callback: function () {
_this.Loading = false;
}
});
}
});