import React, { Component } from "react"; import { Form, Tooltip, Modal, Button, message, Table, Input, Popconfirm } from "antd"; import AgreeButton from "./agreeButton.js"; import Rizhi from "./rizhi.js"; import { getProcessStatusNew, changeColor } from "@/tools.js"; import { shenghePeo } from "@/tools.js"; import { typeList } from '@/dataDic.js' import $ from "jquery/src/ajax"; import tongguo from "../../../../../../image/tongguo.png"; import quxiao from "../../../../../../image/quxiao.png"; import ProAndCuiList from "./proAndCuiList.jsx"; import Refund from "./refund.js" import PicturesWall from "./picturesWall"; import ReactToPrint from "react-to-print"; import ImgList from "../../../../common/imgList"; import EnterpriseNameChange from "../../../../common/enterpriseNameChange"; import FlowChart from '../../../../common/flowchart'; // 流程图 const formItemLayout = { labelCol: { span: 8 }, wrapperCol: { span: 14 } }; const getChangeType = function (e) { if (e || e == 0) { let str = e.toString(); let theType = ""; typeList.map(function (item) { if (item.value == str) { theType = item.key; } }); return theType; } }; class Itemlist extends Component { constructor(props) { super(props); } render() { let pageData = this.props.pageData; return (
{pageData.labelA === '变更原因' ?
{pageData.dataA}
:
{pageData.dataA} {pageData.labelA === '客户名称' ? : null } {pageData.labelA === '当前进度' && }
} {pageData.dataB}
); } } class ChangeDetail extends Component { constructor(props) { super(props); this.state = { rotateDeg: 0, voucherUrl: [], previewVisible: false, dataSource: [], // 累计回收退票 refundInvoice: 0, // 退票数组 contactList: [], rejectState: 0, // 收款信息 proceedsData: [], proceedsTotal: this.props.proceedsTotal, // 开票信息 invoiceData: [], invoiceTotal: this.props.invoiceTotal, cost: 10, refund: 8, // 测试添加退票 contactList: this.props.contactList, ContactsLists: [ { title: "金额(万元)", dataIndex: "amount", key: "amount", render: (text, record) => { return (
实际回收退票(万元) { record.amount = e.target.value; this.setState({ contactList: this.state.contactList }); }} style={{ width: "120px" }} />
); } }, { title: "时间", dataIndex: "createTimes", key: "createTimes", render: (text, record) => { return
{record.createTimes}
; } } ] }; this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this); this.downImg = this.downImg.bind(this); this.upImg = this.upImg.bind(this); this.rotate = this.rotate.bind(this); this.moneyOld = this.moneyOld.bind(this); this.getVoucherUrl = this.getVoucherUrl.bind(this); this.OrderChange = this.OrderChange.bind(this) } getOrgCodeUrl(e) { this.setState({ orgCodeUrl: e }); } componentDidMount() { } // loadData() { // $.ajax({ // method: "get", // dataType: "json", // async: false, // crossDomain: false, // url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList", // data: { // changeId: this.props.data.id // }, // success: function(data) { // if (data.error.length || data.data.list == "") { // if (data.error && data.error.length) { // message.warning(data.error[0].message); // } // } else { // this.setState({ // dataSource: data.data // }); // } // }.bind(this) // }); // } componentWillReceiveProps(nextProps) { this.setState({ paymentTimes: nextProps.data.paymentTimes, paymentAmount: nextProps.data.paymentAmount, invoiceTimes: nextProps.data.invoiceTimes, invoiceAmount: nextProps.data.invoiceAmount, cwCost: nextProps.data.cwCost, refundableAmount: nextProps.data.refundableAmount, cwRemarks: nextProps.data.cwRemarks, contactList: nextProps.contactList, refundInvoice: nextProps.data.refundInvoice }); } getVoucherUrl(e) { this.setState({ voucherUrl: e }); let url = "" e.forEach((item, index) => { if (item.response && item.response.data) { if (index < e.length - 1) { url += item.response.data + "," } else { url += item.response.data } } }) this.setState({ refundUrl: url }) // console.log(this.state.refundUrl); } downImg() { let num = 0; for (let i = 0; i < this.props.pictureUrl.length; i++) { if (this.props.pictureUrl[i].url == this.state.previewImage) { num = i; } } if (num == this.props.pictureUrl.length - 1) { return message.warning("已经是最后一张了哦"); } this.state.previewImage = this.props.pictureUrl[num + 1].url; this.setState({ previewImage: this.state.previewImage, rotateDeg: 0 }); } upImg() { let num = 0; for (let i = 0; i < this.props.pictureUrl.length; i++) { if (this.props.pictureUrl[i].url == this.state.previewImage) { num = i; } } if (num == 0) { return message.warning("已经是第一张了哦"); } this.state.previewImage = this.props.pictureUrl[num - 1].url; this.setState({ previewImage: this.state.previewImage, rotateDeg: 0 }); } rotate() { let rotateDeg = this.state.rotateDeg + 90; this.setState({ rotateDeg }); } moneyOld(str, money) { if (money) { return ( {str}(原合同金额{money}万元) ); } else { return ( {str} ); } } OrderChange() { if (!this.state.refundUrl) { message.info("请上传凭证") return } this.setState({ loading: true }) $.ajax({ url: globalConfig.context + "/api/admin/orderChange/completeOrderChange", method: "get", data: { orderNo: this.props.data.orderNo, type: this.props.data.type, id: this.props.id, attachmentUrl: this.state.refundUrl, }, success: data => { if (data.data) { message.success("提交成功!"); // window.location.reload(); this.setState({ loading: false }) this.props.visitCancel() } else if (data.error && data.error.length) { message.warning(data.error[0].message) this.setState({ loading: false }); } } }); } render() { // const loadData = [ // { // labelA: "", // formItemLayoutA: formItemLayout, // dataA // } // ]; const pageData = [ { labelA: "客户名称", formItemLayoutA: formItemLayout, dataA: this.props.data.userName, labelB: "合同编号", formItemLayoutB: formItemLayout, dataB: this.props.data.contractNo }, { labelA: "时间", formItemLayoutA: formItemLayout, dataA: this.props.data.createTimes, labelB: "发起人", formItemLayoutB: formItemLayout, dataB: this.props.data.applicant }, { labelA: "当前进度", formItemLayoutA: formItemLayout, // 当前是咨询师以及咨询师经理时使用shenhePeo函数,其他流程正常显示 dataA: this.props.data.processState == 3 || this.props.data.processState == 4 ? shenghePeo(this.props.data.examineName, this.props.data.processState) : getProcessStatusNew( this.props.data.examineName, this.props.data.processState, this.props.data.status ), labelB: "变更类型", formItemLayoutB: formItemLayout, dataB: getChangeType(this.props.data.type) }, { labelA: this.props.data.type == 0 ? "企业总经理姓名" : "", formItemLayoutA: formItemLayout, dataA: this.props.data.managerContacts, labelB: "企业总经理联系电话", formItemLayoutB: formItemLayout, dataB: this.props.data.managerContactMobile, }, { labelA: this.props.data.type == 0 ? "企业联系人姓名" : "", formItemLayoutA: formItemLayout, dataA: this.props.data.contacts, labelB: "企业联系人联系方式", formItemLayoutB: formItemLayout, dataB: this.props.data.contactMobile, }, { labelA: "合同额(万元)", formItemLayoutA: formItemLayout, dataA: this.moneyOld(this.props.data.totalAmount, this.props.money), labelB: "已收款(万元)", formItemLayoutB: formItemLayout, dataB: changeColor(this.props.data.settlementAmount) }, { labelA: "欠款(万元)", formItemLayoutA: formItemLayout, dataA: changeColor(this.props.data.arrears), labelB: "申请退款(万元)", formItemLayoutB: formItemLayout, dataB: changeColor(this.props.data.changeAmount) }, { labelA: "首付款(万元)", formItemLayoutA: formItemLayout, dataA: changeColor(this.props.data.firstAmount), }, { labelA: "变更原因", formItemLayoutA: formItemLayout, dataA: this.props.data.remarks } ]; const planData = [ { labelA: "项目进度", formItemLayoutA: formItemLayout, dataA: this.props.data.projectState, labelB: "发生成本费用(万元)", formItemLayoutB: formItemLayout, dataB: this.props.data.zxsCost }, { labelA: "备注", formItemLayoutA: formItemLayout, dataA: this.props.data.zxsRemarks } ]; const financeData = [ { labelA: "发生直接成本(万元)", formItemLayoutA: formItemLayout, dataA: this.props.data.cwCost, labelB: "发生间接成本(万元)", formItemLayoutB: formItemLayout, dataB: this.props.data.cwIndirectCost }, { labelA: "应退金额(万元)", formItemLayoutA: formItemLayout, dataA: this.props.data.refundableAmount } ]; const buttonData = [ { name: "同意", title: "理由", placeholder: "请输入理由", type: "primary", status: 2, onChange: value => { this.setState({ remarks: value }); } }, { name: "拒绝", title: "理由", placeholder: "请输入理由", type: "danger", status: 3, onChange: value => { this.setState({ remarks: value }); } } ]; const orgCodeUrl = this.props.pictureUrl; const attachment = this.props.attachment return (
{ this.refs = e; }} >
{/* 通过 */}

