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.

1672 lines
63 KiB
JavaScript

//集运管理-路单查询
Ext.namespace('Shipping');
Shipping.MsRptFeeModifyIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsRptFeeModifyIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsRptFeeModifyIndex, Ext.Panel, {
PageSize: 30,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '1=2',
initUIComponents: function () {
this.formname = 'MsRptFeeModifyIndex';
this.storeChFeeModifyOld = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetModifyAllData',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeChFeeModifyNew = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetModifyAllData',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'BSNO', type: 'string' },
{ name: 'OPLB', type: 'string' },
{ name: 'OPLBNAME', type: 'string' },
{ name: 'BSTYPE', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'CUSTNO', type: 'string' },
{ name: 'MBLNO', type: 'string' },
{ name: 'HBLNO', type: 'string' },
{ name: 'ETD', type: 'string' },
{ name: 'VESSEL', type: 'string' },
{ name: 'VOYNO', type: 'string' },
{ name: 'INPUTBY', type: 'string' },
{ name: 'CREATETIME', type: 'string' },
{ name: 'BSSTATUS', type: 'string' },
{ name: 'SALE', type: 'string' },
{ name: 'OP', type: 'string' },
{ name: 'DOC', type: 'string' },
{ name: 'CUSTSERVICE', type: 'string' },
{ name: 'PORTLOAD', type: 'string' },
{ name: 'PORTDISCHARGE', type: 'string' },
{ name: 'CUSTOMNO', type: 'string' },
{ name: 'ACCDATE', type: 'string' },
{ name: 'CARRIER', type: 'string' },
{ name: 'BSSOURCE', type: 'string' },
{ name: 'LANE', type: 'string' },
{ name: 'FORWARDER', type: 'string' },
{ name: 'CNTRTOTAL', type: 'string' },
{ name: 'TRADETYPE', type: 'string' },
{ name: 'GOODSNAME', type: 'string' },
{ name: 'OPDATE', type: 'string' },
{ name: 'CUSTOMDATE', type: 'string' },
{ name: 'ENTERP', type: 'string' },
{ name: 'NETWEIGHT', type: 'number' },
{ name: 'KGS', type: 'number' },
{ name: 'TEU', type: 'number' },
{ name: 'CNTR1', type: 'number' },
{ name: 'CNTR2', type: 'number' },
{ name: 'CNTR3', type: 'number' },
{ name: 'CNTR4', type: 'number' },
{ name: 'CNTR5', type: 'number' },
{ name: 'CNTR6', type: 'number' },
{ name: 'CNTR7', type: 'number' },
{ name: 'CNTR8', type: 'number' },
{ name: 'CNTR9', type: 'number' },
{ name: 'CNTR10', type: 'number' },
{ name: 'OTCNTR', type: 'number' },
{ name: 'MODIFYPR', type: 'number' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptFeeModify/BsListData',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.initgirdcolums = [{
sortable: true,
dataIndex: 'BSNO',
header:Zi.LAN.BSNO,
//header: '编号',
hidden: true,
width: 130
}, {
sortable: true,
dataIndex: 'CUSTNO',
header:Zi.LAN.CUSTNO,
//header: '编号',
width: 136
}, {
sortable: true,
dataIndex: 'MODIFYPR',
header: Zi.LAN.MODIFYPR,
//header: '利润调整',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OPLBNAME',
header: Zi.LAN.OPLBNAME,
//header: '业务类型',
width: 70
}, {
sortable: true,
dataIndex: 'BSTYPE',
header: Zi.LAN.BSTYPE,
//header: '运输类型',
width: 70
}, {
sortable: true,
dataIndex: 'OPDATE',
header: Zi.LAN.OPDATE,
//header: '业务日期',
width: 86
}, {
sortable: true,
dataIndex: 'CUSTOMDATE',
header: Zi.LAN.CUSTOMDATE,
//header: '报关日期',
width: 86
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: Zi.LAN.CUSTOMERNAME,
//header: '委托单位',
width: 120
}, {
sortable: true,
dataIndex: 'CUSTOMNO',
header: Zi.LAN.CUSTOMNO,
//header: '报关单号',
width: 136
}, {
sortable: true,
dataIndex: 'ENTERP',
header: Zi.LAN.ENTERP,
//header: '经营单位',
width: 100
}, {
sortable: true,
dataIndex: 'MBLNO',
header: Zi.LAN.MBLNO,
//header: '主提单号',
width: 120
}, {
sortable: true,
dataIndex: 'HBLNO',
header: Zi.LAN.HBLNO,
//header: '分提单号',
width: 120
}, {
sortable: true,
dataIndex: 'ETD',
header: Zi.LAN.ETD,
//header: '开船日期',
width: 86
}, {
sortable: true,
dataIndex: 'VESSEL',
header: Zi.LAN.VESSEL,
//header: '船名',
width: 200
}, {
sortable: true,
dataIndex: 'VOYNO',
header: Zi.LAN.VOYNO,
//header: '航次',
width: 50
}, {
sortable: true,
dataIndex: 'SALE',
header: Zi.LAN.BLANKFIELD,
//header: '业务员',
width: 80
}, {
sortable: true,
dataIndex: 'OP',
header: Zi.LAN.OP,
//header: '操作',
width: 80
}, {
sortable: true,
dataIndex: 'PORTLOAD',
header: Zi.LAN.PORTLOAD,
//header: '起运港',
width: 80
}, {
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: Zi.LAN.PORTDISCHARGE,
//header: '目的港',
width: 150
}, {
sortable: true,
dataIndex: 'ACCDATE',
header: Zi.LAN.ACCDATE,
//header: '会计期间',
width: 80
}, {
sortable: true,
dataIndex: 'CARRIER',
header: Zi.LAN.CARRIER,
//header: '船公司',
width: 80
}, {
sortable: true,
dataIndex: 'BSSOURCE',
header: Zi.LAN.BSSOURCE,
//header: '业务来源',
width: 120
}, {
sortable: true,
dataIndex: 'TEU',
header: Zi.LAN.TEU,
//header: 'TEU',
width: 80
}, {
sortable: true,
dataIndex: 'KGS',
header: Zi.LAN.KGS,
//header: 'KGS',
width: 80
}, {
sortable: true,
dataIndex: 'GOODSNAME',
header: Zi.LAN.GOODSNAME,
//header: '品名',
width: 80
}
];
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.initgirdcolums, 1);
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LOADING },//msg: Zi.LAN.LOADING 数据加载中,请稍等...
trackMouseOver: true,
disableSelection: false,
columns: this.girdcolums,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: Zi.LAN.displayMsg,//'当前显示 {0} - {1}条记录 /共 {2}条记录'
emptyMsg: Zi.LAN.emptyMsg//"没有数据"
})
});
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../MvcShipping/MsOpBill/MsOpFeeView?handle=check&bsno=" + record.data.BSNO;
window.open(openUrl, openType, openSet);
}, this);
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.girdcolums, 1);
this.gridList.reconfigure(this.storeList, this.girdcolums);
this.storeBodyListdetail = Ext.create('Ext.data.Store', {
fields: [
{ name: 'BSNO', type: 'string' },
{ name: 'FEEID', type: 'string' },
{ name: 'GROUPID', type: 'string' },
{ name: 'TYPE', type: 'number' },
{ name: 'TYPEREF', type: 'string' },
{ name: 'APPLYTYPEREF', type: 'string' },
{ name: 'APPLYTYPE', type: 'number' },
{ name: 'APPLYUSER', type: 'string' },
{ name: 'APPLYUSERREF', type: 'string' },
{ name: 'APPLYTIME', type: 'string' },
{ name: 'AUDITUSER', type: 'string' },
{ name: 'AUDITUSERREF', type: 'string' },
{ name: 'AUDITTIME', type: 'string' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptFeeModify/GetFeeModify',
reader: {
id: 'BSNO,FEEID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListdetail = new Ext.grid.GridPanel({
store: this.storeBodyListdetail,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LOADING },//msg: Zi.LAN.LOADING 数据加载中,请稍等...
trackMouseOver: true,
disableSelection: false,
columns: [{
sortable: true,
dataIndex: 'FEEID',
header: Zi.LAN.FEEID,
//header: 'FEEID',
hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'GROUPID',
header: Zi.LAN.GROUPID,
//header: 'GROUPID',
hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'BSNO',
header: Zi.LAN.BSNO,
//header: 'BSNO',
hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'TYPEREF',
header: Zi.LAN.TYPEREF,
//header: '收付',
width: 20
}, {
sortable: true,
dataIndex: 'APPLYTYPEREF',
header: Zi.LAN.APPLYTYPEREF,
//header: '申请类型',
width: 60
}, {
sortable: true,
dataIndex: 'FEENAME',
header: Zi.LAN.FEENAME,
//header: '费用名称',
width: 80
}, {
sortable: true,
dataIndex: 'APPLYUSERREF',
header: Zi.LAN.APPLYUSERREF,
//header: '申请人',
width: 60
}, {
sortable: true,
dataIndex: 'APPLYTIME',
header: Zi.LAN.ApplyTime,
//header: '申请日期',
width: 80
}, {
sortable: true,
dataIndex: 'AUDITUSERREF',
header: Zi.LAN.AUDITUSERREF,
//header: '审核人',
width: 60
}, {
sortable: true,
dataIndex: 'AUDITTIME',
header: Zi.LAN.AUDITTIME,
//header: '审核时间',
width: 80
}
]
});
//#region formSearch
//#region formSearch枚举参照相关
this.StoreOpLb = Ext.create('Ext.data.Store', {
fields: ['OpLb']
});
this.StoreOpLb.add({ "OpLb": "op_aire" ,"OPLBNAME": Zi.LAN.op_aire});//"空运出口"
this.StoreOpLb.add({ "OpLb": "op_airi" ,"OPLBNAME": Zi.LAN.op_airi});//"空运进口"
this.StoreOpLb.add({ "OpLb": "op_seae" ,"OPLBNAME": Zi.LAN.op_seae});//"海运出口"
this.StoreOpLb.add({ "OpLb": "op_seai" ,"OPLBNAME": Zi.LAN.op_seai});//"海运进口"
this.StoreOpLb.add({ "OpLb": "OP_WMS_FEEDUI" ,"OPLBNAME": Zi.LAN.OP_WMS_FEEDUI});//"仓储月结账单"
this.StoreOpLb.add({ "OpLb": "OP_WMS_IN_DO" ,"OPLBNAME": Zi.LAN.OP_WMS_IN_DO});//"入库执行"
this.StoreOpLb.add({ "OpLb": "OP_WMS_MOVE" ,"OPLBNAME": Zi.LAN.OP_WMS_MOVE});//"移库业务"
//this.StoreOpLb.add({ "OpLb": "OP_WMS_OUT_DO" ,"OPLBNAME": "出库明细"});
this.StoreOpLb.add({ "OpLb": "OP_WMS_OUT_DO" ,"OPLBNAME": Zi.LAN.OP_WMS_OUT_DO });//"出库作业"
this.StoreOpLb.add({ "OpLb": "tMsWlPcHead" ,"OPLBNAME": Zi.LAN.tMsWlPcHead});//"陆运派车单"
this.StoreOpLb.add({ "OpLb": "VW_OP_WMS_OUT_PLAN" ,"OPLBNAME": Zi.LAN.VW_OP_WMS_OUT_PLAN});//"出库作业"
this.comboxOpLb = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_OPLB,
//fieldLabel: '业务类型',
store: this.StoreOpLb,
forceSelection: true,
name: 'PS_OPLB',
valueField: 'OpLb',
displayField: 'OpLb'
});
this.storeBsType = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeBsType.load({ params: { enumTypeId: 96004} });
this.comboxBsType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_BSTYPE,
//fieldLabel: '运输类型',
store: this.storeBsType,
name: 'PS_BSTYPE',
valueField: 'EnumValueName',
displayField: 'EnumValueName'
});
this.storeSalesCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeSalesCode.load();
this.comboxSalesCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_SALE,
//fieldLabel: '揽货人',
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_SALE',
valueField: 'UserName',
displayField: 'CodeAndName'
});
this.comboxOp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_OP,
//fieldLabel: '操 作',
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_OP',
valueField: 'UserName',
displayField: 'CodeAndName'
});
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_CUSTOMERNAME,
//fieldLabel: '委托单位',
store: this.storeCustCode,
forceSelection: true,
name: 'PS_CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.storeEnterpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomerRefModel',
proxy: { url: '/MvcShipping/MsBaseInfo/GetCustomerRefList' }
});
this.storeEnterpCode.load({ params: { condition: "ISENTERP='1'"} });
this.comboxEnterp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.ENTERP,
//fieldLabel: '经营单位',
store: this.storeEnterpCode,
forceSelection: true,
name: 'PS_ENTERP',
valueField: 'DESCRIPTION',
displayField: 'CodeAndName'
});
this.storeFeeNameRef = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.FeeTypeRefModel',
proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefList' }
});
this.comboxFeeNameRef = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.FEENAME,
//fieldLabel: '费用名称',
store: this.storeFeeNameRef,
forceSelection: true,
name: 'FeeName',
valueField: 'Name',
displayField: 'CodeAndName'
});
this.storeFeeNameRef.load({ params: { condition: ""} });
this.storeAddDCType = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storeAddDCType.add({ "DC": "", "NAME":Zi.LAN.FeeAll });//"全部"
this.storeAddDCType.add({ "DC": "1", "NAME": Zi.LAN.FeeDr });//"应收"
this.storeAddDCType.add({ "DC": "2", "NAME": Zi.LAN.FeeCr });//"应付"
this.comboxaddDCType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.DCTYPE,
//fieldLabel: '收/付',
store: this.storeAddDCType,
valueField: 'DC',
displayField: 'NAME',
forceSelection: true,
name: 'DC',
value: '2'
});
this.StoreCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' }
});
this.StoreCurr.load({ params: { condition: ""} });
this.comboxCurr2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.BLANKFIELD,
//fieldLabel: '币别',
store: this.StoreCurr,
forceSelection: true,
name: 'Currency',
valueField: 'CURR',
displayField: 'CURR'
});
//#endregion
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxOpLb, {
fieldLabel: Zi.LAN.PS_MBLNO,
//fieldLabel: '编号',
name: 'PS_MBLNO'
}, {
fieldLabel: Zi.LAN.VESSEL,
//fieldLabel: '船名',
name: 'PS_VESSEL'
}, {
fieldLabel: Zi.LAN.VOYNO,
//fieldLabel: '航次',
name: 'PS_VOYNO'
}, this.comboxOp, this.comboxSalesCode
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxBsType, this.comboxCustCode, this.comboxEnterp, {
fieldLabel: Zi.LAN.PS_EXPDATEBGN,
//fieldLabel: '从业务日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEBGN'
}, {
fieldLabel: Zi.LAN.PS_EXPDATEEND,
//fieldLabel: '到业务日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEEND'
}, this.comboxaddDCType
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [ {
fieldLabel: Zi.LAN.PS_AUDITDATEBGN,
//fieldLabel: '从审核日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_ETDDATEBGN'
}, {
fieldLabel: Zi.LAN.PS_AUDITDATEEND,
//fieldLabel: '到审核日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_ETDDATEEND'
}, {
fieldLabel: Zi.LAN.PS_ACCDATEBGN,
//fieldLabel: '从会计期间',
xtype: 'monthfield',
name: 'PS_ACCDATEBGN'
}, {
fieldLabel: Zi.LAN.PS_ACCDATEEND,
//fieldLabel: '从会计期间',
xtype: 'monthfield',
name: 'PS_ACCDATEEND'
}, this.comboxFeeNameRef, this.comboxCurr2
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//查询工具条
_this = this;
this.SearchBtn = new Ext.Button({
text: Zi.LAN.HideQuery,
//text:'隐藏查询',
handler: function () {
if (_this.SearchBtn.text == Zi.LAN.HideQuery) {//'隐藏查询'
_this.panelSearch.hide();
_this.SearchBtn.setText(Zi.LAN.SearchBtn2);//"显示查询"
} else {
_this.panelSearch.show();
_this.SearchBtn.setText(Zi.LAN.HideQuery);//"隐藏查询"
}
}
});
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: Zi.LAN.Refresh,
//text:"执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, {
text: Zi.LAN.btnExportExcel,
//text:"导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-',
{
text: Zi.LAN.btnprint,
//text:"打印",
iconCls: 'btnprint',
handler: function (button, event) {
this.Print();
},
scope: this
}, '-', this.SearchBtn, {
xtype: 'button',
width: 90,
text: Zi.LAN.ClearSql,
//text:"清空条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, '-', {
text: Zi.LAN.SaveGrid,
//text:"保存列表样式",
id: "btntest",
menu: [
{
text: Zi.LAN.FEESTATUSREF,
//text:"保存列表",
handler: function (button, event) {
_this.onSaveGridClick(button, event);
}
}, {
text: Zi.LAN.FEESTATUSREF,
//text:"列表初始化",
handler: function (button, event) {
_this.oninitGridClick(button, event);
}
}],
scope: this
}
]
});
this.OldFeeShow = Ext.widget('form', {
frame: true,
region: 'east',
hidden: true,
title: Zi.LAN.费用修改旧,//'费用修改旧',
width: 450,
trackResetOnLoad: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.BsNo,
//fieldLabel: '业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.GId,
//fieldLabel: 'GId',
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEENAME,
//fieldLabel: '费用名称',
readOnly: true,
name: 'FeeName'
}, {
fieldLabel: Zi.LAN.CustomerName,
//fieldLabel: '费用对象',
readOnly: true,
name: 'CustomerName'
}, {
fieldLabel: Zi.LAN.UNIT,
//fieldLabel: '单位标准',
readOnly: true,
name: 'Unit'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.UNITPRICE,
//fieldLabel: '不含税单价',
readOnly: true,
name: 'UnitPrice',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.TAXRATE,
//fieldLabel: '税率',
readOnly: true,
name: 'TaxRate'
}, {
fieldLabel: Zi.LAN.TaxUnitPrice,
//fieldLabel: '含税单价',
readOnly: true,
name: 'TaxUnitPrice',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.QUANTITY,
//fieldLabel: '计费数量',
readOnly: true,
name: 'Quantity'
}, {
fieldLabel: Zi.LAN.NOTAXAMOUNT,
//fieldLabel: '不含税金额',
readOnly: true,
name: 'NoTaxAmount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.AMOUNT,
//fieldLabel: '含税金额',
readOnly: true,
name: 'Amount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.CURRENCY,
//fieldLabel: '币别',
readOnly: true,
name: 'Currency'
}, {
fieldLabel: Zi.LAN.EXCHANGERATE,
//fieldLabel: '汇率',
readOnly: true,
name: 'ExChangerate'
}, {
fieldLabel: Zi.LAN.ACCTAXRATE,
//fieldLabel: '财务税率',
readOnly: true,
name: 'AccTaxRate'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.NewFeeShow = Ext.widget('form', {
frame: true,
region: 'east',
hidden: true,
title: Zi.LAN.费用修改新值,//'费用修改新值',
width: 450,
trackResetOnLoad: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.BsNo,
//fieldLabel: '业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.GId,
//fieldLabel: 'GId',
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FeeName,
//fieldLabel: '费用名称',
readOnly: true,
name: 'FeeName'
}, {
fieldLabel: Zi.LAN.CustomerName,
//fieldLabel: '费用对象',
readOnly: true,
name: 'CustomerName'
}, {
fieldLabel: Zi.LAN.Unit,
//fieldLabel: '单位标准',
readOnly: true,
name: 'Unit'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.UnitPrice,
//fieldLabel: '不含税单价',
readOnly: true,
name: 'UnitPrice',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.TAXRATE,
//fieldLabel: '税率',
readOnly: true,
name: 'TaxRate'
}, {
fieldLabel: Zi.LAN.TaxUnitPrice,
//fieldLabel: '含税单价',
readOnly: true,
name: 'TaxUnitPrice',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Quantity,
//fieldLabel: '计费数量',
readOnly: true,
name: 'Quantity'
}, {
fieldLabel: Zi.LAN.NOTAXAMOUNT,
//fieldLabel: '不含税金额',
readOnly: true,
name: 'NoTaxAmount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.AMOUNT,
//fieldLabel: '含税金额',
readOnly: true,
name: 'Amount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN. Currency,
//fieldLabel: '币别',
readOnly: true,
name: 'Currency'
}, {
fieldLabel: Zi.LAN.ExchangeRate,
//fieldLabel: '汇率',
readOnly: true,
name: 'ExChangerate'
}, {
fieldLabel: Zi.LAN.AccTaxRate,
//fieldLabel: '财务税率',
readOnly: true,
name: 'AccTaxRate'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Reason,
//fieldLabel: '修改原因',
readOnly: true,
name: 'Reason'
}]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.DeleteFeeShow = Ext.widget('form', {
frame: true,
region: 'east',
hidden: true,
title: '费用删除信息',
width: 450,
trackResetOnLoad: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.BsNo,
//fieldLabel: '业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.GId,
//fieldLabel: 'GId',
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FeeName,
//fieldLabel: '费用名称',
readOnly: true,
name: 'FeeName'
}, {
fieldLabel: Zi.LAN.CustomerName,
//fieldLabel: '费用对象',
readOnly: true,
name: 'CustomerName'
}, {
fieldLabel: Zi.LAN.Unit,
//fieldLabel: '单位标准',
readOnly: true,
name: 'Unit'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.UnitPrice,
//fieldLabel: '不含税单价',
readOnly: true,
name: 'UnitPrice',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.TaxRate,
//fieldLabel: '税率',
readOnly: true,
name: 'TaxRate'
}, {
fieldLabel: Zi.LAN.TaxUnitPrice,
//fieldLabel: '含税单价',
readOnly: true,
name: 'TaxUnitPrice',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Quantity,
//fieldLabel: '计费数量',
readOnly: true,
name: 'Quantity'
}, {
fieldLabel: Zi.LAN.NoTaxAmount,
//fieldLabel: '不含税金额',
readOnly: true,
name: 'NoTaxAmount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.Amount,
//fieldLabel: '含税金额',
readOnly: true,
name: 'Amount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Currency,
//fieldLabel: '币别',
readOnly: true,
name: 'Currency'
}, {
fieldLabel: Zi.LAN.ExChangerate,
//fieldLabel: '汇率',
readOnly: true,
name: 'ExChangerate'
}, {
fieldLabel: Zi.LAN.AccTaxRate,
//fieldLabel: '财务税率',
readOnly: true,
name: 'AccTaxRate'
}, {
fieldLabel: Zi.LAN.ISADVANCEDPAY,
//fieldLabel: '是否垫付',
readOnly: true,
name: 'IsAdvancedpay'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Reason,
//fieldLabel: '修改原因',
readOnly: true,
name: 'Reason'
}]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 29,
items: [this.panelBtn]
});
this.panelSearch = new Ext.Panel({
layout: "border",
region: "north",
height: 96,
items: [this.formSearch]
});
this.paneldetail = new Ext.Panel({
title: Zi.LAN.费用修改明细,//'费用修改明细',
layout: "border",
region: 'south',
split: true,
height: 200,
items: [
this.gridListdetail, this.OldFeeShow, this.NewFeeShow, this.DeleteFeeShow
]
});
this.panelBodyChFee = new Ext.Panel({
title: Zi.LAN.BodyChFee,//'业务明细',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.gridList, this.paneldetail]
});
this.tabpanel = new Ext.TabPanel
({
activeTab: 0,
autoWidth: true,
border: false,
frame: false,
region: 'center',
id: "TabPanelID",
enableTabScroll: true,
items:
[
this.panelBodyChFee
]
});
Ext.apply(this, {
items: [this.panelTop, this.panelSearch, this.tabpanel]
});
this.storeList.on('beforeload', function (store) {
if (!this.checkSearchCondition())
return;
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
_this = this;
this.gridList.getSelectionModel().on('select', function (model, record, index) {
var bsno = record.data.BSNO;
var sql = "";
sql = " BSNO='" + bsno + "'";
_this.storeBodyListdetail.load({ params: { condition: sql} });
}, this);
this.storeBodyListdetail.on('load', function (store, records) {
if (store.getCount() > 0) {
this.gridListdetail.getSelectionModel().select(0);
}
}, this);
_this = this;
this.gridListdetail.getSelectionModel().on('select', function (model, record, index) {
var feeid = record.data.FEEID;
var applytype = record.data.APPLYTYPE;
if (applytype == 1) {
this.NewFeeShow.setVisible(true);
this.OldFeeShow.setVisible(true);
this.DeleteFeeShow.setVisible(false);
this.storeChFeeModifyOld.load({ params: { FeeID: feeid, ApplyType: 1 },
callback: function (r, options, success) {
if (success) {
_this.OldFeeShow.getForm().loadRecord(_this.storeChFeeModifyOld.getAt(0));
}
},
scope: this
});
this.storeChFeeModifyNew.load({ params: { FeeID: feeid, ApplyType: 2 },
callback: function (r, options, success) {
if (success) {
_this.NewFeeShow.getForm().loadRecord(_this.storeChFeeModifyNew.getAt(0));
}
},
scope: this
});
} else if (applytype == 3) {
this.NewFeeShow.setVisible(false);
this.OldFeeShow.setVisible(false);
this.DeleteFeeShow.setVisible(true);
this.storeChFeeModifyOld.load({ params: { FeeID: feeid, ApplyType: 3 },
callback: function (r, options, success) {
if (success) {
_this.DeleteFeeShow.getForm().loadRecord(_this.storeChFeeModifyOld.getAt(0));
}
},
scope: this
});
}
}, this);
}, //end initUIComponents
onRefreshClick: function (button, event) {
if (!this.checkSearchCondition())
return;
var sql = this.getCondition();
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: Zi.LAN.NowSelect,//"正在查询数据...",
scope: this
});
},
getCondition: function () {
var form = this.formSearch.getForm();
var sql = '';
/*
var sqldata = form.getValues();
sql = Ext.JSON.encode(sqldata);
*/
var mblNo = form.findField('PS_MBLNO').getValue();
sql = sql + getAndConSql(sql, mblNo, " (B.CUSTNO like '%" + mblNo + "%' or B.MBLNO like '%" + mblNo + "%' or B.HBLNO like '%" + mblNo + "%' or B.CUSTOMNO like '%" + mblNo + "%' or B.ORDERNO like '%" + mblNo + "%') ");
var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, expDate_Min, " B.OPDATE>='" + expDate_Min + "'");
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
sql = sql + getAndConSql(sql, expDate_Max, " B.OPDATE<='" + expDate_Max + " 23:59:59'");
var accDate_Min = form.findField('PS_ACCDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, accDate_Min, " B.ACCDATE>='" + accDate_Min + "'");
var accDate_Max = form.findField('PS_ACCDATEEND').getRawValue();
sql = sql + getAndConSql(sql, accDate_Max, " B.ACCDATE<='" + accDate_Max + "'");
var ENTERP = form.findField('PS_ENTERP').getValue();
sql = sql + getAndConSql(sql, ENTERP, "B.ENTERP='" + ENTERP + "'");
var CUSTOMERNAME = form.findField('PS_CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "B.CUSTOMERNAME='" + CUSTOMERNAME + "'");
var SALE = form.findField('PS_SALE').getValue();
sql = sql + getAndConSql(sql, SALE, "B.SALE='" + SALE + "'");
var OP = form.findField('PS_OP').getValue();
sql = sql + getAndConSql(sql, OP, "B.OP='" + OP + "'");
var BSTYPE = form.findField('PS_BSTYPE').getValue();
sql = sql + getAndConSql(sql, BSTYPE, "B.BSTYPE='" + BSTYPE + "'");
var OPLB = form.findField('PS_OPLB').getValue();
sql = sql + getAndConSql(sql, OPLB, "B.OPLBNAME='" + OPLB + "'");
var VESSEL = form.findField('PS_VESSEL').getValue();
sql = sql + getAndConSql(sql, VESSEL, "B.VESSEL like '%" + VESSEL + "%'");
var VOYNO = form.findField('PS_VOYNO').getValue();
sql = sql + getAndConSql(sql, VOYNO, "B.VOYNO like '%" + VOYNO + "%'");
var feesql = ' EXISTS (select 1 from ch_fee_modify where B.BSNO=ch_fee_modify.BSNO and (APPLYSTATUS=2) ';
var FeeSqlStr = this.getFeeCondition();
feesql = feesql + getAndConSql(feesql, FeeSqlStr, FeeSqlStr);
feesql = feesql + ')';
sql = sql + getAndConSql(sql, feesql, feesql);
return sql;
},
getFeeCondition: function () {
var form = this.formSearch.getForm();
var feesql = '';
var DC = form.findField('DC').getValue();
feesql = feesql + getAndConSql(feesql, DC, "TYPE=" + DC);
var Currency = form.findField('Currency').getValue();
feesql = feesql + getAndConSql(feesql, Currency, "Currency='" + Currency + "'");
var FeeName = form.findField('FeeName').getValue();
feesql = feesql + getAndConSql(feesql, FeeName, "FeeName='" + FeeName + "'");
var etdDate_Min = form.findField('PS_ETDDATEBGN').getRawValue();
feesql = feesql + getAndConSql(feesql, etdDate_Min, " AUDITTIME>='" + etdDate_Min + "'");
var etdDate_Max = form.findField('PS_ETDDATEEND').getRawValue();
feesql = feesql + getAndConSql(feesql, etdDate_Max, " AUDITTIME<='" + etdDate_Max + " 23:59:59'");
return feesql;
},
checkSearchCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert(Zi.LAN.TiShi, Zi.LAN.SelectConditionValError);//'查询条件赋值错误,请检查。
return false;
}
return true;
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.SelectedRecord.data.BSNO;
ret[4] = "MsRptFeeModifyIndex";
return ret;
},
onSaveGridClick: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, this.formname + 'bs', this.gridList.columns, this.girdcolums, 1, true);
},
oninitGridClick: function (button, event) {
var agirdcolums = this.initgirdcolums;
this.gridList.reconfigure(this.storeList, agirdcolums);
this.girdcolums = DsTruck.SaveGridPanel(USERID, this.formname + 'bs', this.gridList.columns, this.initgirdcolums, 1, true);
},
onExportClick: function (button, event) {
GridExportExcelPage(this.gridList);
}
,
Print: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
Ext.Msg.wait(Zi.LAN.HandlingDataAndWait);//'正在组织数据, 请稍侯..'
Ext.Ajax.request({
waitMsg: Zi.LAN.HandlingData,//'正在组织数据...'
url: '/MvcShipping/MsRptOpProfit/BsListData',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: _this.sqlcontext,
printstr: 'true'
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.Data;
var printType = 'MSRPTPROFITLIST';
var sql1 = returnstr;
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} else {
Ext.Msg.show({ title: Zi.LAN.E, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.Retry ,
msg: Zi.LAN.ServerResponseError,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}
});