import React from 'react'; import ReactDom from 'react-dom'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, Modal, Upload ,Popconfirm,Checkbox} from 'antd'; import MyBillDetaile from "./myBillDetaile.jsx"; import moment from 'moment'; import '../../userMangagement.less'; import {lvl,intentProgress,transactionProgress,contractProgress,projectProgress} from '../../../../dataDic.js'; import {getIntentProgress,getTransactionProgress,getContractProgress,getProjectProgress,getTransactionChannel,getTransactionProject} from '../../../../tools.js'; const MyBill=Form.create()(React.createClass({ loadData(pageNo) { this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/order/listMyBill', data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, payerName:this.state.draweeName,//付款人名称 depId:this.state.departmenttSearch,//部门 confirmSign:this.state.confirmSignSearch,//流水确认 payeeName:this.state.payeeName,//收款人名称 deleteSign:this.state.term,//是否有效 orderNo:this.state.orderNumber,//订单编号 salesmanName:this.state.orderLeader,//订单负责人 }, success: function (data) { let theArr = []; if (!data.data) { 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, billNo: thisdata.billNo, transactionAmount:thisdata.transactionAmount, createTime:thisdata.createTime, transactionAmount:thisdata.transactionAmount, payerName:thisdata.payerName, payeeName:thisdata.payeeName, transactionSubject:thisdata.transactionSubject, transactionChannel:thisdata.transactionChannel, financialPayNo:thisdata.financialPayNo, financialPayTime:thisdata.financialPayTime, orderNo:thisdata.orderNo, departmentName:thisdata.departmentName, salesmanName:thisdata.salesmanName, financeName:thisdata.financeName, confirmSign:thisdata.confirmSign, deleteSign:thisdata.deleteSign, confirmTime:thisdata.confirmTime }); }; this.state.pagination.current = data.data.pageNo; this.state.pagination.total = data.data.totalCount; }; if(!data.data.list.length){ this.state.pagination.current=0 this.state.pagination.total=0 } this.setState({ pageNo:pageNo, dataSource: theArr, pagination: this.state.pagination, selectedRowKeys:[] }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, //部门 departmentList() { this.setState({ loading: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/organization/selectSuperId", data: { }, success: function(data) { let thedata = data.data; let theArr=[]; if(!thedata) { if(data.error && data.error.length) { message.warning(data.error[0].message); }; thedata = {}; }else{ thedata.map(function(item,index){ theArr.push({ key:index, name:item.name, id:item.id, }) }) } this.setState({ departmentArr:theArr, }) }.bind(this), }).always(function() { this.setState({ loading: false }); }.bind(this)); }, getInitialState() { return { datauser:{}, selectedRowKeys: [], selectedRows: [], searchMore: true, departmentArr:[], loading: false, visible:false, showDesc: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: 'billNo', key: 'billNo', render:(text)=>{ return text&&text.substr(0,9)+'…' } }, { title: '平台流水时间', dataIndex: 'createTime', key: 'createTime' }, { title: '流水金额(万元)', dataIndex: 'transactionAmount', key: 'transactionAmount' },{ title: '付款人名称', dataIndex: 'payerName', key: 'payerName' }, { title: '收款人名称', dataIndex: 'payeeName', key: 'payeeName' }, { title: '流水科目', dataIndex: 'transactionSubject', key: 'transactionSubject', render:(text)=>{return getTransactionProject(text) } }, { title: '流水外联', dataIndex: 'transactionChannel', key: 'transactionChannel', render:(text)=>{return getTransactionChannel(text) } },{ title: '财务流水号', dataIndex: 'financialPayNo', key: 'financialPayNo', }, { title: '财务流水时间', dataIndex: 'financialPayTime', key: 'financialPayTime', }, { title: '流水确认', dataIndex: 'confirmSign', key: 'confirmSign', render:(text)=>{return text?'已确认':'待确认' } },{ title: '确认时间', dataIndex: 'confirmTime', key: 'confirmTime', },{ title: '订单编号', dataIndex: 'orderNo', key: 'orderNo', },{ title: '订单负责人', dataIndex: 'salesmanName', key: 'salesmanName', },{ title: '是否有效', dataIndex: 'deleteSign', key: 'deleteSign', render:(text)=>{return text==0?'有效':'作废' } }, ], dataSource: [], }; }, //驳回 reject(record){ this.state.userDetaile=true; this.state.datauser = record; this.setState({ rowClick:false, showDesc: true }); }, componentWillMount() { this.loadData() this.departmentList(); }, closeDesc(e, s) { this.state.userDetaile=false; this.state.showDesc = e; if (s) { this.loadData(this.state.pageNo); }; }, searchSwitch() { this.setState({ searchMore: !this.state.searchMore }); }, search() { this.loadData(); }, reset() { this.state.draweeName=''; this.state.payeeName=''; this.state.term = undefined; this.state.orderNumber = ''; this.state.confirmSignSearch=undefined; this.state.departmenttSearch = undefined; this.state.orderLeader = ''; this.loadData(); }, tableRowClick(record, index) { this.state.userDetaile=true; this.state.datauser = record; this.setState({ rowClick:true, signBillState:true, showDesc: true }); }, render() { const rowSelection = { selectedRowKeys: this.state.selectedRowKeys, onChange: (selectedRowKeys, selectedRows) => { this.setState({ selectedRows: selectedRows.slice(-1), selectedRowKeys: selectedRowKeys.slice(-1) }); }, onSelectAll: (selected, selectedRows, changeRows) => { this.setState({ selectedRowKeys:[] }) }, }; let departmentArr = this.state.departmentArr || []; const hasSelected = this.state.selectedRowKeys.length > 0; return (
结算流水查询
{ this.setState({ draweeName: e.target.value }); }} /> { this.setState({ payeeName: e.target.value }); }} /> 更多搜索
{ this.setState({ orderNumber: e.target.value }); }} /> { this.setState({ orderLeader: e.target.value }); }} />
); } })); export default MyBill;