changeDetailCwjl.js 52 KB

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