import React, { Component } from "react"; import { Form, Upload, Modal, Button, Table, Col, message, Tag, Tooltip } from "antd"; import { splitUrl, getProcessStatus, getjiedian, getLiquidationStatus, getboutique, getCuikuan, getApprovedState, getProjectStatus } from "@/tools.js"; import img from "./img.png" import ResolutionDetail from "@/resolutionDetail"; import ImgList from "../../../../common/imgList"; import { getProjectName } from "../../../../tools"; import { salesList } from "@/dataDic.js"; import ProjectDetailsReadOnly from "../../../../common/projectDetailsReadOnly"; import EnterpriseNameChange from "../../../../common/enterpriseNameChange"; import NewEditProject from "../../../../common/projectOperation/newEditProject"; import OrderCoor from "./orderCoor" import ContentUrl from "../contentUrl"; import FlowChart from '../../../../common/flowchart'; // 流程图 import Gxczx from '../../../../common/orderDetail/gxczx' // 高新纯咨询合同说明详情 import Property from '../../../../common/orderDetail/property' // 知识产权情况 const FormItem = Form.Item; class OrderDetail extends Component { constructor(props) { super(props); this.state = { dataInfor: {}, contentUrl: [], newContactsLists: [ { title: "项目名称", dataIndex: "commodityName", key: "commodityName", render: (text, record) => { return {text + "-" + record.tid}; } }, { title: "项目分类", dataIndex: "projectType", key: "projectType", render: text => { let arr = this.props.dataSourceX || []; let str = ""; for (let i = 0; i < arr.length; i++) { if (this.props.dataSourceX[i].sort == text) { str = this.props.dataSourceX[i].cname; return {str}; } } if (!str) { return 未知; } } }, { title: "催款科目", dataIndex: "dunTypeName", key: "dunTypeName", render: (text, record) => { if (record.customizeName) { return text + record.customizeName; } return {text}; } }, { title: "时间", dataIndex: "waitDay", key: "waitDay", render: (text, record) => { if (record.dunTypeName) { if (record.customizeTimes) { return record.customizeTimes; } return {text}; } } }, { title: "金额(万元)", dataIndex: "money", key: "money", render: (text, record) => { if (record.dunTypeName) { if (record.appropriationRatio) { let percent = Number(record.appropriationRatio * 100).toFixed(2); percent += "%"; return {percent}(拨款比例); } else { return {text}; } } } }, { title: "服务年限", dataIndex: "startDate", key: "startDate", render: (text, record) => { if (record.dunTypeName) { return {text}; } } }, { title: "催款状态", dataIndex: "status", key: "status", render: text => { return {text == 1 ? "已启动" : "未启动"}; } } ], ContactsLists: [ { title: "催款科目", dataIndex: "dunSubject", key: "dunSubject", render: text => { return getjiedian(text); } }, { title: "金额(万元)", dataIndex: "money", key: "money" }, { title: "催款状态", dataIndex: "dunStatus", key: "dunStatus", render: text => { return getCuikuan(text); } } ], resVisible: false, columnsX: [ { title: "业务项目名称", dataIndex: "commodityName", key: "commodityName", render: (text, record) => { return {text}{record.patentTypeName}{"-" + record.id} } }, { title: "项目类别", dataIndex: "cname", key: "cname" }, { title: "项目数量", dataIndex: "commodityQuantity", key: "commodityQuantity", render: (text, record) => { if (record.splitStatus == 1) { return ( {text}{" "} {/* { e.stopPropagation(); this.showRes(record); }} > 已拆 */} ); } else { return text; } } }, { title: "金额(万元)", dataIndex: "commodityPrice", key: "commodityPrice", render: text => { // return this.props.processState === 2 ? "***" : text; return text == null ? "***" : text; } }, { title: "负责人", dataIndex: "contacts", key: "contacts" }, { title: "负责人电话", dataIndex: "contactsMobile", key: "contactsMobile" }, { title: "项目状态", dataIndex: "projectStatus", key: "projectStatus", render: text => { return getProjectName(text); } }, { title: "主要项目", dataIndex: "main", key: "main", width: 50, render: text => { return text ? "是" : "否"; } }, { title: "总年限", dataIndex: "yearSum", key: "yearSum", render: (text, record) => { return (
{["", "一年", "二年", "三年", "四年", "五年"][text]}
); } }, { title: "年限", dataIndex: "serviceLife", key: "serviceLife", render: (text, record) => { return (
{!!text && JSON.parse(text).toString()}
); } }, { title: "本次派单", dataIndex: "serviceYear", key: "serviceYear", render: (text, record) => { return (
{!text ? "" : text}
); } }, { title: "项目说明", dataIndex: "taskComment", key: "taskComment", render: text => { return (
{text}
) } } ], rotateDeg: 0 }; this.tableRowClickX = this.tableRowClickX.bind(this); this.nextCancel = this.nextCancel.bind(this); this.rotate = this.rotate.bind(this); this.downImg = this.downImg.bind(this); this.upImg = this.upImg.bind(this); this.downImgs = this.downImgs.bind(this); this.upImgs = this.upImgs.bind(this); this.showRes = this.showRes.bind(this); this.resCancel = this.resCancel.bind(this); } rotate() { let rotateDeg = this.state.rotateDeg + 90; this.setState({ rotateDeg }); } //项目详情关闭 nextCancel() { this.setState({ visible: false }); } //点击打卡项目详情 tableRowClickX(record) { this.setState({ dataInfor: record, jid: record.id, //项目ID kid: record.commodityId, //商品ID commodityName: record.commodityName, //金额 commodityPrice: record.commodityPrice, //金额 commodityQuantity: record.commodityQuantity, //数量 taskComment: record.taskComment, //备注 main: record.main.toString(), //是否为主要 visible: true, addState: 0 }); } downImg() { const data = this.props.orderData; let num = 0; for ( let i = 0; i < splitUrl( data.contractPictureUrl, ",", globalConfig.avatarHost + "/upload" ).length; i++ ) { if ( splitUrl( data.contractPictureUrl, ",", globalConfig.avatarHost + "/upload" )[i].url == this.state.previewImage ) { num = i; } } if ( num == splitUrl( data.contractPictureUrl, ",", globalConfig.avatarHost + "/upload" ).length - 1 ) { return message.warning("已经是最后一张了哦"); } this.state.previewImage = splitUrl( data.contractPictureUrl, ",", globalConfig.avatarHost + "/upload" )[num + 1].url; this.setState({ previewImage: this.state.previewImage, rotateDeg: 0 }); } upImg() { const data = this.props.orderData; let num = 0; for ( let i = 0; i < splitUrl( data.contractPictureUrl, ",", globalConfig.avatarHost + "/upload" ).length; i++ ) { if ( splitUrl( data.contractPictureUrl, ",", globalConfig.avatarHost + "/upload" )[i].url == this.state.previewImage ) { num = i; } } if (num == 0) { return message.warning("已经是第一张了哦"); } this.state.previewImage = splitUrl( data.contractPictureUrl, ",", globalConfig.avatarHost + "/upload" )[num - 1].url; this.setState({ previewImage: this.state.previewImage, rotateDeg: 0 }); } downImgs() { const data = this.props.orderData; let num = 0; for ( let i = 0; i < splitUrl( data.rep, ",", globalConfig.avatarHost + "/upload" ).length; i++ ) { if ( splitUrl(data.agreementUrl, ",", globalConfig.avatarHost + "/upload")[i] .url == this.state.previewImage ) { num = i; } } if ( num == splitUrl(data.agreementUrl, ",", globalConfig.avatarHost + "/upload") .length - 1 ) { return message.warning("已经是最后一张了哦"); } this.state.previewImage = splitUrl( data.agreementUrl, ",", globalConfig.avatarHost + "/upload" )[num + 1].url; this.setState({ previewImage: this.state.previewImage, rotateDeg: 0 }); } upImgs() { const data = this.props.orderData; let num = 0; for ( let i = 0; i < splitUrl(data.agreementUrl, ",", globalConfig.avatarHost + "/upload") .length; i++ ) { if ( splitUrl(data.agreementUrl, ",", globalConfig.avatarHost + "/upload")[i] .url == this.state.previewImage ) { num = i; } } if (num == 0) { return message.warning("已经是第一张了哦"); } this.state.previewImage = splitUrl( data.agreementUrl, ",", globalConfig.avatarHost + "/upload" )[num - 1].url; this.setState({ previewImage: this.state.previewImage, rotateDeg: 0 }); } // 拆分详细 showRes(record) { this.setState({ resVisible: true, resRecord: record }) } resCancel() { this.setState({ resVisible: false }) } // 可展开颜色不同 addRowColor(record) { if (!!record.splitList && record.splitList.length > 0) { return 'light' } else { return 'dark' } } render() { let domId = this.props.domId; domId = domId ? domId.substr(0, 4) : '' const formItemLayout = { labelCol: { span: 10 }, wrapperCol: { span: 14 } }; const data = this.props.orderData || {}; const propsList = this.props.contactList || []; const expandedRowRenderVip = (e) => { const data = e.splitList; let columns = []; if (data instanceof Array && data.length) { if (e.cSort == 6) { columns = [ { title: "负责人", dataIndex: "receiverName", key: "receiverName", }, { title: "负责人电话", dataIndex: "receiverMobile", key: "receiverMobile", }, { title: "项目状态", dataIndex: "projectStatus", key: "projectStatus", render: (text) => { return getProjectName(text); }, }, { title: "本次派单", dataIndex: "serviceYear", key: "serviceYear", }, { title: "项目说明", dataIndex: "taskComment", key: "taskComment", render: (text) => { return (
{text}
) }, }, ]; } else { columns = [ { title: "子项目名称", dataIndex: "taskName", key: "taskName" }, { title: "子项目数量", dataIndex: "commodityQuantity", key: "commodityQuantity" }, { title: "拆分操作人", dataIndex: "splitAname", key: "splitAname" }, { title: "项目负责人", dataIndex: "receiverName", key: "receiverName" }, { title: "拆分时间", dataIndex: "splitTimes", key: "splitTimes" } ] } return ( ); } else { columns = []; return (

{e.cSort == 6 ? "暂无派单" : "此项目暂未拆分"}

); } }; return (
{this.state.resVisible ? ( ) : ( "" )} {data.orderNo} {data.contractNo} {data.userName} {(["私有客户-", "签单客户-"][data.userType] || " ") + (salesList[data.salesType] || "")} { data.other != null && data.other != "" && {"(" + data.other.toString().slice(0, 10) + (data.other.toString().length > 9 ? "...)" : ")")} } {/* {(["私有客户-", "签单客户-"][data.userType] || " ") + (salesList[data.salesType] || "")} */} {data.signDate} {getProcessStatus(data.processStatus, data.examineName, data.approval)} {getLiquidationStatus(data.liquidationStatus)} {/* {data.contacts} */} {this.props.isCaiWu ? "***" : data.contacts} {/* {data.contactMobile} */} {this.props.isCaiWu ? "***" : data.contactMobile} {this.props.isCaiWu ? "***" : data.legalPerson} {/* {data.legalPersonTel} */} {this.props.isCaiWu ? "***" : data.legalPersonTel} {this.props.processState === 3 ? "***" : data.totalAmount} {this.props.processState === 3 ? "***" : data.firstAmount} {getApprovedState(data.approval)} {this.props.processState === 3 ? "***" : data.settlementAmount} {data.depName} {data.outsource == 0 ? "否" : "是"}

{data.orderRemarks}

{this.props.orderData && data.contractPictureUrl ? :
} {/* 高新纯咨询合同说明详情 */}
{data.salesmanName} {data.salesmanMobile}
{data.nowFinance} {data.nowFinanceMobile}
{data.oldSalesmanName} {data.oldSalesmanMobile}
{data.financeName} {data.financeMobile}
{domId == 'yuan' ? "" : }
项目业务
催款节点 金额总计(万元): {this.props.totalCui}
{this.state.visible && 0 && this.state.processStatus !== 0 } visible={this.state.visible} dataInfor={this.state.dataInfor} onCancel={this.nextCancel} /> // } ); } } export default OrderDetail;