changeDetailCwzy.js 59 KB

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