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/MsOpAirn/AirnFeeView.js

248 lines
8.9 KiB
JavaScript

3 years ago
Ext.namespace('Shipping');
Shipping.SeaeFeeView = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.SeaeFeeView.superclass.constructor.call(this);
};
Ext.extend(Shipping.SeaeFeeView, Ext.Panel, {
ParentWin: null,
OpStatus: 'add',
StoreList: null,
EditRecord: null,
region: 'north',
initUIComponents: function () {
//枚举参照相关
//编辑form
this.storebill = Ext.create('Ext.data.Store', {
model: 'MsOpSeae',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeae/GetBLData',
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: [
{//fieldset 1
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
fieldLabel: '业务编号',
name: 'BSNO', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: '委托编号',
readOnly: true,
name: 'CUSTNO'
}, {
fieldLabel: '业务锁定',
readOnly: true,
name: 'BSSTATUSREF'
}, {
fieldLabel: '费用锁定',
readOnly: true,
name: 'FEESTATUSREF'
}, {
fieldLabel: '会计期间',
readOnly: true,
xtype: 'monthfield',
name: 'ACCDATE'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '委托单位',
readOnly: true,
name: 'CUSTOMERNAME'
}, {
fieldLabel: '业务来源',
readOnly: true,
name: 'BSSOURCE'
}, {
fieldLabel: '来源明细',
readOnly: true,
name: 'BSSOURCEDETAIL'
}, {
fieldLabel: '揽货人',
readOnly: true,
name: 'SALE'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '操 作',
readOnly: true,
name: 'OP'
}, {
fieldLabel: '所属部门',
readOnly: true,
name: 'SALEDEPT'
}, {
fieldLabel: '运输类型',
readOnly: true,
name: 'BSTYPEREF'
}, {
fieldLabel: '报关单号',
readOnly: true,
name: 'CUSTOMNO'
}]
}]//end items(fieldset 1)
}]//end root items
}); //end this.formEdit
this.storecodeservice = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsCodeOpService',
proxy: { url: '/MvcShipping/MsCodeOpService/GetDataList' }
});
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_Seai';
this.panelFee.strBSNO = this.bsno;
this.panelFee.StoreDrOpRange.load({ params: { optype: "modSeAirncvFeeManagement"} });
this.panelFee.StoreCrOpRange.load({ params: { optype: "modSeaiPayFeeManagement"} });
this.panelFee.storeDrChFee.load({ params: { billno: this.bsno, type: 1, optype: "op_Seai"} });
this.panelFee.storeCrChFee.load({ params: { billno: this.bsno, type: 2, optype: "op_Seai"} });
this.panelFee.storeBodySum.load({ params: { bsno: this.bsno, optype: "op_Seae" },
callback: function (r, options, success) {
if (success) {
_thisfee.setTotalHead();
}
}
});
this.panelFee.storeChFeeGain.load({ params: { bsno: this.bsno, optype: "op_Seae"} });
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;
this.storecodeservice.load({ params: { condition: "OPTYPE='5'" },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
var checkboxitems = "";
checkboxitems = "[";
for (i = 0; i < this.storecodeservice.getCount(); i += 1) {
var memberyf = this.storecodeservice.getAt(i);
if (i == 0) {
var checkboxSingleItem = "{boxLabel:'" + memberyf.data.SERVICENAME + "',inputValue:'1',name:'Is" + memberyf.data.OPField + "',id:'Is" + memberyf.data.OPField + "'";
checkboxSingleItem += "}";
} else {
var checkboxSingleItem = ",{boxLabel:'" + memberyf.data.SERVICENAME + "',inputValue:'1',name:'Is" + memberyf.data.OPField + "',id:'Is" + memberyf.data.OPField + "'";
checkboxSingleItem += "}";
}
checkboxitems += checkboxSingleItem;
};
checkboxitems += "]";
_this.myCheckboxGroup = new Ext.form.CheckboxGroup({
id: 'myGroup',
xtype: 'checkboxgroup',
fieldLabel: '服务项目',
columns: 8,
items: eval(checkboxitems)
});
this.formHead.add(_this.myCheckboxGroup);
this.formHead.doLayout();
}
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOpSeai/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
});
}
});