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.
2167 lines
88 KiB
JavaScript
2167 lines
88 KiB
JavaScript
//集运管理-路单查询
|
|
Ext.namespace('Shipping');
|
|
|
|
Shipping.MsRptSaleHYProfitShareIndex = function (config) {
|
|
Ext.applyIf(this, config);
|
|
this.initUIComponents();
|
|
window.Shipping.MsRptSaleHYProfitShareIndex.superclass.constructor.call(this);
|
|
};
|
|
|
|
Ext.extend(Shipping.MsRptSaleHYProfitShareIndex, Ext.Panel, {
|
|
PageSize: 20000,
|
|
OprationStatus: null, //仅当弹出界面时使用
|
|
SelectedRecord: null,
|
|
sqlcontext: '1=2',
|
|
bslistsortfield: '',
|
|
bslistsortdire: '',
|
|
salelistsortfield: '',
|
|
salelistsortdire: '',
|
|
custlistsortfield: '',
|
|
custlistsortdire: '',
|
|
oplistsortfield: '',
|
|
oplistsortdire: '',
|
|
bssourcelistsortfield: '',
|
|
bssourcelistsortdire: '',
|
|
bssourcedetaillistsortfield: '',
|
|
bssourcedetaillistsortdire: '',
|
|
|
|
|
|
initUIComponents: function () {
|
|
|
|
this.formname = 'MsRptSaleBTProfitShareIndex';
|
|
Ext.Ajax.timeout = 120000;
|
|
//定义数据集
|
|
this.storeList = Ext.create('Ext.data.Store', {
|
|
pageSize: this.PageSize,
|
|
fields: [
|
|
{ name: 'BSNO', type: 'string' },
|
|
{ name: 'OPLB', type: 'string' },
|
|
{ name: 'OPLBNAME', type: 'string' },
|
|
{ name: 'OPTYPE', type: 'string' },
|
|
{ name: 'BSTYPE', type: 'string' },
|
|
{ name: 'ISSALEFEE', type: 'string' },
|
|
{ name: 'SETTLETIME', type: 'string' },
|
|
{ name: 'BLFRT', type: 'string' },
|
|
{ name: 'CUSTOMERNAME', type: 'string' },
|
|
{ name: 'CUSTNO', type: 'string' },
|
|
{ name: 'MBLNO', type: 'string' },
|
|
{ name: 'HBLNO', type: 'string' },
|
|
{ name: 'ETD', type: 'string' },
|
|
{ name: 'STLDATE', type: 'string' },
|
|
{ name: 'STLNAME', 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: 'FCOP', 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: 'RMBDR', type: 'number' },
|
|
{ name: 'RMBCR', type: 'number' },
|
|
{ name: 'USDDR', type: 'number' },
|
|
{ name: 'USDCR', type: 'number' },
|
|
{ name: 'OTDR', type: 'number' },
|
|
{ name: 'OTCR', type: 'number' },
|
|
{ name: 'TTLDR', type: 'number' },
|
|
{ name: 'TTLCR', type: 'number' },
|
|
{ name: 'INTEREST', type: 'number' },
|
|
{ name: 'RMBPROFIT', type: 'number' },
|
|
{ name: 'USDPROFIT', type: 'number' },
|
|
{ name: 'OTPROFIT', type: 'number' },
|
|
{ name: 'TTLPROFIT', type: 'number' },
|
|
{ name: 'RMBNODR', type: 'number' },
|
|
{ name: 'USDNODR', type: 'number' },
|
|
{ name: 'OTNODR', type: 'number' },
|
|
{ name: 'TTLNODR', type: 'number' },
|
|
{ name: 'RMBNOCR', type: 'number' },
|
|
{ name: 'USDNOCR', type: 'number' },
|
|
{ name: 'OTNOCR', type: 'number' },
|
|
{ name: 'TTLNOCR', type: 'number' },
|
|
{ name: 'STLRMBDR', type: 'number' },
|
|
{ name: 'STLUSDDR', type: 'number' },
|
|
{ name: 'STLOTDR', type: 'number' },
|
|
{ name: 'STLTTLDR', type: 'number' },
|
|
{ name: 'MONTHSTLTTLDR', type: 'number' },
|
|
{ name: 'STLRMBCR', type: 'number' },
|
|
{ name: 'STLUSDCR', type: 'number' },
|
|
{ name: 'STLOTCR', type: 'number' },
|
|
{ name: 'STLTTLCR', type: 'number' },
|
|
{ name: 'NODAY', type: 'number' },
|
|
{ name: 'TiChengBiLi', type: 'number' },
|
|
{ name: 'TiChengQuJian', type: 'number' },
|
|
{ name: 'ShiJiTiChengBiLi', type: 'number' },
|
|
{ name: 'TiCheng', type: 'number' },
|
|
{ name: 'KouXi', type: 'number' },
|
|
{ name: 'ShiFa', type: 'number' },
|
|
{ name: 'PROFITRATE', type: 'string' }
|
|
|
|
],
|
|
remoteSort: true,
|
|
proxy: {
|
|
type: 'ajax',
|
|
timeout: 1200000,
|
|
url: '/MvcShipping/MsRptSaleBalProfitShare/GetHYDataList',
|
|
reader: {
|
|
id: '',
|
|
root: 'data',
|
|
totalProperty: 'totalCount'
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
//定义Grid
|
|
this.initgirdcolums = [{
|
|
sortable: true,
|
|
dataIndex: 'BSNO',
|
|
header: '编号',
|
|
hidden: true,
|
|
width: 130
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'OPLBNAME',
|
|
header: '业务类型',
|
|
width: 70
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'OPTYPE',
|
|
header: '更改单',
|
|
width: 70
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'FEESTATUSREF',
|
|
header: '费用锁定',
|
|
width: 70
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'ISSALEFEE',
|
|
header: '提成发放',
|
|
width: 70
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'OPDATE',
|
|
header: '业务日期',
|
|
width: 86
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'SETTLETIME',
|
|
header: '结算日期',
|
|
width: 86
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'CUSTOMERNAME',
|
|
header: '委托单位',
|
|
width: 120
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'CUSTNO',
|
|
header: '委托编号',
|
|
width: 136
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'BLFRT',
|
|
header: '付费方式',
|
|
width: 200
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'MBLNO',
|
|
header: '主提单号',
|
|
width: 120
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'HBLNO',
|
|
header: '分提单号',
|
|
width: 120
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'ETD',
|
|
header: '开船日期',
|
|
width: 86
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'VESSEL',
|
|
header: '船名',
|
|
width: 200
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'VOYNO',
|
|
header: '航次',
|
|
width: 50
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'SALE',
|
|
header: '业务员',
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'OP',
|
|
header: '操作',
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'DOC',
|
|
header: '单证',
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'CUSTSERVICE',
|
|
header: '客服员',
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'PORTLOAD',
|
|
header: '起运港',
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'PORTDISCHARGE',
|
|
header: '目的港',
|
|
width: 150
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'ACCDATE',
|
|
header: '会计期间',
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'CARRIER',
|
|
header: '船公司',
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'BSSOURCE',
|
|
header: '业务来源',
|
|
width: 120
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'TEU',
|
|
header: 'TEU',
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'KGS',
|
|
header: 'KGS',
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'GOODSNAME',
|
|
header: '品名',
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'RMBDR',
|
|
header: 'RMB应收',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'RMBCR',
|
|
header: 'RMB应付',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'RMBPROFIT',
|
|
header: 'RMB利润',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'USDDR',
|
|
header: 'USD应收',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'USDCR',
|
|
header: 'USD应付',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'USDPROFIT',
|
|
header: 'USD利润',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'OTDR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'OTCR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'OTPROFIT',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'TTLDR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'TTLCR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'TTLPROFIT',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'KouXi',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'PROFITRATE',
|
|
header: '利润率',
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'STLRMBDR',
|
|
header: 'RMB已收',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'RMBNODR',
|
|
header: 'RMB未收',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'STLUSDDR',
|
|
header: 'USD已收',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'USDNODR',
|
|
header: 'USD未收',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'STLOTDR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'OTNODR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'STLTTLDR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'MONTHSTLTTLDR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'TTLNODR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'STLRMBCR',
|
|
header: 'RMB已付',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'RMBNOCR',
|
|
header: 'RMB未付',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'STLUSDCR',
|
|
header: 'USD已付',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'USDNOCR',
|
|
header: 'USD未付',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'STLOTCR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'OTNOCR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'STLTTLCR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'TTLNOCR',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'NODAY',
|
|
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: 'TiChengBiLi',
|
|
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: 'ShiJiTiChengBiLi',
|
|
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: 'TiCheng',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'ShiFa',
|
|
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',
|
|
summaryType: 'sum',
|
|
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
|
|
value = usMoney(value, 2, '', true);
|
|
return value;
|
|
},
|
|
width: 80
|
|
}];
|
|
|
|
// this.girdcolums = this.initgirdcolums;
|
|
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.initgirdcolums, 1);
|
|
|
|
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
|
|
this.cellEditingDrChFee = Ext.create('Ext.grid.plugin.CellEditing', {
|
|
clicksToEdit: 1
|
|
});
|
|
|
|
this.gridList = new Ext.grid.GridPanel({
|
|
store: this.storeList,
|
|
enableHdMenu: false,
|
|
region: 'center',
|
|
loadMask: { msg: "数据加载中,请稍等..." },
|
|
trackMouseOver: true,
|
|
selModel: this.GridCheckBoxModel,
|
|
plugins: [this.cellEditingDrChFee],
|
|
disableSelection: false,
|
|
features: [{
|
|
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
|
|
}],
|
|
columns: this.girdcolums,
|
|
viewConfig: {
|
|
autoFill: true,
|
|
getRowClass: function (record, rowIndex, rowParams, store) {
|
|
var BILLSTATUSREF = record.get('ISSALEFEE');
|
|
if (BILLSTATUSREF == "已发放")
|
|
return 'feestatus_pass';
|
|
}
|
|
},
|
|
bbar: Ext.create('Ext.PagingToolbar', {
|
|
store: this.storeList,
|
|
displayInfo: true,
|
|
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
|
|
emptyMsg: "没有数据"
|
|
})
|
|
});
|
|
|
|
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.girdcolums, 1);
|
|
this.gridList.reconfigure(this.storeList, this.girdcolums);
|
|
|
|
this.cellEditingDrChFee.on('beforeedit', function (editor, e) {
|
|
return this.cellEditingChFeeBeforeEdit(editor, e);
|
|
}, this);
|
|
|
|
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 = "";
|
|
if (record.data.OPLBNAME == "报关业务") {
|
|
openUrl = "../../MvcShipping/MsOpApply/ApplyFeeView?handle=check&bsno=" + record.data.BSNO;
|
|
} else {
|
|
|
|
openUrl = "../../MvcShipping/MsOpBill/MsOpFeeView?handle=check&bsno=" + record.data.BSNO;
|
|
|
|
}
|
|
window.open(openUrl, openType, openSet);
|
|
|
|
}, this);
|
|
|
|
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
|
|
this.bslistsortfield = column.dataIndex;
|
|
this.bslistsortdire = direction;
|
|
}, this);
|
|
|
|
|
|
|
|
Ext.define('MsSaleSum', {
|
|
extend: 'Ext.data.Model',
|
|
idProperty: 'SALE',
|
|
fields: [
|
|
{ name: 'SALE', type: 'string' },
|
|
{ name: 'TTLPROFIT', type: 'number' },
|
|
{ name: 'TiCheng', type: 'number' },
|
|
{ name: 'ShiFa', type: 'number' }
|
|
|
|
]
|
|
});
|
|
|
|
|
|
this.storeSaleSumList = Ext.create('Ext.data.Store', {
|
|
pageSize: this.PageSize,
|
|
model: 'MsSaleSum',
|
|
remoteSort: false,
|
|
//proxy: {
|
|
// type: 'ajax',
|
|
// url: '/MvcShipping/MsRptOpProfit/SumListData',
|
|
// reader: {
|
|
// id: '',
|
|
// root: 'data',
|
|
// totalProperty: 'totalCount'
|
|
// }
|
|
//}
|
|
});
|
|
|
|
//定义Grid
|
|
this.gridListSaleSum = new Ext.grid.GridPanel({
|
|
store: this.storeSaleSumList,
|
|
enableHdMenu: false,
|
|
region: 'center',
|
|
loadMask: { msg: "数据加载中,请稍等..." },
|
|
trackMouseOver: true,
|
|
disableSelection: false,
|
|
columns: [{
|
|
sortable: true,
|
|
dataIndex: 'SALE',
|
|
header: '揽货人',
|
|
width: 80
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'TTLPROFIT',
|
|
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: 'TiCheng',
|
|
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: 'ShiFa',
|
|
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
|
|
}
|
|
|
|
]
|
|
});
|
|
|
|
|
|
|
|
//#region formSearch
|
|
|
|
//#region formSearch枚举参照相关
|
|
_this = this;
|
|
this.StoreOpLb = Ext.create('DsExt.ux.RefEnumStore', {});
|
|
this.StoreOpLb.load({ params: { enumTypeId: 96005} });
|
|
|
|
this.comboxOpLb = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '业务类型',
|
|
store: this.StoreOpLb,
|
|
forceSelection: true,
|
|
name: 'PS_OPLB',
|
|
valueField: 'EnumValueName',
|
|
displayField: 'EnumValueName',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
this.storeBsType = Ext.create('DsExt.ux.RefEnumStore', {});
|
|
this.storeBsType.load({ params: { enumTypeId: 96004} });
|
|
|
|
this.comboxBsType = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '运输类型',
|
|
store: this.storeBsType,
|
|
name: 'PS_BSTYPE',
|
|
valueField: 'EnumValueName',
|
|
displayField: 'EnumValueName',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
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: '揽货人',
|
|
store: this.storeSalesCode,
|
|
forceSelection: true,
|
|
name: 'PS_SALE',
|
|
valueField: 'UserName',
|
|
displayField: 'CodeAndName',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
this.comboxOp = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '操 作',
|
|
store: this.storeSalesCode,
|
|
forceSelection: true,
|
|
name: 'PS_OP',
|
|
valueField: 'UserName',
|
|
displayField: 'CodeAndName',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
this.comboxCUSTSERVER = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '客 服',
|
|
store: this.storeSalesCode,
|
|
forceSelection: true,
|
|
name: 'PS_CUSTSERVICE',
|
|
valueField: 'UserName',
|
|
displayField: 'CodeAndName',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
this.comboxDOC = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '单 证',
|
|
store: this.storeSalesCode,
|
|
forceSelection: true,
|
|
name: 'PS_DOC',
|
|
valueField: 'UserName',
|
|
displayField: 'CodeAndName',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
//所属部门
|
|
this.storeDept = Ext.create('DsExt.ux.RefTableStore', {
|
|
model: 'DsShipping.ux.DeptModel',
|
|
proxy: { url: '/CommMng/BasicDataRef/GetDeptList' }
|
|
});
|
|
this.storeDept.load();
|
|
this.comboxDept = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '揽货人所属部门', //'所属部门',
|
|
store: this.storeDept,
|
|
forceSelection: true,
|
|
name: 'SALEDEPT',
|
|
valueField: 'DeptName',
|
|
displayField: 'DeptName'
|
|
//,hidden: true
|
|
});
|
|
|
|
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: '委托单位',
|
|
store: this.storeCustCode,
|
|
name: 'PS_CUSTOMERNAME',
|
|
valueField: 'CustName',
|
|
displayField: 'CodeAndName',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
//业务来源
|
|
this.storeSource = Ext.create('DsExt.ux.RefTableStore', {
|
|
model: 'DsShipping.ux.SourceModel',
|
|
proxy: { url: '/CommMng/BasicDataRef/GetSource' }
|
|
});
|
|
this.storeSource.load();
|
|
this.storeSourceDetail = Ext.create('DsExt.ux.RefTableStore', {
|
|
model: 'DsShipping.ux.SourceDetailModel',
|
|
proxy: { url: '/CommMng/BasicDataRef/GetSourceDetail2' }
|
|
});
|
|
this.comboxBSSOURCE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '业务来源',
|
|
store: this.storeSource,
|
|
forceSelection: true,
|
|
name: 'BSSOURCE',
|
|
valueField: 'SourceName',
|
|
displayField: 'SourceName',
|
|
listeners: {
|
|
scope: this,
|
|
'select': function (combo, records, eOpts) {
|
|
if (records.length > 0) {
|
|
var recs = DsStoreQueryBy(this.storeSource, 'SourceID', records[0].data.SourceID);
|
|
if (recs.getCount() > 0) {
|
|
var data = recs.getAt(0).data;
|
|
var s = "SOURCEID='" + data.SourceID + "'";
|
|
this.storeSourceDetail.load({ params: { condition: s} });
|
|
} else {
|
|
var BSSOURCEDETAIL = this.formSearch.getForm().findField('BSSOURCEDETAIL');
|
|
BSSOURCEDETAIL.setValue('');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
this.storeSourceDetail.load();
|
|
this.comboxBSSOURCEDETAIL = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '来源明细',
|
|
store: this.storeSourceDetail,
|
|
forceSelection: true,
|
|
name: 'BSSOURCEDETAIL',
|
|
valueField: 'SourceDetail',
|
|
displayField: 'SourceDetail',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
this.StoreFeeLock = Ext.create('Ext.data.Store', {
|
|
fields: ['OpLb']
|
|
});
|
|
this.StoreFeeLock.add({ "OpLb": "全部" });
|
|
this.StoreFeeLock.add({ "OpLb": "已锁定" });
|
|
this.StoreFeeLock.add({ "OpLb": "未锁定" });
|
|
|
|
this.comboxFeeLock = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '费用锁定',
|
|
store: this.StoreFeeLock,
|
|
forceSelection: true,
|
|
name: 'PS_FEELOCK',
|
|
valueField: 'OpLb',
|
|
displayField: 'OpLb',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
Ext.define('SubComp', {
|
|
extend: 'Ext.data.Model',
|
|
fields: [
|
|
{ name: 'GID', type: 'string' },
|
|
{ name: 'NAME', type: 'string' },
|
|
{ name: 'ENNAME', type: 'string' }
|
|
]
|
|
});
|
|
this.StoreSubComp = Ext.create('DsExt.ux.RefTableStore', {
|
|
model: 'SubComp',
|
|
proxy: { url: '/MvcShipping/MsBaseInfo/GetCompanyEN' }
|
|
});
|
|
|
|
this.StoreSubComp.load({ params: { condition: ""} });
|
|
|
|
this.comboxSubComp = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '所属公司',
|
|
store: this.StoreSubComp,
|
|
name: 'SUBCOMP',
|
|
valueField: 'GID',
|
|
displayField: 'NAME',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
|
|
});
|
|
|
|
this.CheckOnlyStl = new Ext.form.Checkbox({
|
|
fieldLabel: '仅应收全部结算业务',
|
|
checked: true,
|
|
labelAlign: "right",
|
|
labelWidth: 120
|
|
});
|
|
|
|
this.CheckAllDR = new Ext.form.Checkbox({
|
|
fieldLabel: '包含应收为0业务',
|
|
checked: false,
|
|
labelAlign: "right",
|
|
labelWidth: 120
|
|
});
|
|
|
|
|
|
this.storeAddDCType = Ext.create('Ext.data.Store', {
|
|
fields: ['DC', 'NAME']
|
|
});
|
|
this.storeAddDCType.add({ "DC": "", "NAME": "全部" });
|
|
this.storeAddDCType.add({ "DC": "1", "NAME": "已发放" });
|
|
this.storeAddDCType.add({ "DC": "2", "NAME": "未发放" });
|
|
|
|
this.comboxaddDCType = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '是否发放',
|
|
store: this.storeAddDCType,
|
|
valueField: 'DC',
|
|
displayField: 'NAME',
|
|
forceSelection: true,
|
|
name: 'ISFEE',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
this.storeDATETYPE = Ext.create('Ext.data.Store', {
|
|
fields: ['FSTATUS', 'NAME']
|
|
});
|
|
this.storeDATETYPE.add({ "FSTATUS": "OPDATE", "NAME": "业务日期" });
|
|
// this.storeBLNOTYPE.add({ "FSTATUS": "INVOICENO", "NAME": "发票号" });
|
|
this.storeDATETYPE.add({ "FSTATUS": "ACCDATE", "NAME": "会计期间" });
|
|
|
|
this.comboxDATETYPE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '统计日期',
|
|
store: this.storeDATETYPE,
|
|
valueField: 'FSTATUS',
|
|
displayField: 'NAME',
|
|
forceSelection: true,
|
|
name: 'DATETYPE',
|
|
value: 'OPDATE',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
//#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: '编号',
|
|
name: 'PS_MBLNO',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
fieldLabel: '船名',
|
|
name: 'PS_VESSEL',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
fieldLabel: '航次',
|
|
name: 'PS_VOYNO',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, this.comboxSalesCode, this.comboxOp
|
|
]
|
|
}, {
|
|
xtype: 'container',
|
|
layout: 'hbox',
|
|
defaultType: 'textfield',
|
|
items: [this.comboxDATETYPE, this.comboxCustCode, {
|
|
fieldLabel: '从业务日期',
|
|
format: 'Y-m-d',
|
|
xtype: 'datefield',
|
|
name: 'PS_EXPDATEBGN',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
fieldLabel: '到业务日期',
|
|
format: 'Y-m-d',
|
|
xtype: 'datefield',
|
|
name: 'PS_EXPDATEEND',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
fieldLabel: '从结算日期',
|
|
format: 'Y-m-d',
|
|
xtype: 'datefield',
|
|
name: 'PS_STLDATEBGN',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
fieldLabel: '到结算日期',
|
|
format: 'Y-m-d',
|
|
xtype: 'datefield',
|
|
name: 'PS_STLDATEEND',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}, {
|
|
xtype: 'container',
|
|
layout: 'hbox',
|
|
defaultType: 'textfield',
|
|
items: [this.comboxBSSOURCE, {
|
|
fieldLabel: '从会计期间',
|
|
xtype: 'monthfield',
|
|
name: 'PS_ACCDATEBGN',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
fieldLabel: '从会计期间',
|
|
xtype: 'monthfield',
|
|
name: 'PS_ACCDATEEND',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, this.comboxSubComp, this.CheckOnlyStl, this.CheckAllDR
|
|
]
|
|
}, {
|
|
xtype: 'container',
|
|
layout: 'hbox',
|
|
defaultType: 'textfield',
|
|
items: [this.comboxFeeLock, this.comboxCUSTSERVER, this.comboxDept, this.comboxDOC, this.comboxaddDCType, { xtype: 'hiddenfield' }
|
|
]
|
|
}
|
|
]//end items(fieldset 1)
|
|
}//end fieldset 1
|
|
]//end root items
|
|
|
|
});
|
|
|
|
|
|
|
|
//#endregion formSearch
|
|
|
|
//查询工具条
|
|
|
|
this.CheckSaveQuery = new Ext.form.Checkbox({
|
|
fieldLabel: '记忆查询条件',
|
|
checked: true,
|
|
width: 120
|
|
});
|
|
|
|
|
|
_this = this;
|
|
this.SearchBtn = new Ext.Button({
|
|
text: '隐藏查询',
|
|
handler: function () {
|
|
if (_this.SearchBtn.text == '隐藏查询') {
|
|
_this.panelSearch.hide();
|
|
_this.SearchBtn.setText("显示查询");
|
|
|
|
} else {
|
|
|
|
_this.panelSearch.show();
|
|
_this.SearchBtn.setText("隐藏查询");
|
|
|
|
|
|
}
|
|
}
|
|
});
|
|
|
|
this.panelBtn = new Ext.Panel({
|
|
region: "north",
|
|
tbar: [
|
|
{
|
|
text: "执行查询",
|
|
iconCls: "btnrefresh",
|
|
handler: function (button, event) {
|
|
this.onRefreshClick(button, event);
|
|
var isvisible = true;
|
|
var issavevalue = false;
|
|
|
|
if (_this.SearchBtn.text == '隐藏查询')
|
|
isvisible = true
|
|
else
|
|
isvisible = false;
|
|
if (this.CheckSaveQuery.checked)
|
|
issavevalue = true
|
|
|
|
saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue);
|
|
|
|
},
|
|
scope: this
|
|
}, '-', {
|
|
text: "高级查询",
|
|
iconCls: "btnmore",
|
|
handler: function (button, event) {
|
|
var sql = this.getCondition();
|
|
var winAccess = new Shipping.DsQuery({
|
|
|
|
});
|
|
winAccess.StoreList = this.storeList;
|
|
winAccess.formname = this.formname;
|
|
winAccess.condition = sql;
|
|
winAccess.show();
|
|
return;
|
|
},
|
|
scope: this
|
|
}, {
|
|
text: "导出Excel",
|
|
id: "btnExportExcel",
|
|
iconCls: 'btnexportexcel',
|
|
handler: function (button, event) {
|
|
this.onExportClick(button, event);
|
|
},
|
|
scope: this
|
|
}, '-',
|
|
{
|
|
text: "打印",
|
|
iconCls: 'btnprint',
|
|
handler: function (button, event) {
|
|
this.Print();
|
|
},
|
|
scope: this
|
|
}, '-', this.SearchBtn, {
|
|
xtype: 'button',
|
|
width: 90,
|
|
text: "清空条件",
|
|
iconCls: "btnreset",
|
|
handler: function (button, event) {
|
|
this.onClearSql(button, event);
|
|
},
|
|
scope: this
|
|
}, this.CheckSaveQuery, '-', {
|
|
text: "保存列表样式",
|
|
id: "btntest",
|
|
menu: [
|
|
{ text: "保存列表",
|
|
handler: function (button, event) {
|
|
_this.onSaveGridClick(button, event);
|
|
|
|
}
|
|
}, { text: "列表初始化",
|
|
handler: function (button, event) {
|
|
_this.oninitGridClick(button, event);
|
|
}
|
|
}],
|
|
scope: this
|
|
}, '-', {
|
|
text: '发放提成',
|
|
tooltip: '发放提成',
|
|
id: 'btnSubmitAudit',
|
|
handler: function (button, event) {
|
|
this.onSetFeeClick();
|
|
},
|
|
scope: this
|
|
}, '-', {
|
|
text: '取消发放',
|
|
tooltip: '取消发放',
|
|
id: 'btnSubmitAuditBack',
|
|
handler: function (button, event) {
|
|
this.onCancelSetFeeClick();
|
|
},
|
|
scope: this
|
|
}
|
|
]
|
|
});
|
|
|
|
this.panelTop = new Ext.Panel({
|
|
layout: "border",
|
|
region: "north",
|
|
height: 29,
|
|
items: [this.panelBtn]
|
|
});
|
|
|
|
this.panelSearch = new Ext.Panel({
|
|
layout: "border",
|
|
region: "north",
|
|
height: 126,
|
|
items: [this.formSearch]
|
|
});
|
|
|
|
this.panelBodyChFee = new Ext.Panel({
|
|
title: '业务明细',
|
|
layout: "border",
|
|
region: 'center',
|
|
margin: '0 0',
|
|
frame: true,
|
|
items: [this.gridList]
|
|
});
|
|
|
|
|
|
this.panelSale = new Ext.Panel({
|
|
title: '揽货人合计',
|
|
layout: "border",
|
|
region: 'center',
|
|
margin: '0 0',
|
|
frame: true,
|
|
items: [this.gridListSaleSum]
|
|
});
|
|
|
|
|
|
|
|
// this.panelSum = new Ext.Panel({
|
|
// title: '合 计',
|
|
// layout: "border",
|
|
// height: 120,
|
|
// region: 'south',
|
|
// margin: '0 0',
|
|
// frame: true,
|
|
// items: [this.gridListSum]
|
|
// });
|
|
|
|
|
|
this.tabpanel = new Ext.TabPanel
|
|
({
|
|
activeTab: 0,
|
|
autoWidth: true,
|
|
border: false,
|
|
frame: false,
|
|
region: 'center',
|
|
id: "TabPanelID",
|
|
enableTabScroll: true,
|
|
items:
|
|
[
|
|
this.panelBodyChFee,
|
|
this.panelSale
|
|
]
|
|
});
|
|
|
|
Ext.apply(this, {
|
|
items: [this.panelTop, this.panelSearch, this.tabpanel]
|
|
});
|
|
|
|
this.storeList.on('beforeload', function (store) {
|
|
if (!this.checkSearchCondition())
|
|
return;
|
|
var form = this.formSearch.getForm();
|
|
var datetype = form.findField('DATETYPE').getValue();
|
|
var datesql = this.getdateCondition();
|
|
var stlsql = this.getstlCondition();
|
|
var iszerodr = this.CheckAllDR.checked;
|
|
var Dsql = this.getDCondition();
|
|
var isallstl = this.CheckOnlyStl.checked;
|
|
|
|
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext, stlcondition: stlsql, datecondition: datesql, datetype: datetype, isdrzero: iszerodr, dcondition: Dsql, isallstl: isallstl });
|
|
}, this);
|
|
|
|
|
|
// this.storeSumList.on('beforeload', function (store) {
|
|
// if (!this.checkSearchCondition())
|
|
// return;
|
|
|
|
// var sql = this.getCondition();
|
|
// Ext.apply(store.proxy.extraParams, { condition: sql });
|
|
// }, this);
|
|
|
|
LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery);
|
|
|
|
}, //end initUIComponents
|
|
|
|
onRefreshClick: function (button, event) {
|
|
if (!this.checkSearchCondition())
|
|
return;
|
|
var form = this.formSearch.getForm();
|
|
var datetype = form.findField('DATETYPE').getValue();
|
|
if (datetype == 'OPDATE') {
|
|
var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue();
|
|
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
|
|
if (expDate_Min == '' || expDate_Min == null || expDate_Min == undefined) {
|
|
Ext.Msg.alert('提示', '开始业务日期不能为空!');
|
|
return;
|
|
}
|
|
if (expDate_Max == '' || expDate_Max == null || expDate_Max == undefined) {
|
|
Ext.Msg.alert('提示', '结束业务日期不能为空!');
|
|
return;
|
|
}
|
|
|
|
var expDate_Mindate = form.findField('PS_EXPDATEBGN').getValue();
|
|
var expDate_Maxdate = form.findField('PS_EXPDATEEND').getValue();
|
|
|
|
if (expDate_Mindate > expDate_Maxdate) {
|
|
Ext.Msg.alert('提示', '业务开始日期不能大于结束日期!');
|
|
return;
|
|
|
|
}
|
|
} else {
|
|
var expDate_Min = form.findField('PS_ACCDATEBGN').getRawValue();
|
|
var expDate_Max = form.findField('PS_ACCDATEEND').getRawValue();
|
|
if (expDate_Min == '' || expDate_Min == null || expDate_Min == undefined) {
|
|
Ext.Msg.alert('提示', '开始会计期间不能为空!');
|
|
return;
|
|
}
|
|
if (expDate_Max == '' || expDate_Max == null || expDate_Max == undefined) {
|
|
Ext.Msg.alert('提示', '结束会计期间不能为空!');
|
|
return;
|
|
}
|
|
|
|
var expDate_Mindate = form.findField('PS_ACCDATEBGN').getValue();
|
|
var expDate_Maxdate = form.findField('PS_ACCDATEEND').getValue();
|
|
|
|
if (expDate_Mindate > expDate_Maxdate) {
|
|
Ext.Msg.alert('提示', '会计期间开始日期不能大于结束日期!');
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
var sql = this.getCondition();
|
|
var stlsql = this.getstlCondition();
|
|
var iszerodr = this.CheckAllDR.checked;
|
|
var Dsql = this.getDCondition();
|
|
var datesql = this.getdateCondition();
|
|
var isallstl = this.CheckOnlyStl.checked;
|
|
this.sqlcontext = sql;
|
|
|
|
|
|
|
|
|
|
|
|
this.storeList.load({
|
|
params: { start: 0, limit: this.PageSize, condition: sql, stlcondition: stlsql, datecondition: datesql, datetype: datetype, isdrzero: iszerodr, dcondition: Dsql, isallstl: isallstl },
|
|
callback: function (r, options, success) {
|
|
if (success) {
|
|
if (this.storeList.getCount() > 0) {
|
|
for (var j = 0; j < this.storeList.getCount(); j += 1) {
|
|
var member = this.storeList.getAt(j);
|
|
var isfind = false;
|
|
for (var i = 0; i < this.storeSaleSumList.getCount(); i += 1) {
|
|
var memberSale = this.storeSaleSumList.getAt(i);
|
|
if (member.data.SALE == memberSale.data.SALE) {
|
|
var TTLPROFIT = Add(memberSale.data.TTLPROFIT, member.data.TTLPROFIT);
|
|
var TiCheng = Add(memberSale.data.TiCheng, member.data.TiCheng);
|
|
var ShiFa = Add(memberSale.data.ShiFa, member.data.ShiFa);
|
|
memberSale.set("TTLPROFIT", TTLPROFIT);
|
|
memberSale.set("TiCheng", TiCheng);
|
|
memberSale.set("ShiFa", ShiFa);
|
|
memberSale.commit();
|
|
isfind = true;
|
|
|
|
}
|
|
}
|
|
if (!isfind) {
|
|
var record = Ext.create('MsSaleSum', {
|
|
SALE: member.data.SALE,
|
|
TTLPROFIT: member.data.TTLPROFIT,
|
|
TiCheng: member.data.TiCheng,
|
|
ShiFa: member.data.ShiFa
|
|
});
|
|
this.storeSaleSumList.add(record);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
},
|
|
waitMsg: "正在查询数据...",
|
|
scope: this
|
|
});
|
|
|
|
},
|
|
|
|
onDsQuery: function (button, event) {
|
|
|
|
|
|
var sql = this.sqlcontext;
|
|
var stlsql = this.getstlCondition();
|
|
var iszerodr = this.CheckAllDR.checked;
|
|
var Dsql = this.getDCondition();
|
|
var isallstl = this.CheckOnlyStl.checked;
|
|
|
|
this.storeList.load({
|
|
params: { start: 0, limit: this.PageSize, condition: sql, stlcondition: stlsql, isdrzero: iszerodr, dcondition: Dsql, isallstl: isallstl },
|
|
callback: function (r, options, success) {
|
|
if (success) {
|
|
if (this.storeList.getCount() > 0) {
|
|
for (var j = 0; j < this.storeList.getCount(); j += 1) {
|
|
var member = this.storeList.getAt(j);
|
|
var isfind = false;
|
|
for (var i = 0; i < this.storeSaleSumList.getCount(); i += 1) {
|
|
var memberSale = this.storeSaleSumList.getAt(i);
|
|
if (member.data.SALE == memberSale.data.SALE) {
|
|
var TTLPROFIT = Add(memberSale.data.TTLPROFIT, member.data.TTLPROFIT);
|
|
var TiCheng = Add(memberSale.data.TiCheng, member.data.TiCheng);
|
|
var ShiFa = Add(memberSale.data.ShiFa, member.data.ShiFa);
|
|
memberSale.set("TTLPROFIT", TTLPROFIT);
|
|
memberSale.set("TiCheng", TiCheng);
|
|
memberSale.set("ShiFa", ShiFa);
|
|
memberSale.commit();
|
|
isfind = true;
|
|
|
|
}
|
|
}
|
|
if (!isfind) {
|
|
var record = Ext.create('MsSaleSum', {
|
|
SALE: member.data.SALE,
|
|
TTLPROFIT: member.data.TTLPROFIT,
|
|
TiCheng: member.data.TiCheng,
|
|
ShiFa: member.data.ShiFa
|
|
});
|
|
this.storeSaleSumList.add(record);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
},
|
|
waitMsg: "正在查询数据...",
|
|
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 + "%') ");
|
|
|
|
|
|
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 CUSTSERVICE = form.findField('PS_CUSTSERVICE').getValue();
|
|
sql = sql + getAndConSql(sql, CUSTSERVICE, "B.CUSTSERVICE='" + CUSTSERVICE + "'");
|
|
|
|
var DOC = form.findField('PS_DOC').getValue();
|
|
sql = sql + getAndConSql(sql, DOC, "B.DOC='" + DOC + "'");
|
|
|
|
|
|
var OPLB = form.findField('PS_OPLB').getValue();
|
|
sql = sql + getAndConSql(sql, OPLB, "B.OPLBNAME='" + OPLB + "'");
|
|
|
|
var SUBCOMP = form.findField('SUBCOMP').getValue();
|
|
sql = sql + getAndConSql(sql, SUBCOMP, "B.CORPID='" + SUBCOMP + "'");
|
|
|
|
var SALEDEPT = form.findField('SALEDEPT').getValue();
|
|
sql = sql + getAndConSql(sql, SALEDEPT, "B.SALE IN (SELECT SHOWNAME FROM VW_user WHERE DEPTNAME='" + SALEDEPT + "')");
|
|
|
|
|
|
|
|
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 BSSOURCE = form.findField('BSSOURCE').getValue();
|
|
sql = sql + getAndConSql(sql, BSSOURCE, "B.BSSOURCE='" + BSSOURCE + "'");
|
|
// var BSSOURCEDETAIL = form.findField('BSSOURCEDETAIL').getValue();
|
|
// sql = sql + getAndConSql(sql, BSSOURCEDETAIL, "B.BSSOURCEDETAIL='" + BSSOURCEDETAIL + "'");
|
|
|
|
var PS_FEELOCK = form.findField('PS_FEELOCK').getValue();
|
|
if (PS_FEELOCK == '已锁定')
|
|
sql = sql + getAndConSql(sql, PS_FEELOCK, "B.FEESTATUS=1");
|
|
else if (PS_FEELOCK == '未锁定')
|
|
sql = sql + getAndConSql(sql, PS_FEELOCK, "B.FEESTATUS=0");
|
|
|
|
if (this.CheckOnlyStl.checked) {
|
|
sql = sql + getAndConSql(sql, "11", " B.TTLDR=B.STLTTLDR AND B.TTLDR<>0 ");
|
|
}
|
|
|
|
var ISFEE = form.findField('ISFEE').getValue();
|
|
if (ISFEE == '1')
|
|
sql = sql + getAndConSql(sql, ISFEE, "f.ISFEE=1");
|
|
else if (ISFEE == '2')
|
|
sql = sql + getAndConSql(sql, ISFEE, "ISNULL(f.ISFEE,0)<>1");
|
|
|
|
|
|
|
|
return sql;
|
|
},
|
|
|
|
getstlCondition: function () {
|
|
var form = this.formSearch.getForm();
|
|
var sql = '';
|
|
/*
|
|
var sqldata = form.getValues();
|
|
sql = Ext.JSON.encode(sqldata);
|
|
*/
|
|
|
|
var expDate_Min = form.findField('PS_STLDATEBGN').getRawValue();
|
|
sql = sql + getAndConSql(sql, expDate_Min, " T.SETTLETIME>='" + expDate_Min + "'");
|
|
|
|
var expDate_Max = form.findField('PS_STLDATEEND').getRawValue();
|
|
sql = sql + getAndConSql(sql, expDate_Max, " T.SETTLETIME<='" + expDate_Max + " 23:59:59'");
|
|
|
|
|
|
|
|
return sql;
|
|
},
|
|
getdateCondition: function () {
|
|
var form = this.formSearch.getForm();
|
|
var sql = '';
|
|
/*
|
|
var sqldata = form.getValues();
|
|
sql = Ext.JSON.encode(sqldata);
|
|
*/
|
|
|
|
var datetype = form.findField('DATETYPE').getValue();
|
|
if (datetype == 'OPDATE') {
|
|
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'");
|
|
} else {
|
|
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 + "'");
|
|
|
|
}
|
|
|
|
|
|
return sql;
|
|
},
|
|
getDCondition: function () {
|
|
var form = this.formSearch.getForm();
|
|
var sql = '';
|
|
/*
|
|
var sqldata = form.getValues();
|
|
sql = Ext.JSON.encode(sqldata);
|
|
*/
|
|
|
|
var expDate_Min = form.findField('PS_STLDATEBGN').getRawValue();
|
|
if (expDate_Min != '') {
|
|
var myexpDate_Min = Ext.util.Format.date(expDate_Min, 'Y-m');
|
|
|
|
sql = sql + getAndConSql(sql, myexpDate_Min, " B.ACCDATE>='" + myexpDate_Min + "'");
|
|
}
|
|
|
|
var expDate_Max = form.findField('PS_STLDATEEND').getRawValue();
|
|
if (expDate_Max != '') {
|
|
var myexpDate_Max = Ext.util.Format.date(expDate_Max, 'Y-m');
|
|
|
|
sql = sql + getAndConSql(sql, myexpDate_Max, " B.ACCDATE<='" + myexpDate_Min + "'");
|
|
}
|
|
|
|
|
|
return sql;
|
|
},
|
|
checkSearchCondition: function () {
|
|
var form = this.formSearch.getForm();
|
|
if (!form.isValid()) {
|
|
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
},
|
|
|
|
onClearSql: function () {
|
|
var form = this.formSearch.getForm();
|
|
form.reset();
|
|
},
|
|
|
|
cellEditingChFeeBeforeEdit: function (editor, e) {
|
|
var ISSALEFEE = e.record.get('ISSALEFEE');
|
|
if (ISSALEFEE == '已发放') return false;
|
|
},
|
|
|
|
onSaveFeeClick: function (button, event) {
|
|
var GidStr = '';
|
|
|
|
//var records = this.GridCheckBoxModel.selected.items;
|
|
//if (records.length == 0) {
|
|
// Ext.Msg.show({ title: '提示', msg: '请先选择要发放的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
// return;
|
|
//}
|
|
|
|
|
|
var bodyAddDatas = [];
|
|
for (var i = 0; i < this.storeList.getCount(); i++) {
|
|
var rec = this.storeList.getAt(i);
|
|
//if (rec.data.ISSALEFEE != '已发放') {
|
|
bodyAddDatas.push(rec);
|
|
//}
|
|
}
|
|
|
|
|
|
_this = this;
|
|
if (bodyAddDatas.length == 0) {
|
|
Ext.Msg.show({ title: '提示', msg: '没有要保存的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
return;
|
|
|
|
} else {
|
|
|
|
Ext.Msg.wait('正在提取数据...');
|
|
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
|
|
Ext.Ajax.request({
|
|
waitMsg: '正在锁定...',
|
|
url: '/MvcShipping/MsRptSaleBalProfitShare/SaveFee',
|
|
params: {
|
|
data: jsonbodyAddDatas
|
|
},
|
|
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;
|
|
} else {
|
|
|
|
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
_this.onRefreshClick();
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
|
|
}
|
|
},
|
|
scope: this
|
|
});
|
|
}
|
|
|
|
|
|
},
|
|
|
|
onSetFeeClick: function (button, event) {
|
|
var GidStr = '';
|
|
var records = this.GridCheckBoxModel.selected.items;
|
|
if (records.length == 0) {
|
|
Ext.Msg.show({ title: '提示', msg: '请先选择要发放的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
return;
|
|
}
|
|
|
|
|
|
var bodyAddDatas = [];
|
|
for (var i = 0; i < records.length; i++) {
|
|
var rec = records[i];
|
|
if (rec.data.ISSALEFEE != '已发放') {
|
|
bodyAddDatas.push(rec);
|
|
}
|
|
}
|
|
|
|
|
|
_this = this;
|
|
if (bodyAddDatas.length == 0) {
|
|
Ext.Msg.show({ title: '提示', msg: '没有要发放提成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
return;
|
|
|
|
} else {
|
|
|
|
Ext.Msg.wait('正在提取数据...');
|
|
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
|
|
Ext.Ajax.request({
|
|
waitMsg: '正在锁定...',
|
|
url: '/MvcShipping/MsRptSaleBalProfitShare/SetFee',
|
|
params: {
|
|
data: jsonbodyAddDatas
|
|
},
|
|
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;
|
|
} else {
|
|
|
|
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
_this.onRefreshClick();
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
|
|
}
|
|
},
|
|
scope: this
|
|
});
|
|
}
|
|
|
|
|
|
},
|
|
|
|
onCancelSetFeeClick: function (button, event) {
|
|
var GidStr = '';
|
|
var records = this.GridCheckBoxModel.selected.items;
|
|
if (records.length == 0) {
|
|
Ext.Msg.show({ title: '提示', msg: '请先选择要发放的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
return;
|
|
}
|
|
|
|
|
|
var bodyAddDatas = [];
|
|
for (var i = 0; i < records.length; i++) {
|
|
var rec = records[i];
|
|
if (rec.data.ISSALEFEE != '未发放') {
|
|
bodyAddDatas.push(rec);
|
|
}
|
|
}
|
|
|
|
|
|
_this = this;
|
|
if (bodyAddDatas.length == 0) {
|
|
Ext.Msg.show({ title: '提示', msg: '没有要发放提成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
return;
|
|
|
|
} else {
|
|
|
|
Ext.Msg.wait('正在提取数据...');
|
|
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
|
|
Ext.Ajax.request({
|
|
waitMsg: '正在锁定...',
|
|
url: '/MvcShipping/MsRptSaleBalProfitShare/CancelSetFee',
|
|
params: {
|
|
data: jsonbodyAddDatas
|
|
},
|
|
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;
|
|
} else {
|
|
|
|
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
_this.onRefreshClick();
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
|
|
}
|
|
},
|
|
scope: this
|
|
});
|
|
}
|
|
|
|
|
|
},
|
|
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] = "MsRptOpProfitIndex";
|
|
|
|
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) {
|
|
if (this.tabpanel.getActiveTab() == this.panelSale) {
|
|
GridExportExcelPage(this.gridListSaleSum, "业务员利润");
|
|
|
|
} else GridExportExcelPage(this.gridList);
|
|
|
|
},
|
|
|
|
|
|
|
|
Print: function () {
|
|
|
|
_this = this;
|
|
if (this.storeList.getCount() == 0) {
|
|
return;
|
|
}
|
|
|
|
var sql = this.sqlcontext
|
|
var stlsql = this.getstlCondition();
|
|
var iszerodr = this.CheckAllDR.checked;
|
|
var Dsql = this.getDCondition();
|
|
var isallstl = this.CheckOnlyStl.checked;
|
|
|
|
var sortstr = '';
|
|
|
|
if (this.bslistsortfield != '' && this.bslistsortdire != '') {
|
|
|
|
sortstr = this.bslistsortfield + ' ' + this.bslistsortdire;
|
|
}
|
|
|
|
|
|
Ext.Msg.wait('正在组织数据, 请稍侯..');
|
|
Ext.Ajax.request({
|
|
waitMsg: '正在组织数据...',
|
|
url: '/MvcShipping/MsRptSaleBalProfitShare/GetDataListStr',
|
|
scope: this,
|
|
params: {
|
|
start: 0, limit: this.PageSize, condition: sql, stlcondition: stlsql, isdrzero: iszerodr, dcondition: Dsql,isallstl:isallstl,
|
|
sort: sortstr
|
|
},
|
|
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 = 'MSRPTSALEBALPROFITSHARELIST';
|
|
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: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
}
|
|
} else {
|
|
Ext.Msg.show({ title: '请重试',
|
|
msg: '服务器响应出错',
|
|
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|