|
|
|
|
Ext.namespace('Shipping');
|
|
|
|
|
|
|
|
|
|
Shipping.MsOpCtnStatusPLEdit = function (config) {
|
|
|
|
|
Ext.applyIf(this, config);
|
|
|
|
|
this.initUIComponents();
|
|
|
|
|
window.Shipping.MsOpCtnStatusPLEdit.superclass.constructor.call(this);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Ext.extend(Shipping.MsOpCtnStatusPLEdit, Ext.Panel, {
|
|
|
|
|
|
|
|
|
|
ParentWin: null,
|
|
|
|
|
OpStatus: 'add',
|
|
|
|
|
StoreList: null,
|
|
|
|
|
EditRecord: null,
|
|
|
|
|
|
|
|
|
|
initUIComponents: function () {
|
|
|
|
|
this.serialNo = 0;
|
|
|
|
|
this.bodyDel = [];
|
|
|
|
|
|
|
|
|
|
//枚举参照相关
|
|
|
|
|
|
|
|
|
|
this.storeVoyVeg = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
|
|
model: 'DsShipping.ux.VesselModel',
|
|
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetVesselList' }
|
|
|
|
|
});
|
|
|
|
|
this.storeVoyVeg.load({ params: { condition: ""} });
|
|
|
|
|
|
|
|
|
|
this.comboxVoyVeg = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
|
|
fieldLabel: '船 名',
|
|
|
|
|
store: this.storeVoyVeg,
|
|
|
|
|
name: 'VESSEL',
|
|
|
|
|
valueField: 'VESSEL',
|
|
|
|
|
flex: 1.5,
|
|
|
|
|
displayField: 'CodeAndName',
|
|
|
|
|
listeners: {
|
|
|
|
|
scope: this,
|
|
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
|
|
if (records.length > 0) {
|
|
|
|
|
var selectrecords = DsStoreQueryBy(this.storeVoyVeg, 'VoyName', combo.value);
|
|
|
|
|
if (selectrecords.getCount() > 0) {
|
|
|
|
|
var selectdata = selectrecords.getAt(0).data;
|
|
|
|
|
this.formEdit.getForm().findField('VESSELID').setValue(selectdata.EDICODE);
|
|
|
|
|
} else {
|
|
|
|
|
this.formEdit.getForm().findField('VESSELID').setValue('');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.StoreStatus = Ext.create('Ext.data.Store', {
|
|
|
|
|
fields: ['ID', 'NAME']
|
|
|
|
|
});
|
|
|
|
|
this.StoreStatus.add({ "ID": 1, "NAME": "空箱" });
|
|
|
|
|
this.StoreStatus.add({ "ID": 2, "NAME": "重箱" });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.comboxStatus = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
|
|
store: this.StoreStatus,
|
|
|
|
|
fieldLabel: '箱子状态',
|
|
|
|
|
forceSelection: true,
|
|
|
|
|
name: 'state',
|
|
|
|
|
valueField: 'ID',
|
|
|
|
|
displayField: 'NAME'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
|
|
model: 'DsShipping.ux.PortRefModel',
|
|
|
|
|
proxy: { url: '/MvcShipping/MsBaseInfo/GetPortRefList' }
|
|
|
|
|
});
|
|
|
|
|
this.storeCodeDisport.load();
|
|
|
|
|
|
|
|
|
|
this.comboxPORT = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
|
|
fieldLabel: '起运港',
|
|
|
|
|
store: this.storeCodeDisport,
|
|
|
|
|
forceSelection: true,
|
|
|
|
|
name: 'fobport',
|
|
|
|
|
valueField: 'PORTID',
|
|
|
|
|
queryMode: 'local',
|
|
|
|
|
displayField: 'PORT'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.comboxposition = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
|
|
fieldLabel: '目的港',
|
|
|
|
|
store: this.storeCodeDisport,
|
|
|
|
|
forceSelection: true,
|
|
|
|
|
name: 'position',
|
|
|
|
|
valueField: 'PORTID',
|
|
|
|
|
queryMode: 'local',
|
|
|
|
|
displayField: 'PORT'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//编辑form
|
|
|
|
|
this.formEdit = Ext.widget('form', {
|
|
|
|
|
region: 'north',
|
|
|
|
|
frame: true,
|
|
|
|
|
bodyPadding: 5,
|
|
|
|
|
fieldDefaults: {
|
|
|
|
|
margins: '2 2 2 2',
|
|
|
|
|
labelAlign: 'right',
|
|
|
|
|
flex: 1,
|
|
|
|
|
labelWidth:60,
|
|
|
|
|
msgTarget: 'qtip'
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
items: [
|
|
|
|
|
{//fieldset 1
|
|
|
|
|
xtype: 'fieldset',
|
|
|
|
|
defaultType: 'textfield',
|
|
|
|
|
layout: 'anchor',
|
|
|
|
|
defaults: {
|
|
|
|
|
anchor: '100%'
|
|
|
|
|
},
|
|
|
|
|
items: [{
|
|
|
|
|
xtype: 'container',
|
|
|
|
|
layout: 'hbox',
|
|
|
|
|
defaultType: 'textfield',
|
|
|
|
|
items: [this.comboxVoyVeg, {
|
|
|
|
|
fieldLabel: '航次',
|
|
|
|
|
flex: 0.5,
|
|
|
|
|
name: 'voyage'
|
|
|
|
|
}, {
|
|
|
|
|
fieldLabel: 'ETD',
|
|
|
|
|
format: 'Y-m-d',
|
|
|
|
|
xtype: 'datefield',
|
|
|
|
|
name: 'etd'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}, {
|
|
|
|
|
xtype: 'container',
|
|
|
|
|
layout: 'hbox',
|
|
|
|
|
defaultType: 'textfield',
|
|
|
|
|
items: [this.comboxPORT, this.comboxposition, {
|
|
|
|
|
fieldLabel: 'ETA',
|
|
|
|
|
format: 'Y-m-d',
|
|
|
|
|
xtype: 'datefield',
|
|
|
|
|
name: 'reachtime'
|
|
|
|
|
}]
|
|
|
|
|
}, {
|
|
|
|
|
xtype: 'container',
|
|
|
|
|
layout: 'hbox',
|
|
|
|
|
defaultType: 'textfield',
|
|
|
|
|
items: [{
|
|
|
|
|
xtype: 'textareafield',
|
|
|
|
|
fieldLabel: '批量内容',
|
|
|
|
|
grow: true,
|
|
|
|
|
height: 120,
|
|
|
|
|
name: 'Remarks',
|
|
|
|
|
anchor: '100%'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}, {
|
|
|
|
|
xtype: 'container',
|
|
|
|
|
layout: 'hbox',
|
|
|
|
|
defaultType: 'textfield',
|
|
|
|
|
items: [{ xtype: 'hiddenfield', flex: 0.2 }, {
|
|
|
|
|
xtype: 'label',
|
|
|
|
|
flex: 3,
|
|
|
|
|
html: '<html>录入格式:箱号/提单号/重箱F和空箱E 多个信息用","隔开</html>'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}, {
|
|
|
|
|
xtype: 'container',
|
|
|
|
|
layout: 'hbox',
|
|
|
|
|
defaultType: 'textfield',
|
|
|
|
|
items: [{ xtype: 'hiddenfield', flex: 0.2 }, {
|
|
|
|
|
xtype: 'label',
|
|
|
|
|
flex: 3,
|
|
|
|
|
html: '例如:CLHU3618566/SOFCGBW1239902/F,SNWU1000477/SOFCGBW1239903/E </html>'
|
|
|
|
|
} ]
|
|
|
|
|
}
|
|
|
|
|
]//end items(fieldset 1)
|
|
|
|
|
}//end fieldset 1
|
|
|
|
|
]//end root items
|
|
|
|
|
}); //end this.formEdit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//按钮Toolbar
|
|
|
|
|
this.panelBtn = new Ext.Panel({
|
|
|
|
|
region: "north",
|
|
|
|
|
tbar: [
|
|
|
|
|
{
|
|
|
|
|
id: 'btnESave',
|
|
|
|
|
text: "保存",
|
|
|
|
|
iconCls: "btnsave",
|
|
|
|
|
handler: function (button, event) {
|
|
|
|
|
this.Save('0');
|
|
|
|
|
},
|
|
|
|
|
scope: this
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'btnESaveAndClose',
|
|
|
|
|
text: "保存并关闭",
|
|
|
|
|
handler: function (button, event) {
|
|
|
|
|
this.Save('1');
|
|
|
|
|
},
|
|
|
|
|
scope: this
|
|
|
|
|
},
|
|
|
|
|
'-',
|
|
|
|
|
{
|
|
|
|
|
text: "关闭",
|
|
|
|
|
handler: function (button, event) {
|
|
|
|
|
window.close();
|
|
|
|
|
},
|
|
|
|
|
scope: this
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: "新建",
|
|
|
|
|
handler: function (button, event) {
|
|
|
|
|
this.LoadData('add', '');
|
|
|
|
|
var basicForm = this.formEdit.getForm();
|
|
|
|
|
basicForm.findField('cntrid').setDisabled(false);
|
|
|
|
|
},
|
|
|
|
|
scope: this
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}); //end 按钮Toolbar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ext.apply(this, {
|
|
|
|
|
items: [this.panelBtn, this.formEdit]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
parentWin = window.parent.opener;
|
|
|
|
|
|
|
|
|
|
this.InitData();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, //end initUIComponents
|
|
|
|
|
|
|
|
|
|
InitData: function () {
|
|
|
|
|
this.opStatus = 'add';
|
|
|
|
|
var condition = '';
|
|
|
|
|
if (parentWin) {
|
|
|
|
|
var ret = parentWin.OprationSwap();
|
|
|
|
|
this.opStatus = ret[0];
|
|
|
|
|
this.StoreList = ret[1];
|
|
|
|
|
this.editRecord = ret[2];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// condition = " box_no='XX'";
|
|
|
|
|
|
|
|
|
|
// this.LoadData(this.opStatus, condition);
|
|
|
|
|
|
|
|
|
|
}, //end InitData
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Save: function (type) {
|
|
|
|
|
var basicForm = this.formEdit.getForm();
|
|
|
|
|
|
|
|
|
|
if (!basicForm.isValid()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var data = this.formEdit.getForm().getValues();
|
|
|
|
|
|
|
|
|
|
Ext.Msg.wait('正在保存数据, 请稍侯..');
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
waitMsg: '正在保存数据...',
|
|
|
|
|
url: '/MvcShipping/MsOpCtnStatus/SavePL',
|
|
|
|
|
scope: this,
|
|
|
|
|
params: {
|
|
|
|
|
opstatus: this.opStatus,
|
|
|
|
|
data: Ext.JSON.encode(data)
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
callback: function (options, success, response) {
|
|
|
|
|
if (success) {
|
|
|
|
|
Ext.MessageBox.hide();
|
|
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
|
|
if (jsonresult.Success) {
|
|
|
|
|
|
|
|
|
|
if (this.opStatus == 'add') {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (this.opStatus == 'edit') {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (type == '0') {
|
|
|
|
|
this.opStatus = 'edit';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (type == '1') {
|
|
|
|
|
window.close();
|
|
|
|
|
} else {
|
|
|
|
|
this.LoadData('add', '');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
Ext.Msg.show({ title: '请重试',
|
|
|
|
|
msg: '服务器响应出错',
|
|
|
|
|
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} //end save
|
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setSaveBtnStatus: function (enable) {
|
|
|
|
|
var btnESave = Ext.getCmp('btnESave');
|
|
|
|
|
var btnESaveAndClose = Ext.getCmp('btnESaveAndClose');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (enable) {
|
|
|
|
|
btnESave.enable();
|
|
|
|
|
btnESaveAndClose.enable();
|
|
|
|
|
} else {
|
|
|
|
|
btnESave.disable();
|
|
|
|
|
btnESaveAndClose.disable();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
Print: function () {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|