123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352 |
- 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 (
- <div className="user-content" >
- <div className="content-title">
- <span style={{fontSize:'16px'}}>结算流水查询</span>
- <div className="user-search">
- <Input placeholder="付款人名称" style={{width:'150px'}}
- value={this.state.draweeName}
- onChange={(e) => { this.setState({ draweeName: e.target.value }); }} />
- <Input placeholder="收款人名称" style={{width:'150px'}}
- value={this.state.payeeName}
- onChange={(e) => { this.setState({ payeeName: e.target.value }); }} />
- <Select placeholder="流水确认"
- style={{ width: 150 ,marginRight:'10px'}}
- value={this.state.confirmSignSearch}
- onChange={(e) => { this.setState({ confirmSignSearch: e }) }}>
- <Select.Option value='0'>待确认</Select.Option>
- <Select.Option value='1'>已确认</Select.Option>
- </Select>
- <Select placeholder="是否有效"
- style={{ width: 150 ,marginRight:'10px'}}
- value={this.state.term}
- onChange={(e) => { this.setState({ term: e }) }}>
- <Select.Option value='0'>有效</Select.Option>
- <Select.Option value='1'>作废</Select.Option>
- </Select>
- <Button type="primary" onClick={this.search} style={{marginLeft:'10px'}}>搜索</Button>
- <Button onClick={this.reset}>重置</Button>
- <span style={{marginLeft:'10px',marginRight:'20px'}}>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
- </div>
- <div className='clearfix' style={{marginTop:'5px'}}>
- <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
- <Input placeholder="订单编号" style={{width:'150px'}}
- value={this.state.orderNumber}
- onChange={(e) => { this.setState({ orderNumber: e.target.value }); }} />
- <Select placeholder="订单部门"
- style={{ width: 150 ,marginRight:'10px',marginLeft:'10px'}}
- value={this.state.departmenttSearch}
- onChange={(e) => { this.setState({ departmenttSearch: e }) }}>
- {
- departmentArr.map(function (item) {
- return <Select.Option key={item.id} >{item.name}</Select.Option>
- })
- }
- </Select>
- <Input placeholder="订单负责人" style={{width:'150px',marginBottom:'10px'}}
- value={this.state.orderLeader}
- onChange={(e) => { this.setState({ orderLeader: e.target.value }); }} />
- </div>
- </div>
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table columns={this.state.columns}
- dataSource={this.state.dataSource}
- rowSelection={rowSelection}
- pagination={this.state.pagination}
- onRowClick={this.tableRowClick}
- />
- </Spin>
- </div>
- <MyBillDetaile
- rowClick={this.state.rowClick}
- userDetaile={this.state.userDetaile}
- datauser={this.state.datauser}
- showDesc={this.state.showDesc}
- closeDesc={this.closeDesc} />
- </div >
- </div>
- );
- }
- }));
- export default MyBill;
|