|
@@ -51,19 +51,24 @@ const Order = React.createClass({
|
|
|
page:pageNo,
|
|
|
loading: true
|
|
|
});
|
|
|
+ let time = new Date(),
|
|
|
+ year = time.getFullYear(),
|
|
|
+ month = time.getMonth()+1,
|
|
|
+ mon1 = this.state.releaseDate.length?this.state.releaseDate[0].replace(/-/g,''):'',
|
|
|
+ mon2 = this.state.releaseDate.length?this.state.releaseDate[1].replace(/-/g,''):'';
|
|
|
$.ajax({
|
|
|
- method: "post",
|
|
|
+ method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/order/listAllSettlement",
|
|
|
+ url: globalConfig.context + "/api/admin/bonus/orderReportList",
|
|
|
data: {
|
|
|
pageNo: pageNo || 1,
|
|
|
- pageSize:999,
|
|
|
- signName: this.state.signName,//客户名称
|
|
|
+ pageSize:this.state.pagination.pageSize,
|
|
|
+ saleName: this.state.signName,//客户名称
|
|
|
departmentId:this.state.departmenttList,
|
|
|
- orderType:this.state.orderType,
|
|
|
- startDate: this.state.releaseDate[0],
|
|
|
- endDate: this.state.releaseDate[1],
|
|
|
+ type:this.state.orderType>='0'?Number(this.state.orderType)+1:'',
|
|
|
+ month: mon1||Number((year+''+month)),
|
|
|
+ month1: mon2||Number((month+1>12?year+1:year)+''+(month+1>12?'01':month+1)),
|
|
|
},
|
|
|
success: function (data) {
|
|
|
let theArr = [];
|
|
@@ -76,12 +81,12 @@ const Order = React.createClass({
|
|
|
let thisdata = data.data.list[i];
|
|
|
theArr.push({
|
|
|
key: i+1,
|
|
|
- orderNo: thisdata.orderNo,
|
|
|
- department:thisdata.department,
|
|
|
- orderType:thisdata.orderType,
|
|
|
- signName:thisdata.signName,
|
|
|
- signNumber:thisdata.signNumber,
|
|
|
- signTotalAmount:thisdata.signTotalAmount
|
|
|
+ id:thisdata.id,
|
|
|
+ deptName:thisdata.deptName,
|
|
|
+ type:thisdata.type,
|
|
|
+ saleName:thisdata.saleName,
|
|
|
+ proofCount:thisdata.proofCount,
|
|
|
+ amount:thisdata.amount
|
|
|
});
|
|
|
};
|
|
|
}
|
|
@@ -126,36 +131,36 @@ const Order = React.createClass({
|
|
|
columns: [
|
|
|
{
|
|
|
title: '序号',
|
|
|
- dataIndex: 'key',
|
|
|
- key: 'key',
|
|
|
+ dataIndex: 'id',
|
|
|
+ key: 'id',
|
|
|
},
|
|
|
{
|
|
|
title: '订单部门',
|
|
|
- dataIndex: 'department',
|
|
|
- key: 'department',
|
|
|
+ dataIndex: 'deptName',
|
|
|
+ key: 'deptName',
|
|
|
},
|
|
|
{
|
|
|
title: '订单类型',
|
|
|
- dataIndex: 'orderType',
|
|
|
- key: 'orderType',
|
|
|
+ dataIndex: 'type',
|
|
|
+ key: 'type',
|
|
|
render:text=>{
|
|
|
return getNewOrderType(text)
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
title: '签单人员',
|
|
|
- dataIndex: 'signName',
|
|
|
- key: 'signName',
|
|
|
+ dataIndex: 'saleName',
|
|
|
+ key: 'saleName',
|
|
|
},
|
|
|
{
|
|
|
title: '签单数量',
|
|
|
- dataIndex: 'signNumber',
|
|
|
- key: 'signNumber',
|
|
|
+ dataIndex: 'proofCount',
|
|
|
+ key: 'proofCount',
|
|
|
},
|
|
|
{
|
|
|
title: '累计签单金额(万)',
|
|
|
- dataIndex: 'signTotalAmount',
|
|
|
- key: 'signTotalAmount',
|
|
|
+ dataIndex: 'amount',
|
|
|
+ key: 'amount',
|
|
|
},
|
|
|
],
|
|
|
dataSource: [],
|
|
@@ -173,7 +178,7 @@ const Order = React.createClass({
|
|
|
this.state.signName='';
|
|
|
this.state.releaseDate = [];
|
|
|
this.state.departmenttList=undefined;
|
|
|
- this.state.orderType='';
|
|
|
+ this.state.orderType=undefined;
|
|
|
this.loadData();
|
|
|
},
|
|
|
searchSwitch() {
|
|
@@ -183,26 +188,19 @@ const Order = React.createClass({
|
|
|
},
|
|
|
//导出exec
|
|
|
exec(){
|
|
|
- let departmentName='',
|
|
|
- depart =this.state.departmentArr || [];
|
|
|
- depart.map(item=>{
|
|
|
- if(this.state.departmentId==item.id){
|
|
|
- departmentName=item.name;
|
|
|
- return;
|
|
|
- }
|
|
|
- });
|
|
|
+ let time = new Date(),
|
|
|
+ year = time.getFullYear(),
|
|
|
+ month = time.getMonth()+1,
|
|
|
+ mon1 = this.state.releaseDate.length?this.state.releaseDate[0].replace(/-/g,''):'',
|
|
|
+ mon2 = this.state.releaseDate.length?this.state.releaseDate[1].replace(/-/g,''):'';
|
|
|
let data = {
|
|
|
departmentId:this.state.departmentId,
|
|
|
- departmentName:departmentName,
|
|
|
- payeeName: this.state.signName,
|
|
|
- orderType:this.state.orderType,
|
|
|
- startTime: this.state.releaseDate[0],
|
|
|
- endTime: this.state.releaseDate[1],
|
|
|
+ saleName: this.state.signName,
|
|
|
+ type:this.state.orderType>='0'?Number(this.state.orderType)+1:'',
|
|
|
+ month: mon1||Number((year+''+month)),
|
|
|
+ month1: mon2||Number((month+1>12?year+1:year)+''+(month+1>12?'01':month+1)),
|
|
|
}
|
|
|
- window.location.href=(globalConfig.context+'/api/admin/financial/exportBillData?'+$.param(data));
|
|
|
- // var _headers = [{ k: 'key', v: '序号' }, { k: 'department', v: '订单部门' },
|
|
|
- // { k: 'orderType', v: '订单类型' }, { k: 'signName', v: '签单人员' },{k:'signNumber',v:'签单数量'},{k:'signTotalAmount',v:'累计签单金额'}]
|
|
|
- // exportExcel(_headers,this.state.dataSource,'订单统计报表.xlsx');
|
|
|
+ window.location.href=(globalConfig.context+'/api/admin/bonus/exportOrderData?'+$.param(data));
|
|
|
},
|
|
|
render() {
|
|
|
const { RangePicker } = DatePicker;
|
|
@@ -260,12 +258,13 @@ const Order = React.createClass({
|
|
|
}} >
|
|
|
<Button>导入年度销售数据</Button>
|
|
|
</Upload>
|
|
|
- <Button type="primary" onClick={this.exec} style={{margin:'0 10px'}}>导出到exec</Button>
|
|
|
+ <Button type="primary" onClick={this.exec} style={{margin:'0 10px'}}>导出到excel</Button>
|
|
|
</div>
|
|
|
<span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch.bind(this)} /></span>
|
|
|
<div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
|
|
|
<span>起止时间 :</span>
|
|
|
<RangePicker
|
|
|
+ format="YYYY-MM"
|
|
|
value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
|
|
|
this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
|
|
|
onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
|