import React, { Component } from "react"; import { Form, Upload, Modal, Button, Table, Col, message } from "antd"; import { splitUrl, getProcessStatus, getjiedian, getLiquidationStatus, getboutique, getCuikuan, getApprovedState, getProjectStatus } from "@/tools.js"; import img from "./img.png" const FormItem = Form.Item; class OrderDetail extends Component { constructor(props) { super(props); this.state = { newContactsLists: [ { title: "项目名称", dataIndex: "commodityName", key: "commodityName", render: text => { return {text}; } }, { title: "项目分类", dataIndex: "projectType", key: "projectType", render: text => { let arr = this.state.dataSourceX || []; let str = ""; for (let i = 0; i < arr.length; i++) { if (this.state.dataSourceX[i].sort == text) { str = this.state.dataSourceX[i].cname; return {str}; } } } }, { title: "催款科目", dataIndex: "dunTypeName", key: "dunTypeName", render: text => { return {text}; } }, { title: "时间", dataIndex: "waitDay", key: "waitDay", render: (text, record) => { if (record.dunTypeName) { return {text}; } } }, { title: "金额(万)", dataIndex: "money", key: "money", render: (text, record) => { if (record.dunTypeName) { 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", render: text => { return this.props.processState === 2 ? "***" : text; } }, { title: "催款状态", dataIndex: "dunStatus", key: "dunStatus", render: text => { return getCuikuan(text); } } ], columnsX: [ { title: "业务项目名称", dataIndex: "commodityName", key: "commodityName" }, { title: "项目类别", dataIndex: "cname", key: "cname" }, { title: "项目数量", dataIndex: "commodityQuantity", key: "commodityQuantity" }, { title: "金额(万元)", dataIndex: "commodityPrice", key: "commodityPrice", render: text => { return this.props.processState === 2 ? "***" : text; } }, { title: "负责人", dataIndex: "contacts", key: "contacts" }, { title: "负责人电话", dataIndex: "contactsMobile", key: "contactsMobile" }, { title: "项目状态", dataIndex: "projectStatus", key: "projectStatus", render: text => { return getProjectStatus(text); } }, { title: "主要项目", dataIndex: "main", key: "main", render: text => { return text ? "是" : "否"; } }, { title: "项目说明", dataIndex: "taskComment", key: "taskComment", render: text => { return text && text.length > 8 ? text.substr(0, 8) + "…" : 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); } rotate() { let rotateDeg = this.state.rotateDeg + 90; this.setState({ rotateDeg }); } //项目详情关闭 nextCancel() { this.setState({ visible: false }); } //点击打卡项目详情 tableRowClickX(record) { this.setState({ 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() { console.log(this.props.pictureUrl); 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 }); } render() { const formItemLayout = { labelCol: { span: 8 }, wrapperCol: { span: 14 } }; const data = this.props.orderData; const propsList = this.props.contactList || []; return (
{data.orderRemarks}