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/TruckMng/Viewsjs/RPT_ZB_LRBB/RPT_zb_lrbbIndex.js

324 lines
10 KiB
JavaScript

Ext.namespace('DsTruck');
DsTruck.RPT_zb_lrbbIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.DsTruck.RPT_zb_lrbbIndex.superclass.constructor.call(this);
};
Ext.extend(DsTruck.RPT_zb_lrbbIndex, Ext.Panel, {
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
initUIComponents: function () {
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
model: 'RPT_zb_lrbb',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/TruckMng/RPT_zb_lrbb/GetDataList',
reader: {
id: 'id',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
enableColumnHide: false,
features: [{
ftype: 'summary'
}],
columns: [
{
sortable: false,
dataIndex: 'mblno',
header: '提单号',
width: 150
},
{
sortable: false,
dataIndex: 'billno',
header: '派车单号',
width: 150
},
{
sortable: false,
dataIndex: 'custdate',
header: '委托时间',
width: 80
},
{
sortable: false,
dataIndex: 'ExpDate',
header: '派车日期',
width: 80
},
{
sortable: false,
dataIndex: 'VoyVeg',
header: '船名航次',
width: 150
},
{
sortable: false,
dataIndex: 'custname',
header: '委托单位',
width: 80
}, {
sortable: false,
dataIndex: 'YFCUSTNAME',
header: '应付对象',
width: 80
},
{
sortable: false,
dataIndex: 'ContainerType',
header: '箱型',
width: 80
},
{
sortable: false,
dataIndex: 'ContainerNo',
header: '箱号',
width: 80
},
{
sortable: false,
dataIndex: 'username',
header: '录入人',
width: 80
},
{
sortable: false,
dataIndex: 'detination',
header: '目的地',
width: 80
},
{
sortable: false,
dataIndex: 'ys',
header: '应收',
summaryType: 'sum',
width: 80
},
{
sortable: false,
dataIndex: 'yf',
header: '应付',
summaryType: 'sum',
width: 80
},
{
sortable: false,
dataIndex: 'lr',
header: '利润',
summaryType: 'sum',
width: 80
},
{
sortable: false,
dataIndex: 'lrl',
header: '利润率',
width: 80
}
]
});
this.storedept = Ext.create('DsExt.ux.RefTableStore', {
model: 'RPT_MsDept',
proxy: { url: '/TruckMng/RPT_zb_lrbb/GetDept' }
});
this.storedept.load({ params: { condition: ""} });
this.comboxdept = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '所属部门',
store: this.storedept,
name: 'DEPT',
valueField: 'DeptName',
displayField: 'DeptName'
});
//#region formSearch
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: [{
fieldLabel: '提单号',
name: 'mblno'
}, {
fieldLabel: '委托单位',
name: 'custname'
}, {
fieldLabel: '从委托日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'CustDate_Min'
}, {
fieldLabel: '至委托日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'CustDate_Max'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '从派车日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEBGN'
}, {
fieldLabel: '至派车日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEEND'
}, this.comboxdept, { xtype: 'hiddenfield' }
]
}
]//end root items
});
//#endregion formSearch
//搜索条件模块
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
},
{
text: "重置条件",
iconCls: "btnreset",
handler: function (button, event) {
},
scope: this
},{
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 110,
items: [this.formSearch, this.panelBtn]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList]
});
/*
this.storeList.on(' beforeload ', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
*/
}, //end initUIComponents
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.storeList.load({
params: { start: 0, limit: 5000, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
var mblno = form.findField('mblno').getRawValue();
sql = sql + getAndConSql(sql, mblno, "h.mblno like '%" + mblno + "%'");
var customername = form.findField('custname').getRawValue();
sql = sql + getAndConSql(sql, customername, "h.custname like '%" + customername + "%'");
var custDate_Min = form.findField('CustDate_Min').getRawValue();
sql = sql + getAndConSql(sql, custDate_Min, "h.CustDate >= '" + custDate_Min + "'");
var custDate_Max = form.findField('CustDate_Max').getRawValue();
sql = sql + getAndConSql(sql, custDate_Max, "h.CustDate <= '" + custDate_Max + " 23:59:59'");
var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, expDate_Min, " p.ExpDate>='" + expDate_Min + "'");
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
sql = sql + getAndConSql(sql, expDate_Max, " p.ExpDate<='" + expDate_Max + " 23:59:59'");
var deptname = form.findField('DEPT').getRawValue();
sql = sql + getAndConSql(sql, deptname, "h.usercode in (select codename from [user] where GID in ( select userid from user_baseinfo where DEPTNAME= '" + deptname + "'))");
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = "RPT_zb_lrbbIndex";
return ret;
},
onExportClick: function (button, event) {
GridExportExcelPage(this.gridList);
}
});