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/MsOpAire/PiLiangOpBill.js

270 lines
7.4 KiB
JavaScript

Ext.namespace('Shipping');
Shipping.PiliangOpBill = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.PiliangOpBill.superclass.constructor.call(this);
};
Ext.extend(Shipping.PiliangOpBill, Ext.Panel, {
ParentWin: null,
OpStatus: 'add',
StoreList: null,
EditRecord: null,
region: 'north',
BsNo: '',
feeType:null,
StoreFee: null,
StoreFeeUnit: null,
StoreFeeCust:null,
initUIComponents: function () {
this.formHead = Ext.widget('form', {
frame: true,
region: 'center', title: '委托信息',
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [
{ xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '委托编号',
readOnly: true,
name: 'CUSTNO'
}, {
fieldLabel: '主提单号',
readOnly: true,
name: 'MBLNO'
}, {
fieldLabel: '付费方式',
readOnly: true,
name: 'BLFRT'
}, {
fieldLabel: '其他付费方式',
readOnly: true,
name: 'OTFRT'
}, {
fieldLabel: '揽货人',
readOnly: true,
name: 'SALE'
}, {
fieldLabel: '委托单位',
readOnly: true,
name: 'CUSTOMERNAME'
}
]
},
{ xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
fieldLabel: '目的港',
readOnly: true,
name: 'PORTDISCHARGE'
},
{
fieldLabel: '航班',
readOnly: true,
name: 'VESSEL'
}, {
fieldLabel: '件数',
name: 'PKGS'
}, {
fieldLabel: '重量',
name: 'KGS'
}, {
fieldLabel: '尺码',
name: 'CBM'
}, {
fieldLabel: '计费重量',
name: 'FEEKGS'
}
]
}
]
}]
}); //end this.formEdit
//#region 按钮Toolbar
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
id: 'btnEPrev',
text: "上一票",
// iconCls: "btnsave",
handler: function (button, event) {
this.PrevRecord();
},
scope: this
}, {
id: 'btnENext',
text: "下一票",
// iconCls: "btnsave",
handler: function (button, event) {
this.NextRecord();
},
scope: this
}]
}); //end 按钮Toolbar
//#endregion
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 130,
id: "BillHeadAire",
items: [this.panelBtn, this.formHead]
});
this.panelFee = new Shipping.MsOpAireBillEdit({
title: '提单信息',
region: 'center',
layout: 'border'
});
Ext.apply(this, {
items: [this.panelTop, this.panelFee]
});
parentWin = window.parent.opener;
this.InitData();
},
//#region 加载事件
InitData: function () {
this.opStatus = 'add';
var condition = '';
_this = this;
if (parentWin) {
var ret = parentWin.OprationSwap();
this.opStatus = ret[0];
this.StoreList = ret[1];
this.EditRecord = ret[2];
}
this.BsNo = this.EditRecord.get('BSNO');
this.LoadData();
}, //end InitData
LoadData: function () {
this.formHead.getForm().loadRecord(this.EditRecord);
this.panelFee.MainEditRecord = this.EditRecord;
this.panelFee.BsNo = this.BsNo;
this.panelFee.InitData();
}, // end LoadDate
//#region 打印
Print: function () {
var basicForm = this.formHead.getForm();
var billNo = basicForm.findField('BSNO').value;
if (billNo == '*' || billNo == '') {
Ext.Msg.show({ title: '错误', msg: '单据还没有保存,请保存后再打印', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var printType = 'MSOPAIRE';
var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM op_aire WHERE BSNO = '" + billNo + "'";
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
//#endregion
PrevRecord: function () {
var j = this.StoreList.indexOf(this.EditRecord);
if (j == 0) {
Ext.Msg.show({ title: '警告', msg: '已是最前一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
if (j == this.StoreList.count) {
Ext.Msg.show({ title: '警告', msg: '已是最后一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
j = j - 1;
this.EditRecord = this.StoreList.getAt(j);
this.BsNo = this.EditRecord.get('BSNO');
this.LoadData();
},
NextRecord: function () {
var j = this.StoreList.indexOf(this.EditRecord);
if (j == (this.StoreList.count - 1)) {
Ext.Msg.show({ title: '警告', msg: '已是最后一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
j = j + 1;
this.EditRecord = this.StoreList.getAt(j);
this.BsNo = this.EditRecord.get('BSNO');
this.LoadData();
},
getModifyStatus: function () {
return this.panelFee.getModifyStatus();
},
feeType: function () {
return this.panelFee.feeType;
},
StoreFee: function () {
return this.panelFee.StoreFee;
},
StoreFeeUnit: function () {
return this.panelFee.StoreFeeUnit;
},
StoreFeeCust: function () {
return this.panelFee.StoreFeeCust;
}
});