import React from 'react'; import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,AutoComplete} from 'antd'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import '../userMangagement.less'; import {orderType,publishStatus} from '../../../../dataDic.js'; import {getOrderType,getProjectState,getTaskStatus,getPublishStatus,getOrderChannel,getOrderState,getPaymentState,getApprovedState} from '../../../../tools.js'; const MySettlementDetaile = Form.create()(React.createClass({ getInitialState() { return { loading: false, visible: false, //派单 contractList:[ { title: '姓名', dataIndex: 'name', key: 'name' }, { title: '部门', dataIndex: 'depatrment', key: 'depatrment' },{ title: '联系方式', dataIndex: 'mobile', key: 'mobile' },{ title: '是否为主要联系人', dataIndex: 'major', key: 'major', render:(text) => { return text?'是':"否" } }, { title: '职务', dataIndex: 'position', key: 'position' },{ title: '微信', dataIndex: 'wechat', key: 'wechat' },{ title: 'QQ', dataIndex: 'qq', key: 'qq' }, ], }; }, //查看基本详情基本信息 loaduser(record){ if(record){ $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/techproject/getProjectTaskDetail', data: { taskId: record.taskId }, success: function (data) { let thisData = data.data; if (!thisData) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; thisData = {}; }; this.setState({ orderNo:thisData.orderNo, orderList:thisData, uid:thisData.uid, taskId:thisData.taskId, publishStatus:thisData.publishStatus, }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); } }, //查看订单 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.state.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)); }, //点击查看联系人 seeContract(){ this.contract(); this.setState({ seeState:false, orderVisible:true }) }, orderCancel(){ this.setState({ orderVisible:false }) }, //查看联系人 contract(){ $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/customer/findAllContacts', data: { uid: this.state.uid }, success: function (data) { let thisData = data.data; if (!thisData) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; thisData = {}; }; this.setState({ contractArr:thisData, }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, //修改公示状态 changePublishStatus(){ $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/techproject/updatePublishStatus', data: { taskId:this.state.taskId, publishStatus:this.state.publishStatus, }, success: function (data) { let thisData = data.data; if (!thisData) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; thisData = {}; } message.success('修改成功'); }.bind(this), }) }, componentWillMount() { }, componentWillReceiveProps(nextProps) { //props改变时触发 this.state.visible = nextProps.showDesc; if(nextProps.showDesc) { this.loaduser(nextProps.datauser); } }, handleCancel(){ this.setState({ visible:false }) this.props.closeShow(false) }, render() { const FormItem = Form.Item const formItemLayout = { labelCol: { span: 8 }, wrapperCol: { span: 14 }, }; const seeOrderDetaiel=this.state.lookOrderList || []; const orderDetaiel=this.state.orderList || []; return(
{orderDetaiel.buyerName} {orderDetaiel.buyerName&&} {orderDetaiel.salesmanName} {orderDetaiel.orderNo} {/**/} {orderDetaiel.contractNo} {/**/} {orderDetaiel.projectNo} {orderDetaiel.taskNo} {orderDetaiel.commodityName} {getTaskStatus(orderDetaiel.taskStatus)} {orderDetaiel.deletedSign==2?'锁定':'未锁定'} {orderDetaiel.taskStatus==3? :{getPublishStatus(orderDetaiel.publishStatus)} }
{orderDetaiel.taskComment}
{orderDetaiel.taskAllocatorName} {orderDetaiel.taskDistributionTime} {orderDetaiel.taskReceiverName} {orderDetaiel.departmentName}
{orderDetaiel.orderRemarks}
{seeOrderDetaiel.orderNo} {seeOrderDetaiel.createTime} {seeOrderDetaiel.buyerName} {getOrderType(seeOrderDetaiel.orderType)} {getOrderChannel(seeOrderDetaiel.orderChannel)} {getOrderState(seeOrderDetaiel.orderStatus)}
{getApprovedState(seeOrderDetaiel.approval)}
{seeOrderDetaiel.orderRemarks}
{seeOrderDetaiel.salesmanName} {seeOrderDetaiel.createTime} {seeOrderDetaiel.signTime} {seeOrderDetaiel.financeName} {seeOrderDetaiel.technicianName} {seeOrderDetaiel.setUpTime} {getProjectState(seeOrderDetaiel.projectStage)}
{this.state.seeState?
: } ) } })); export default MySettlementDetaile;