changeDetailCwzy.js 54 KB

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