|  | @@ -3,10 +3,12 @@ import ajax from 'jquery/src/ajax/xhr.js';
 | 
												
													
														
															|  |  import $ from 'jquery/src/ajax';
 |  |  import $ from 'jquery/src/ajax';
 | 
												
													
														
															|  |  import moment from 'moment';
 |  |  import moment from 'moment';
 | 
												
													
														
															|  |  import '@/manageCenter/financialManage/distribute/public.less';
 |  |  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 {getNewOrderType,beforeUploadFile} from '@/tools';
 | 
												
													
														
															|  |  import {newOrderType} from '@/dataDic';
 |  |  import {newOrderType} from '@/dataDic';
 | 
												
													
														
															|  |  import { exportExcel } from 'xlsx-oc';
 |  |  import { exportExcel } from 'xlsx-oc';
 | 
												
													
														
															|  | 
 |  | +const FormItem = Form.Item;
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  const Order = React.createClass({
 |  |  const Order = React.createClass({
 | 
												
													
														
															|  |      departmentList() {
 |  |      departmentList() {
 | 
												
											
												
													
														
															|  | @@ -68,8 +70,8 @@ const Order = React.createClass({
 | 
												
													
														
															|  |                  saleName: this.state.signName,//客户名称
 |  |                  saleName: this.state.signName,//客户名称
 | 
												
													
														
															|  |                  departmentId:this.state.departmenttList,
 |  |                  departmentId:this.state.departmenttList,
 | 
												
													
														
															|  |                  type:orderN>=0?orderN+1:'',
 |  |                  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) {
 |  |              success: function (data) {
 | 
												
													
														
															|  |                  let theArr = [];
 |  |                  let theArr = [];
 | 
												
											
												
													
														
															|  | @@ -83,6 +85,7 @@ const Order = React.createClass({
 | 
												
													
														
															|  |                          theArr.push({
 |  |                          theArr.push({
 | 
												
													
														
															|  |                              key: i+1,
 |  |                              key: i+1,
 | 
												
													
														
															|  |                              id:thisdata.id,
 |  |                              id:thisdata.id,
 | 
												
													
														
															|  | 
 |  | +                            mid:thisdata.mid,
 | 
												
													
														
															|  |                              deptName:thisdata.deptName,
 |  |                              deptName:thisdata.deptName,
 | 
												
													
														
															|  |                              type:thisdata.type,
 |  |                              type:thisdata.type,
 | 
												
													
														
															|  |                              saleName:thisdata.saleName,  
 |  |                              saleName:thisdata.saleName,  
 | 
												
											
												
													
														
															|  | @@ -163,11 +166,78 @@ const Order = React.createClass({
 | 
												
													
														
															|  |                      dataIndex: 'amount',
 |  |                      dataIndex: 'amount',
 | 
												
													
														
															|  |                      key: 'amount',
 |  |                      key: 'amount',
 | 
												
													
														
															|  |                  },
 |  |                  },
 | 
												
													
														
															|  | 
 |  | +                {
 | 
												
													
														
															|  | 
 |  | +                    title:'修改单量',
 | 
												
													
														
															|  | 
 |  | +                    dataIndex:'dl',
 | 
												
													
														
															|  | 
 |  | +                    key:'d1',
 | 
												
													
														
															|  | 
 |  | +                    render:(text,recard)=>{
 | 
												
													
														
															|  | 
 |  | +                        return <Button onClick={(e)=>{e.stopPropagation();this.modify(recard)}}>修改单量</Button>
 | 
												
													
														
															|  | 
 |  | +                    }
 | 
												
													
														
															|  | 
 |  | +                }
 | 
												
													
														
															|  |              ],
 |  |              ],
 | 
												
													
														
															|  |              dataSource: [],
 |  |              dataSource: [],
 | 
												
													
														
															|  |              searchTime: [,]
 |  |              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() {
 |  |      componentWillMount() {
 | 
												
													
														
															|  |          this.loadData();
 |  |          this.loadData();
 | 
												
													
														
															|  |          this.departmentList();
 |  |          this.departmentList();
 | 
												
											
												
													
														
															|  | @@ -210,6 +280,7 @@ const Order = React.createClass({
 | 
												
													
														
															|  |      render() { 
 |  |      render() { 
 | 
												
													
														
															|  |          const { RangePicker } = DatePicker;
 |  |          const { RangePicker } = DatePicker;
 | 
												
													
														
															|  |          let departmentArr = this.state.departmentArr || [];
 |  |          let departmentArr = this.state.departmentArr || [];
 | 
												
													
														
															|  | 
 |  | +        const recard = this.state.recard || {};
 | 
												
													
														
															|  |          return ( <div className="user-content">
 |  |          return ( <div className="user-content">
 | 
												
													
														
															|  |              <div className="content-title">
 |  |              <div className="content-title">
 | 
												
													
														
															|  |                  <span>订单统计报表</span>
 |  |                  <span>订单统计报表</span>
 | 
												
											
												
													
														
															|  | @@ -285,6 +356,35 @@ const Order = React.createClass({
 | 
												
													
														
															|  |                              />
 |  |                              />
 | 
												
													
														
															|  |                      </Spin>
 |  |                      </Spin>
 | 
												
													
														
															|  |                  </div>
 |  |                  </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> )
 |  |          </div> )
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |  })
 |  |  })
 |