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.

202 lines
6.6 KiB
JavaScript

Ext.namespace('Shipping');
Shipping.RailwayFeeView = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.RailwayFeeView.superclass.constructor.call(this);
};
Ext.extend(Shipping.RailwayFeeView, Ext.Panel, {
ParentWin: null,
OpStatus: 'add',
StoreList: null,
EditRecord: null,
region: 'north',
initUIComponents: function () {
//枚举参照相关
//编辑form
this.storebill = Ext.create('Ext.data.Store', {
model: 'MsOpRailwayModel',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpRailway/GetData',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.bsno = getUrlParam('bsno');
//按钮Toolbar
this.formHead = Ext.widget('form', {
id: 'FeeHead',
region: 'north',
frame: true,
bodyPadding: 5,
trackResetOnLoad: true,
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: '件数',
name: 'PKGS', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: '重量',
name: 'KGS', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: '尺码',
name: 'CBM', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: '委托编号',
readOnly: true,
name: 'CUSTNO'
}, {
fieldLabel: '运输单号',
readOnly: true,
name: 'TRANSNO'
},
{
fieldLabel: '箱号',
readOnly: true,
name: 'CNTRNO'
}, {
fieldLabel: '箱型',
readOnly: true,
name: 'CTNALL'
}, {
fieldLabel: '箱源',
readOnly: true,
name: 'CTNSOURCE'
}
]
},
{ xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '揽货人',
readOnly: true,
name: 'SALE'
}, {
fieldLabel: '委托单位',
readOnly: true,
name: 'CUSTOMERNAME'
},
{
fieldLabel: '发站',
readOnly: true,
name: 'PLACELOAD'
},
{
fieldLabel: '到达站',
readOnly: true,
name: 'DESTINATION'
}, {
fieldLabel: '山口站',
readOnly: true,
name: 'PLACETRANSIT'
}
]
}
]
}]//end root items
}); //end this.formEdit
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 130,
id: "BillHead",
items: [this.formHead]
});
this.panelFee = new Shipping.FeeViewGrid({
region: 'center',
layout: 'border'
});
this.panelFee.stroplb = 'op_railway';
this.panelFee.strBSNO = this.bsno;
this.panelFee.StoreDrOpRange.load({ params: { optype: "modRailwayRecvFeeManagement"} });
this.panelFee.StoreCrOpRange.load({ params: { optype: "modRailwayPayFeeManagement"} });
this.panelFee.storeDrChFee.load({ params: { billno: this.bsno, type: 1, optype: "op_railway"} });
this.panelFee.storeCrChFee.load({ params: { billno: this.bsno, type: 2, optype: "op_railway"} });
this.panelFee.storeBodySum.load({ params: { bsno: this.bsno} });
this.panelFee.storeChFeeGain.load({ params: { bsno: this.bsno} });
Ext.apply(this, {
items: [this.panelTop, this.panelFee]
});
this.InitData();
}, //end initUIComponents
//#region 加载数据
InitData: function () {
var condition = '';
condition = " BsNo='" + this.bsno + "'";
this.LoadData(condition, this.bsno);
}, //end InitData
LoadData: function (condition, refbillno) {
_this = this;
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOpRailway/GetData',
params: {
handle: 'edit',
condition: condition
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
data = result.data;
this.formHead.getForm().reset();
this.formHead.getForm().setValues(data);
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
});