合同变更记录

{pageData.map((item, index) => { return !!item.labelA && ; })} {orgCodeUrl ?
:
}
{/* {this.props.data.type === 0 && this.props.data.processState >= 2 ? (

当前项目进度(咨询师经理填写)

{planData.map((item, index) => { return ; })}
) : ( "" )} */} {/*

变更日志

*/} { this.props.contractPictureUrl && this.props.contractPictureUrl.length != 0 &&
}
    {/* 操作人: */} {this.props.dataSource.map((item, index) => { if (item.status == 0) { item.status = "发起"; } else if (item.status == 1) { item.status = "审核中"; } else if (item.status == 2) { item.status = "通过"; } else if (item.status == 3) { item.status = "驳回"; } else if (item.status == 4) { item.status = "完成"; } else if (item.status == 5) { item.status = "撤销"; } return (
  • {item.aname + ":" + "【" + item.status + "】" + item.remarks + "(" + item.createTimes + ")"}
  • ); })}
{/* 收款情况1 */}

收款情况

    {(this.props.proceedsData.bill || []).map((item, index) => (
  • {item.payTime + " " + item.aName + " 收款:" + item.transactionAmount + "万元"}
  • ))}
收款总计:{this.props.proceedsTotal}万元

    {(this.props.proceedsData.invoice || []).map((item, index) => (
  • {item.createTime + " " + " 开票:" + item.amount + "万元"}
  • ))}
