changeDetailCwzy.js 54 KB

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