changeDetailCwzy.js 60 KB

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