import React,{Component} from 'react'; import {message, Modal, Tabs} from "antd"; import { cuiJieDian } from '@/dataDic.js' import ProjectOverview from './projectOverview' import {splitUrl} from '@/tools' import CheckProject from "../../../../components/checkProject"; import $ from "jquery"; import OrderItemStatus from "../../../../../common/orderItemStatus"; const { TabPane } = Tabs class DetailsModal extends Component{ constructor(props) { super(props); this.state={ loading: false, activeKey:'1', paySubject: [], orderDtails: {}, containOfficialFees:0,//官费缴费情况 } this.visitCancel = this.visitCancel.bind(this); this.getCsortData = this.getCsortData.bind(this); } async componentDidMount() { if(this.props.tid){ this.waiDetail(); this.thirdTable(this.props.tid); this.getOrderNewDetail(); await this.xiangqing(this.props.tid); await this.getCsortData(this.state.sort) await this.payNodeTable(this.props.tid); } } // 获取csort下的数据 getCsortData(cSort) { return cuiJieDian.map((item) => { if (item.value == cSort) { this.setState({ paySubject: item.children, }) } }) } visitOk(){ this.setState({ oldInfor: {} }); } visitCancel(){ this.setState({ oldInfor: {} }); this.props.visitCancel(); } waiDetail() { let url = window.location.href.substring(7) this.setState({ loading: true, }) $.ajax({ method: 'get', dataType: 'json', crossDomain: false, url: globalConfig.context + '/api/admin/outsourceOrg/orderOutsourceDtails', data: { tid: this.props.tid, orderNo: this.props.orderNo, }, }).done( function (data) { this.setState({ loading: false, }) if (!data.error.length && data.data) { if(data.data.unitNumber){ this.setState({ oldInfor: { companyName:data.data.companyName, unitPrice:data.data.unitPrice, unitNumber:data.data.unitNumber, amount:data.data.amount, outsourceRemarks:data.data.outsourceRemarks, refundStatus: data.data.refundStatus, pictureUrl: data.data.pictureUrl ? splitUrl( data.data.pictureUrl, ',', globalConfig.avatarHost + '/upload', url ) : [], //图片地址 } }) }else{ this.setState({ oldInfor: {} }) } this.setState({ containOfficialFees: data.data.actualOfficial,//官费类型 0实际已缴费 1实际未缴费 orderDtails: data.data, startType: data.data.startType, //类型 mid: data.data.id, outsourceRemarks: data.data.outsourceRemarks, refundStatus: data.data.refundStatus, pictureUrl: data.data.pictureUrl ? splitUrl( data.data.pictureUrl, ',', globalConfig.avatarHost + '/upload', url ) : [], //图片地址 }) } else if (data.error && data.error.length) { message.warning(data.error[0].message) } else if (!data.data) { this.setState({ refundStatus: undefined, }) } }.bind(this) ) } //查看第三方信息表格 thirdTable(id) { this.setState({ loadData: true, }) $.ajax({ method: 'get', dataType: 'json', crossDomain: false, url: globalConfig.context + '/api/admin/company/selectCompany', data: { tid: id, }, success: function (data) { if (data.error && data.error.length) { message.warning(data.error[0].message) } else { let companyNameArr = [] let theArr = [] let thisData = [] let arr = data.data || [] let allTotalAmount = 0 for (let i = 0; i < arr.length; i++) { thisData = arr[i] allTotalAmount = (allTotalAmount * 10000 + thisData.totalAmount * 10000) / 10000 companyNameArr.push(thisData.companyName); thisData.key = i; theArr.push(thisData) } for(let d=0;d { if (item.value == thisData.dunType) { thisData.dunType = item.key } }) payNodeArr.push({ key: i, id: thisData.id, //付款节点Id tid: thisData.tid, companyName: thisData.companyName, //供应商名称 projectType: thisData.projectType, //项目分类 dunType: thisData.dunType, //催款分类 unitPrice: thisData.unitPrice, //单价 quantity: thisData.quantity, //数量 totalAmount: thisData.totalAmount, //总价 partyAmount: thisData.partyAmount, //付款 partyTimes: thisData.partyTimes, //付款时间 cid: thisData.cid, //机构id }) } for(let d=0;d { this.setState({ activeKey: e }) if(e === '1'){ this.waiDetail(); this.thirdTable(this.props.tid); this.payNodeTable(this.props.tid); this.xiangqing(this.props.tid); } }} tabBarExtraContent={
项目名称: {this.props.taskName} 项目编号: {this.props.taskID}
} > {this.state.activeKey === '1' ? { this.waiDetail(); this.thirdTable(this.props.tid); this.payNodeTable(this.props.tid); this.xiangqing(this.props.tid); this.props.refreshList && this.props.refreshList(); }} /> :
} ) } } export default DetailsModal;