开票总计:{this.props.invoiceTotal}万元

系统预估 产生成本(万元): {this.props.data.estimateCost ? this.props.data.estimateCost : "0"}{" "}  应退金额(万元): {this.props.data.estimateRefundable ? this.props.data.estimateRefundable : "0"}

{/* {this.props.data.type === 0 ? (

当前项目进度(咨询师经理填写)

{planData.map((item, index) => { return ; })}
) : ( "" )} */} {/* 当前财务状态 */}
6 ? "block" : "none", marginTop: '10px' }} >

当前财务状态(财务填写)

{financeData.map((item, index) => { return ; })}
{/* 回收退票3 */}

回收退票

{/* 完成审核,上传附件 */}

完成审核,上传附件{" "} (注:由营销员上传变更后附件,全变更流程完成。)

{attachment.length > 0 ? : '无附件'}
{ this.setState({ uploadVisible: false, rotateDeg: 0 }, () => { // this.reset(); }); }} > {/* */}
{/*
营销员变更
*/} {/* 完成审核,上传附件 */}

完成审核,上传附件{" "} (注:由营销员上传变更后附件,全变更流程完成。)

变更附件:

{/*
    备注 {this.state.dataSource.map((item, index) => (
  • {item.remarks}
  • ))}
*/} {/* {this.props.data.type === 0 ? ( this.props.data.processState >= 5 ? (

当前财务状态(财务填写)

{financeData.map((item, index) => { return ; })}
) : ( "" ) ) : this.props.data.status === 4 ? (

当前财务状态(财务填写)

{financeData.map((item, index) => { return ; })}
) : ( "" )} */}
{this.props.processState === this.props.data.processState && this.props.data.status != 5 ? (
{buttonData.map((item, index) => { return ( ); })}
) : ( "" )} ( )} content={() => this.refs} /> ); } } export { ChangeDetail };