| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 | 
							- import React,{Component} from 'react';
 
- import ajax from 'jquery/src/ajax/xhr.js';
 
- import $ from 'jquery/src/ajax';
 
- import moment from 'moment';
 
- import './public.less';
 
- import { Icon, Button,Form, Input, Select, Spin, Table, Switch, message, DatePicker, Modal } from 'antd';
 
- import OrderDesc from '@/manageCenter/financialManage/orderDetail/orderDesc';
 
- import Assign from '@/manageCenter/publicComponent/assign';
 
- import {getProcessStatus,getApproval} from '@/tools';
 
- const FormItem = Form.Item;
 
- const PaiDan = React.createClass({
 
-     loadData(pageNo) {
 
-         this.state.data = [];
 
-         this.setState({
 
-             selectedRowKeys:[],
 
-             selectedRowKey:[],
 
-             page:pageNo,
 
-             loading: true
 
-         });
 
-         $.ajax({
 
-             method: "get",
 
-             dataType: "json",
 
-             crossDomain: false,
 
-             url: globalConfig.context + "/api/admin/financial/allUnassignedOrder",
 
-             data: {
 
-                 pageNo: pageNo || 1,
 
-                 pageSize: this.state.pagination.pageSize,
 
-                 buyerName: this.state.nameSearch,//客户名称
 
-                 orderNo:this.state.orderNoSearch,
 
-                 startTime: this.state.releaseDate[0],
 
-                 endTime: this.state.releaseDate[1],
 
-             },
 
-             success: function (data) {
 
-                 let theArr = [];
 
-                 if (!data.data || !data.data.list) {
 
-                     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,
 
-                             approval:thisdata.approval,
 
- 		                    orderType:thisdata.orderType,
 
- 		                    processStatus:thisdata.processStatus,
 
-                             signTotalAmount:thisdata.signTotalAmount,
 
-                             buyerName:thisdata.buyerName,
 
-                             sellerName:thisdata.sellerName,
 
-                             createTime:thisdata.createTime?new Date(thisdata.createTime).toLocaleString():'',
 
-                             signTime:thisdata.signTime,
 
-                         });
 
-                     };
 
-                 }
 
-                 this.state.pagination.current = data.data.pageNo;
 
-                 this.state.pagination.total = data.data.totalCount;
 
-                 if(data.data&&data.data.list&&!data.data.list.length){
 
- 					this.state.pagination.current=0
 
- 					this.state.pagination.total=0
 
- 				}
 
-                 this.setState({
 
-                     dataSource: theArr,
 
-                     pagination: this.state.pagination
 
-                 });
 
-             }.bind(this),
 
-         }).always(function () {
 
-             this.setState({
 
-                 loading: false
 
-             });
 
-         }.bind(this));
 
-     },
 
-     getInitialState() {
 
-         return {
 
-             searchMore: true,
 
-             assignVisible:false,
 
-             releaseDate: [],
 
-             boHuivisible:false,
 
-             selectedRowKeys: [],
 
-             selectedRows: [],
 
-             loading: false,
 
-             pagination: {
 
-                 defaultCurrent: 1,
 
-                 defaultPageSize: 10,
 
-                 showQuickJumper: true,
 
-                 pageSize: 10,
 
-                 onChange: function (page) {
 
-                     this.loadData(page);
 
-                 }.bind(this),
 
-                 showTotal: function (total) {
 
-                     return '共' + total + '条数据';
 
-                 }
 
-             },
 
-             columns: [
 
-                 {
 
-                     title: '订单编号',
 
-                     dataIndex: 'orderNo',
 
-                     key: 'orderNo',
 
-                 }, {
 
-                     title: '下单时间',
 
-                     dataIndex: 'createTime',
 
-                     key: 'createTime',
 
-                 },  {
 
-                     title: '签单时间',
 
-                     dataIndex: 'signTime',
 
-                     key: 'signTime',
 
-                 },
 
-                 {
 
-                     title: '签单客户',
 
-                     dataIndex: 'buyerName',
 
-                     key: 'buyerName',
 
-                 },
 
-                 {
 
-                     title: '流程状态',
 
-                     dataIndex: 'processStatus',
 
-                     key: 'processStatus',
 
-                     render: text => { return getProcessStatus(text)}
 
-                 },
 
-                 {
 
-                     title: '订单总金额(万)',
 
-                     dataIndex: 'signTotalAmount',
 
-                     key: 'signTotalAmount'
 
-                 },
 
-                 {
 
-                     title: '是否特批',
 
-                     dataIndex: 'approval',
 
-                     key: 'approval',
 
-                     render: text => { return getApproval(text)}
 
-                 },
 
-                 {
 
-                     title: '订单负责人',
 
-                     dataIndex: 'sellerName',
 
-                     key: 'sellerName'
 
-                 },
 
-                 {
 
-                     title:'操作',
 
-                     dataIndex: 'caozuo',
 
-                     key: 'caouzo',
 
-                     render:(text,recard)=>{
 
-                         return <div>
 
-                             <Button type="primary" style={{margin:'0 10px'}} onClick={(e)=>{e.stopPropagation(),this.evaluate(recard)}}>分派</Button>
 
-                         </div>
 
-                     }
 
-                 }
 
-             ],
 
-             dataSource: [],
 
-             searchTime: [,]
 
-         }
 
-     },
 
