changeDetailJsy.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. import React, { Component } from "react";
  2. import { Form, Upload, Modal, Button, message, Select, Input } from "antd";
  3. import AgreeButton from "./agreeButton.js";
  4. import Rizhi from "./rizhi.js";
  5. import { getProcessStatusNew, changeColor } from "@/tools.js";
  6. import {shenghePeo} from "@/tools.js"
  7. import $ from "jquery/src/ajax";
  8. import tongguo from "../../../../../../image/tongguo.png";
  9. import ProAndCuiList from "./proAndCuiList.jsx";
  10. // import ReactToPrint from "react-to-print";
  11. const FormItem = Form.Item;
  12. const { TextArea } = Input;
  13. const formItemLayout = {
  14. labelCol: { span: 8 },
  15. wrapperCol: { span: 14 }
  16. };
  17. const changeType = [
  18. {
  19. value: "0",
  20. key: "退单退款"
  21. },
  22. {
  23. value: "1",
  24. key: "项目及金额变更"
  25. },
  26. {
  27. value: "2",
  28. key: "仅项目变更"
  29. },
  30. {
  31. value: "3",
  32. key: "仅金额变更"
  33. },
  34. {
  35. value: "4",
  36. key: "重报"
  37. },
  38. {
  39. value: "5",
  40. key: "赠送"
  41. }
  42. ];
  43. const getChangeType = function(e) {
  44. if (e || e == 0) {
  45. let str = e.toString();
  46. let theType = "";
  47. changeType.map(function(item) {
  48. if (item.value == str) {
  49. theType = item.key;
  50. }
  51. });
  52. return theType;
  53. }
  54. };
  55. class Itemlist extends Component {
  56. constructor(props) {
  57. super(props);
  58. }
  59. render() {
  60. let pageData = this.props.pageData;
  61. return (
  62. <div className="clearfix">
  63. <Form.Item
  64. label={pageData.labelA}
  65. {...pageData.formItemLayoutA}
  66. className="half-item"
  67. >
  68. <p style={{ width: 500, wordWrap: "break-word" }}>{pageData.dataA}</p>
  69. </Form.Item>
  70. <Form.Item
  71. label={pageData.labelB}
  72. {...pageData.formItemLayoutB}
  73. className="half-item"
  74. >
  75. <span>{pageData.dataB}</span>
  76. </Form.Item>
  77. </div>
  78. );
  79. }
  80. }
  81. class ChangeDetail extends Component {
  82. constructor(props) {
  83. super(props);
  84. this.state = {
  85. previewVisible: false,
  86. buttonStatus: true,
  87. changeType: 1,
  88. dataSource: [],
  89. reason: "",
  90. // 累计回收退票
  91. refundInvoice: 0,
  92. // 退票数组
  93. contactList: [],
  94. rejectState: 0,
  95. // 收款信息
  96. proceedsData: [],
  97. proceedsTotal: this.props.proceedsTotal,
  98. // 开票信息
  99. invoiceData: [],
  100. invoiceTotal: this.props.invoiceTotal,
  101. cost: 10,
  102. refund: 8,
  103. // 测试添加退票
  104. contactList: this.props.contactList,
  105. ContactsLists: [
  106. {
  107. title: "金额(万元)",
  108. dataIndex: "amount",
  109. key: "amount",
  110. render: (text, record) => {
  111. return (
  112. <div>
  113. 实际回收退票(万元)
  114. <Input
  115. value={record.amount}
  116. placeholder="请输入金额(必填项)"
  117. disabled={record.load}
  118. key={record.id}
  119. required="required"
  120. onChange={e => {
  121. record.amount = e.target.value;
  122. this.setState({ contactList: this.state.contactList });
  123. }}
  124. style={{ width: "120px" }}
  125. />
  126. </div>
  127. );
  128. }
  129. },
  130. {
  131. title: "时间",
  132. dataIndex: "createTimes",
  133. key: "createTimes",
  134. render: (text, record) => {
  135. return <div>{record.createTimes}</div>;
  136. }
  137. }
  138. ]
  139. };
  140. this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
  141. this.changeButtonStatus = this.changeButtonStatus.bind(this);
  142. this.moneyOld = this.moneyOld.bind(this);
  143. }
  144. getOrgCodeUrl(e) {
  145. this.setState({
  146. orgCodeUrl: e
  147. });
  148. }
  149. changeButtonStatus() {
  150. this.setState({
  151. buttonStatus: !this.state.buttonStatus
  152. });
  153. }
  154. // loadData() {
  155. // $.ajax({
  156. // method: "get",
  157. // dataType: "json",
  158. // async: false,
  159. // crossDomain: false,
  160. // url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  161. // data: {
  162. // changeId: this.props.data.id
  163. // },
  164. // success: function(data) {
  165. // if (data.error.length || data.data.list == "") {
  166. // if (data.error && data.error.length) {
  167. // message.warning(data.error[0].message);
  168. // }
  169. // } else {
  170. // this.setState({
  171. // dataSource: data.data
  172. // });
  173. // }
  174. // }.bind(this)
  175. // });
  176. // }
  177. moneyOld(str, money) {
  178. if (money) {
  179. return (
  180. <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
  181. {str}(原合同金额{money}万元)
  182. </span>
  183. );
  184. } else {
  185. return (
  186. <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
  187. {str}
  188. </span>
  189. );
  190. }
  191. }
  192. render() {
  193. const pageData = [
  194. {
  195. labelA: "客户名称",
  196. formItemLayoutA: formItemLayout,
  197. dataA: this.props.data.userName,
  198. labelB: "合同编号",
  199. formItemLayoutB: formItemLayout,
  200. dataB: this.props.data.contractNo
  201. },
  202. {
  203. labelA: "时间",
  204. formItemLayoutA: formItemLayout,
  205. dataA: this.props.data.createTimes,
  206. labelB: "发起人",
  207. formItemLayoutB: formItemLayout,
  208. dataB: this.props.data.applicant
  209. },
  210. {
  211. labelA: "当前进度",
  212. formItemLayoutA: formItemLayout,
  213. // 当前是咨询师以及咨询师经理时使用shenhePeo函数,其他流程正常显示
  214. dataA:
  215. this.props.data.processState == 2 || this.props.data.processState == 3
  216. ? shenghePeo(
  217. this.props.data.processState == 2
  218. ? this.props.data.consultantExamine
  219. : this.props.data.managerExamine,
  220. this.props.data.processState
  221. )
  222. : getProcessStatusNew(
  223. this.props.data.processState,
  224. this.props.data.status
  225. ),
  226. labelB: "变更类型",
  227. formItemLayoutB: formItemLayout,
  228. dataB: getChangeType(this.props.data.type)
  229. },
  230. {
  231. labelA: "合同额(万元)",
  232. formItemLayoutA: formItemLayout,
  233. dataA: "***",
  234. labelB: "已收款(万元)",
  235. formItemLayoutB: formItemLayout,
  236. dataB: "***"
  237. },
  238. {
  239. labelA: "欠款(万元)",
  240. formItemLayoutA: formItemLayout,
  241. dataA: "***",
  242. labelB: "申请退款(万元)",
  243. formItemLayoutB: formItemLayout,
  244. dataB: "***"
  245. },
  246. {
  247. labelA: "变更原因",
  248. formItemLayoutA: formItemLayout,
  249. dataA: this.props.data.remarks
  250. }
  251. ];
  252. const planData = [
  253. {
  254. labelA: "项目进度",
  255. formItemLayoutA: formItemLayout,
  256. dataA: this.props.data.projectState,
  257. labelB: "发生成本费用(万元)",
  258. formItemLayoutB: formItemLayout,
  259. dataB: "***"
  260. },
  261. {
  262. labelA: "备注",
  263. formItemLayoutA: formItemLayout,
  264. dataA: this.props.data.zxsRemarks
  265. }
  266. ];
  267. const financeData = [
  268. {
  269. labelA: "收款时间",
  270. formItemLayoutA: formItemLayout,
  271. dataA: this.props.data.paymentTimes,
  272. labelB: "收款金额(万元)",
  273. formItemLayoutB: formItemLayout,
  274. dataB: "***"
  275. },
  276. {
  277. labelA: "开票时间",
  278. formItemLayoutA: formItemLayout,
  279. dataA: this.props.data.invoiceTimes,
  280. labelB: "已开票金额(万元)",
  281. formItemLayoutB: formItemLayout,
  282. dataB: "***"
  283. },
  284. {
  285. labelA: "发生成本(万元)",
  286. formItemLayoutA: formItemLayout,
  287. dataA: "***",
  288. labelB: "应退金额(万元)",
  289. formItemLayoutB: formItemLayout,
  290. dataB: "***"
  291. },
  292. {
  293. labelA: "补充资料/备注",
  294. formItemLayoutA: formItemLayout,
  295. dataA: this.props.data.cwRemarks
  296. }
  297. ];
  298. const buttonData = [
  299. {
  300. name: "同意",
  301. title: "理由",
  302. placeholder: "请输入理由",
  303. type: "primary",
  304. status: 2,
  305. onChange: value => {
  306. this.setState({
  307. remarks: value
  308. });
  309. }
  310. },
  311. {
  312. name: "拒绝",
  313. title: "理由",
  314. placeholder: "请输入理由",
  315. type: "danger",
  316. status: 3,
  317. onChange: value => {
  318. this.setState({
  319. remarks: value
  320. });
  321. }
  322. }
  323. ];
  324. const orgCodeUrl = this.props.pictureUrl;
  325. return (
  326. <div className="clearfix changeDetail">
  327. <div
  328. className="clearfix"
  329. ref={e => {
  330. this.refs = e;
  331. }}
  332. >
  333. <div
  334. style={{
  335. borderRadius: "50%",
  336. width: 300,
  337. height: 300,
  338. position: "absolute",
  339. top: 230,
  340. left: 525,
  341. transform: "rotate(-5deg)",
  342. zIndex: 1,
  343. display:
  344. (this.props.data.processState == 7 ||
  345. this.props.data.processState == 8) &&
  346. this.props.data.status == 4
  347. ? "block"
  348. : "none"
  349. }}
  350. >
  351. {/* <span
  352. style={{
  353. fontSize: 29,
  354. position: "absolute",
  355. left: "50%",
  356. top: "50%",
  357. transform: "translate(-50%,-50%)",
  358. color: "red"
  359. }}
  360. >
  361. 通过
  362. </span> */}
  363. <img src={tongguo} style={{ width: "100%" }} />
  364. </div>
  365. <h2 style={{ textAlign: "center", marginBottom: 10 }}>
  366. 合同变更记录
  367. </h2>
  368. {pageData.map((item, index) => {
  369. return <Itemlist key={index} pageData={item} />;
  370. })}
  371. <Form.Item
  372. label="变更凭证"
  373. labelCol={{ span: 4 }}
  374. wrapperCol={{ span: 18 }}
  375. >
  376. <Upload
  377. className="demandDetailShow-upload"
  378. listType="picture-card"
  379. fileList={orgCodeUrl}
  380. onPreview={file => {
  381. this.setState({
  382. previewImage: file.url || file.thumbUrl,
  383. previewVisible: true
  384. });
  385. }}
  386. />
  387. <Modal
  388. maskClosable={false}
  389. footer={null}
  390. visible={this.state.previewVisible}
  391. onCancel={() => {
  392. this.setState({ previewVisible: false });
  393. }}
  394. >
  395. <img
  396. alt=""
  397. style={{ width: "100%" }}
  398. src={this.state.previewImage || ""}
  399. />
  400. </Modal>
  401. <Rizhi changeId={this.props.data.id} />
  402. </Form.Item>
  403. {/* <ul>
  404. {this.props.data.consultantExamine.map((item, index) => {
  405. return (
  406. <li>
  407. )
  408. })}
  409. </ul> */}
  410. {/* <h2 style={{ textAlign: "center", marginBottom: 0 }}>变更日志</h2> */}
  411. <ul
  412. style={{
  413. width: "868px",
  414. overflow: "hidden",
  415. paddingLeft: "90px",
  416. position: "relative",
  417. bottom: "0px"
  418. }}
  419. >
  420. {/* <span>操作人:</span> */}
  421. {this.props.dataSource.map((item, index) => {
  422. if (item.status == 0) {
  423. item.status = "发起";
  424. } else if (item.status == 1) {
  425. item.status = "审核中";
  426. } else if (item.status == 2) {
  427. item.status = "通过";
  428. } else if (item.status == 3) {
  429. item.status = "驳回";
  430. } else if (item.status == 4) {
  431. item.status = "完成";
  432. }
  433. return (
  434. <li
  435. key={index}
  436. style={{
  437. width: "100%",
  438. height: "auto",
  439. wordBreak: "break-all",
  440. marginBottom: "10px"
  441. }}
  442. >
  443. {item.aname + ":" + "(" + item.status + ")" + item.remarks}
  444. </li>
  445. );
  446. })}
  447. </ul>
  448. <ProAndCuiList id={this.props.id} isZxs={true} />
  449. {/* {this.props.data.processState >= 3 ? (
  450. <div>
  451. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  452. 当前项目进度(咨询师填写)
  453. </h3>
  454. {planData.map((item, index) => {
  455. return <Itemlist key={index} pageData={item} />;
  456. })}
  457. </div>
  458. ) : (
  459. ""
  460. )} */}
  461. {/* {this.props.data.processState >= 5 ? (
  462. <div>
  463. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  464. 当前财务状态(财务填写)
  465. </h3>
  466. {financeData.map((item, index) => {
  467. return <Itemlist key={index} pageData={item} />;
  468. })}
  469. </div>
  470. ) : (
  471. ""
  472. )} */}
  473. </div>
  474. {this.props.processState === this.props.data.processState ? (
  475. <div
  476. style={{
  477. display: this.props.data.isExamine == 0 ? "block" : "none"
  478. }}
  479. >
  480. <div className="clearfix" style={{ marginBottom: "10px" }}>
  481. <FormItem
  482. style={{ height: "auto" }}
  483. labelCol={{ span: 4 }}
  484. wrapperCol={{ span: 18 }}
  485. label="备注"
  486. >
  487. <TextArea
  488. rows={4}
  489. placeholder="请输入备注信息"
  490. style={{ width: "95%" }}
  491. value={this.state.reason}
  492. onChange={e => {
  493. let reason = e.target.value;
  494. this.setState({ reason });
  495. }}
  496. />
  497. </FormItem>
  498. </div>
  499. <div
  500. className="clearfix"
  501. style={{ display: "flex", justifyContent: "space-around" }}
  502. >
  503. {buttonData.map((item, index) => {
  504. return (
  505. <AgreeButton
  506. data={item}
  507. key={index}
  508. backData={this.props.data}
  509. processState={this.props.processState}
  510. visible={this.changeButtonStatus}
  511. ajaxData={this.state}
  512. loadData={this.props.loadData}
  513. rejectState={this.state.rejectState}
  514. reason={this.state.reason}
  515. onCancel={this.props.onCancel}
  516. />
  517. );
  518. })}
  519. </div>
  520. <Select
  521. defaultValue="0"
  522. style={{
  523. width: 120,
  524. float: "left",
  525. position: "relative",
  526. bottom: "28px",
  527. right: "-600px"
  528. }}
  529. onChange={val => {
  530. this.setState({ rejectState: val });
  531. }}
  532. >
  533. <Option
  534. value="0"
  535. style={{
  536. display: this.props.processState >= 1 ? "block" : "none"
  537. }}
  538. >
  539. 营销员
  540. </Option>
  541. <Option
  542. value="1"
  543. style={{
  544. display: this.props.processState >= 2 ? "block" : "none"
  545. }}
  546. >
  547. 营销管理员
  548. </Option>
  549. <Option
  550. value="2"
  551. style={{
  552. display: this.props.processState >= 3 ? "block" : "none"
  553. }}
  554. >
  555. 咨询师
  556. </Option>
  557. <Option
  558. value="3"
  559. style={{
  560. display: this.props.processState >= 4 ? "block" : "none"
  561. }}
  562. >
  563. 咨询师经理
  564. </Option>
  565. <Option
  566. value="4"
  567. style={{
  568. display: this.props.processState >= 5 ? "block" : "none"
  569. }}
  570. >
  571. 咨询师总监
  572. </Option>
  573. <Option
  574. value="5"
  575. style={{
  576. display: this.props.processState >= 6 ? "block" : "none"
  577. }}
  578. >
  579. 财务专员(退单)
  580. </Option>
  581. <Option
  582. value="6"
  583. style={{
  584. display: this.props.processState >= 7 ? "block" : "none"
  585. }}
  586. >
  587. 财务总监
  588. </Option>
  589. <Option
  590. value="7"
  591. style={{
  592. display: this.props.processState >= 8 ? "block" : "none"
  593. }}
  594. >
  595. 总裁
  596. </Option>
  597. </Select>
  598. </div>
  599. ) : (
  600. ""
  601. )}
  602. {/* <ReactToPrint
  603. trigger={() => (
  604. <div className="clearfix">
  605. <Button type="primary" style={{ float: "right", marginTop: 10 }}>
  606. 打印
  607. </Button>
  608. </div>
  609. )}
  610. content={() => this.refs}
  611. /> */}
  612. </div>
  613. );
  614. }
  615. }
  616. export { ChangeDetail };