changeDetailCwjl.js 53 KB

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