changeDetailCwzy.js 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029
  1. import React, { Component } from "react";
  2. import {
  3. Form,
  4. Upload,
  5. Modal,
  6. Input,
  7. DatePicker,
  8. Button,
  9. message,
  10. Select,
  11. Table,
  12. Popconfirm,
  13. Spin
  14. } from "antd";
  15. import AgreeButton from "./agreeButton.js";
  16. import Rizhi from "./rizhi.js";
  17. import PicturesWall from "./picturesWall";
  18. import moment from "moment";
  19. import { getProcessStatusNew, moneyVerify } from "@/tools.js";
  20. import { shenghePeo, changeColor } from "@/tools.js";
  21. import { typeList } from '@/dataDic.js'
  22. import $ from "jquery/src/ajax";
  23. import ReactToPrint from "react-to-print";
  24. import tongguo from "../../../../../../image/tongguo.png";
  25. import quxiao from "../../../../../../image/quxiao.png";
  26. import ProAndCuiList from "./proAndCuiList.jsx";
  27. import Refund from "./refund.js"
  28. import "./xButton.less"
  29. import ImgList from "../../../../common/imgList";
  30. const { RangePicker } = DatePicker;
  31. const { TextArea } = Input;
  32. const FormItem = Form.Item;
  33. const formItemLayout = {
  34. labelCol: { span: 8 },
  35. wrapperCol: { span: 14 }
  36. };
  37. const formItemLayoutRefund = {
  38. labelCol: { span: 5 },
  39. wrapperCol: { span: 11 }
  40. };
  41. const getChangeType = function (e) {
  42. if (e || e == 0) {
  43. let str = e.toString();
  44. let theType = "";
  45. typeList.map(function (item) {
  46. if (item.value == str) {
  47. theType = item.key;
  48. }
  49. });
  50. return theType;
  51. }
  52. };
  53. class Itemlist extends Component {
  54. constructor(props) {
  55. super(props);
  56. }
  57. render() {
  58. let pageData = this.props.pageData;
  59. return (
  60. <div className="clearfix">
  61. <Form.Item
  62. label={pageData.labelA}
  63. {...pageData.formItemLayoutA}
  64. className="half-item"
  65. >
  66. <p style={{ width: 350, wordWrap: "break-word" }}>{pageData.dataA}</p>
  67. </Form.Item>
  68. <Form.Item
  69. label={pageData.labelB}
  70. {...pageData.formItemLayoutB}
  71. className="half-item"
  72. >
  73. <span>{pageData.dataB}</span>
  74. </Form.Item>
  75. </div>
  76. );
  77. }
  78. }
  79. class ItemInput extends Component {
  80. constructor(props) {
  81. super(props);
  82. this.state = {
  83. valueA: "",
  84. valueB: ""
  85. };
  86. }
  87. componentWillReceiveProps(nextProps) {
  88. if (!nextProps.reset) {
  89. this.reset();
  90. }
  91. }
  92. reset() {
  93. this.setState({
  94. valueA: "",
  95. valueB: ""
  96. });
  97. }
  98. render() {
  99. let pageData = this.props.pageData;
  100. return (
  101. <div className="clearfix">
  102. <Form.Item
  103. label={pageData.labelA}
  104. {...pageData.formItemLayoutA}
  105. className="half-item"
  106. >
  107. <Input
  108. value={this.state.valueA}
  109. placeholder={"请输入" + pageData.labelA}
  110. style={{ width: 160 }}
  111. onChange={e => {
  112. this.setState({ valueA: e.target.value });
  113. pageData.onChangeA(e.target.value);
  114. }}
  115. />
  116. </Form.Item>
  117. <Form.Item
  118. label={pageData.labelB}
  119. {...pageData.formItemLayoutB}
  120. className="half-item"
  121. >
  122. {pageData.mark ? (
  123. <Input
  124. value={this.state.valueB}
  125. placeholder={"请输入" + pageData.labelB}
  126. style={{ width: 160 }}
  127. onChange={e => {
  128. this.setState({ valueB: e.target.value });
  129. pageData.onChangeB(e.target.value);
  130. }}
  131. />
  132. ) : (
  133. ""
  134. )}
  135. </Form.Item>
  136. </div>
  137. );
  138. }
  139. }
  140. class ChangeDetail extends Component {
  141. constructor(props) {
  142. super(props);
  143. this.state = {
  144. rotateDeg: 0,
  145. rotateDeg1: 0,
  146. previewVisible: false,
  147. uploadVisible: false,
  148. buttonStatus: true,
  149. changeType: 2,
  150. dataSource: [],
  151. voucherUrl: [],
  152. loading: false,
  153. reason: "",
  154. // 累计回收退票
  155. refundInvoice: 0,
  156. // 退票数组
  157. contactList: [],
  158. // 退款数据
  159. refundDataSource: [],
  160. rejectState: 0,
  161. // 收款信息
  162. proceedsData: [],
  163. proceedsTotal: this.props.proceedsTotal,
  164. // 开票信息
  165. invoiceData: [],
  166. invoiceTotal: this.props.invoiceTotal,
  167. cost: 10,
  168. refund: 8,
  169. // 测试添加退票
  170. contactList: this.props.contactList,
  171. // 退款
  172. refundColumn: [
  173. {
  174. title: "退款金额(万元)",
  175. dataIndex: "refundAmount",
  176. key: "refundAmount",
  177. },
  178. {
  179. title: "退款时间",
  180. dataIndex: "refundDate",
  181. key: "refundDate"
  182. },
  183. {
  184. title: "备注",
  185. dataIndex: "remarks",
  186. key: "remarks"
  187. },
  188. {
  189. title: "操作",
  190. dataIndex: "delete",
  191. key: "delete",
  192. render: (text, record) => {
  193. return (
  194. <Popconfirm
  195. title="是否删除?"
  196. onConfirm={() => {
  197. this.deleteRefund(record)
  198. }}
  199. okText="删除"
  200. cancelText="不删除"
  201. >
  202. <Button
  203. style={{ display: !this.props.refundStatus ? "block" : "none" }}
  204. type="danger">
  205. 删除
  206. </Button>
  207. </Popconfirm>
  208. )
  209. }
  210. }
  211. ],
  212. ContactsLists: [
  213. {
  214. title: "金额(万元)",
  215. dataIndex: "amount",
  216. key: "amount",
  217. render: (text, record) => {
  218. return (
  219. <div>
  220. 实际回收退票(万元)
  221. <Input
  222. value={record.amount}
  223. placeholder="请输入金额(必填项)"
  224. disabled={record.load}
  225. key={record.id}
  226. required="required"
  227. onChange={e => {
  228. record.amount = e.target.value;
  229. this.setState({ contactList: this.state.contactList });
  230. }}
  231. style={{ width: "120px" }}
  232. />
  233. </div>
  234. );
  235. }
  236. },
  237. {
  238. title: "时间",
  239. dataIndex: "createTimes",
  240. key: "createTimes",
  241. render: (text, record) => {
  242. return (
  243. <div>
  244. {/* <DatePicker
  245. showTime
  246. placeholder="请输入退票时间"
  247. onChange={v => {
  248. record.time = v._d;
  249. this.setState({ contactList: this.state.contactList });
  250. }}
  251. onOk={v => {
  252. record.time = v._d;
  253. this.setState({ contactList: this.state.contactList });
  254. console.log(this.state);
  255. }}
  256. /> */}
  257. {record.createTimes}
  258. </div>
  259. );
  260. }
  261. },
  262. {
  263. title: "操作",
  264. dataIndex: "dels",
  265. key: "dels",
  266. render: (text, record, index) => {
  267. return (
  268. <div
  269. style={{
  270. display:
  271. (this.props.data.processState == 7 ||
  272. this.props.data.processState == 8) &&
  273. this.props.data.status == 4 || this.props.data.status == 6
  274. ? "none"
  275. : "block"
  276. }}
  277. >
  278. <Popconfirm
  279. title="是否删除?"
  280. onConfirm={() => {
  281. this.confirmDelet(record);
  282. }}
  283. okText="删除"
  284. cancelText="不删除"
  285. >
  286. <Button
  287. style={{
  288. marginRight: "10px",
  289. color: "#ffffff",
  290. background: "#f00",
  291. border: "none",
  292. }}
  293. >
  294. 删除
  295. </Button>
  296. </Popconfirm>
  297. {record.load != true ? (
  298. <Button
  299. type="primary"
  300. onClick={() => {
  301. this.contactSave(record);
  302. }}
  303. >
  304. 保存
  305. </Button>
  306. ) : (
  307. ""
  308. )}
  309. </div>
  310. );
  311. }
  312. }
  313. ]
  314. };
  315. this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
  316. this.changeButtonStatus = this.changeButtonStatus.bind(this);
  317. this.reset = this.reset.bind(this);
  318. this.addcontact = this.addcontact.bind(this);
  319. this.contactSave = this.contactSave.bind(this);
  320. this.confirmDelet = this.confirmDelet.bind(this);
  321. this.finish = this.finish.bind(this);
  322. this.reload = this.reLoad.bind(this);
  323. this.downImg = this.downImg.bind(this);
  324. this.upImg = this.upImg.bind(this);
  325. this.downImg1 = this.downImg1.bind(this);
  326. this.upImg1 = this.upImg1.bind(this);
  327. this.rotate = this.rotate.bind(this);
  328. this.rotate1 = this.rotate1.bind(this);
  329. this.moneyOld = this.moneyOld.bind(this);
  330. this.addRefund = this.addRefund.bind(this);
  331. this.refundCancel = this.refundCancel.bind(this);
  332. this.sumitRefund = this.sumitRefund.bind(this);
  333. this.getVoucherUrl = this.getVoucherUrl.bind(this);
  334. this.refundGetList = this.refundGetList.bind(this);
  335. this.deleteRefund = this.deleteRefund.bind(this);
  336. this.refundExecute = this.refundExecute.bind(this);
  337. }
  338. componentWillReceiveProps(nextProps) {
  339. this.setState({
  340. paymentTimes: nextProps.data.paymentTimes,
  341. paymentAmount: nextProps.data.paymentAmount,
  342. invoiceTimes: nextProps.data.invoiceTimes,
  343. invoiceAmount: nextProps.data.invoiceAmount,
  344. cwCost: nextProps.data.cwCost,
  345. refundableAmount: nextProps.data.refundableAmount,
  346. cwRemarks: nextProps.data.cwRemarks,
  347. contactList: nextProps.contactList,
  348. refundInvoice: nextProps.data.refundInvoice
  349. });
  350. if (!nextProps.reset) {
  351. this.reset();
  352. }
  353. }
  354. refundExecute() {
  355. this.setState({
  356. loading: true
  357. });
  358. $.ajax({
  359. method: "post",
  360. dataType: "json",
  361. crossDomain: false,
  362. url: globalConfig.context + "/api/admin/orderChange/pushRefund",
  363. data: {
  364. id: this.props.id,
  365. refundUrl: this.state.refundUrl
  366. },
  367. success: function (data) {
  368. let theArr = [];
  369. if (data.error && data.error.length) {
  370. message.warning(data.error[0].message);
  371. } else {
  372. message.success("提交退款成功!")
  373. this.refundGetList()
  374. this.props.onCancel()
  375. }
  376. }.bind(this)
  377. }).always(
  378. function () {
  379. this.setState({
  380. loading: false
  381. });
  382. }.bind(this)
  383. );
  384. }
  385. deleteRefund(record) {
  386. this.setState({
  387. loading: true
  388. });
  389. $.ajax({
  390. method: "post",
  391. dataType: "json",
  392. crossDomain: false,
  393. url: globalConfig.context + "/api/admin/orderChange/deleteRefund",
  394. data: {
  395. id: record.id
  396. },
  397. success: function (data) {
  398. let theArr = [];
  399. if (data.error && data.error.length) {
  400. message.warning(data.error[0].message);
  401. } else {
  402. message.success("删除成功!")
  403. this.refundGetList()
  404. }
  405. }.bind(this)
  406. }).always(
  407. function () {
  408. this.setState({
  409. loading: false
  410. });
  411. }.bind(this)
  412. );
  413. }
  414. sumitRefund() {
  415. if (this.state.refundMoney == "" || this.state.refundMoney == undefined) {
  416. message.warning("请填写正确退款金额")
  417. return
  418. } else if (this.state.refundRemarks == "" || this.state.refundRemarks == undefined) {
  419. message.warning("请填写备注")
  420. return
  421. } else if (this.state.refundDate == "" || this.state.refundDate == undefined) {
  422. message.warning("请选择退款时间")
  423. return
  424. }
  425. this.setState({
  426. loading: true
  427. });
  428. $.ajax({
  429. method: "post",
  430. dataType: "json",
  431. crossDomain: false,
  432. url: globalConfig.context + "/api/admin/orderChange/addRefund",
  433. data: {
  434. refundAmount: this.state.refundMoney,
  435. refundDate: this.state.refundDate,
  436. remarks: this.state.refundRemarks,
  437. orderNo: this.props.data.orderNo,
  438. cid: this.props.id,
  439. },
  440. success: function (data) {
  441. let theArr = [];
  442. if (data.error && data.error.length) {
  443. message.warning(data.error[0].message);
  444. } else {
  445. message.success("添加成功!")
  446. this.refundGetList()
  447. this.setState({
  448. addRefundVisible: false
  449. })
  450. }
  451. }.bind(this)
  452. }).always(
  453. function () {
  454. this.setState({
  455. loading: false
  456. });
  457. }.bind(this)
  458. );
  459. }
  460. refundGetList() {
  461. this.setState({
  462. loading: true
  463. });
  464. $.ajax({
  465. method: "get",
  466. dataType: "json",
  467. crossDomain: false,
  468. url: globalConfig.context + "/api/admin/orderChange/listRefund",
  469. data: {
  470. id: this.props.id
  471. },
  472. success: function (data) {
  473. let theArr = [];
  474. if (data.error && data.error.length) {
  475. message.warning(data.error[0].message);
  476. } else {
  477. this.setState({
  478. refundDataSource: data.data
  479. })
  480. }
  481. }.bind(this)
  482. }).always(
  483. function () {
  484. this.setState({
  485. loading: false
  486. });
  487. }.bind(this)
  488. );
  489. }
  490. moneyOld(str, money) {
  491. if (money) {
  492. return (
  493. <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
  494. {str}(原合同金额{money}万元)
  495. </span>
  496. );
  497. } else {
  498. return (
  499. <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
  500. {str}
  501. </span>
  502. );
  503. }
  504. }
  505. componentDidMount() {
  506. window.setTimeout(() => {
  507. const contactList = this.props.contactList;
  508. contactList.forEach(item => {
  509. item.load = true;
  510. });
  511. this.setState({
  512. contactList
  513. });
  514. }, 0);
  515. this.refundGetList()
  516. }
  517. addRefund() {
  518. this.setState({
  519. addRefundVisible: true,
  520. refundMoney: undefined,
  521. refundDate: undefined,
  522. refundRemarks: undefined,
  523. })
  524. }
  525. refundCancel() {
  526. this.setState({
  527. addRefundVisible: false,
  528. refundMoney: undefined,
  529. refundDate: undefined,
  530. refundRemarks: undefined,
  531. })
  532. }
  533. getVoucherUrl(e) {
  534. this.setState({
  535. voucherUrl: e
  536. });
  537. let url = ""
  538. e.forEach((item, index) => {
  539. if (item.response && item.response.data) {
  540. if (index < e.length - 1) {
  541. url += item.response.data + ","
  542. } else {
  543. url += item.response.data
  544. }
  545. }
  546. })
  547. this.setState({
  548. refundUrl: url
  549. })
  550. }
  551. downImg() {
  552. let num = 0;
  553. for (let i = 0; i < this.props.pictureUrl.length; i++) {
  554. if (this.props.pictureUrl[i].url == this.state.previewImage) {
  555. num = i;
  556. }
  557. }
  558. if (num == this.props.pictureUrl.length - 1) {
  559. return message.warning("已经是最后一张了哦");
  560. }
  561. this.state.previewImage = this.props.pictureUrl[num + 1].url;
  562. this.setState({
  563. previewImage: this.state.previewImage,
  564. rotateDeg: 0
  565. });
  566. }
  567. downImg1() {
  568. let num = 0;
  569. for (let i = 0; i < this.props.attachment.length; i++) {
  570. if (this.props.attachment[i].url == this.state.previewImage1) {
  571. num = i;
  572. }
  573. }
  574. if (num == this.props.attachment.length - 1) {
  575. return message.warning("已经是最后一张了哦");
  576. }
  577. this.state.previewImage1 = this.props.attachment[num + 1].url;
  578. this.setState({
  579. previewImage1: this.state.previewImage1,
  580. rotateDeg1: 0
  581. });
  582. }
  583. upImg() {
  584. let num = 0;
  585. for (let i = 0; i < this.props.pictureUrl.length; i++) {
  586. if (this.props.pictureUrl[i].url == this.state.previewImage) {
  587. num = i;
  588. }
  589. }
  590. if (num == 0) {
  591. return message.warning("已经是第一张了哦");
  592. }
  593. this.state.previewImage = this.props.pictureUrl[num - 1].url;
  594. this.setState({
  595. previewImage: this.state.previewImage,
  596. rotateDeg: 0
  597. });
  598. }
  599. upImg1() {
  600. let num = 0;
  601. for (let i = 0; i < this.props.attachment.length; i++) {
  602. if (this.props.attachment[i].url == this.state.previewImage1) {
  603. num = i;
  604. }
  605. }
  606. if (num == 0) {
  607. return message.warning("已经是第一张了哦");
  608. }
  609. this.state.previewImage1 = this.props.attachment[num - 1].url;
  610. this.setState({
  611. previewImage1: this.state.previewImage1,
  612. rotateDeg1: 0
  613. });
  614. }
  615. rotate() {
  616. let rotateDeg = this.state.rotateDeg + 90;
  617. let rotateDeg1 = this.state.rotateDeg + 90;
  618. this.setState({
  619. rotateDeg,
  620. rotateDeg1
  621. });
  622. }
  623. rotate1() {
  624. let rotateDeg1 = this.state.rotateDeg + 90;
  625. this.setState({
  626. rotateDeg1
  627. });
  628. }
  629. reset() {
  630. this.setState({
  631. paymentTimes: null,
  632. paymentAmount: "",
  633. invoiceTimes: null,
  634. invoiceAmount: "",
  635. cwCost: "",
  636. refundableAmount: "",
  637. cwRemarks: ""
  638. });
  639. }
  640. getOrgCodeUrl(e) {
  641. this.setState({
  642. orgCodeUrl: e
  643. });
  644. }
  645. // //查看催款节点
  646. // loaduserss(record) {
  647. // this.state.orderList = [];
  648. // this.setState({
  649. // orderNoss: record ? record.orderNo : this.props.datauser.orderNo
  650. // });
  651. // $.ajax({
  652. // method: "get",
  653. // dataType: "json",
  654. // crossDomain: false,
  655. // url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  656. // data: {
  657. // orderNo: record ? record.orderNo : this.props.datauser.orderNo
  658. // },
  659. // success: function(data) {
  660. // let theArr = [];
  661. // let thisData = [];
  662. // if (!thisData) {
  663. // if (data.error && data.error.length) {
  664. // message.warning(data.error[0].message);
  665. // }
  666. // thisData = {};
  667. // } else {
  668. // for (let i = 0; i < data.data.length; i++) {
  669. // thisData = data.data[i];
  670. // theArr.push({
  671. // key: i,
  672. // dunSubject: thisData.dunSubject
  673. // ? thisData.dunSubject.toString()
  674. // : "", //催款科目
  675. // id: thisData.id, //节点Id
  676. // money: thisData.money, //催款金额
  677. // dunStatus: thisData.dunStatus, //催款状态
  678. // orderNo: record ? record.orderNo : this.props.datauser.orderNo
  679. // });
  680. // }
  681. // this.setState({
  682. // contactList: theArr
  683. // });
  684. // }
  685. // }.bind(this)
  686. // }).always(
  687. // function() {
  688. // this.setState({
  689. // loading: false
  690. // });
  691. // }.bind(this)
  692. // );
  693. // }
  694. timestampToTime(timestamp) {
  695. var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  696. var Y = date.getFullYear() + "-";
  697. var M =
  698. (date.getMonth() + 1 < 10
  699. ? "0" + (date.getMonth() + 1)
  700. : date.getMonth() + 1) + "-";
  701. var D = date.getDate() + " ";
  702. var h = date.getHours() + ":";
  703. var m = date.getMinutes() + ":";
  704. var s = date.getSeconds();
  705. return Y + M + D + h + m + s;
  706. }
  707. reLoad() {
  708. $.ajax({
  709. method: "get",
  710. dataType: "json",
  711. crossDomain: false,
  712. url:
  713. globalConfig.context + "/api/admin/orderChange/listOrderRefundInvoice",
  714. data: {
  715. orderNo: this.props.data.orderNo
  716. },
  717. success: data => {
  718. if (!data) return;
  719. data.data.forEach(item => {
  720. item.load = true;
  721. });
  722. this.setState({
  723. contactList: data.data
  724. });
  725. }
  726. });
  727. }
  728. // 完成订单
  729. finish() {
  730. // this.props.onCancel()
  731. this.setState({
  732. loading: true
  733. })
  734. $.ajax({
  735. url: globalConfig.context + "/api/admin/orderChange/completeRefund",
  736. method: "get",
  737. data: {
  738. // orderNo: this.props.data.orderNo,
  739. // type: this.props.data.type,
  740. id: this.props.data.id
  741. },
  742. success: data => {
  743. if (data.data) {
  744. message.success("提交成功!");
  745. // window.location.reload();
  746. this.setState({
  747. loading: false
  748. })
  749. this.props.onCancel()
  750. } else if (data.error && data.error.length) {
  751. message.warning(data.error[0].message)
  752. this.setState({
  753. loading: false
  754. });
  755. }
  756. }
  757. });
  758. }
  759. contactSave(index) {
  760. if (this.state.contactList) {
  761. let Data = this.state.contactList;
  762. for (var a = 0; a < Data.length; a++) {
  763. if (Data[a].amount == "") {
  764. message.warning("退票金额不能为空");
  765. // this.refs.signFirstPayment.focus();
  766. return false;
  767. }
  768. }
  769. }
  770. // this.setState({
  771. // loading: true
  772. // });
  773. $.ajax({
  774. url:
  775. globalConfig.context + "/api/admin/orderChange/addOrderRefundInvoice",
  776. method: "post",
  777. data: {
  778. orderNo: this.props.data.orderNo,
  779. amount: index.amount
  780. }
  781. }).done(
  782. function (data) {
  783. if (!data.error.length) {
  784. message.success("保存成功!");
  785. let num = 0;
  786. this.state.contactList.forEach(item => {
  787. num += +item.amount;
  788. // if (item.key == index.key) {
  789. // item.load = true;
  790. // let time = this.timestampToTime(new Date().getTime());
  791. // item.createTimes = time;
  792. // }
  793. });
  794. this.setState({
  795. contactList: this.state.contactList,
  796. refundInvoice: num
  797. });
  798. this.reLoad();
  799. } else {
  800. message.warning(data.error[0].message);
  801. }
  802. }.bind(this)
  803. );
  804. }
  805. //点击新增催款节点
  806. addcontact() {
  807. // let key = this.state.contactList.length
  808. // if(key == 0) {
  809. // key
  810. // }
  811. this.state.contactList.push({
  812. key: this.state.contactList.length,
  813. amount: "",
  814. createTime: undefined
  815. // orderNo: this.state.orderNoss,
  816. // dunTarget: this.state.kehuId
  817. });
  818. this.setState({
  819. contactList: this.state.contactList
  820. });
  821. }
  822. //删除收款节点
  823. confirmDelet(index) {
  824. // if (index.id) {
  825. // this.state.contactList.splice(index.key, 1);
  826. // this.setState({
  827. // contactList: this.state.contactList
  828. // });
  829. // this.contactSave();
  830. // } else {
  831. // this.state.contactList.splice(index.key, 1);
  832. // this.setState({
  833. // contactList: this.state.contactList
  834. // });
  835. // }
  836. // if(this.state.contactList.length == 1) {
  837. // this.state.contactList = []
  838. // this.setState({
  839. // contactList: this.state.contactList
  840. // });
  841. // return
  842. // }
  843. // let num = index.key
  844. // if (this.state.contactList[num + 1].key) {
  845. // this.state.contactList[num + 1].key = index.key;
  846. // }
  847. if (index.key || !index.id) {
  848. let num = this.state.contactList.findIndex(item => item.key == index.key);
  849. this.state.contactList.splice(num, 1);
  850. let total = 0;
  851. this.state.contactList.forEach(item => {
  852. total += +item.amount;
  853. });
  854. this.setState({
  855. contactList: this.state.contactList,
  856. refundInvoice: total
  857. });
  858. } else {
  859. $.ajax({
  860. url:
  861. globalConfig.context +
  862. "/api/admin/orderChange/deleteOrderRefundInvoice",
  863. method: "post",
  864. data: {
  865. id: index.id
  866. }
  867. }).done(
  868. function (data) {
  869. if (!data.error.length) {
  870. message.success("删除成功!");
  871. this.reLoad();
  872. } else {
  873. message.warning(data.error[0].message);
  874. }
  875. }.bind(this)
  876. );
  877. }
  878. // console.log(this.state.contactList[num + 1].key);
  879. }
  880. // loadData() {
  881. // $.ajax({
  882. // method: "get",
  883. // dataType: "json",
  884. // async: false,
  885. // crossDomain: false,
  886. // url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  887. // data: {
  888. // changeId: this.props.data.id
  889. // },
  890. // success: function(data) {
  891. // if (data.error.length || data.data.list == "") {
  892. // if (data.error && data.error.length) {
  893. // message.warning(data.error[0].message);
  894. // }
  895. // } else {
  896. // this.setState({
  897. // dataSource: data.data
  898. // });
  899. // }
  900. // }.bind(this)
  901. // });
  902. // }
  903. //同意拒绝按钮的有无
  904. changeButtonStatus() {
  905. this.setState({
  906. buttonStatus: !this.state.buttonStatus
  907. });
  908. }
  909. onRef(ref) {
  910. this.fun = ref;
  911. }
  912. render() {
  913. const pageData = [
  914. {
  915. labelA: "客户名称",
  916. formItemLayoutA: formItemLayout,
  917. dataA: this.props.data.userName,
  918. labelB: "合同编号",
  919. formItemLayoutB: formItemLayout,
  920. dataB: this.props.data.contractNo
  921. },
  922. {
  923. labelA: "时间",
  924. formItemLayoutA: formItemLayout,
  925. dataA: this.props.data.createTimes,
  926. labelB: "发起人",
  927. formItemLayoutB: formItemLayout,
  928. dataB: this.props.data.applicant
  929. },
  930. {
  931. labelA: "当前进度",
  932. formItemLayoutA: formItemLayout,
  933. // 当前是咨询师以及咨询师经理时使用shenhePeo函数,其他流程正常显示
  934. dataA:
  935. this.props.data.processState == 2 || this.props.data.processState == 3
  936. ? shenghePeo(this.props.data.examineName, this.props.data.processState)
  937. : getProcessStatusNew(
  938. this.props.data.examineName,
  939. this.props.data.processState,
  940. this.props.data.status
  941. ),
  942. labelB: "变更类型",
  943. formItemLayoutB: formItemLayout,
  944. dataB: getChangeType(this.props.data.type)
  945. },
  946. {
  947. labelA: "合同额(万元)",
  948. formItemLayoutA: formItemLayout,
  949. dataA: this.moneyOld(this.props.data.totalAmount, this.props.money),
  950. labelB: "已收款(万元)",
  951. formItemLayoutB: formItemLayout,
  952. dataB: changeColor(this.props.data.settlementAmount)
  953. },
  954. {
  955. labelA: "欠款(万元)",
  956. formItemLayoutA: formItemLayout,
  957. dataA: changeColor(this.props.data.arrears),
  958. labelB: "申请退款(万元)",
  959. formItemLayoutB: formItemLayout,
  960. dataB: changeColor(this.props.data.changeAmount)
  961. },
  962. {
  963. labelA: "首付款(万元)",
  964. formItemLayoutA: formItemLayout,
  965. dataA: changeColor(this.props.data.firstAmount),
  966. },
  967. {
  968. labelA: "变更原因",
  969. formItemLayoutA: formItemLayout,
  970. dataA: this.props.data.remarks
  971. }
  972. ];
  973. const planData = [
  974. {
  975. labelA: "项目进度",
  976. formItemLayoutA: formItemLayout,
  977. dataA: this.props.data.projectState,
  978. onChangeA: value => {
  979. this.setState({
  980. projectState: value
  981. });
  982. },
  983. labelB: "发生成本费用(万元)",
  984. formItemLayoutB: formItemLayout,
  985. dataB: this.props.data.zxsCost,
  986. onChangeB: value => {
  987. this.setState({
  988. zxsCost: value
  989. });
  990. }
  991. },
  992. {
  993. labelA: "备注",
  994. formItemLayoutA: formItemLayout,
  995. dataA: this.props.data.zxsRemarks,
  996. onChangeA: value => {
  997. this.setState({
  998. zxsRemarks: value
  999. });
  1000. }
  1001. }
  1002. ];
  1003. const financeData = [
  1004. {
  1005. labelA: "发生成本(万元)",
  1006. formItemLayoutA: formItemLayout,
  1007. dataA: this.props.data.cwCost ? this.props.data.cwCost : "0",
  1008. onChangeA: value => {
  1009. this.setState({
  1010. cwCost: value
  1011. });
  1012. },
  1013. labelB: "应退金额(万元)",
  1014. formItemLayoutB: formItemLayout,
  1015. dataB: this.props.data.refundableAmount
  1016. ? this.props.data.refundableAmount
  1017. : "0",
  1018. onChangeB: value => {
  1019. this.setState({
  1020. refundableAmount: value
  1021. });
  1022. },
  1023. mark: true
  1024. }
  1025. // {
  1026. // labelA: "备注",
  1027. // formItemLayoutA: formItemLayout,
  1028. // dataA: this.props.data.cwRemarks,
  1029. // onChangeA: value => {
  1030. // this.setState({
  1031. // reason: value
  1032. // });
  1033. // },
  1034. // mark: false
  1035. // }
  1036. ];
  1037. const buttonData = [
  1038. {
  1039. name: "同意",
  1040. title: "理由",
  1041. placeholder: "请输入理由",
  1042. type: "primary",
  1043. status: 2,
  1044. onChange: value => {
  1045. this.setState({
  1046. remarks: value
  1047. });
  1048. }
  1049. },
  1050. {
  1051. name: "拒绝",
  1052. title: "理由",
  1053. placeholder: "请输入理由",
  1054. type: "danger",
  1055. status: 3,
  1056. onChange: value => {
  1057. this.setState({
  1058. remarks: value
  1059. });
  1060. }
  1061. }
  1062. ];
  1063. const orgCodeUrl = this.props.pictureUrl;
  1064. const attachment = this.props.attachment
  1065. // console.log(this.props.attachment);
  1066. return (
  1067. <div className="clearfix changeDetail">
  1068. <div
  1069. className="clearfix"
  1070. ref={(e) => {
  1071. this.refs = e;
  1072. }}
  1073. >
  1074. <div
  1075. style={{
  1076. borderRadius: "50%",
  1077. width: 300,
  1078. height: 300,
  1079. position: "absolute",
  1080. top: 230,
  1081. left: 525,
  1082. transform: "rotate(-5deg)",
  1083. zIndex: 1,
  1084. display:
  1085. (this.props.data.processState == 7 ||
  1086. this.props.data.processState == 8) &&
  1087. this.props.data.status == 4
  1088. ? "block"
  1089. : "none",
  1090. }}
  1091. >
  1092. {/* <span
  1093. style={{
  1094. fontSize: 29,
  1095. position: "absolute",
  1096. left: "50%",
  1097. top: "50%",
  1098. transform: "translate(-50%,-50%)",
  1099. color: "red"
  1100. }}
  1101. >
  1102. 通过
  1103. </span> */}
  1104. <img src={tongguo} style={{ width: "100%" }} />
  1105. </div>
  1106. <div
  1107. style={{
  1108. borderRadius: "50%",
  1109. width: 300,
  1110. height: 300,
  1111. position: "absolute",
  1112. top: 284,
  1113. left: 586,
  1114. transform: "rotate(-5deg)",
  1115. zIndex: 1,
  1116. display: this.props.data.status == 5 ? "block" : "none",
  1117. }}
  1118. >
  1119. <img src={quxiao} style={{ width: "63%" }} />
  1120. </div>
  1121. <h2 style={{ textAlign: "center", marginBottom: 10, marginTop: 20 }}>
  1122. 合同变更记录
  1123. </h2>
  1124. {pageData.map((item, index) => {
  1125. return <Itemlist key={index} pageData={item} />;
  1126. })}
  1127. <Form.Item
  1128. label="变更凭证"
  1129. labelCol={{ span: 4 }}
  1130. wrapperCol={{ span: 18 }}
  1131. >
  1132. <div style={{ paddingTop: '10px', paddingBottom: '10px' }}>
  1133. <ImgList domId={this.props.domId ? this.props.domId : 'hetongbiangenjilu'} fileList={orgCodeUrl} ItemWidth={'96px'} />
  1134. </div>
  1135. <Modal
  1136. maskClosable={false}
  1137. footer={null}
  1138. width={"50%"}
  1139. visible={this.state.previewVisible}
  1140. onCancel={() => {
  1141. this.setState({ previewVisible: false, rotateDeg: 0 }, () => {
  1142. this.reset();
  1143. });
  1144. }}
  1145. >
  1146. <img
  1147. alt=""
  1148. style={{
  1149. width: "100%",
  1150. transform: `rotate(${this.state.rotateDeg}deg)`,
  1151. }}
  1152. src={this.state.previewImage || ""}
  1153. />
  1154. <Button
  1155. onClick={this.rotate}
  1156. style={{
  1157. position: "relative",
  1158. left: "50%",
  1159. transform: "translateX(-50%)",
  1160. }}
  1161. >
  1162. 旋转
  1163. </Button>
  1164. <Button
  1165. onClick={this.upImg}
  1166. style={{
  1167. position: "absolute",
  1168. left: -81,
  1169. top: "50%",
  1170. transform: "translateY(-50%)",
  1171. }}
  1172. >
  1173. 上一张
  1174. </Button>
  1175. <Button
  1176. onClick={this.downImg}
  1177. style={{
  1178. position: "absolute",
  1179. right: -81,
  1180. top: "50%",
  1181. transform: "translateY(-50%)",
  1182. }}
  1183. >
  1184. 下一张
  1185. </Button>
  1186. </Modal>
  1187. <Rizhi changeId={this.props.id} />
  1188. </Form.Item>
  1189. {
  1190. this.props.contractPictureUrl && this.props.contractPictureUrl.length != 0 &&
  1191. <div className="clearfix">
  1192. <Form.Item
  1193. labelCol={{ span: 4 }}
  1194. wrapperCol={{ span: 18 }}
  1195. label="最新合同"
  1196. >
  1197. <div style={{ paddingTop: 10 }}>
  1198. <ImgList
  1199. fileList={
  1200. this.props.contractPictureUrl
  1201. }
  1202. ItemWidth={"96px"}
  1203. />
  1204. </div>
  1205. </Form.Item>
  1206. </div>
  1207. }
  1208. <ul
  1209. style={{
  1210. width: "868px",
  1211. overflow: "hidden",
  1212. paddingLeft: "90px",
  1213. paddingTop: "10px",
  1214. position: "relative",
  1215. bottom: "20px",
  1216. fontSize: "12px",
  1217. color: "rgba(0, 0, 0, 0.65)",
  1218. }}
  1219. >
  1220. {/* <span>操作人:</span> */}
  1221. {this.props.dataSource.map((item, index) => {
  1222. if (item.status == 0) {
  1223. item.status = "发起";
  1224. } else if (item.status == 1) {
  1225. item.status = "审核中";
  1226. } else if (item.status == 2) {
  1227. item.status = "通过";
  1228. } else if (item.status == 3) {
  1229. item.status = "驳回";
  1230. } else if (item.status == 4) {
  1231. item.status = "完成";
  1232. } else if (item.status == 5) {
  1233. item.status = "撤销";
  1234. }
  1235. return (
  1236. <li
  1237. key={index}
  1238. style={{
  1239. width: "100%",
  1240. height: "auto",
  1241. wordBreak: "break-all",
  1242. marginBottom: "10px",
  1243. }}
  1244. >
  1245. {item.aname + ":" + "【" + item.status + "】" + item.remarks + "(" + item.createTimes + ")"}
  1246. </li>
  1247. );
  1248. })}
  1249. </ul>
  1250. <ProAndCuiList id={this.props.id} />
  1251. {/* 收款情况1 */}
  1252. <div className="clearfix">
  1253. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1254. 收款情况
  1255. </h3>
  1256. <div style={{ marginLeft: "90px" }}>
  1257. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  1258. {(this.props.proceedsData.bill || []).map((item, index) => (
  1259. <li key={index}>
  1260. {item.payTime +
  1261. " " +
  1262. item.aName +
  1263. " 收款:" +
  1264. item.transactionAmount +
  1265. "万元"}
  1266. </li>
  1267. ))}
  1268. </ul>
  1269. <div>收款总计:{this.props.proceedsTotal}万元</div>
  1270. </div>
  1271. <br />
  1272. <div style={{ marginLeft: "90px" }}>
  1273. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  1274. {(this.props.proceedsData.invoice || []).map((item, index) => (
  1275. <li key={index}>
  1276. {item.createTime + " " + " 开票:" + item.amount + "万元"}
  1277. </li>
  1278. ))}
  1279. </ul>
  1280. <div>开票总计:{this.props.invoiceTotal}万元</div>
  1281. </div>
  1282. <p style={{ marginLeft: "90px", color: "red" }}>
  1283. 系统预估 产生成本(万元):
  1284. {this.props.data.estimateCost
  1285. ? this.props.data.estimateCost
  1286. : "0"}{" "}
  1287. &nbsp;应退金额(万元):
  1288. {this.props.data.estimateRefundable
  1289. ? this.props.data.estimateRefundable
  1290. : "0"}
  1291. </p>
  1292. </div>
  1293. {/* {this.props.data.type === 0 ? (
  1294. <div>
  1295. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1296. 当前项目进度(咨询师经理填写)
  1297. </h3>
  1298. {planData.map((item, index) => {
  1299. return <Itemlist key={index} pageData={item} />;
  1300. })}
  1301. </div>
  1302. ) : (
  1303. ""
  1304. )} */}
  1305. {/* 当前财务状态2 */}
  1306. {this.props.data.processState != 5 ? (
  1307. <div>
  1308. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10, marginTop: '10px' }}>
  1309. 当前财务状态(财务填写)
  1310. </h3>
  1311. {/* <div className="clearfix">
  1312. <Form.Item
  1313. className="half-item"
  1314. label="收款时间"
  1315. labelCol={{ span: 8 }}
  1316. wrapperCol={{ span: 14 }}
  1317. >
  1318. <span>{this.props.data.paymentTimes}</span>
  1319. </Form.Item>
  1320. <Form.Item
  1321. className="half-item"
  1322. label="收款金额(万元)"
  1323. labelCol={{ span: 8 }}
  1324. wrapperCol={{ span: 14 }}
  1325. >
  1326. <span>{this.props.data.paymentAmount}</span>
  1327. </Form.Item>
  1328. </div>
  1329. <div className="clearfix">
  1330. <Form.Item
  1331. className="half-item"
  1332. label="开票时间"
  1333. labelCol={{ span: 8 }}
  1334. wrapperCol={{ span: 14 }}
  1335. >
  1336. <span>{this.props.data.invoiceTimes}</span>
  1337. </Form.Item>
  1338. <Form.Item
  1339. className="half-item"
  1340. label="开票金额(万元)"
  1341. labelCol={{ span: 8 }}
  1342. wrapperCol={{ span: 14 }}
  1343. >
  1344. <span>{this.props.data.invoiceAmount}</span>
  1345. </Form.Item>
  1346. </div> */}
  1347. {financeData.map((item, index) => {
  1348. return <Itemlist key={index} pageData={item} />;
  1349. })}
  1350. </div>
  1351. ) : (
  1352. <div style={{ marginBottom: 10 }}>
  1353. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1354. 当前财务状态(财务填写)
  1355. </h3>
  1356. <div className="clearfix">
  1357. {/* <Form.Item
  1358. className="half-item"
  1359. label="收款时间"
  1360. labelCol={{ span: 8 }}
  1361. wrapperCol={{ span: 14 }}
  1362. >
  1363. <DatePicker
  1364. style={{ width: 160 }}
  1365. value={
  1366. this.state.paymentTimes
  1367. ? moment(this.state.paymentTimes)
  1368. : null
  1369. }
  1370. onChange={(_data, dataString) => {
  1371. this.setState({
  1372. paymentTimes: dataString
  1373. });
  1374. }}
  1375. />
  1376. </Form.Item>
  1377. <Form.Item
  1378. className="half-item"
  1379. label="收款金额(万元)"
  1380. labelCol={{ span: 8 }}
  1381. wrapperCol={{ span: 14 }}
  1382. >
  1383. <Input
  1384. style={{ width: 160 }}
  1385. value={this.state.paymentAmount}
  1386. placeholder="请输入收款金额"
  1387. onChange={e => {
  1388. this.setState({
  1389. paymentAmount: e.target.value
  1390. });
  1391. }}
  1392. />
  1393. </Form.Item>
  1394. </div>
  1395. <div className="clearfix">
  1396. <Form.Item
  1397. className="half-item"
  1398. label="开票时间"
  1399. labelCol={{ span: 8 }}
  1400. wrapperCol={{ span: 14 }}
  1401. >
  1402. <DatePicker
  1403. style={{ width: 160 }}
  1404. value={
  1405. this.state.invoiceTimes
  1406. ? moment(this.state.invoiceTimes)
  1407. : null
  1408. }
  1409. onChange={(_data, dataString) => {
  1410. this.setState({
  1411. invoiceTimes: dataString
  1412. });
  1413. }}
  1414. />
  1415. </Form.Item>
  1416. <Form.Item
  1417. className="half-item"
  1418. label="开票金额(万元)"
  1419. labelCol={{ span: 8 }}
  1420. wrapperCol={{ span: 14 }}
  1421. >
  1422. <Input
  1423. style={{ width: 160 }}
  1424. value={this.state.invoiceAmount}
  1425. placeholder="请输入开票金额"
  1426. onChange={e => {
  1427. this.setState({
  1428. invoiceAmount: e.target.value
  1429. });
  1430. }}
  1431. />
  1432. </Form.Item> */}
  1433. <Form.Item
  1434. className="half-item"
  1435. label="发生成本(万元)"
  1436. labelCol={{ span: 8 }}
  1437. wrapperCol={{ span: 14 }}
  1438. >
  1439. <Input
  1440. style={{ width: 160 }}
  1441. value={this.state.cwCost}
  1442. placeholder="请输入发生成本"
  1443. onChange={(e) => {
  1444. this.setState({
  1445. cwCost: e.target.value,
  1446. });
  1447. }}
  1448. />
  1449. </Form.Item>
  1450. <Form.Item
  1451. className="half-item"
  1452. label="应退金额(万元)"
  1453. labelCol={{ span: 8 }}
  1454. wrapperCol={{ span: 14 }}
  1455. >
  1456. <Input
  1457. style={{ width: 160 }}
  1458. value={this.state.refundableAmount}
  1459. placeholder="请输入应退金额"
  1460. onChange={(e) => {
  1461. this.setState({
  1462. refundableAmount: e.target.value,
  1463. });
  1464. }}
  1465. />
  1466. </Form.Item>
  1467. </div>
  1468. <div
  1469. style={{
  1470. marginTop: "10px",
  1471. display:
  1472. this.props.processState == this.props.data.processState
  1473. ? "block"
  1474. : "none",
  1475. }}
  1476. >
  1477. <Form.Item
  1478. label="备注"
  1479. labelCol={{ span: 4 }}
  1480. wrapperCol={{ span: 14 }}
  1481. >
  1482. <Input.TextArea
  1483. rows={4}
  1484. value={this.state.reason}
  1485. placeholder="请输入补充资料/备注"
  1486. onChange={(e) => {
  1487. this.setState({
  1488. reason: e.target.value,
  1489. });
  1490. }}
  1491. />
  1492. </Form.Item>
  1493. </div>
  1494. </div>
  1495. )}
  1496. {/* 回收退票 3 */}
  1497. <div
  1498. style={{
  1499. display:
  1500. (this.props.data.processState == 8 ||
  1501. this.props.data.processState == 7) &&
  1502. (this.props.data.status == 2 || this.props.data.status == 4 || this.props.data.status == 3 || this.props.data.status == 6)
  1503. ? "block"
  1504. : "none",
  1505. }}
  1506. >
  1507. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1508. 回收退票
  1509. </h3>
  1510. {/* {this.state.processStatus == 0 ? ( */}
  1511. <Button
  1512. type="primary"
  1513. onClick={this.addcontact}
  1514. style={{
  1515. float: "right",
  1516. marginRight: "50px",
  1517. marginBottom: "15px",
  1518. position: "relative",
  1519. zIndex: "999",
  1520. display:
  1521. (this.props.data.processState == 7 ||
  1522. this.props.data.processState == 8) &&
  1523. this.props.data.status == 4 || this.props.data.status == 6
  1524. ? "none"
  1525. : "block",
  1526. }}
  1527. >
  1528. 添加回收退票
  1529. </Button>
  1530. {/* ) : (
  1531. ""
  1532. )} */}
  1533. <Table
  1534. pagination={false}
  1535. bordered
  1536. columns={this.state.ContactsLists}
  1537. dataSource={this.state.contactList}
  1538. size="small"
  1539. />
  1540. </div>
  1541. {/* 应收 回收 */}
  1542. <ul
  1543. style={{
  1544. margin: "10px 0 0 20px",
  1545. color: "red",
  1546. display:
  1547. (this.props.data.processState == 7 ||
  1548. this.props.data.processState == 8) &&
  1549. (this.props.data.status == 4 || this.props.data.status == 2)
  1550. ? "inline-block"
  1551. : "none",
  1552. }}
  1553. >
  1554. <li>
  1555. {"本次应收退票(万元):" +
  1556. (this.props.data.refundableAmount == null
  1557. ? 0
  1558. : this.props.data.refundableAmount)}
  1559. </li>
  1560. <li>
  1561. {"累计已回收退票(万元):" +
  1562. (this.state.refundInvoice == null
  1563. ? 0
  1564. : this.state.refundInvoice)}
  1565. </li>
  1566. </ul>
  1567. {/* 审核查看附件4 */}
  1568. <div style={{
  1569. position: "relative",
  1570. display:
  1571. (this.props.data.processState == 7 ||
  1572. this.props.data.processState == 8) &&
  1573. this.props.data.status == 4 || this.props.data.status == 3 || this.props.data.status == 6
  1574. ? "block"
  1575. : "none",
  1576. marginTop: 10,
  1577. }}
  1578. >
  1579. <hr
  1580. style={{
  1581. marginTop: 12,
  1582. marginBottom: 10,
  1583. backgroundColor: "black",
  1584. height: 1,
  1585. border: "none",
  1586. }}
  1587. />
  1588. <h3
  1589. style={{
  1590. marginLeft: 20,
  1591. fontWeight: 800,
  1592. marginBottom: 10,
  1593. display: "inline-block",
  1594. }}
  1595. >
  1596. 完成审核,上传附件{" "}
  1597. <span
  1598. style={{ fontSize: 12, fontWeight: "normal", color: "red" }}
  1599. >
  1600. (注:由营销员上传变更后附件,全变更流程完成。)
  1601. </span>
  1602. </h3>
  1603. <div>
  1604. <Form.Item
  1605. label="变更附件"
  1606. labelCol={{ span: 4 }}
  1607. wrapperCol={{ span: 18 }}
  1608. >
  1609. <div style={{ paddingTop: '10px', paddingBottom: '10px' }}>
  1610. {attachment.length > 0 ? <ImgList domId={this.props.domId + 1 ? this.props.domId + 1 : 'hetongbiangenjilu112'} fileList={attachment} ItemWidth={'96px'} /> : '无附件'}
  1611. </div>
  1612. <Modal
  1613. maskClosable={false}
  1614. footer={null}
  1615. width={"50%"}
  1616. visible={this.state.uploadVisible}
  1617. onCancel={() => {
  1618. this.setState({ uploadVisible: false, rotateDeg1: 0 }, () => {
  1619. // this.reset();
  1620. });
  1621. }}
  1622. >
  1623. <img
  1624. alt=""
  1625. style={{
  1626. width: "100%",
  1627. transform: `rotate(${this.state.rotateDeg1}deg)`,
  1628. }}
  1629. src={this.state.previewImage1 || ""}
  1630. />
  1631. <Button
  1632. onClick={this.rotate1}
  1633. style={{
  1634. position: "relative",
  1635. left: "50%",
  1636. transform: "translateX(-50%)",
  1637. }}
  1638. >
  1639. 旋转
  1640. </Button>
  1641. <Button
  1642. onClick={this.upImg1}
  1643. style={{
  1644. position: "absolute",
  1645. left: -81,
  1646. top: "50%",
  1647. transform: "translateY(-50%)",
  1648. }}
  1649. >
  1650. 上一张
  1651. </Button>
  1652. <Button
  1653. onClick={this.downImg1}
  1654. style={{
  1655. position: "absolute",
  1656. right: -81,
  1657. top: "50%",
  1658. transform: "translateY(-50%)",
  1659. }}
  1660. >
  1661. 下一张
  1662. </Button>
  1663. </Modal>
  1664. {/* <Rizhi changeId={this.props.id} /> */}
  1665. </Form.Item>
  1666. </div>
  1667. </div>
  1668. {/* 退款凭证5 */}
  1669. <div
  1670. style={{
  1671. position: "relative",
  1672. display:
  1673. (this.props.data.processState == 7 ||
  1674. this.props.data.processState == 8) &&
  1675. this.props.data.status == 4 &&
  1676. !this.props.data.refundStatus
  1677. ? "block"
  1678. : "none",
  1679. marginTop: 10,
  1680. }}
  1681. >
  1682. <hr
  1683. style={{
  1684. marginTop: 12,
  1685. marginBottom: 10,
  1686. backgroundColor: "black",
  1687. height: 1,
  1688. border: "none",
  1689. }}
  1690. />
  1691. <h3
  1692. style={{
  1693. marginLeft: 20,
  1694. fontWeight: 800,
  1695. marginBottom: 10,
  1696. display: "inline-block",
  1697. }}
  1698. >
  1699. 执行退款{" "}
  1700. <span
  1701. style={{ fontSize: 12, fontWeight: "normal", color: "red" }}
  1702. >
  1703. (注:执行退款,系统将从已收款金额中直接减款)
  1704. </span>
  1705. </h3>
  1706. <Button onClick={this.addRefund} style={{ float: "right" }}>
  1707. 添加执行退款
  1708. </Button>
  1709. <Table
  1710. pagination={false}
  1711. bordered
  1712. columns={this.state.refundColumn}
  1713. dataSource={this.state.refundDataSource}
  1714. scroll={{ x: "max-content", y: 0 }}
  1715. size="small"
  1716. />
  1717. <div className="clearfix">
  1718. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1719. 上传退款凭证
  1720. </h3>
  1721. <div style={{ marginLeft: 20 }}>
  1722. <PicturesWall
  1723. fileList={this.getVoucherUrl}
  1724. pictureUrl={this.state.voucherUrl}
  1725. url="/api/admin/orderChange/uploadRefund"
  1726. sign="order_change_file"
  1727. />
  1728. </div>
  1729. </div>
  1730. <Button
  1731. type="primary"
  1732. onClick={this.refundExecute}
  1733. style={{
  1734. position: "relative",
  1735. left: "50%",
  1736. transform: "translateX(-50%)",
  1737. }}
  1738. >
  1739. 确定执行退款
  1740. </Button>
  1741. </div>
  1742. <div
  1743. style={{
  1744. display:
  1745. (this.props.data.processState == 7 ||
  1746. this.props.data.processState == 8) &&
  1747. this.props.data.status == 4 &&
  1748. this.props.data.refundStatus
  1749. ? "block"
  1750. : "none",
  1751. }}
  1752. >
  1753. <Refund
  1754. data={this.props.data}
  1755. id={this.props.id}
  1756. dataSource={this.state.refundDataSource}
  1757. />
  1758. </div>
  1759. </div>
  1760. {this.props.data.processState == 5 ? (
  1761. this.state.buttonStatus ? (
  1762. <div>
  1763. <div
  1764. className="clearfix"
  1765. style={{ display: "flex", justifyContent: "space-around" }}
  1766. >
  1767. {buttonData.map((item, index) => {
  1768. return (
  1769. <AgreeButton
  1770. data={item}
  1771. key={index}
  1772. backData={this.props.data}
  1773. processState={this.props.processState}
  1774. visible={this.changeButtonStatus}
  1775. ajaxData={this.state}
  1776. loadData={this.props.loadData}
  1777. rejectState={this.state.rejectState}
  1778. reason={this.state.reason}
  1779. onCancel={this.props.onCancel}
  1780. />
  1781. );
  1782. })}
  1783. </div>
  1784. {
  1785. this.props.data.type == 7
  1786. ? <Select
  1787. defaultValue="0"
  1788. style={{ width: 120, float: "left", position: "relative", bottom: "28px", right: "-600px", }}
  1789. onChange={(val) => {
  1790. this.setState({ rejectState: val });
  1791. }}
  1792. >
  1793. <Option value="0" style={{ display: this.props.processState >= 1 ? "block" : "none", }}
  1794. >营销员</Option>
  1795. <Option value="1" style={{ display: this.props.processState >= 2 ? "block" : "none", }}
  1796. >营销管理员</Option>
  1797. <Option value="5" style={{ display: this.props.processState >= 6 ? "block" : "none", }}
  1798. >财务专员(退单)</Option>
  1799. </Select>
  1800. : <Select
  1801. defaultValue="0"
  1802. style={{ width: 120, float: "left", position: "relative", bottom: "28px", right: "-600px", }}
  1803. onChange={(val) => {
  1804. this.setState({ rejectState: val });
  1805. }}
  1806. >
  1807. <Option value="0" style={{ display: this.props.processState >= 1 ? "block" : "none", }}
  1808. >营销员</Option>
  1809. <Option value="1" style={{ display: this.props.processState >= 2 ? "block" : "none", }}
  1810. >营销管理员</Option>
  1811. <Option value="2" style={{ display: this.props.processState >= 3 ? "block" : "none", }}
  1812. >咨询师</Option>
  1813. <Option value="3" style={{ display: this.props.processState >= 4 ? "block" : "none", }}
  1814. >咨询师经理</Option>
  1815. <Option value="4" style={{ display: this.props.processState >= 5 ? "block" : "none", }}
  1816. >咨询师总监</Option>
  1817. <Option value="5" style={{ display: this.props.processState >= 6 ? "block" : "none", }}
  1818. >财务专员(退单)</Option>
  1819. <Option value="6" style={{ display: this.props.processState >= 7 ? "block" : "none", }}
  1820. >财务总监</Option>
  1821. <Option value="7" style={{ display: this.props.processState >= 8 ? "block" : "none", }}
  1822. >总裁</Option>
  1823. </Select>
  1824. }
  1825. </div>
  1826. ) : (
  1827. ""
  1828. )
  1829. ) : (
  1830. ""
  1831. )}
  1832. <Popconfirm
  1833. title="确定完成退票?"
  1834. onConfirm={this.finish}
  1835. okText="确定"
  1836. cancelText="取消">
  1837. <Button
  1838. type="primary"
  1839. shape="round"
  1840. size="large"
  1841. style={{
  1842. position: "absolute",
  1843. left: "50%",
  1844. bottom: "0",
  1845. transform: "translateX(-50%)",
  1846. display:
  1847. (this.props.data.processState == 7 ||
  1848. this.props.data.processState == 8) &&
  1849. this.props.data.status == 2
  1850. ? "block"
  1851. : "none",
  1852. }}
  1853. // onClick={this.finish}
  1854. >
  1855. 完成退票
  1856. </Button>
  1857. </Popconfirm>
  1858. <ReactToPrint
  1859. trigger={() => (
  1860. <Button
  1861. type="primary"
  1862. style={{
  1863. float: "right",
  1864. marginTop: 10,
  1865. position: "absolute",
  1866. top: 0,
  1867. right: 30,
  1868. display:
  1869. (this.props.data.processState == 7 ||
  1870. this.props.data.processState == 8) &&
  1871. this.props.data.status == 4
  1872. ? "block"
  1873. : "block",
  1874. }}
  1875. >
  1876. 打印
  1877. </Button>
  1878. )}
  1879. content={() => this.refs}
  1880. />
  1881. <Modal
  1882. maskClosable={false}
  1883. visible={this.state.addRefundVisible}
  1884. onOk={this.refundCancel}
  1885. onCancel={this.refundCancel}
  1886. width="700px"
  1887. title="添加执行退款"
  1888. footer=""
  1889. className="admin-desc-content"
  1890. >
  1891. <Form
  1892. layout="horizontal"
  1893. onSubmit={this.nextSubmit}
  1894. // id="demand-form"
  1895. >
  1896. <Spin spinning={this.state.loading}>
  1897. <div className="clearfix">
  1898. <FormItem
  1899. className="half-item"
  1900. {...formItemLayoutRefund}
  1901. label="退款金额"
  1902. >
  1903. <Input
  1904. style={{ width: "155px" }}
  1905. placeholder="请输入退款金额"
  1906. value={this.state.refundMoney}
  1907. onChange={(e) => {
  1908. this.setState({
  1909. refundMoney: e.target.value,
  1910. });
  1911. }}
  1912. />
  1913. </FormItem>
  1914. <FormItem
  1915. className="half-item"
  1916. {...formItemLayoutRefund}
  1917. label="退款时间"
  1918. >
  1919. <DatePicker
  1920. value={
  1921. this.state.refundDate
  1922. ? moment(this.state.refundDate)
  1923. : null
  1924. }
  1925. onChange={(date, dateString) => {
  1926. this.setState({
  1927. refundDate: dateString,
  1928. });
  1929. }}
  1930. />
  1931. </FormItem>
  1932. <FormItem
  1933. style={{ height: "auto" }}
  1934. labelCol={{ span: 3 }}
  1935. wrapperCol={{ span: 19 }}
  1936. label="备注"
  1937. >
  1938. <TextArea
  1939. rows={4}
  1940. placeholder="请输入备注信息"
  1941. style={{ width: "95%" }}
  1942. value={this.state.refundRemarks}
  1943. onChange={(e) => {
  1944. this.setState({
  1945. refundRemarks: e.target.value,
  1946. });
  1947. }}
  1948. />
  1949. </FormItem>
  1950. <FormItem
  1951. wrapperCol={{ span: 12, offset: 6 }}
  1952. className="half-middle"
  1953. style={{ marginTop: 10 }}
  1954. >
  1955. <Button
  1956. className="submitSave"
  1957. type="primary"
  1958. onClick={this.sumitRefund}
  1959. >
  1960. 保存
  1961. </Button>
  1962. <Button
  1963. className="submitSave"
  1964. type="ghost"
  1965. style={{ marginLeft: 10 }}
  1966. onClick={this.refundCancel}
  1967. >
  1968. 取消
  1969. </Button>
  1970. </FormItem>
  1971. </div>
  1972. </Spin>
  1973. </Form>
  1974. </Modal>
  1975. </div>
  1976. );
  1977. }
  1978. }
  1979. export { ChangeDetail };