changeDetailCwjl.js 57 KB

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