|
@@ -3,10 +3,12 @@ import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import moment from 'moment';
|
|
|
import '@/manageCenter/financialManage/distribute/public.less';
|
|
|
-import { Button, Input, Spin, Table,Select, Switch, message, DatePicker,Upload} from 'antd';
|
|
|
+import { Button, Input, Form,Spin,InputNumber, Table,Select, Switch, message, DatePicker,Upload,Modal} from 'antd';
|
|
|
import {getNewOrderType,beforeUploadFile} from '@/tools';
|
|
|
import {newOrderType} from '@/dataDic';
|
|
|
import { exportExcel } from 'xlsx-oc';
|
|
|
+const FormItem = Form.Item;
|
|
|
+
|
|
|
|
|
|
const Order = React.createClass({
|
|
|
departmentList() {
|
|
@@ -68,8 +70,8 @@ const Order = React.createClass({
|
|
|
saleName: this.state.signName,//客户名称
|
|
|
departmentId:this.state.departmenttList,
|
|
|
type:orderN>=0?orderN+1:'',
|
|
|
- month: mon1||Number((year+''+month)),
|
|
|
- month1: mon2||Number((month+1>12?year+1:year)+''+(month+1>12?'01':month+1)),
|
|
|
+ month: mon1||Number(year+''+(month<10?('0'+month):month)),
|
|
|
+ month1: mon2||Number((month+1>12?year+1:year)+''+(month+1>12?'01':(month+1)<10?'0'+(month+1):(month+1))),
|
|
|
},
|
|
|
success: function (data) {
|
|
|
let theArr = [];
|
|
@@ -83,6 +85,7 @@ const Order = React.createClass({
|
|
|
theArr.push({
|
|
|
key: i+1,
|
|
|
id:thisdata.id,
|
|
|
+ mid:thisdata.mid,
|
|
|
deptName:thisdata.deptName,
|
|
|
type:thisdata.type,
|
|
|
saleName:thisdata.saleName,
|
|
@@ -163,11 +166,78 @@ const Order = React.createClass({
|
|
|
dataIndex: 'amount',
|
|
|
key: 'amount',
|
|
|
},
|
|
|
+ {
|
|
|
+ title:'修改单量',
|
|
|
+ dataIndex:'dl',
|
|
|
+ key:'d1',
|
|
|
+ render:(text,recard)=>{
|
|
|
+ return <Button onClick={(e)=>{e.stopPropagation();this.modify(recard)}}>修改单量</Button>
|
|
|
+ }
|
|
|
+ }
|
|
|
],
|
|
|
dataSource: [],
|
|
|
searchTime: [,]
|
|
|
}
|
|
|
},
|
|
|
+ //修改单量
|
|
|
+ modify(recard){
|
|
|
+ this.setState({
|
|
|
+ boHuiVisible:true,
|
|
|
+ recard,
|
|
|
+ result:recard.proofCount,
|
|
|
+ amount:recard.amount
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bohuiOk(){
|
|
|
+ this.setState({
|
|
|
+ boHuiVisible:false
|
|
|
+ })
|
|
|
+ this.loadData(this.state.page);
|
|
|
+ },
|
|
|
+ boHuiCancel(){
|
|
|
+ this.setState({
|
|
|
+ boHuiVisible:false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ boHuiSubmit(e){
|
|
|
+ e.preventDefault();
|
|
|
+ var resType = typeof this.state.result;
|
|
|
+ if(resType != 'number'){
|
|
|
+ message.warning('请填写校对信息');
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ var amountType = typeof this.state.amount;
|
|
|
+ if(amountType != 'number'){
|
|
|
+ message.warning('请填写金额');
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ this.setState({
|
|
|
+ loading:true
|
|
|
+ });
|
|
|
+ const recard = this.state.recard;
|
|
|
+ var api = '/api/admin/bonus/updateProof';
|
|
|
+ $.ajax({
|
|
|
+ method: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + api,
|
|
|
+ data: {
|
|
|
+ id:recard.mid,
|
|
|
+ amount:this.state.amount,
|
|
|
+ proofCount:this.state.result
|
|
|
+ }
|
|
|
+ }).done(function (data) {
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success('修改单量成功');
|
|
|
+ this.bohuiOk();
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
componentWillMount() {
|
|
|
this.loadData();
|
|
|
this.departmentList();
|
|
@@ -210,6 +280,7 @@ const Order = React.createClass({
|
|
|
render() {
|
|
|
const { RangePicker } = DatePicker;
|
|
|
let departmentArr = this.state.departmentArr || [];
|
|
|
+ const recard = this.state.recard || {};
|
|
|
return ( <div className="user-content">
|
|
|
<div className="content-title">
|
|
|
<span>订单统计报表</span>
|
|
@@ -285,6 +356,35 @@ const Order = React.createClass({
|
|
|
/>
|
|
|
</Spin>
|
|
|
</div>
|
|
|
+ <Modal visible={this.state.boHuiVisible}
|
|
|
+ width="400px"
|
|
|
+ title='修改单量'
|
|
|
+ footer=''
|
|
|
+ onOk={this.boHuiOk}
|
|
|
+ onCancel={this.boHuiCancel}
|
|
|
+ >
|
|
|
+ <Form layout="horizontal" onSubmit={this.boHuiSubmit}>
|
|
|
+ <Spin spinning={this.state.loading}>
|
|
|
+ <FormItem labelCol={{ span: 8 }} wrapperCol={{ span: 10 }} label={<span><strong style={{color:'#f00'}}>*</strong>单量校对结果</span>}>
|
|
|
+ <InputNumber min={0} max={1} placeholder="输入单量"
|
|
|
+ value={this.state.result}
|
|
|
+ onChange={(e)=>{this.setState({result:e})}}
|
|
|
+ />
|
|
|
+ </FormItem>
|
|
|
+ <FormItem labelCol={{ span: 8 }} wrapperCol={{ span: 10 }} label={<span><strong style={{color:'#f00'}}>*</strong>金额</span>}>
|
|
|
+ <InputNumber min={0} max={9999} placeholder="金额"
|
|
|
+ value={this.state.amount}
|
|
|
+ onChange={(e)=>{this.setState({amount:e})}}
|
|
|
+ />
|
|
|
+ <span> 万元</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem wrapperCol={{ span: 12, offset:8 }}>
|
|
|
+ <Button type="primary" htmlType="submit" style={{marginRight:20}}>修改</Button>
|
|
|
+ <Button type="default" onClick={()=>{this.boHuiCancel()}}>取消</Button>
|
|
|
+ </FormItem>
|
|
|
+ </Spin>
|
|
|
+ </Form>
|
|
|
+ </Modal>
|
|
|
</div> )
|
|
|
}
|
|
|
})
|