-     /* 分派 */
 
-     evaluate(recard){
 
-         this.state.assignData=recard;
 
-         this.setState({
 
-             assignVisible:true
 
-         })
 
-     },
 
-     /* 驳回 */
 
-     reject(recard){
 
-        this.setState({
 
-            bohuiData:recard,
 
-            boHuiVisible:true,
 
-            content:''
 
-        })
 
-     },
 
-     boHuiOk(){
 
-         this.setState({
 
-             boHuiVisible:false
 
-         })
 
-         if((this.state.pagination.total)%10==1){
 
-             this.loadData((this.state.page)-1);
 
-         }else{
 
-             this.loadData(this.state.page);
 
-         }
 
-     },
 
-     boHuiCancel(e){
 
-         this.setState({
 
-             boHuiVisible:false
 
-         })
 
-     },
 
-     componentWillMount() {
 
-         this.loadData();
 
-     },
 
-     tableRowClick(record, index) {
 
-         this.state.RowData = record;
 
-         this.setState({
 
-             showDesc: true,
 
-         });
 
-     },
 
-     closeDesc(e, s) {
 
-         this.state.showDesc = e;
 
-         if (s) {
 
-             this.loadData(this.state.page);
 
-         };
 
-     },
 
-     closeAssign(e, s) {
 
-         this.state.assignVisible = e;
 
-         if (s) {
 
-             if((this.state.pagination.total)%10==1){
 
-                 this.loadData((this.state.page)-1);
 
-             }else{
 
-                 this.loadData(this.state.page);
 
-             }
 
-         };
 
-     },
 
-     search() {
 
-         this.loadData();
 
-     },
 
-     reset() {
 
-         this.state.nameSearch = '';
 
-         this.state.releaseDate = [];
 
-         this.state.orderNoSearch=''
 
-         this.loadData();
 
-     },
 
-     searchSwitch() {
 
-         this.setState({
 
-             searchMore: !this.state.searchMore
 
-         });
 
-     },
 
-     render() { 
 
-         const rowSelection = {
 
-             selectedRowKeys: this.state.selectedRowKeys,
 
-             onChange: (selectedRowKeys, selectedRows) => {
 
-                 this.setState({
 
-                     selectedRows: selectedRows.slice(-1),
 
-                     selectedRowKeys: selectedRowKeys.slice(-1)
 
-                 });
 
-             }
 
-         };
 
-         const hasSelected = this.state.selectedRowKeys.length > 0;
 
-         const { RangePicker } = DatePicker;
 
-         return ( <div className="user-content">
 
-             <div className="content-title">
 
-                     <span>派单管理</span>
 
-                 </div>
 
-                 <div className="user-search">
 
-                     <Input placeholder="客户名称"
 
-                         value={this.state.nameSearch}
 
-                         onChange={(e) => { this.setState({ nameSearch: e.target.value }); }} />
 
-                     <Input placeholder="订单编号"
 
-                         value={this.state.orderNoSearch}
 
-                         onChange={(e) => { this.setState({ orderNoSearch: e.target.value }); }} />
 
-                     <Button type="primary" onClick={this.search}>搜索</Button>
 
-                     <Button onClick={this.reset}>重置</Button>
 
-                     <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch.bind(this)} /></span>
 
-                     <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
 
-                         <span>订单时间 :</span>
 
-                         <RangePicker
 
-                             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">
 
-                     <Spin spinning={this.state.loading}>
 
-                         <Table columns={this.state.columns}
 
-                             dataSource={this.state.dataSource}
 
-                             rowSelection={false}
 
-                             pagination={this.state.pagination}
 
-                             onRowClick={this.tableRowClick.bind(this)} />
 
-                     </Spin>
 
-                 </div>
 
-                 <OrderDesc
 
-                     data={this.state.RowData}
 
-                     showDesc={this.state.showDesc}
 
-                     closeDesc={this.closeDesc.bind(this)}
 
-                 />
 
-                 <Assign
 
-                     selApi="/api/admin/financial/distributionFinance"
 
-                     data={this.state.assignData}
 
-                     showDesc={this.state.assignVisible}
 
-                     closeDesc={this.closeAssign.bind(this)}
 
-                 />
 
-                 <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: 5 }} wrapperCol={{ span: 16 }} label={<span><strong style={{color:'#f00'}}>*</strong>驳回原因</span>}>
 
- 									<Input
 
- 										type="textarea"
 
- 										rows={4}
 
- 										placeholder="请输入驳回原因"
 
- 										value={this.state.content}
 
- 										onChange={(e) => {
 
- 											this.setState({ content: e.target.value });
 
- 										}}
 
- 									/>
 
- 								</FormItem>   
 
-                                 <FormItem wrapperCol={{ span: 12, offset:5 }}>  
 
-                                         <Button type="primary" htmlType="submit"  style={{marginRight:20}}>驳回</Button>
 
-                                         <Button type="default" onClick={()=>{this.boHuiCancel()}}>取消</Button>
 
-                                 </FormItem>        
 
-                             </Spin>
 
-                         </Form>
 
-                 </Modal>
 
-         </div> )
 
-     }
 
- })
 
-  
 
- export default PaiDan;
 
 
  |