|
@@ -3,7 +3,7 @@ import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import moment from 'moment';
|
|
|
import '../distribute/public.less';
|
|
|
-import { Button, Input, Spin, Table,Select, Switch, message, DatePicker,Modal ,Form } from 'antd';
|
|
|
+import { Button, Input, Spin, Table,Select, Switch,InputNumber, message, DatePicker,Modal ,Form } from 'antd';
|
|
|
import {getNewOrderStatus,getProjectStatus,getPaymentType,getTransactionProject,getBonusState} from '@/tools';
|
|
|
import BonuseDetail from './bonusDetail';
|
|
|
const FormItem= Form.Item;
|
|
@@ -54,17 +54,18 @@ const YxBonus = React.createClass({
|
|
|
loading: true
|
|
|
});
|
|
|
$.ajax({
|
|
|
- method: "post",
|
|
|
+ method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/order/listAllSettlement",
|
|
|
+ url: globalConfig.context + "/api/admin/bonus/saleBonusStatistics",
|
|
|
data: {
|
|
|
pageNo: pageNo || 1,
|
|
|
pageSize:this.state.pagination.pageSize,
|
|
|
- ownerName: this.state.nameSearch,//客户名称
|
|
|
+ salesName: this.state.orderRefundSearch,//订单负责人
|
|
|
departmentId:this.state.departmenttList,
|
|
|
- startDate: this.state.releaseDate[0],
|
|
|
- endDate: this.state.releaseDate[1],
|
|
|
+ startTime: this.state.releaseDate[0],
|
|
|
+ endTime: this.state.releaseDate[1],
|
|
|
+ grantStatus:this.state.grantStatus
|
|
|
},
|
|
|
success: function (data) {
|
|
|
let theArr = [];
|
|
@@ -72,23 +73,7 @@ const YxBonus = React.createClass({
|
|
|
if (data.error && data.error.length) {
|
|
|
message.warning(data.error[0].message);
|
|
|
};
|
|
|
- } else {
|
|
|
- for (let i = 0; i < data.data.list.length; i++) {
|
|
|
- let thisdata = data.data.list[i];
|
|
|
- theArr.push({
|
|
|
- key: i,
|
|
|
- orderNo: thisdata.orderNo,
|
|
|
- orderType:thisdata.orderType,
|
|
|
- orderStatus:thisdata.orderStatus,
|
|
|
- processStatus:thisdata.processStatus,
|
|
|
- projectStage:thisdata.projectStage,
|
|
|
- approval:thisdata.approval,
|
|
|
- creater:thisdata.creater,
|
|
|
- createTime:thisdata.createTime?(new Date(thisdata.createTime)).toLocaleString():'',
|
|
|
- signTime:thisdata.signTime?(new Date(thisdata.signTime)).toLocaleString():''
|
|
|
- });
|
|
|
- };
|
|
|
- }
|
|
|
+ }
|
|
|
this.state.pagination.current = data.data.pageNo;
|
|
|
this.state.pagination.total = data.data.totalCount;
|
|
|
if(data.data&&data.data.list&&!data.data.list.length){
|
|
@@ -96,11 +81,12 @@ const YxBonus = React.createClass({
|
|
|
this.state.pagination.total=0
|
|
|
}
|
|
|
this.setState({
|
|
|
- dataSource: theArr,
|
|
|
+ dataSource: data.data.list,
|
|
|
pagination: this.state.pagination
|
|
|
});
|
|
|
}.bind(this),
|
|
|
}).always(function () {
|
|
|
+
|
|
|
this.setState({
|
|
|
loading: false
|
|
|
});
|
|
@@ -136,8 +122,8 @@ const YxBonus = React.createClass({
|
|
|
},
|
|
|
{
|
|
|
title: '订单负责人',
|
|
|
- dataIndex: 'sellerName',
|
|
|
- key: 'sellerName',
|
|
|
+ dataIndex: 'salesName',
|
|
|
+ key: 'salesName',
|
|
|
},
|
|
|
{
|
|
|
title: '签单日期',
|
|
@@ -146,24 +132,16 @@ const YxBonus = React.createClass({
|
|
|
},
|
|
|
{
|
|
|
title: '客户名称',
|
|
|
- dataIndex: 'buyerName',
|
|
|
- key: 'buyerName',
|
|
|
+ dataIndex: 'buyName',
|
|
|
+ key: 'buyName',
|
|
|
render:text=>{
|
|
|
return text&&text>8?text.substr(0,8)+'...':text
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- title: '订单金额',
|
|
|
- dataIndex: 'transactionAmount',
|
|
|
- key: 'transactionAmount'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '流水科目',
|
|
|
- dataIndex: 'transactionSubject',
|
|
|
- key: 'transactionSubject',
|
|
|
- render:(text)=>{
|
|
|
- return getTransactionProject(text)
|
|
|
- }
|
|
|
+ title: '订单金额(万元)',
|
|
|
+ dataIndex: 'totalAmount',
|
|
|
+ key: 'totalAmount'
|
|
|
},
|
|
|
{
|
|
|
title: '订单状态',
|
|
@@ -183,28 +161,28 @@ const YxBonus = React.createClass({
|
|
|
},
|
|
|
{
|
|
|
title: '发放状态',
|
|
|
- dataIndex: 'creater11',
|
|
|
- key: 'creater11',
|
|
|
+ dataIndex: 'grantStatus',
|
|
|
+ key: 'grantStatus',
|
|
|
render:(text)=>{
|
|
|
return getBonusState(text)
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
title: '发放类型',
|
|
|
- dataIndex: 'creater11t',
|
|
|
- key: 'creater11t',
|
|
|
+ dataIndex: 'bonusSubject',
|
|
|
+ key: 'bonusSubject',
|
|
|
render:text=>{
|
|
|
return getPaymentType(text)
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- title: '已收',
|
|
|
- dataIndex: 'creater22',
|
|
|
- key: 'creater22'
|
|
|
+ title: '已收(万元)',
|
|
|
+ dataIndex: 'settlementAmount',
|
|
|
+ key: 'settlementAmount'
|
|
|
},{
|
|
|
- title: '已退',
|
|
|
- dataIndex: 'creater33',
|
|
|
- key: 'creater33'
|
|
|
+ title: '已退(万元)',
|
|
|
+ dataIndex: 'refundAmount',
|
|
|
+ key: 'refundAmount'
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
@@ -212,8 +190,8 @@ const YxBonus = React.createClass({
|
|
|
key: 'state11',
|
|
|
render:(text,recard)=>{
|
|
|
return <div>
|
|
|
- <Button type="primary" style={{margin:'0 10px'}} onClick={(e)=>{e.stopPropagation(),this.proofread(recard,0)}}>发放</Button>
|
|
|
- <Button type="primary" onClick={(e)=>{e.stopPropagation(),this.proofread(recard,1)}}>校对</Button>
|
|
|
+ {(recard.proofStatus&&!recard.grantStatus)?<Button type="primary" onClick={(e)=>{e.stopPropagation(),this.proofread(recard,0)}}>发放</Button>:''}
|
|
|
+ {(!recard.proofStatus&&!recard.grantStatus)?<Button type="primary" onClick={(e)=>{e.stopPropagation(),this.proofread(recard,1)}}>校对</Button>:''}
|
|
|
</div>
|
|
|
}
|
|
|
},
|
|
@@ -277,8 +255,9 @@ const YxBonus = React.createClass({
|
|
|
salesName: this.state.orderRefundSearch,//订单负责人
|
|
|
startTime: this.state.releaseDate[0],
|
|
|
endTime: this.state.releaseDate[1],
|
|
|
+ grantStatus:this.state.grantStatus,
|
|
|
}
|
|
|
- window.location.href=(globalConfig.context+'/api/admin/financial/exportBillData?'+$.param(data));
|
|
|
+ window.location.href=(globalConfig.context+'/api/admin/bonus/exportSaleBonusData?'+$.param(data));
|
|
|
},
|
|
|
//保存发放状态
|
|
|
boHuiSubmit(e){
|
|
@@ -290,11 +269,12 @@ const YxBonus = React.createClass({
|
|
|
this.setState({
|
|
|
loading:true
|
|
|
});
|
|
|
+ var api = !this.state.proofreadState?"/api/admin/bonus/bonusPayment":"/api/admin/bonus/proofreading";
|
|
|
$.ajax({
|
|
|
method: "POST",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + !this.state.proofreadState?"/api/admin/bonus/bonusPayment":"/api/admin/bonus/proofreading",
|
|
|
+ url: globalConfig.context + api,
|
|
|
data: !this.state.proofreadState?{ //0-发放 1-校对
|
|
|
id: this.state.proofData.id,
|
|
|
orderNo:this.state.proofData.orderNo,
|
|
@@ -318,6 +298,7 @@ const YxBonus = React.createClass({
|
|
|
this.state.orderRefundSearch='';
|
|
|
this.state.releaseDate = [];
|
|
|
this.state.departmenttList=undefined;
|
|
|
+ this.state.grantStatus=undefined
|
|
|
this.loadData();
|
|
|
},
|
|
|
searchSwitch() {
|
|
@@ -356,6 +337,14 @@ const YxBonus = React.createClass({
|
|
|
<Input placeholder="订单负责人"
|
|
|
value={this.state.orderRefundSearch}
|
|
|
onChange={(e) => { this.setState({ orderRefundSearch: e.target.value }); }} />
|
|
|
+ <Select placeholder="发放状态"
|
|
|
+ style={{ width: 150 ,marginRight:10}}
|
|
|
+ value={this.state.grantStatus}
|
|
|
+ onChange={(e) => { this.setState({ grantStatus: e }) }}>
|
|
|
+ <Option value='0'>未发放</Option>
|
|
|
+ <Option value="1">已发放</Option>
|
|
|
+ </Select>
|
|
|
+
|
|
|
<Button type="primary" onClick={this.search}>搜索</Button>
|
|
|
<Button onClick={this.reset}>重置</Button>
|
|
|
<div style={{float:'right'}}>
|
|
@@ -369,6 +358,7 @@ const YxBonus = React.createClass({
|
|
|
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 }); }} />
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="patent-table" id="table">
|
|
@@ -397,12 +387,9 @@ const YxBonus = React.createClass({
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
{this.state.proofreadState?<div>
|
|
|
<FormItem labelCol={{ span: 8 }} wrapperCol={{ span: 10 }} label={<span><strong style={{color:'#f00'}}>*</strong>单量校对结果</span>}>
|
|
|
- <Input
|
|
|
- placeholder="请输入单量校对结果"
|
|
|
+ <InputNumber min={0} max={1} placeholder="输入单量"
|
|
|
value={this.state.result}
|
|
|
- onChange={(e) => {
|
|
|
- this.setState({ result: e.target.value });
|
|
|
- }}
|
|
|
+ onChange={(e)=>{this.setState({result:e})}}
|
|
|
/>
|
|
|
</FormItem>
|
|
|
<FormItem labelCol={{ span: 8 }} wrapperCol={{ span: 10 }} label='校对人'>
|
|
@@ -411,14 +398,11 @@ const YxBonus = React.createClass({
|
|
|
</div>:
|
|
|
<div>
|
|
|
<FormItem labelCol={{ span: 8 }} wrapperCol={{ span: 10 }} label='应收人'>
|
|
|
- <span>{this.state.proofData.targetName}</span>
|
|
|
+ <span>{this.state.proofData.salesName}</span>
|
|
|
</FormItem>
|
|
|
<FormItem labelCol={{ span: 8 }} wrapperCol={{ span: 10 }} label='发放人'>
|
|
|
<span>{this.state.proofData.byName}</span>
|
|
|
</FormItem>
|
|
|
- <FormItem labelCol={{ span: 8 }} wrapperCol={{ span: 10 }} label='发放日期'>
|
|
|
- <span>{this.state.proofData.grantTime}</span>
|
|
|
- </FormItem>
|
|
|
</div>
|
|
|
}
|
|
|
<FormItem wrapperCol={{ span: 12, offset:8 }}>
|