changeDetailCwjl.js 53 KB

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