changeDetailCwzy.js 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925
  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. console.log(this.props,"222");
  536. }
  537. addRefund() {
  538. this.setState({
  539. addRefundVisible: true,
  540. refundMoney: undefined,
  541. refundDate: undefined,
  542. refundRemarks: undefined,
  543. })
  544. }
  545. refundCancel() {
  546. this.setState({
  547. addRefundVisible: false,
  548. refundMoney: undefined,
  549. refundDate: undefined,
  550. refundRemarks: undefined,
  551. })
  552. }
  553. getVoucherUrl(e) {
  554. this.setState({
  555. voucherUrl: e
  556. });
  557. let url = ""
  558. e.forEach((item, index) => {
  559. if (item.response && item.response.data) {
  560. if (index < e.length - 1) {
  561. url += item.response.data + ","
  562. } else {
  563. url += item.response.data
  564. }
  565. }
  566. })
  567. this.setState({
  568. refundUrl: url
  569. })
  570. }
  571. downImg() {
  572. let num = 0;
  573. for (let i = 0; i < this.props.pictureUrl.length; i++) {
  574. if (this.props.pictureUrl[i].url == this.state.previewImage) {
  575. num = i;
  576. }
  577. }
  578. if (num == this.props.pictureUrl.length - 1) {
  579. return message.warning("已经是最后一张了哦");
  580. }
  581. this.state.previewImage = this.props.pictureUrl[num + 1].url;
  582. this.setState({
  583. previewImage: this.state.previewImage,
  584. rotateDeg: 0
  585. });
  586. }
  587. upImg() {
  588. let num = 0;
  589. for (let i = 0; i < this.props.pictureUrl.length; i++) {
  590. if (this.props.pictureUrl[i].url == this.state.previewImage) {
  591. num = i;
  592. }
  593. }
  594. if (num == 0) {
  595. return message.warning("已经是第一张了哦");
  596. }
  597. this.state.previewImage = this.props.pictureUrl[num - 1].url;
  598. this.setState({
  599. previewImage: this.state.previewImage,
  600. rotateDeg: 0
  601. });
  602. }
  603. rotate() {
  604. let rotateDeg = this.state.rotateDeg + 90;
  605. this.setState({
  606. rotateDeg
  607. });
  608. }
  609. reset() {
  610. this.setState({
  611. paymentTimes: null,
  612. paymentAmount: "",
  613. invoiceTimes: null,
  614. invoiceAmount: "",
  615. cwCost: "",
  616. refundableAmount: "",
  617. cwRemarks: ""
  618. });
  619. }
  620. getOrgCodeUrl(e) {
  621. this.setState({
  622. orgCodeUrl: e
  623. });
  624. }
  625. // //查看催款节点
  626. // loaduserss(record) {
  627. // this.state.orderList = [];
  628. // this.setState({
  629. // orderNoss: record ? record.orderNo : this.props.datauser.orderNo
  630. // });
  631. // $.ajax({
  632. // method: "get",
  633. // dataType: "json",
  634. // crossDomain: false,
  635. // url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  636. // data: {
  637. // orderNo: record ? record.orderNo : this.props.datauser.orderNo
  638. // },
  639. // success: function(data) {
  640. // let theArr = [];
  641. // let thisData = [];
  642. // if (!thisData) {
  643. // if (data.error && data.error.length) {
  644. // message.warning(data.error[0].message);
  645. // }
  646. // thisData = {};
  647. // } else {
  648. // for (let i = 0; i < data.data.length; i++) {
  649. // thisData = data.data[i];
  650. // theArr.push({
  651. // key: i,
  652. // dunSubject: thisData.dunSubject
  653. // ? thisData.dunSubject.toString()
  654. // : "", //催款科目
  655. // id: thisData.id, //节点Id
  656. // money: thisData.money, //催款金额
  657. // dunStatus: thisData.dunStatus, //催款状态
  658. // orderNo: record ? record.orderNo : this.props.datauser.orderNo
  659. // });
  660. // }
  661. // this.setState({
  662. // contactList: theArr
  663. // });
  664. // }
  665. // }.bind(this)
  666. // }).always(
  667. // function() {
  668. // this.setState({
  669. // loading: false
  670. // });
  671. // }.bind(this)
  672. // );
  673. // }
  674. timestampToTime(timestamp) {
  675. var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  676. var Y = date.getFullYear() + "-";
  677. var M =
  678. (date.getMonth() + 1 < 10
  679. ? "0" + (date.getMonth() + 1)
  680. : date.getMonth() + 1) + "-";
  681. var D = date.getDate() + " ";
  682. var h = date.getHours() + ":";
  683. var m = date.getMinutes() + ":";
  684. var s = date.getSeconds();
  685. return Y + M + D + h + m + s;
  686. }
  687. reLoad() {
  688. $.ajax({
  689. method: "get",
  690. dataType: "json",
  691. crossDomain: false,
  692. url:
  693. globalConfig.context + "/api/admin/orderChange/listOrderRefundInvoice",
  694. data: {
  695. orderNo: this.props.data.orderNo
  696. },
  697. success: data => {
  698. if (!data) return;
  699. data.data.forEach(item => {
  700. item.load = true;
  701. });
  702. this.setState({
  703. contactList: data.data
  704. });
  705. }
  706. });
  707. }
  708. // 完成订单
  709. finish() {
  710. // this.props.onCancel()
  711. this.setState({
  712. loading: true
  713. })
  714. $.ajax({
  715. url: globalConfig.context + "/api/admin/orderChange/completeOrderChange",
  716. method: "get",
  717. data: {
  718. orderNo: this.props.data.orderNo,
  719. type: this.props.data.type,
  720. id: this.props.data.id
  721. },
  722. success: data => {
  723. if (data.data) {
  724. message.success("提交成功!");
  725. // window.location.reload();
  726. this.setState({
  727. loading: false
  728. })
  729. this.props.onCancel()
  730. } else if (data.error && data.error.length) {
  731. message.warning(data.error[0].message)
  732. this.setState({
  733. loading: false
  734. });
  735. }
  736. }
  737. });
  738. }
  739. contactSave(index) {
  740. if (this.state.contactList) {
  741. let Data = this.state.contactList;
  742. for (var a = 0; a < Data.length; a++) {
  743. if (Data[a].amount == "") {
  744. message.warning("退票金额不能为空");
  745. // this.refs.signFirstPayment.focus();
  746. return false;
  747. }
  748. }
  749. }
  750. // this.setState({
  751. // loading: true
  752. // });
  753. $.ajax({
  754. url:
  755. globalConfig.context + "/api/admin/orderChange/addOrderRefundInvoice",
  756. method: "post",
  757. data: {
  758. orderNo: this.props.data.orderNo,
  759. amount: index.amount
  760. }
  761. }).done(
  762. function (data) {
  763. if (!data.error.length) {
  764. message.success("保存成功!");
  765. let num = 0;
  766. this.state.contactList.forEach(item => {
  767. num += +item.amount;
  768. // if (item.key == index.key) {
  769. // item.load = true;
  770. // let time = this.timestampToTime(new Date().getTime());
  771. // item.createTimes = time;
  772. // }
  773. });
  774. this.setState({
  775. contactList: this.state.contactList,
  776. refundInvoice: num
  777. });
  778. this.reLoad();
  779. console.log("bug", this.state);
  780. } else {
  781. message.warning(data.error[0].message);
  782. }
  783. }.bind(this)
  784. );
  785. }
  786. //点击新增催款节点
  787. addcontact() {
  788. // let key = this.state.contactList.length
  789. // if(key == 0) {
  790. // key
  791. // }
  792. this.state.contactList.push({
  793. key: this.state.contactList.length,
  794. amount: "",
  795. createTime: undefined
  796. // orderNo: this.state.orderNoss,
  797. // dunTarget: this.state.kehuId
  798. });
  799. this.setState({
  800. contactList: this.state.contactList
  801. });
  802. }
  803. //删除收款节点
  804. confirmDelet(index) {
  805. // if (index.id) {
  806. // this.state.contactList.splice(index.key, 1);
  807. // this.setState({
  808. // contactList: this.state.contactList
  809. // });
  810. // this.contactSave();
  811. // } else {
  812. // this.state.contactList.splice(index.key, 1);
  813. // this.setState({
  814. // contactList: this.state.contactList
  815. // });
  816. // }
  817. // if(this.state.contactList.length == 1) {
  818. // this.state.contactList = []
  819. // this.setState({
  820. // contactList: this.state.contactList
  821. // });
  822. // return
  823. // }
  824. // let num = index.key
  825. // if (this.state.contactList[num + 1].key) {
  826. // this.state.contactList[num + 1].key = index.key;
  827. // }
  828. if (index.key || !index.id) {
  829. let num = this.state.contactList.findIndex(item => item.key == index.key);
  830. this.state.contactList.splice(num, 1);
  831. let total = 0;
  832. this.state.contactList.forEach(item => {
  833. total += +item.amount;
  834. });
  835. this.setState({
  836. contactList: this.state.contactList,
  837. refundInvoice: total
  838. });
  839. } else {
  840. $.ajax({
  841. url:
  842. globalConfig.context +
  843. "/api/admin/orderChange/deleteOrderRefundInvoice",
  844. method: "post",
  845. data: {
  846. id: index.id
  847. }
  848. }).done(
  849. function (data) {
  850. if (!data.error.length) {
  851. message.success("删除成功!");
  852. this.reLoad();
  853. } else {
  854. message.warning(data.error[0].message);
  855. }
  856. }.bind(this)
  857. );
  858. }
  859. // console.log(this.state.contactList[num + 1].key);
  860. }
  861. // loadData() {
  862. // $.ajax({
  863. // method: "get",
  864. // dataType: "json",
  865. // async: false,
  866. // crossDomain: false,
  867. // url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  868. // data: {
  869. // changeId: this.props.data.id
  870. // },
  871. // success: function(data) {
  872. // if (data.error.length || data.data.list == "") {
  873. // if (data.error && data.error.length) {
  874. // message.warning(data.error[0].message);
  875. // }
  876. // } else {
  877. // this.setState({
  878. // dataSource: data.data
  879. // });
  880. // }
  881. // }.bind(this)
  882. // });
  883. // }
  884. //同意拒绝按钮的有无
  885. changeButtonStatus() {
  886. this.setState({
  887. buttonStatus: !this.state.buttonStatus
  888. });
  889. }
  890. onRef(ref) {
  891. this.fun = ref;
  892. }
  893. render() {
  894. const pageData = [
  895. {
  896. labelA: "客户名称",
  897. formItemLayoutA: formItemLayout,
  898. dataA: this.props.data.userName,
  899. labelB: "合同编号",
  900. formItemLayoutB: formItemLayout,
  901. dataB: this.props.data.contractNo
  902. },
  903. {
  904. labelA: "时间",
  905. formItemLayoutA: formItemLayout,
  906. dataA: this.props.data.createTimes,
  907. labelB: "发起人",
  908. formItemLayoutB: formItemLayout,
  909. dataB: this.props.data.applicant
  910. },
  911. {
  912. labelA: "当前进度",
  913. formItemLayoutA: formItemLayout,
  914. // 当前是咨询师以及咨询师经理时使用shenhePeo函数,其他流程正常显示
  915. dataA:
  916. this.props.data.processState == 2 || this.props.data.processState == 3
  917. ? shenghePeo(
  918. this.props.data.processState == 2
  919. ? this.props.data.consultantExamine
  920. : this.props.data.managerExamine,
  921. this.props.data.processState
  922. )
  923. : getProcessStatusNew(
  924. this.props.data.processState,
  925. this.props.data.status
  926. ),
  927. labelB: "变更类型",
  928. formItemLayoutB: formItemLayout,
  929. dataB: getChangeType(this.props.data.type)
  930. },
  931. {
  932. labelA: "合同额(万元)",
  933. formItemLayoutA: formItemLayout,
  934. dataA: this.moneyOld(this.props.data.totalAmount, this.props.money),
  935. labelB: "已收款(万元)",
  936. formItemLayoutB: formItemLayout,
  937. dataB: changeColor(this.props.data.settlementAmount)
  938. },
  939. {
  940. labelA: "欠款(万元)",
  941. formItemLayoutA: formItemLayout,
  942. dataA: changeColor(this.props.data.arrears),
  943. labelB: "申请退款(万元)",
  944. formItemLayoutB: formItemLayout,
  945. dataB: changeColor(this.props.data.changeAmount)
  946. },
  947. {
  948. labelA: "变更原因",
  949. formItemLayoutA: formItemLayout,
  950. dataA: this.props.data.remarks
  951. }
  952. ];
  953. const planData = [
  954. {
  955. labelA: "项目进度",
  956. formItemLayoutA: formItemLayout,
  957. dataA: this.props.data.projectState,
  958. onChangeA: value => {
  959. this.setState({
  960. projectState: value
  961. });
  962. },
  963. labelB: "发生成本费用(万元)",
  964. formItemLayoutB: formItemLayout,
  965. dataB: this.props.data.zxsCost,
  966. onChangeB: value => {
  967. this.setState({
  968. zxsCost: value
  969. });
  970. }
  971. },
  972. {
  973. labelA: "备注",
  974. formItemLayoutA: formItemLayout,
  975. dataA: this.props.data.zxsRemarks,
  976. onChangeA: value => {
  977. this.setState({
  978. zxsRemarks: value
  979. });
  980. }
  981. }
  982. ];
  983. const financeData = [
  984. {
  985. labelA: "发生成本(万元)",
  986. formItemLayoutA: formItemLayout,
  987. dataA: this.props.data.cwCost ? this.props.data.cwCost : "0",
  988. onChangeA: value => {
  989. this.setState({
  990. cwCost: value
  991. });
  992. },
  993. labelB: "应退金额(万元)",
  994. formItemLayoutB: formItemLayout,
  995. dataB: this.props.data.refundableAmount
  996. ? this.props.data.refundableAmount
  997. : "0",
  998. onChangeB: value => {
  999. this.setState({
  1000. refundableAmount: value
  1001. });
  1002. },
  1003. mark: true
  1004. }
  1005. // {
  1006. // labelA: "备注",
  1007. // formItemLayoutA: formItemLayout,
  1008. // dataA: this.props.data.cwRemarks,
  1009. // onChangeA: value => {
  1010. // this.setState({
  1011. // reason: value
  1012. // });
  1013. // },
  1014. // mark: false
  1015. // }
  1016. ];
  1017. const buttonData = [
  1018. {
  1019. name: "同意",
  1020. title: "理由",
  1021. placeholder: "请输入理由",
  1022. type: "primary",
  1023. status: 2,
  1024. onChange: value => {
  1025. this.setState({
  1026. remarks: value
  1027. });
  1028. }
  1029. },
  1030. {
  1031. name: "拒绝",
  1032. title: "理由",
  1033. placeholder: "请输入理由",
  1034. type: "danger",
  1035. status: 3,
  1036. onChange: value => {
  1037. this.setState({
  1038. remarks: value
  1039. });
  1040. }
  1041. }
  1042. ];
  1043. const orgCodeUrl = this.props.pictureUrl;
  1044. return (
  1045. <div className="clearfix changeDetail">
  1046. <div
  1047. className="clearfix"
  1048. ref={(e) => {
  1049. this.refs = e;
  1050. }}
  1051. >
  1052. <div
  1053. style={{
  1054. borderRadius: "50%",
  1055. width: 300,
  1056. height: 300,
  1057. position: "absolute",
  1058. top: 230,
  1059. left: 525,
  1060. transform: "rotate(-5deg)",
  1061. zIndex: 1,
  1062. display:
  1063. (this.props.data.processState == 7 ||
  1064. this.props.data.processState == 8) &&
  1065. this.props.data.status == 4
  1066. ? "block"
  1067. : "none",
  1068. }}
  1069. >
  1070. {/* <span
  1071. style={{
  1072. fontSize: 29,
  1073. position: "absolute",
  1074. left: "50%",
  1075. top: "50%",
  1076. transform: "translate(-50%,-50%)",
  1077. color: "red"
  1078. }}
  1079. >
  1080. 通过
  1081. </span> */}
  1082. <img src={tongguo} style={{ width: "100%" }} />
  1083. </div>
  1084. <div
  1085. style={{
  1086. borderRadius: "50%",
  1087. width: 300,
  1088. height: 300,
  1089. position: "absolute",
  1090. top: 284,
  1091. left: 586,
  1092. transform: "rotate(-5deg)",
  1093. zIndex: 1,
  1094. display: this.props.data.status == 5 ? "block" : "none",
  1095. }}
  1096. >
  1097. <img src={quxiao} style={{ width: "63%" }} />
  1098. </div>
  1099. <h2 style={{ textAlign: "center", marginBottom: 10, marginTop: 20 }}>
  1100. 合同变更记录
  1101. </h2>
  1102. {pageData.map((item, index) => {
  1103. return <Itemlist key={index} pageData={item} />;
  1104. })}
  1105. <Form.Item
  1106. label="变更凭证"
  1107. labelCol={{ span: 4 }}
  1108. wrapperCol={{ span: 18 }}
  1109. >
  1110. <Upload
  1111. className="demandDetailShow-upload"
  1112. listType="picture-card"
  1113. fileList={orgCodeUrl}
  1114. onPreview={(file) => {
  1115. this.setState({
  1116. previewImage: file.url || file.thumbUrl,
  1117. previewVisible: true,
  1118. });
  1119. }}
  1120. />
  1121. <Modal
  1122. maskClosable={false}
  1123. footer={null}
  1124. visible={this.state.previewVisible}
  1125. onCancel={() => {
  1126. this.setState({ previewVisible: false, rotateDeg: 0 }, () => {
  1127. this.reset();
  1128. });
  1129. }}
  1130. >
  1131. <img
  1132. alt=""
  1133. style={{
  1134. width: "100%",
  1135. transform: `rotate(${this.state.rotateDeg}deg)`,
  1136. }}
  1137. src={this.state.previewImage || ""}
  1138. />
  1139. <Button
  1140. onClick={this.rotate}
  1141. style={{
  1142. position: "relative",
  1143. left: "50%",
  1144. transform: "translateX(-50%)",
  1145. }}
  1146. >
  1147. 旋转
  1148. </Button>
  1149. <Button
  1150. onClick={this.upImg}
  1151. style={{
  1152. position: "absolute",
  1153. left: -81,
  1154. top: "50%",
  1155. transform: "translateY(-50%)",
  1156. }}
  1157. >
  1158. 上一张
  1159. </Button>
  1160. <Button
  1161. onClick={this.downImg}
  1162. style={{
  1163. position: "absolute",
  1164. right: -81,
  1165. top: "50%",
  1166. transform: "translateY(-50%)",
  1167. }}
  1168. >
  1169. 下一张
  1170. </Button>
  1171. </Modal>
  1172. <Rizhi changeId={this.props.id} />
  1173. </Form.Item>
  1174. <ul
  1175. style={{
  1176. width: "868px",
  1177. overflow: "hidden",
  1178. paddingLeft: "90px",
  1179. paddingTop: "10px",
  1180. position: "relative",
  1181. bottom: "20px",
  1182. fontSize: "12px",
  1183. color: "rgba(0, 0, 0, 0.65)",
  1184. }}
  1185. >
  1186. {/* <span>操作人:</span> */}
  1187. {this.props.dataSource.map((item, index) => {
  1188. if (item.status == 0) {
  1189. item.status = "发起";
  1190. } else if (item.status == 1) {
  1191. item.status = "审核中";
  1192. } else if (item.status == 2) {
  1193. item.status = "通过";
  1194. } else if (item.status == 3) {
  1195. item.status = "驳回";
  1196. } else if (item.status == 4) {
  1197. item.status = "完成";
  1198. }
  1199. return (
  1200. <li
  1201. key={index}
  1202. style={{
  1203. width: "100%",
  1204. height: "auto",
  1205. wordBreak: "break-all",
  1206. marginBottom: "10px",
  1207. }}
  1208. >
  1209. {item.aname + ":" + "(" + item.status + ")" + item.remarks}
  1210. </li>
  1211. );
  1212. })}
  1213. </ul>
  1214. <ProAndCuiList id={this.props.id} />
  1215. <div className="clearfix">
  1216. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1217. 收款情况
  1218. </h3>
  1219. <div style={{ marginLeft: "90px" }}>
  1220. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  1221. {(this.props.proceedsData.bill || []).map((item, index) => (
  1222. <li key={index}>
  1223. {item.payTime +
  1224. " " +
  1225. item.aName +
  1226. " 收款:" +
  1227. item.transactionAmount +
  1228. "万元"}
  1229. </li>
  1230. ))}
  1231. </ul>
  1232. <div>收款总计:{this.props.proceedsTotal}万元</div>
  1233. </div>
  1234. <br />
  1235. <div style={{ marginLeft: "90px" }}>
  1236. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  1237. {(this.props.proceedsData.invoice || []).map((item, index) => (
  1238. <li key={index}>
  1239. {item.createTime + " " + " 开票:" + item.amount + "万元"}
  1240. </li>
  1241. ))}
  1242. </ul>
  1243. <div>开票总计:{this.props.invoiceTotal}万元</div>
  1244. </div>
  1245. <p style={{ marginLeft: "90px", color: "red" }}>
  1246. 系统预估 产生成本(万元):
  1247. {this.props.data.estimateCost
  1248. ? this.props.data.estimateCost
  1249. : "0"}{" "}
  1250. &nbsp;应退金额(万元):
  1251. {this.props.data.estimateRefundable
  1252. ? this.props.data.estimateRefundable
  1253. : "0"}
  1254. </p>
  1255. </div>
  1256. {/* {this.props.data.type === 0 ? (
  1257. <div>
  1258. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1259. 当前项目进度(咨询师经理填写)
  1260. </h3>
  1261. {planData.map((item, index) => {
  1262. return <Itemlist key={index} pageData={item} />;
  1263. })}
  1264. </div>
  1265. ) : (
  1266. ""
  1267. )} */}
  1268. <div
  1269. style={{
  1270. display:
  1271. (this.props.data.processState == 8 ||
  1272. this.props.data.processState == 7) &&
  1273. (this.props.data.status == 2 || this.props.data.status == 4)
  1274. ? "block"
  1275. : "none",
  1276. }}
  1277. >
  1278. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1279. 回收退票
  1280. </h3>
  1281. {/* {this.state.processStatus == 0 ? ( */}
  1282. <Button
  1283. type="primary"
  1284. onClick={this.addcontact}
  1285. style={{
  1286. float: "right",
  1287. marginRight: "50px",
  1288. marginBottom: "15px",
  1289. position: "relative",
  1290. zIndex: "999",
  1291. display:
  1292. (this.props.data.processState == 7 ||
  1293. this.props.data.processState == 8) &&
  1294. this.props.data.status == 4
  1295. ? "none"
  1296. : "block",
  1297. }}
  1298. >
  1299. 添加回收退票
  1300. </Button>
  1301. {/* ) : (
  1302. ""
  1303. )} */}
  1304. <Table
  1305. pagination={false}
  1306. bordered
  1307. columns={this.state.ContactsLists}
  1308. dataSource={this.state.contactList}
  1309. size="small"
  1310. />
  1311. </div>
  1312. {this.props.data.processState != 5 ? (
  1313. <div>
  1314. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1315. 当前财务状态(财务填写)
  1316. </h3>
  1317. {/* <div className="clearfix">
  1318. <Form.Item
  1319. className="half-item"
  1320. label="收款时间"
  1321. labelCol={{ span: 8 }}
  1322. wrapperCol={{ span: 14 }}
  1323. >
  1324. <span>{this.props.data.paymentTimes}</span>
  1325. </Form.Item>
  1326. <Form.Item
  1327. className="half-item"
  1328. label="收款金额(万元)"
  1329. labelCol={{ span: 8 }}
  1330. wrapperCol={{ span: 14 }}
  1331. >
  1332. <span>{this.props.data.paymentAmount}</span>
  1333. </Form.Item>
  1334. </div>
  1335. <div className="clearfix">
  1336. <Form.Item
  1337. className="half-item"
  1338. label="开票时间"
  1339. labelCol={{ span: 8 }}
  1340. wrapperCol={{ span: 14 }}
  1341. >
  1342. <span>{this.props.data.invoiceTimes}</span>
  1343. </Form.Item>
  1344. <Form.Item
  1345. className="half-item"
  1346. label="开票金额(万元)"
  1347. labelCol={{ span: 8 }}
  1348. wrapperCol={{ span: 14 }}
  1349. >
  1350. <span>{this.props.data.invoiceAmount}</span>
  1351. </Form.Item>
  1352. </div> */}
  1353. {financeData.map((item, index) => {
  1354. return <Itemlist key={index} pageData={item} />;
  1355. })}
  1356. </div>
  1357. ) : (
  1358. <div style={{ marginBottom: 10 }}>
  1359. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1360. 当前财务状态(财务填写)
  1361. </h3>
  1362. <div className="clearfix">
  1363. {/* <Form.Item
  1364. className="half-item"
  1365. label="收款时间"
  1366. labelCol={{ span: 8 }}
  1367. wrapperCol={{ span: 14 }}
  1368. >
  1369. <DatePicker
  1370. style={{ width: 160 }}
  1371. value={
  1372. this.state.paymentTimes
  1373. ? moment(this.state.paymentTimes)
  1374. : null
  1375. }
  1376. onChange={(_data, dataString) => {
  1377. this.setState({
  1378. paymentTimes: dataString
  1379. });
  1380. }}
  1381. />
  1382. </Form.Item>
  1383. <Form.Item
  1384. className="half-item"
  1385. label="收款金额(万元)"
  1386. labelCol={{ span: 8 }}
  1387. wrapperCol={{ span: 14 }}
  1388. >
  1389. <Input
  1390. style={{ width: 160 }}
  1391. value={this.state.paymentAmount}
  1392. placeholder="请输入收款金额"
  1393. onChange={e => {
  1394. this.setState({
  1395. paymentAmount: e.target.value
  1396. });
  1397. }}
  1398. />
  1399. </Form.Item>
  1400. </div>
  1401. <div className="clearfix">
  1402. <Form.Item
  1403. className="half-item"
  1404. label="开票时间"
  1405. labelCol={{ span: 8 }}
  1406. wrapperCol={{ span: 14 }}
  1407. >
  1408. <DatePicker
  1409. style={{ width: 160 }}
  1410. value={
  1411. this.state.invoiceTimes
  1412. ? moment(this.state.invoiceTimes)
  1413. : null
  1414. }
  1415. onChange={(_data, dataString) => {
  1416. this.setState({
  1417. invoiceTimes: dataString
  1418. });
  1419. }}
  1420. />
  1421. </Form.Item>
  1422. <Form.Item
  1423. className="half-item"
  1424. label="开票金额(万元)"
  1425. labelCol={{ span: 8 }}
  1426. wrapperCol={{ span: 14 }}
  1427. >
  1428. <Input
  1429. style={{ width: 160 }}
  1430. value={this.state.invoiceAmount}
  1431. placeholder="请输入开票金额"
  1432. onChange={e => {
  1433. this.setState({
  1434. invoiceAmount: e.target.value
  1435. });
  1436. }}
  1437. />
  1438. </Form.Item> */}
  1439. <Form.Item
  1440. className="half-item"
  1441. label="发生成本(万元)"
  1442. labelCol={{ span: 8 }}
  1443. wrapperCol={{ span: 14 }}
  1444. >
  1445. <Input
  1446. style={{ width: 160 }}
  1447. value={this.state.cwCost}
  1448. placeholder="请输入发生成本"
  1449. onChange={(e) => {
  1450. this.setState({
  1451. cwCost: e.target.value,
  1452. });
  1453. }}
  1454. />
  1455. </Form.Item>
  1456. <Form.Item
  1457. className="half-item"
  1458. label="应退金额(万元)"
  1459. labelCol={{ span: 8 }}
  1460. wrapperCol={{ span: 14 }}
  1461. >
  1462. <Input
  1463. style={{ width: 160 }}
  1464. value={this.state.refundableAmount}
  1465. placeholder="请输入应退金额"
  1466. onChange={(e) => {
  1467. this.setState({
  1468. refundableAmount: e.target.value,
  1469. });
  1470. }}
  1471. />
  1472. </Form.Item>
  1473. </div>
  1474. <div
  1475. style={{
  1476. marginTop: "10px",
  1477. display:
  1478. this.props.processState == this.props.data.processState
  1479. ? "block"
  1480. : "none",
  1481. }}
  1482. >
  1483. <Form.Item
  1484. label="备注"
  1485. labelCol={{ span: 4 }}
  1486. wrapperCol={{ span: 14 }}
  1487. >
  1488. <Input.TextArea
  1489. rows={4}
  1490. value={this.state.reason}
  1491. placeholder="请输入补充资料/备注"
  1492. onChange={(e) => {
  1493. this.setState({
  1494. reason: e.target.value,
  1495. });
  1496. }}
  1497. />
  1498. </Form.Item>
  1499. </div>
  1500. </div>
  1501. )}
  1502. <ul
  1503. style={{
  1504. margin: "10px 0 0 20px",
  1505. color: "red",
  1506. display:
  1507. (this.props.data.processState == 7 ||
  1508. this.props.data.processState == 8) &&
  1509. (this.props.data.status == 4 || this.props.data.status == 2)
  1510. ? "inline-block"
  1511. : "none",
  1512. }}
  1513. >
  1514. <li>
  1515. {"本次应收退票(万元):" +
  1516. (this.props.data.refundableAmount == null
  1517. ? 0
  1518. : this.props.data.refundableAmount)}
  1519. </li>
  1520. <li>
  1521. {"累计已回收退票(万元):" +
  1522. (this.state.refundInvoice == null
  1523. ? 0
  1524. : this.state.refundInvoice)}
  1525. </li>
  1526. </ul>
  1527. <div
  1528. style={{
  1529. position: "relative",
  1530. display:
  1531. (this.props.data.processState == 7 ||
  1532. this.props.data.processState == 8) &&
  1533. this.props.data.status == 4 &&
  1534. !this.props.data.refundStatus
  1535. ? "block"
  1536. : "none",
  1537. marginTop: 10,
  1538. }}
  1539. >
  1540. <hr
  1541. style={{
  1542. marginTop: 12,
  1543. marginBottom: 10,
  1544. backgroundColor: "black",
  1545. height: 1,
  1546. border: "none",
  1547. }}
  1548. />
  1549. <h3
  1550. style={{
  1551. marginLeft: 20,
  1552. fontWeight: 800,
  1553. marginBottom: 10,
  1554. display: "inline-block",
  1555. }}
  1556. >
  1557. 执行退款{" "}
  1558. <span
  1559. style={{ fontSize: 12, fontWeight: "normal", color: "red" }}
  1560. >
  1561. (注:执行退款,系统将从已收款金额中直接减款)
  1562. </span>
  1563. </h3>
  1564. <Button onClick={this.addRefund} style={{ float: "right" }}>
  1565. 添加执行退款
  1566. </Button>
  1567. <Table
  1568. pagination={false}
  1569. bordered
  1570. columns={this.state.refundColumn}
  1571. dataSource={this.state.refundDataSource}
  1572. scroll={{ x: "max-content", y: 0 }}
  1573. size="small"
  1574. />
  1575. <div className="clearfix">
  1576. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1577. 上传退款凭证
  1578. </h3>
  1579. <div style={{ marginLeft: 20 }}>
  1580. <PicturesWall
  1581. fileList={this.getVoucherUrl}
  1582. pictureUrl={this.state.voucherUrl}
  1583. url="/api/admin/orderChange/uploadRefund"
  1584. sign="order_change_file"
  1585. />
  1586. </div>
  1587. </div>
  1588. <Button
  1589. type="primary"
  1590. onClick={this.refundExecute}
  1591. style={{
  1592. position: "relative",
  1593. left: "50%",
  1594. transform: "translateX(-50%)",
  1595. }}
  1596. >
  1597. 确定执行退款
  1598. </Button>
  1599. </div>
  1600. <div
  1601. style={{
  1602. display:
  1603. (this.props.data.processState == 7 ||
  1604. this.props.data.processState == 8) &&
  1605. this.props.data.status == 4 &&
  1606. this.props.data.refundStatus
  1607. ? "block"
  1608. : "none",
  1609. }}
  1610. >
  1611. <Refund
  1612. data={this.props.data}
  1613. id={this.props.id}
  1614. dataSource={this.state.refundDataSource}
  1615. />
  1616. </div>
  1617. </div>
  1618. {this.props.data.processState == 5 ? (
  1619. this.state.buttonStatus ? (
  1620. <div>
  1621. <div
  1622. className="clearfix"
  1623. style={{ display: "flex", justifyContent: "space-around" }}
  1624. >
  1625. {buttonData.map((item, index) => {
  1626. return (
  1627. <AgreeButton
  1628. data={item}
  1629. key={index}
  1630. backData={this.props.data}
  1631. processState={this.props.processState}
  1632. visible={this.changeButtonStatus}
  1633. ajaxData={this.state}
  1634. loadData={this.props.loadData}
  1635. rejectState={this.state.rejectState}
  1636. reason={this.state.reason}
  1637. onCancel={this.props.onCancel}
  1638. />
  1639. );
  1640. })}
  1641. </div>
  1642. <Select
  1643. defaultValue="0"
  1644. style={{
  1645. width: 120,
  1646. float: "left",
  1647. position: "relative",
  1648. bottom: "28px",
  1649. right: "-600px",
  1650. }}
  1651. onChange={(val) => {
  1652. this.setState({ rejectState: val });
  1653. // console.log(val, this.state.rejectState);
  1654. }}
  1655. >
  1656. <Option
  1657. value="0"
  1658. style={{
  1659. display: this.props.processState >= 1 ? "block" : "none",
  1660. }}
  1661. >
  1662. 营销员
  1663. </Option>
  1664. <Option
  1665. value="1"
  1666. style={{
  1667. display: this.props.processState >= 2 ? "block" : "none",
  1668. }}
  1669. >
  1670. 营销管理员
  1671. </Option>
  1672. <Option
  1673. value="2"
  1674. style={{
  1675. display: this.props.processState >= 3 ? "block" : "none",
  1676. }}
  1677. >
  1678. 咨询师
  1679. </Option>
  1680. <Option
  1681. value="3"
  1682. style={{
  1683. display: this.props.processState >= 4 ? "block" : "none",
  1684. }}
  1685. >
  1686. 咨询师经理
  1687. </Option>
  1688. <Option
  1689. value="4"
  1690. style={{
  1691. display: this.props.processState >= 5 ? "block" : "none",
  1692. }}
  1693. >
  1694. 咨询师总监
  1695. </Option>
  1696. <Option
  1697. value="5"
  1698. style={{
  1699. display: this.props.processState >= 6 ? "block" : "none",
  1700. }}
  1701. >
  1702. 财务专员(退单)
  1703. </Option>
  1704. <Option
  1705. value="6"
  1706. style={{
  1707. display: this.props.processState >= 7 ? "block" : "none",
  1708. }}
  1709. >
  1710. 财务总监
  1711. </Option>
  1712. <Option
  1713. value="7"
  1714. style={{
  1715. display: this.props.processState >= 8 ? "block" : "none",
  1716. }}
  1717. >
  1718. 总裁
  1719. </Option>
  1720. </Select>
  1721. </div>
  1722. ) : (
  1723. ""
  1724. )
  1725. ) : (
  1726. ""
  1727. )}
  1728. <Button
  1729. type="primary"
  1730. shape="round"
  1731. size="large"
  1732. style={{
  1733. position: "absolute",
  1734. left: "50%",
  1735. bottom: "0",
  1736. transform: "translateX(-50%)",
  1737. display:
  1738. (this.props.data.processState == 7 ||
  1739. this.props.data.processState == 8) &&
  1740. this.props.data.status == 2
  1741. ? "block"
  1742. : "none",
  1743. }}
  1744. onClick={this.finish}
  1745. >
  1746. 完成订单
  1747. </Button>
  1748. <ReactToPrint
  1749. trigger={() => (
  1750. <Button
  1751. type="primary"
  1752. style={{
  1753. float: "right",
  1754. marginTop: 10,
  1755. position: "absolute",
  1756. top: 0,
  1757. right: 30,
  1758. display:
  1759. (this.props.data.processState == 7 ||
  1760. this.props.data.processState == 8) &&
  1761. this.props.data.status == 4
  1762. ? "block"
  1763. : "block",
  1764. }}
  1765. >
  1766. 打印
  1767. </Button>
  1768. )}
  1769. content={() => this.refs}
  1770. />
  1771. <Modal
  1772. maskClosable={false}
  1773. visible={this.state.addRefundVisible}
  1774. onOk={this.refundCancel}
  1775. onCancel={this.refundCancel}
  1776. width="700px"
  1777. title="添加执行退款"
  1778. footer=""
  1779. className="admin-desc-content"
  1780. >
  1781. <Form
  1782. layout="horizontal"
  1783. onSubmit={this.nextSubmit}
  1784. // id="demand-form"
  1785. >
  1786. <Spin spinning={this.state.loading}>
  1787. <div className="clearfix">
  1788. <FormItem
  1789. className="half-item"
  1790. {...formItemLayoutRefund}
  1791. label="退款金额"
  1792. >
  1793. <Input
  1794. style={{ width: "155px" }}
  1795. placeholder="请输入退款金额"
  1796. value={this.state.refundMoney}
  1797. onChange={(e) => {
  1798. this.setState({
  1799. refundMoney: e.target.value,
  1800. });
  1801. }}
  1802. />
  1803. </FormItem>
  1804. <FormItem
  1805. className="half-item"
  1806. {...formItemLayoutRefund}
  1807. label="退款时间"
  1808. >
  1809. <DatePicker
  1810. value={
  1811. this.state.refundDate
  1812. ? moment(this.state.refundDate)
  1813. : null
  1814. }
  1815. onChange={(date, dateString) => {
  1816. console.log(date, dateString);
  1817. this.setState({
  1818. refundDate: dateString,
  1819. });
  1820. }}
  1821. />
  1822. </FormItem>
  1823. <FormItem
  1824. style={{ height: "auto" }}
  1825. labelCol={{ span: 3 }}
  1826. wrapperCol={{ span: 19 }}
  1827. label="备注"
  1828. >
  1829. <TextArea
  1830. rows={4}
  1831. placeholder="请输入备注信息"
  1832. style={{ width: "95%" }}
  1833. value={this.state.refundRemarks}
  1834. onChange={(e) => {
  1835. this.setState({
  1836. refundRemarks: e.target.value,
  1837. });
  1838. }}
  1839. />
  1840. </FormItem>
  1841. <FormItem
  1842. wrapperCol={{ span: 12, offset: 6 }}
  1843. className="half-middle"
  1844. style={{ marginTop: 10 }}
  1845. >
  1846. <Button
  1847. className="submitSave"
  1848. type="primary"
  1849. onClick={this.sumitRefund}
  1850. >
  1851. 保存
  1852. </Button>
  1853. <Button
  1854. className="submitSave"
  1855. type="ghost"
  1856. style={{ marginLeft: 10 }}
  1857. onClick={this.refundCancel}
  1858. >
  1859. 取消
  1860. </Button>
  1861. </FormItem>
  1862. </div>
  1863. </Spin>
  1864. </Form>
  1865. </Modal>
  1866. </div>
  1867. );
  1868. }
  1869. }
  1870. export { ChangeDetail };