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_ONE.js

2256 lines
85 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_ONE = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.formDjyOrder_ONE.superclass.constructor.call(this);
};
Ext.extend(Shipping.formDjyOrder_ONE, Ext.Panel, {
ParentWin: null,
MParentWin: null,
OpStatus: 'add',
StoreList: null,
EditRecord: null,
Editdata: null,
MainEditRecord: null,
seaeHeadData:null,
initUIComponents: function () {
_this = this;
this.carrier = "ONE";
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' }
});
var ONEService = parentWin.mainWin.GetPubStore("DJYService").data.items;
this.storeDJYService.loadData(ONEService);
//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,
title: "发送状态",
//region: 'border',
id: "formSendResult",
//bodyPadding: 2,
layout: 'anchor',
height: 100,
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('ShipperName').setValue(rec.BookingName);
_this.formDjyOrder.getForm().findField('ShipperAddress').setValue(rec.BookingAddress);
_this.formDjyOrder.getForm().findField('NotifypartName').setValue(rec.BookingName);
_this.formDjyOrder.getForm().findField('NotifypartAddress').setValue(rec.BookingAddress);
}
})
}
}
}
});
//合约类型
this.StoreContractType = Ext.create('DsExt.ux.RefEnumStore', {});
this.StoreContractType.load({ params: { enumTypeId: 81013 } });
this.comboxContractType = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreContractType,
//fieldLabel: "合约号",
hidden:true,
labelWidth: 45,
forceSelection: false,
allowBlank: true,
flex: 0.50,
//matchFieldWidth: false, //下拉款自适应宽度
name: 'contractType',
valueField: 'EnumValueId',
displayField: 'EnumValueId'
});
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('NamedAccount').setValue(rec.NamedAccount);
// }
//})
}
}
}
});
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.StoresignType = Ext.create('Ext.data.Store', {
fields: ['ID', 'NAME']
});
this.StoresignType.add({ "ID": "Shipper", "NAME": "Shipper" });
this.StoresignType.add({ "ID": "Forwarder", "NAME": "Forwarder" });
this.StoresignType.add({ "ID": "Consignee", "NAME": "Consignee" });
this.StoresignType.add({ "ID": "Notify Party", "NAME": "Notify Party" });
this.comboxSignType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: "签约方",
allowBlank: true,
store: this.StoresignType,
forceSelection: true,
name: 'signType',
valueField: 'ID',
displayField: 'NAME'
});
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_ONE' }
});
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); ShipperPhoneEx
//_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.ShipperSex);
//_this.formDjyOrder.getForm().findField('ShipperPhoneExtension').setValue(rec.ShipperAddress);
}
})
}
}
}
});
//近期使用过的收货人
this.storeLASTConsignee = Ext.create('DsExt.ux.RefTableStore', {
model: 'LASTConsigneemb',
proxy: { url: '/MvcShipping/DJYORDER_CONTRACTNO/GetLASTConsignee_ONE' }
});
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_ONE' }
});
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.storeCONTACTTITLE = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsExtEnumModel',
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
});
this.storeCONTACTTITLE.load({ params: { enumTypeId: 81014 } });
this.comboxShipperCONTACTTITLE = Ext.create('DsExt.ux.RefTableCombox', {
flex: 1,
//fieldLabel: '性别',
//hidden: true,
store: this.storeCONTACTTITLE,
forceSelection: true,
emptyText: 'MR/MS',
blankText: 'MR/MS',
id: 'ShipperCONTACTTITLE',
name: 'ShipperSex',
valueField: 'EnumValueName',
displayField: 'EnumValueName'
});
this.comboxBookingCONTACTTITLE = Ext.create('DsExt.ux.RefTableCombox', {
flex: 1,
//fieldLabel: '性别',
//hidden: true,
store: this.storeCONTACTTITLE,
forceSelection: true,
emptyText: 'MR/MS',
blankText: 'MR/MS',
id: 'BookingCONTACTTITLE',
name: 'BookingSex',
valueField: 'EnumValueName',
displayField: 'EnumValueName'
});
this.storeBillAddr = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsExtEnumModel',
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
});
this.storeBillAddr.load({ params: { enumTypeId: 81021 } });
this.comboxbookingAddr = Ext.create('DsExt.ux.RefTableCombox', {
flex: 1,
fieldLabel: '订舱网点',
//hidden: true,
allowBlank: false,
store: this.storeBillAddr,
forceSelection: true,
emptyText: '订舱网点',
blankText: '订舱网点',
id: 'bookingAddr',
name: 'bookingAddr',
valueField: 'EnumValueName',
displayField: 'EnumValueName'
});
this.comboxbillSignLoc = Ext.create('DsExt.ux.RefTableCombox', {
flex: 1,
fieldLabel: '提单签发地',
//hidden: true,
allowBlank: true,
store: this.storeBillAddr,
forceSelection: true,
labelWidth: 80,
emptyText: '提单签发地',
blankText: '提单签发地',
id: 'billSignLoc',
name: 'billSignLoc',
valueField: 'EnumValueName',
displayField: 'EnumValueName'
});
//运输条款
this.storeSERVICE = Ext.create('DsExt.ux.RefTableStore', {
model: 'CODE_SERVICE',
proxy: { url: '/CommMng/BasicDataRef/GetCodeServiceList' }
});
this.storeSERVICE.load({ params: { condition: "" } });
this.comboxSERVICE2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.SERVICE, //'运输条款',
store: this.storeSERVICE,
forceSelection: true,
name: 'SERVICE',
valueField: 'SERVICE',
displayField: 'SERVICE',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
//if (records.length > 0) {
// var _DCYQ = Ext.getCmp("DCYQ");
// if (!_DCYQ.getValue()) {
// var headdataService = records[0].data.SERVICE;
// if (headdataService != "CY-CY") {
// _DCYQ.setValue(headdataService);
// }
// //var headdataService = me.formDjyOrder.getForm().findField('SERVICE').getValue();
// //if (headdataService != "CY-CY")
// //{
// // _DCYQ.setValue(headdataService);
// //}
// }
//}
}
}
});
//付费方式
this.storeFrt = Ext.create('DsExt.ux.RefTableStore', {
model: 'CODE_FRT',
proxy: { url: '/CommMng/BasicDataRef/GetCodeFrtList' }
});
this.storeFrt.load({ params: { condition: "" } });
this.comboxBLFRT2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: "付费方式", //'付费方式',
store: this.storeFrt,
forceSelection: true,
allowBlank: true,
name: 'BLFRT',
valueField: 'FRT',
displayField: 'FRT',
listeners: {
scope: this,
//'select': function (combo, records, eOpts) {
// if (records.length > 0) {
// if (combo.value == "FREIGHT PREPAID") {
// var portload = this.formEdit.getForm().findField('PORTLOAD').getValue();
// var portloadid = this.formEdit.getForm().findField('PORTLOADID').getValue();
// this.formEdit.getForm().findField('PREPARDAT').setValue(portload);
// this.formEdit.getForm().findField('PAYABLEAT').setValue('');
// this.formEdit.getForm().findField('PREPARDATID').setValue(portloadid);
// // this.formEdit.getForm().findField('ISSUEPLACE').setValue(portload);
// // this.formEdit.getForm().findField('ISSUEPLACEID').setValue(portloadid);
// } else if (combo.value == "FREIGHT COLLECT") {
// var DESTINATION = this.formEdit.getForm().findField('DESTINATION').getValue();
// var DESTINATIONID = this.formEdit.getForm().findField('DESTINATIONID').getValue();
// this.formEdit.getForm().findField('PREPARDAT').setValue('');
// this.formEdit.getForm().findField('PAYABLEAT').setValue(DESTINATION);
// this.formEdit.getForm().findField('PREPARDATID').setValue(DESTINATIONID);
// }
// }
//}
}
});
//合约类型
this.StoreCarrierGoodsName = Ext.create('DsExt.ux.RefEnumStore', {});
this.StoreCarrierGoodsName.load({ params: { enumTypeId: 81020 } });
this.comboxCarrierGoodsName = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCarrierGoodsName,
fieldLabel: "品名",
//hidden: true,
labelWidth: 45,
forceSelection: true,
allowBlank: true,
flex:1,
//matchFieldWidth: false, //下拉款自适应宽度
name: 'DESCRIPTION',
valueField: 'EnumValueName',
displayField: 'EnumValueName'
});
this.formDjyOrder = Ext.widget('form', {
frame: true,
region: 'north',
height: 290,
id: "formDjyOrder",
bodyPadding: 2,
layout: 'anchor',
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [
{
xtype: 'container',
id: 'formDjyOrder_1',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxTHIRDACCOUNT
, this.comboxContractType
, this.comboxPilCode2
, {
labelWidth: 80,
fieldLabel: 'NamedAccount',
emptyText: 'NamedAccount',
blankText: 'NamedAccount',
name: 'NamedAccount'
}
, this.comboxCargoid2
, this.comboxbookingAddr
, {
xtype: 'numberfield',
fieldLabel: '复制票数',
emptyText: '复制票数',
blankText: '复制票数',
name: 'CopyNum'
}
]
}
, {
xtype: 'container',
id: 'formDjyOrder_3',
hidden:true,
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxSignType
, this.comboxbillSignLoc
, {
xtype: 'numberfield',
fieldLabel: '提单数量',
allowBlank: true,
emptyText: '提单数量',
blankText: '提单数量',
name: 'billCount'
}
, {
xtype: 'radiogroup',
labelWidth:105,
fieldLabel: '是否接收订舱通知', //'报文类型',
id: 'acceptNotify',
name: 'acceptNotify',
defaults: {
flex: 1
},
layout: 'hbox',
items: [
{
boxLabel: '是', //'订舱',
name: 'acceptNotify',
//checked: true,
inputValue: "1"
//,id: 'radio1'
}, {
boxLabel: '否', //'确认',
name: 'acceptNotify',
inputValue: "0"
//,id: 'radio2'
}
]
}
]
}
//订舱人和货运代理
//对应 booking 和 notice
, {
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: '订舱方名称',
flex: 1,
readOnly: true,
emptyText: '订舱人名称',
blankText: '订舱人名称',
name: 'BookingName'
},
this.comboxLASTNotifypart
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
xtype: 'textfield',
flex: 1,
//allowBlank: false,
readOnly: true,
emptyText: '订舱人地址',
blankText: '订舱人地址',
name: 'BookingAddress'
},
{
xtype: 'textfield',
flex: 1,
emptyText: '货运代理地址',
blankText: '货运代理地址',
name: 'NotifypartAddress'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
//defaultType: 'textfield',
items: [
{
flex: 1,
xtype: 'label',
html: '托运人'
},
{
flex: 1,
xtype: 'label',
html: '收货人'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxLASTShipper,
this.comboxLASTConsignee
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
xtype: 'textfield',
flex: 1,
//allowBlank: false,
readOnly: true,
emptyText: '托运人地址',
blankText: '托运人地址',
name: 'ShipperAddress'
},
{
xtype: 'textfield',
flex: 1,
emptyText: '收货人地址',
blankText: '收货人地址',
name: 'ConsigneeAddress'
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
//PLACERECEIPTID
this.comboxPLACERECEIPTID
, this.comboxPORTLOAD2
, this.comboxPORTDISCHARGE2
, this.comboxDESTINATION2
, this.comboxSERVICE2
,
{
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: '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'
},
{
xtype:"hiddenfield"
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textarea',
items: [
this.comboxCarrierGoodsName,
{
xtype: 'textarea',
//grow: true,
labelWidth: 80,
name: 'DCYQ',
//width: 800,
//height:120,
id: 'DCYQ',
emptyText: '订舱备注',
fieldLabel: Zi.LAN.DjyDCYQ
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textarea',
items: [
]
}
]
});
//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 = "";
//20241105 只保留第3个 订舱
if (memberyf.data.EnumValueName == "订舱") {
checkboxSingleItem= "{boxLabel:'" + memberyf.data.EnumValueName + "',inputValue:true,checked:" + checked + ",name:'" + memberyf.data.EnumValueId + "',id:'" + memberyf.data.EnumValueId + "'";
} else {
checkboxSingleItem = "{boxLabel:'" + memberyf.data.EnumValueName + "',inputValue:true,checked:false,name:'" + memberyf.data.EnumValueId + "',id:'" + memberyf.data.EnumValueId + "'";
checkboxSingleItem += ",hidden:true";
}
checkboxSingleItem += "}";
if (checkboxitems2 != "[") {
checkboxitems2 += ",";
}
checkboxitems2 += checkboxSingleItem;
}
};
checkboxitems2 += "]";
this.DjyServiceCheckboxGroup = new Ext.form.CheckboxGroup({
id: 'DjyServiceGroup',
xtype: 'checkboxgroup',
//fieldLabel: Zi.LAN.myService, //'大简云服务项目',
//flex: 2,
//columns: 8,
flex: 1,
columns:1,
items: eval(checkboxitems2)
});
//this.formDjyOrder.add(this.DjyServiceCheckboxGroup);
Ext.getCmp('formDjyOrder_1').add(this.DjyServiceCheckboxGroup);
//var DCYQ = new Ext.form.TextArea({
// //xtype: 'textarea',
// grow: true,
// name: 'DCYQ',
// width: 800,
// //height:120,
// id: 'DCYQ',
// fieldLabel: Zi.LAN.DjyDCYQ
//});
//this.formDjyOrder.add(DCYQ);
//var DCYQ = "{fieldLabel: Zi.LAN.DjyDCYQ,xtype:'textareafield', name: 'DCYQ'}";
//this.formDjyOrder.add(eval(DCYQ));
this.formDjyOrder.doLayout();
this.storeVesselVoyno = Ext.create('DsExt.ux.RefTableStore', {
model: 'VesselVoyno_One_md',
proxy: { url: '' }
});
this.storeVesselVoyno_detail = Ext.create('DsExt.ux.RefTableStore', {
model: 'VesselVoyno_One_Detail_md',
proxy: { url: '' }
});
var grid_VesselVoyno = Ext.create('Ext.grid.Panel', {
region: "center",
autoWidth:false,
store: _this.storeVesselVoyno,
plugins: [{
ptype: 'rowexpander',
rowBodyTpl: [
'<div id="{ID}">',
'</div>'
]
}],
viewConfig: {
enableTextSelection: true, //允许复制数据
},
columns: [
{
dataIndex: 'ID',
header: "顺序",
width: 0
},
{
dataIndex: 'originName',
header: "起运港",
width: 140
},
{
dataIndex: 'destinationName',
header: "卸货港",
width: 140
},
{
dataIndex: 'polDepartureDate',
header: "开船日期",
width: 80
},
{
dataIndex: 'podArrivalDate',
header: "预抵日期",
width: 80
}, {
dataIndex: 'vesselAndVoyage',
header: '船名航次航线',
width: 200
}, {
dataIndex: 'days',
header: "航程",
width: 40
}, {
dataIndex: 'trans',
header: "是否直达",
width: 60,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
if (value == "true") {
return '<SPAN style="COLOR: red">否</SPAN>';
}
if (value == "false") {
return '<SPAN style="COLOR: green">是</SPAN>';
}
}
catch (e) {
return value;
}
return value;
}
},
{
dataIndex: 'inlandCutOff',
header: "内陆截止时间",
width: 120
},
{
dataIndex: 'portCutOff',
header: "港口截止时间",
width: 120
},
{
dataIndex: 'docCutOff',
header: "文件截止时间",
width: 120
},
{
dataIndex: 'vgmCutOff',
header: "VGM截止时间",
width: 120
}
],
forceFit: true,
split: true,
region: 'center'
});
grid_VesselVoyno.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
me = this;
Ext.MessageBox.confirm("您已选择如下船期订舱,确定发送订舱请选择“是”",
"船名:" + record.data.vesselName + ",航次:" + record.data.voyageNumber + ",ETD:" + record.data.departureDate + ",航线:" + record.data.serviceCode + ",航程:" + record.data.days, function (btn) {
if (btn == 'yes') {
Ext.getCmp("DJYORDER_VESSEL").setValue(record.data.vesselName);
Ext.getCmp("DJYORDER_VOYNO").setValue(record.data.voyageNumber);
Ext.getCmp("DJYORDER_ETD").setValue(record.data.departureDate);
Ext.getCmp("DJYORDER_LANE").setValue(record.data.serviceCode);
Ext.getCmp("DJYORDER_PolPortName").setValue(record.data.originName);
Ext.getCmp("DJYORDER_PodPortName").setValue(record.data.destinationName);
me.win_VesselVoyno.close();
}
});
////双击时 将船名航次写入 并关闭win_VesselVoyno
//Ext.getCmp("DJYORDER_VESSEL").setValue(record.data.vesselName);
//Ext.getCmp("DJYORDER_VOYNO").setValue(record.data.voyageNumber);
//Ext.getCmp("DJYORDER_ETD").setValue(record.data.departureDate);
//Ext.getCmp("DJYORDER_LANE").setValue(record.data.serviceCode);
//Ext.getCmp("DJYORDER_PolPortName").setValue(record.data.originName);
//Ext.getCmp("DJYORDER_PodPortName").setValue(record.data.destinationName);
//this.win_VesselVoyno.close();
}, this);
grid_VesselVoyno.view.on('expandBody', function (rowNode, record, expandRow, eOpts) {
_this.displayInnerGrid(record.get('ID') );
});
grid_VesselVoyno.view.on('collapsebody', function (rowNode, record, expandRow, eOpts) {
_this.destroyInnerGrid(record);
});
this.win_VesselVoyno = Ext.create('Ext.window.Window', {
title: "ONE船期选择",
width: 1400,
height: 450,
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],
buttons: [{
text: Zi.LAN.GuanBi, //"关闭",
minWidth: 70,
handler: function () {
_this.win_VesselVoyno.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
/////////
//,this.gridList_OrderCtn
//, this.gridDocList
//, this.formSendResult
]
});
//#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('ShipperName').setValue(rec.BookingName);
_this.formDjyOrder.getForm().findField('ShipperAddress').setValue(rec.BookingAddress);
_this.formDjyOrder.getForm().findField('NotifypartName').setValue(rec.BookingName);
_this.formDjyOrder.getForm().findField('NotifypartAddress').setValue(rec.BookingAddress);
}
_count++;
if (_count == 2) {
_this.GetDjyOrderDataBySeae();
}
} else {
Ext.Msg.show({
title: '提示',
msg: "请在【系统配置-参数设置-大简云订舱_账号密码设置】中增加船公司[" + 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('NamedAccount').setValue(rec.NamedAccount);
}
_count++;
if (_count == 2) {
_this.GetDjyOrderDataBySeae();
}
} else {
Ext.Msg.show({
title: '提示',
msg: "请在【系统配置-参数设置-大简云订舱_合约号设置】中增加船公司[" + 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:"ONE"
},
//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);
if (data.acceptNotify == "1") {
data.acceptNotify = true;
} else {
data.acceptNotify = false;
}
//data.ShipperAddress = "";
//data.BookingAddress = "";
data.ShipperCountry = "";
data.ShipperProvince = "";
data.ShipperCity = "";
data.ShipperCounty = "";
data.ShipperPostCode = "";
data.BookingCountry = "";
data.BookingProvince = "";
data.BookingCity = "";
data.BookingCounty = "";
data.BookingPostCode = "";
//data.ConsigneeAddress = "";
//data.NotifypartAddress = "";
data.ConsigneeProvince = "";
data.ConsigneeCity = "";
data.ConsigneeCounty = "";
data.ConsigneePostCode = "";
data.NotifypartProvince = "";
data.NotifypartCity = "";
data.NotifypartCounty = "";
data.NotifypartPostCode = "";
data.ConsigneeLastName = "";
data.ConsigneeFirstName = "";
data.ConsigneePhoneCountryCode = "";
data.ConsigneePhoneCode = "";
data.ConsigneePhone = "";
data.NotifypartLastName = "";
data.NotifypartFirstName = "";
data.NotifypartPhoneCountryCode = "";
data.NotifypartPhoneCode = "";
data.NotifypartPhone = "";
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',
timeout: 30000,
cors: true,
params: {
BSNO: BSNO,
str: str,
CARRIER: "ONE",
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.removeAll();
_this.storeVesselVoyno_detail.removeAll();
for (var i = 0; i < resultData.Data.length; i += 1) {
var rec = resultData.Data[i];
rec.ID = i;
rec.vesselAndVoyage = rec.vesselName + " " + rec.voyageNumber + " " + rec.serviceCode;
if (rec.oceanLegs.length > 0) {
for (var j = 0; j < rec.oceanLegs.length; j += 1) {
var detail = rec.oceanLegs[j];
detail.ID = i;
_this.storeVesselVoyno_detail.add(detail);
}
}
_this.storeVesselVoyno.add(rec);
}
//_this.storeVesselVoyno.loadData(resultData.Data);
//_this.win_VesselVoyno.setTitle("中远订舱:" + resultData.Message2 + "");
_this.win_VesselVoyno.title = "ONE订舱:<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;
}
}
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
});
//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();
}
//#region 船期子列表
,
displayInnerGrid: function (ID) {
_this = this;
//columns_Voyno_detail =
var detailstore = Ext.create('DsExt.ux.RefTableStore', {
model: 'VesselVoyno_One_Detail_md',
proxy: { url: '' }
});
for (i = 0; i < this.storeVesselVoyno_detail.getCount(); i += 1) {
var rec = this.storeVesselVoyno_detail.getAt(i);
if (rec.data.ID == ID) {
detailstore.add(rec);
}
}
var innerGrid = Ext.create('Ext.grid.Panel', {
region: "center",
autoWidth: false,
store: detailstore,
viewConfig: {
enableTextSelection: true, //允许复制数据
//autoFill: true
},
columns: [
{
sortable: true,
dataIndex: 'ID',
header: "ID",
//hidden: true,
width: 0
},
{
dataIndex: 'polPortName',
header: "起运港",
width: 160
}, {
dataIndex: 'podPortName',
header: "目的港",
width: 160
}, {
dataIndex: 'polETD',
header: "ETD",
width: 120
}, {
dataIndex: 'podETA',
header: "ETA",
width: 120
}, {
dataIndex: 'vesselName',
header: "船名",
width: 140
}, {
dataIndex: 'voyageNumber',
header: "航次信息",
width: 140
}, {
dataIndex: 'serviceCode',
header: "航线代码",
width: 70
}, {
dataIndex: 'days',
header: "航程",
width: 140
}
],
//frame: false,
renderTo: ID
});
},
destroyInnerGrid: function (record, fenpiao) {
var parent = document.getElementById(record.get('ID'));
var child = parent.firstChild;
while (child) {
child.parentNode.removeChild(child);
child = child.nextSibling;
}
}
//#endregion
, LoadUploadFile: function (BSNO) {
var condition2 = " BSNO='" + BSNO + "' ";
this.storeDocList.load({
params: { condition: condition2 },
waitMsg: "正在查询数据...",
scope: this,
callback: function () {
_this.Loading = false;
}
});
}
});