import React from 'react'; import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,DatePicker} from 'antd'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import '../../userMangagement.less'; import {getOrderType ,getOrderChannel , getOrderState, getProjectState,getPaymentState ,getApprovedState,getTransactionChannel,getTransactionProject } from '../../../../tools.js'; import moment from 'moment'; const MyBillDetaile = Form.create()(React.createClass({ getInitialState() { return { loading: false, visible: false, seeOrderVisible:false }; }, //查看基本详情基本信息 loaduser(record){ if(record){ this.setState({ loading:true }) $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/order/selectBillDetail', data: { billNo: record.billNo }, success: function (data) { let thisData = data.data; if (!thisData) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; thisData = {}; }; this.setState({ orderList:thisData, financialPayNo:thisData.financialPayNo, financialPayTime:thisData.financialPayTime?moment(thisData.financialPayTime,'YYYY-MM-DD HH:mm:ss'):undefined, times:thisData.financialPayTime, remarks:thisData.remarks, billNoId:record.billNo, }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); } }, //保存确认流水 handleSubmit(state){ if(!this.state.times){ if(this.state.selTime==undefined){ message.warning('请选择财务流水时间'); return false; } }; this.setState({ loading: true }); $.ajax({ method: "POST", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/order/updateBill', data: { confirm:state?'1':'0', billNo:this.state.billNoId, orderNo:this.props.datauser.orderNo, financialPayNo:this.state.financialPayNo, financialPayTime:this.state.selTime==undefined?this.state.times:this.state.selTime, remarks:this.state.remarks } }).done(function(data) { this.setState({ loading: false }); if(!data.error.length) { message.success('操作成功!'); this.handleOk() } else { message.warning(data.error[0].message); } }.bind(this)); }, //时间选择 selTime(e,index){ this.setState({ financialPayTime:e, selTime:index }) }, //确认流水 toVoidCancel(){ this.handleSubmit(true) }, handleOk(e) { this.setState({ visible: false, }); this.props.closeDesc(false, true); }, handleCancel(e) { this.setState({ visible: false, }); this.props.closeDesc(false); }, componentWillMount() { }, nextCancel() { this.setState({ addnextVisible: false }) }, //查看订单 seeOrder(){ this.setState({ seeOrderVisible:true }) this.seeOrderList() }, seeOrderCancel(){ this.setState({ seeOrderVisible:false }) }, seeOrderList(){ this.state.lookOrderList=[]; $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/order/getServiceOrderDetail', data: { orderNo: this.props.datauser.orderNo }, success: function (data) { let thisData = data.data; if (!thisData) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; thisData = {}; }; this.setState({ id:thisData.id, lookOrderList:thisData, }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, componentWillReceiveProps(nextProps) { //props改变时触发 this.state.visible = nextProps.showDesc; if(nextProps.userDetaile && nextProps.showDesc ) { this.loaduser(nextProps.datauser); } }, render() { const FormItem = Form.Item const formItemLayout = { labelCol: { span: 8 }, wrapperCol: { span: 14 }, }; const orderDetaiel=this.state.orderList || []; const seeOrderDetaiel=this.state.lookOrderList || []; return(