contractJszj.js 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502
  1. import React from "react";
  2. import { Button, Input, Spin, Table, message, Form, Modal, Tabs, Tooltip } from "antd";
  3. import $ from "jquery/src/ajax";
  4. import {
  5. getNewOrderStatus,
  6. getProcessStatusNew,
  7. splitUrl,
  8. getjiedian,
  9. getboutique,
  10. getCuikuan,
  11. getProjectStatus,
  12. ShowModal,
  13. getType
  14. } from "@/tools.js";
  15. import "./customer.less";
  16. import { ChangeDetail } from "./changeComponent/changeDetailJszj.js";
  17. import { SearchInput } from "./changeComponent/searchInput.js";
  18. import OrderDetail from "./changeComponent/orderDetail";
  19. import ShowModalDiv from "@/showModal.jsx";
  20. import OrderRiZi from "@/orderRiZi.jsx";
  21. import { ChooseList } from "./chooseList";
  22. import { getProjectName } from "../../../tools";
  23. import ProjectDetailsReadOnly from "../../../common/projectDetailsReadOnly";
  24. import OrderItemStatus from "../../../common/orderItemStatus";
  25. import Cascaders from "../../../common/cascaders";
  26. const contractChange = Form.create()(
  27. React.createClass({
  28. loadData(pageNo) {
  29. this.setState({
  30. loading: true
  31. });
  32. $.ajax({
  33. method: "get",
  34. dataType: "json",
  35. crossDomain: false,
  36. url: globalConfig.context + "/api/admin/orderChange/orderChangeList",
  37. data: {
  38. pageNo: pageNo || 1,
  39. pageSize: this.state.pagination.pageSize,
  40. userName: this.state.searchData.userNameSearch,
  41. processState: this.props.processState,
  42. timeType: this.state.searchData.timeTypeSearch,
  43. startTime: this.state.searchData.releaseDate[0],
  44. endTime: this.state.searchData.releaseDate[1],
  45. salesmanName: this.state.searchData.salesmanNameSearch,
  46. complete: this.state.searchData.completeSearch || 1,
  47. deps: this.state.searchData.deps,
  48. orderNo: this.state.searchData.orderNoSearch,
  49. contractNo: this.state.searchData.contractNoSearch,
  50. type: this.state.searchData.changeSearch
  51. },
  52. success: function (data) {
  53. ShowModal(this);
  54. let theArr = [];
  55. if (data.error.length || data.data.list == "") {
  56. if (data.error && data.error.length) {
  57. message.warning(data.error[0].message);
  58. }
  59. } else {
  60. for (let i = 0; i < data.data.list.length; i++) {
  61. let thisdata = data.data.list[i];
  62. theArr.push({
  63. key: i,
  64. orderNo: thisdata.orderNo,
  65. createTimes: thisdata.createTimes,
  66. nickname: thisdata.nickname,
  67. orderType: thisdata.orderType,
  68. establishTimes: thisdata.establishTimes,
  69. orderStatus: thisdata.orderStatus,
  70. totalAmount: thisdata.totalAmount,
  71. settlementAmount: thisdata.settlementAmount,
  72. arrears: thisdata.arrears,
  73. salesmanName: thisdata.salesmanName,
  74. depName: thisdata.depName,
  75. processState: thisdata.processState,
  76. type: thisdata.type,
  77. status: thisdata.status,
  78. id: thisdata.id,
  79. contractNo: thisdata.contractNo,
  80. processStateText: getProcessStatusNew(
  81. thisdata.processState,
  82. thisdata.status
  83. )
  84. });
  85. }
  86. this.state.pagination.total = data.data.totalCount;
  87. this.state.pagination.current = data.data.pageNo;
  88. }
  89. if (data.data && data.data.list && !data.data.list.length) {
  90. this.state.pagination.total = 0;
  91. }
  92. this.setState({
  93. dataSource: theArr,
  94. pageNo: pageNo,
  95. pagination: this.state.pagination
  96. });
  97. }.bind(this)
  98. }).always(
  99. function () {
  100. this.setState({
  101. loading: false
  102. });
  103. }.bind(this)
  104. );
  105. },
  106. getInitialState() {
  107. return {
  108. page: 1,
  109. searchData: {
  110. releaseDate: []
  111. },
  112. declarationBatch: 1,
  113. dataInfor: {},
  114. primaryOrderData: {}, //原订单数据
  115. orderData: {}, //现订单数据
  116. pictureUrl: [],
  117. voucherUrl: [],
  118. attachment: [],
  119. attachmentUrl: [],
  120. proceedsData: {},
  121. proTotal: 0,
  122. invTotal: 0,
  123. contractData: {},
  124. // 回收退票数据
  125. refundInvoice: [],
  126. RefundInvoice: [],
  127. additionalOrderData: {},
  128. paginations: false,
  129. activeKey: "a",
  130. confirmLoading: false,
  131. aloading: false,
  132. pagination: {
  133. defaultCurrent: 1,
  134. defaultPageSize: 10,
  135. showQuickJumper: true,
  136. pageSize: 10,
  137. onChange: function (page) {
  138. this.loadData(page);
  139. }.bind(this),
  140. showTotal: function (total) {
  141. return "共" + total + "条数据";
  142. }
  143. },
  144. columns: [
  145. {
  146. title: "合同编号",
  147. dataIndex: "contractNo",
  148. key: "contractNo"
  149. },
  150. {
  151. title: "订单编号",
  152. dataIndex: "orderNo",
  153. key: "orderNo"
  154. },
  155. {
  156. title: "客户名称",
  157. dataIndex: "nickname",
  158. key: "nickname",
  159. render: text => {
  160. return (
  161. <Tooltip title={text}>
  162. <div style={{
  163. maxWidth: '150px',
  164. overflow: 'hidden',
  165. textOverflow: "ellipsis",
  166. whiteSpace: 'nowrap',
  167. }}>{text}</div>
  168. </Tooltip>
  169. )
  170. }
  171. },
  172. {
  173. title: "订单部门",
  174. dataIndex: "depName",
  175. key: "depName"
  176. },
  177. {
  178. title: "订单类型",
  179. dataIndex: "orderType",
  180. key: "orderType",
  181. render: text => {
  182. return text ? "科技项目" : "认证项目";
  183. }
  184. },
  185. {
  186. title: "下单时间",
  187. dataIndex: "establishTimes",
  188. key: "establishTimes"
  189. },
  190. {
  191. title: "订单状态",
  192. dataIndex: "orderStatus",
  193. key: "orderStatus",
  194. render: text => {
  195. return getNewOrderStatus(text);
  196. }
  197. },
  198. {
  199. title: "合同额(万元)",
  200. dataIndex: "totalAmount",
  201. key: "totalAmount"
  202. },
  203. {
  204. title: "已付额(万元)",
  205. dataIndex: "settlementAmount",
  206. key: "settlementAmount"
  207. },
  208. {
  209. title: "欠款(万元)",
  210. dataIndex: "arrears",
  211. key: "arrears"
  212. },
  213. {
  214. title: "订单负责人",
  215. dataIndex: "salesmanName",
  216. key: "salesmanName"
  217. },
  218. {
  219. title: "变更类型",
  220. dataIndex: "type",
  221. key: "type",
  222. render: text => {
  223. return getType(text);
  224. }
  225. },
  226. {
  227. title: "审核状态",
  228. dataIndex: "processStateText",
  229. key: "processStateText"
  230. },
  231. {
  232. title: "提交时间",
  233. dataIndex: "createTimes",
  234. key: "createTimes"
  235. }
  236. ],
  237. dataSource: [],
  238. // 传递给子组件的
  239. dataProps: [],
  240. columnsX: [
  241. {
  242. title: "业务项目名称",
  243. dataIndex: "commodityName",
  244. key: "commodityName",
  245. render: (text, record) => {
  246. return (
  247. <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span></span>
  248. )
  249. }
  250. },
  251. {
  252. title: "项目类别",
  253. dataIndex: "cname",
  254. key: "cname"
  255. },
  256. {
  257. title: "项目数量",
  258. dataIndex: "commodityQuantity",
  259. key: "commodityQuantity"
  260. },
  261. {
  262. title: "金额(万元)",
  263. dataIndex: "commodityPrice",
  264. key: "commodityPrice"
  265. },
  266. {
  267. title: "负责人",
  268. dataIndex: "contacts",
  269. key: "contacts"
  270. },
  271. {
  272. title: "负责人电话",
  273. dataIndex: "contactsMobile",
  274. key: "contactsMobile"
  275. },
  276. {
  277. title: "项目状态",
  278. dataIndex: "projectStatus",
  279. key: "projectStatus",
  280. render: text => {
  281. return getProjectName(text);
  282. }
  283. },
  284. {
  285. title: "主要项目",
  286. dataIndex: "main",
  287. key: "main",
  288. render: text => {
  289. return text ? "是" : "否";
  290. }
  291. },
  292. {
  293. title: "总年限",
  294. dataIndex: "yearSum",
  295. key: "yearSum",
  296. render: (text, record) => {
  297. return (
  298. <div>{["", "一年", "二年", "三年", "四年", "五年"][text]}</div>
  299. );
  300. }
  301. },
  302. {
  303. title: "年限",
  304. dataIndex: "serviceLife",
  305. key: "serviceLife",
  306. render: (text, record) => {
  307. return (
  308. <div>{!!text && JSON.parse(text).toString()}</div>
  309. );
  310. }
  311. },
  312. {
  313. title: "本次派单",
  314. dataIndex: "serviceYear",
  315. key: "serviceYear",
  316. render: (text, record) => {
  317. return (
  318. <div>{!text ? "" : text}</div>
  319. );
  320. }
  321. },
  322. {
  323. title: "项目说明",
  324. dataIndex: "taskComment",
  325. key: "taskComment",
  326. render: text => {
  327. return (
  328. <Tooltip title={text}>
  329. <div
  330. style={{
  331. width: 100,
  332. overflow: "hidden",
  333. whiteSpace: "nowrap",
  334. textOverflow: "ellipsis",
  335. }}
  336. >{text}</div>
  337. </Tooltip>
  338. )
  339. }
  340. }
  341. ],
  342. columnsrizhi: [
  343. {
  344. title: "流程",
  345. dataIndex: "processName",
  346. key: "processName"
  347. },
  348. {
  349. title: "操作人",
  350. dataIndex: "adminName",
  351. key: "adminName"
  352. },
  353. {
  354. title: "时间",
  355. dataIndex: "createDate",
  356. key: "createDate"
  357. }
  358. ],
  359. dataSourceX: [],
  360. ContactsLists: [
  361. {
  362. title: "催款科目",
  363. dataIndex: "dunSubject",
  364. key: "dunSubject",
  365. render: text => {
  366. return getjiedian(text);
  367. }
  368. },
  369. {
  370. title: "金额(万元)",
  371. dataIndex: "money",
  372. key: "money"
  373. },
  374. {
  375. title: "催款状态",
  376. dataIndex: "dunStatus",
  377. key: "dunStatus",
  378. render: text => {
  379. return getCuikuan(text);
  380. }
  381. }
  382. ]
  383. };
  384. },
  385. //页面加载函数
  386. componentWillMount() {
  387. this.loadData();
  388. },
  389. //整行点击
  390. tableRowClick(record) {
  391. this.setState(
  392. {
  393. visible: true,
  394. type: record.type,
  395. status: record.status,
  396. buttonStatus: true,
  397. orderStatus: record.orderStatus,
  398. processStateText: record.processStateText,
  399. id: record.id,
  400. orderNo: record.orderNo
  401. },
  402. () => {
  403. this.xiangqing(record.orderNo);
  404. this.xiangmu(record.orderNo);
  405. this.jiedian(record.orderNo);
  406. this.jiedianNew(record.orderNo);
  407. this.createTabs();
  408. }
  409. );
  410. },
  411. //点击打卡项目详情
  412. tableRowClickX(record) {
  413. this.setState({
  414. jid: record.id, //项目ID
  415. kid: record.commodityId, //商品ID
  416. commodityName: record.commodityName, //金额
  417. commodityPrice: record.commodityPrice, //金额
  418. commodityQuantity: record.commodityQuantity, //数量
  419. taskComment: record.taskComment, //备注
  420. main: record.main.toString(), //是否为主要
  421. addnextVisible: true,
  422. dataInfor: record,
  423. addState: 0
  424. });
  425. },
  426. //项目详情关闭
  427. nextCancel() {
  428. this.setState({
  429. addnextVisible: false
  430. });
  431. },
  432. // 合同变更详情
  433. ChangeDetail(id) {
  434. let url = window.location.href.substring(7);
  435. $.ajax({
  436. method: "get",
  437. dataType: "json",
  438. crossDomain: false,
  439. url:
  440. globalConfig.context +
  441. "/api/admin/orderChange/orderChangeDetailsById",
  442. data: {
  443. id: id
  444. },
  445. success: function (data) {
  446. if (data.data) {
  447. let thisdata = data.data;
  448. Object.assign(thisdata, {
  449. processStateText: this.state.processStateText,
  450. userName: this.state.userName,
  451. contractNo: this.state.contractNo
  452. });
  453. this.setState({
  454. contractData: thisdata,
  455. voucherUrl: thisdata.voucherUrl
  456. ? splitUrl(
  457. thisdata.voucherUrl,
  458. ",",
  459. globalConfig.avatarHost + "/upload",
  460. url
  461. )
  462. : [],
  463. attachment: thisdata.attachmentUrl
  464. ? splitUrl(
  465. thisdata.attachmentUrl,
  466. ",",
  467. globalConfig.avatarHost + "/upload",
  468. url
  469. )
  470. : [],
  471. contractPictureUrl: thisdata.contractPictureUrl
  472. ? splitUrl(
  473. thisdata.contractPictureUrl,
  474. ",",
  475. globalConfig.avatarHost + "/upload",
  476. url
  477. )
  478. : []
  479. });
  480. }
  481. }.bind(this)
  482. });
  483. $.ajax({
  484. method: "get",
  485. dataType: "json",
  486. crossDomain: false,
  487. url:
  488. globalConfig.context +
  489. "/api/admin/orderChange/listOrderInvoiceAndBill",
  490. data: {
  491. orderNo: this.state.orderNo
  492. },
  493. success: function (data) {
  494. if (!data.data) return;
  495. let proTotal = 0;
  496. let invTotal = 0;
  497. data.data.bill.forEach(item => {
  498. proTotal += item.transactionAmount;
  499. });
  500. data.data.invoice.forEach(item => {
  501. invTotal += item.amount;
  502. });
  503. this.setState({
  504. proceedsData: data.data,
  505. proTotal: (Math.round(proTotal * 1000000) / 1000000).toFixed(6),
  506. invTotal: (Math.round(invTotal * 1000000) / 1000000).toFixed(6),
  507. });
  508. }.bind(this)
  509. });
  510. $.ajax({
  511. method: "get",
  512. dataType: "json",
  513. crossDomain: false,
  514. url:
  515. globalConfig.context +
  516. "/api/admin/orderChange/listOrderRefundInvoice",
  517. data: {
  518. orderNo: this.state.orderNo
  519. },
  520. success: data => {
  521. if (!data) return;
  522. data.data.forEach(item => {
  523. item.load = true;
  524. });
  525. this.setState({
  526. refundInvoice: data.data
  527. });
  528. }
  529. });
  530. },
  531. //订单详情
  532. xiangqing(orderNos) {
  533. $.ajax({
  534. method: "get",
  535. dataType: "json",
  536. crossDomain: false,
  537. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  538. data: {
  539. orderNo: orderNos
  540. },
  541. success: function (data) {
  542. if (data.error.length || data.data.list == "") {
  543. if (data.error && data.error.length) {
  544. message.warning(data.error[0].message);
  545. }
  546. } else {
  547. let thisdata = data.data;
  548. this.setState({
  549. orderUid: thisdata.uid,
  550. userName: thisdata.userName,
  551. primaryOrderNo: thisdata.primaryOrder,
  552. additionalOrder: thisdata.additionalOrder,
  553. contractNo: thisdata.contractNo,
  554. // arrears: thisdata.arrears,
  555. orderData: thisdata,
  556. isAddition: thisdata.additionalOrder ? true : false,
  557. deleteSign: thisdata.deleteSign,
  558. });
  559. }
  560. }.bind(this)
  561. });
  562. },
  563. // 原订单数据
  564. primaryOrder(primaryOrder) {
  565. $.ajax({
  566. method: "get",
  567. dataType: "json",
  568. crossDomain: false,
  569. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  570. data: {
  571. orderNo: primaryOrder
  572. },
  573. success: function (data) {
  574. if (data.error.length || data.data.list == "") {
  575. if (data.error && data.error.length) {
  576. message.warning(data.error[0].message);
  577. }
  578. } else {
  579. let thisdata = data.data;
  580. this.setState({
  581. primaryOrderData: thisdata
  582. });
  583. }
  584. }.bind(this)
  585. });
  586. },
  587. // 附加订单数据
  588. additionalOrder(additionalOrder) {
  589. $.ajax({
  590. method: "get",
  591. dataType: "json",
  592. crossDomain: false,
  593. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  594. data: {
  595. orderNo: additionalOrder
  596. },
  597. success: function (data) {
  598. if (data.error.length || data.data.list == "") {
  599. if (data.error && data.error.length) {
  600. message.warning(data.error[0].message);
  601. }
  602. } else {
  603. let thisdata = data.data;
  604. this.setState({
  605. additionalOrderData: thisdata
  606. });
  607. }
  608. }.bind(this)
  609. });
  610. },
  611. //项目列表
  612. xiangmu(orderNos) {
  613. $.ajax({
  614. method: "get",
  615. dataType: "json",
  616. crossDomain: false,
  617. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  618. data: {
  619. orderNo: orderNos
  620. },
  621. success: function (data) {
  622. let theArr = [];
  623. if (data.error.length || data.data.list == "") {
  624. if (data.error && data.error.length) {
  625. message.warning(data.error[0].message);
  626. }
  627. } else {
  628. for (let i = 0; i < data.data.length; i++) {
  629. let thisdata = data.data[i];
  630. thisdata.key = i;
  631. thisdata.sort = thisdata.cSort;
  632. theArr.push(thisdata);
  633. }
  634. }
  635. this.setState({
  636. dataSourceX: theArr
  637. });
  638. }.bind(this)
  639. });
  640. },
  641. search(obj) {
  642. if (obj.reset) {
  643. this.state.searchData.deps = [];
  644. this.Cascaders.empty();
  645. this.loadData(1);
  646. } else {
  647. this.setState(
  648. {
  649. searchData: Object.assign(this.state.searchData, obj)
  650. },
  651. () => {
  652. this.loadData(1);
  653. }
  654. );
  655. }
  656. },
  657. rizhi(orderNo) {
  658. $.ajax({
  659. method: "get",
  660. dataType: "json",
  661. crossDomain: false,
  662. url: "/api/admin/newOrder/selectOrderLog",
  663. data: {
  664. orderNo: orderNo
  665. },
  666. success: function (data) {
  667. let theArr = [];
  668. let thisData = data.data;
  669. if (!thisData.length) {
  670. if (data.error && data.error.length) {
  671. message.warning(data.error[0].message);
  672. }
  673. thisData = {};
  674. } else {
  675. for (let i = 0; i < data.data.length; i++) {
  676. let thisdata = data.data[i];
  677. theArr.push({
  678. processName: thisdata.processName,
  679. adminName: thisdata.adminName,
  680. createDate: thisdata.createDate,
  681. remarks: thisdata.remarks
  682. });
  683. }
  684. }
  685. this.setState({
  686. dataSourcerizhi: theArr
  687. });
  688. }.bind(this)
  689. });
  690. },
  691. getOrderLog(orderNo) {
  692. this.setState({
  693. rizhivisible: true
  694. });
  695. this.rizhi(orderNo);
  696. },
  697. closeOrderLog() {
  698. this.setState({
  699. rizhivisible: false
  700. });
  701. },
  702. //节点列表
  703. jiedian(orderNos) {
  704. $.ajax({
  705. method: "get",
  706. dataType: "json",
  707. crossDomain: false,
  708. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  709. data: {
  710. orderNo: orderNos
  711. },
  712. success: function (data) {
  713. let theArr = [];
  714. let thisData = [];
  715. if (data.error.length || data.data.list == "") {
  716. if (data.error && data.error.length) {
  717. message.warning(data.error[0].message);
  718. }
  719. } else {
  720. for (let i = 0; i < data.data.length; i++) {
  721. thisData = data.data[i];
  722. theArr.push({
  723. key: i,
  724. dunSubject: thisData.dunSubject
  725. ? thisData.dunSubject.toString()
  726. : "", //催款科目
  727. id: thisData.id, //节点Id
  728. money: thisData.money, //催款金额
  729. dunStatus: thisData.dunStatus //催款状态
  730. });
  731. }
  732. this.setState({
  733. contactList: theArr
  734. });
  735. }
  736. }.bind(this)
  737. });
  738. },
  739. jiedianNew(orderNos) {
  740. $.ajax({
  741. method: "get",
  742. dataType: "json",
  743. crossDomain: false,
  744. url:
  745. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  746. data: {
  747. orderNo: orderNos
  748. },
  749. success: function (data) {
  750. if (data.error && data.error.length) {
  751. message.warning(data.error[0].message);
  752. } else {
  753. let theArr = [];
  754. let thisData = [];
  755. let arr = data.data || [];
  756. let totalCui = 0;
  757. for (let i = 0; i < arr.length; i++) {
  758. thisData = arr[i];
  759. totalCui += +thisData.money;
  760. theArr.push({
  761. key: i,
  762. dunSubject: thisData.dunSubject
  763. ? thisData.dunSubject.toString()
  764. : "", //催款科目
  765. id: thisData.id, //节点Id
  766. money: thisData.money, //催款金额
  767. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  768. commodityName: thisData.commodityName,
  769. projectType: thisData.projectType,
  770. dunTypeName: thisData.dunTypeName,
  771. status: thisData.status,
  772. waitDay: thisData.waitDay,
  773. effectiveCount: thisData.effectiveCount,
  774. startDate: thisData.startDate,
  775. dunType: thisData.dunType,
  776. appropriationRatio: thisData.appropriationRatio,
  777. customizeName: thisData.customizeName,
  778. customizeTimes: thisData.customizeTimes,
  779. tid: thisData.tid,
  780. });
  781. }
  782. if (!totalCui) {
  783. totalCui = 0;
  784. }
  785. totalCui = (Math.round(totalCui * 1000000) / 1000000).toFixed(6);
  786. this.setState({
  787. contactListNew: theArr,
  788. totalCui
  789. });
  790. }
  791. }.bind(this)
  792. }).always(
  793. function () {
  794. this.setState({
  795. loading: false
  796. });
  797. }.bind(this)
  798. );
  799. },
  800. //审核通过
  801. examOk() {
  802. $.ajax({
  803. method: "post",
  804. dataType: "json",
  805. crossDomain: false,
  806. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  807. data: {
  808. orderNo: this.state.orderNo,
  809. orderStatus: 2
  810. },
  811. success: function (data) {
  812. if (data.error.length || data.data.list == "") {
  813. if (data.error && data.error.length) {
  814. message.warning(data.error[0].message);
  815. }
  816. } else {
  817. message.success("该订单已通过审核~");
  818. this.setState({
  819. visible: false
  820. });
  821. this.reset();
  822. }
  823. }.bind(this)
  824. }).always(
  825. function () {
  826. this.setState({
  827. loading: false
  828. });
  829. }.bind(this)
  830. );
  831. },
  832. //通过发给外包
  833. outsourcing() {
  834. $.ajax({
  835. method: "post",
  836. dataType: "json",
  837. crossDomain: false,
  838. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  839. data: {
  840. orderNo: this.state.orderNo,
  841. orderStatus: 2,
  842. outsource: 1
  843. },
  844. success: function (data) {
  845. if (data.error.length || data.data.list == "") {
  846. if (data.error && data.error.length) {
  847. message.warning(data.error[0].message);
  848. }
  849. } else {
  850. message.success("该订单已通过审核~");
  851. this.setState({
  852. visible: false
  853. });
  854. this.reset();
  855. }
  856. }.bind(this)
  857. }).always(
  858. function () {
  859. this.setState({
  860. loading: false
  861. });
  862. }.bind(this)
  863. );
  864. },
  865. //审核不通过
  866. examOks() {
  867. this.setState({
  868. aloading: true
  869. });
  870. $.ajax({
  871. method: "post",
  872. dataType: "json",
  873. crossDomain: false,
  874. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  875. data: {
  876. orderNo: this.state.orderNo,
  877. orderStatus: 3,
  878. reason: this.state.reason
  879. },
  880. success: function (data) {
  881. if (data.error.length || data.data.list == "") {
  882. if (data.error && data.error.length) {
  883. message.warning(data.error[0].message);
  884. this.setState({
  885. aloading: true
  886. });
  887. }
  888. } else {
  889. message.success("该订单已被拒绝~");
  890. this.setState({
  891. visible: false,
  892. aloading: false,
  893. noVisible: false,
  894. reason: ""
  895. });
  896. this.reset();
  897. }
  898. }.bind(this)
  899. }).always(
  900. function () {
  901. this.setState({
  902. loading: false
  903. });
  904. }.bind(this)
  905. );
  906. },
  907. //点击拒绝
  908. examNo() {
  909. this.setState({
  910. noVisible: true
  911. });
  912. },
  913. loadDataChange(key) {
  914. $.ajax({
  915. method: "get",
  916. dataType: "json",
  917. async: false,
  918. crossDomain: false,
  919. url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  920. data: {
  921. changeId: key
  922. },
  923. success: function (data) {
  924. if (data.error.length || data.data.list == "") {
  925. if (data.error && data.error.length) {
  926. message.warning(data.error[0].message);
  927. }
  928. } else {
  929. // console.log("拿到历史", data.data);
  930. this.setState({
  931. dataProps: data.data
  932. });
  933. }
  934. }.bind(this)
  935. });
  936. },
  937. callback(key) {
  938. this.setState(
  939. {
  940. activeKey: key
  941. },
  942. () => {
  943. if (key != "a" && key != "c" && key.length < 10) {
  944. this.ChangeDetail(key);
  945. this.loadDataChange(key);
  946. } else if (key != "a" && key != "c" && key.length > 10) {
  947. this.primaryOrder(key);
  948. this.xiangmu(key);
  949. this.jiedian(key);
  950. this.jiedianNew(key);
  951. this.loadDataChange(key);
  952. }
  953. }
  954. );
  955. if (key === "a") {
  956. this.xiangmu(this.state.orderNo);
  957. this.jiedian(this.state.orderNo);
  958. this.jiedianNew(this.state.orderNo);
  959. }
  960. // if (key === "2") {
  961. // this.ChangeDetail(this.state.id);
  962. // this.loadDataChange();
  963. // }
  964. // if (key === "3") {
  965. // this.primaryOrder(this.state.primaryOrderNo);
  966. // this.xiangmu(this.state.primaryOrderNo);
  967. // this.jiedian(this.state.primaryOrderNo);
  968. // this.jiedianNew(this.state.primaryOrderNo);
  969. // }
  970. if (key === "c") {
  971. this.additionalOrder(this.state.additionalOrder);
  972. this.xiangmu(this.state.additionalOrder);
  973. this.jiedian(this.state.additionalOrder);
  974. this.jiedianNew(this.state.additionalOrder);
  975. this.setState({
  976. buttonStatusA: false
  977. });
  978. } else {
  979. this.setState({
  980. buttonStatusA: true
  981. });
  982. }
  983. },
  984. closeDesc(e, s) {
  985. this.state.activeKey = "a";
  986. this.state.userDetaile = false;
  987. this.state.signBillVisible = false;
  988. this.state.visible = e;
  989. if (s) {
  990. this.loadData(this.state.pageNo);
  991. }
  992. },
  993. // 获取原订单编号
  994. getPrimaryOrder(value) {
  995. this.setState({
  996. primaryOrder: value
  997. });
  998. },
  999. getAdditionalOrder(value) {
  1000. this.setState({
  1001. additionalOrder: value
  1002. });
  1003. },
  1004. getUrl(url) {
  1005. let theorgCodeUrl = [];
  1006. if (url.length) {
  1007. let picArr = [];
  1008. url.map(function (item) {
  1009. if (
  1010. item.response &&
  1011. item.response.data &&
  1012. item.response.data.length
  1013. ) {
  1014. picArr.push(item.response.data);
  1015. }
  1016. });
  1017. theorgCodeUrl = picArr.join(",");
  1018. }
  1019. return theorgCodeUrl;
  1020. },
  1021. sureOut() {
  1022. if (!this.state.companyName) {
  1023. message.warning("公司名称不能为空");
  1024. return;
  1025. }
  1026. if (!this.state.unitPrice) {
  1027. message.warning("单价不能为空");
  1028. return;
  1029. }
  1030. if (!this.state.unitNumber) {
  1031. message.warning("数量不能为空");
  1032. return;
  1033. }
  1034. if (!this.state.amount) {
  1035. message.warning("总金额不能为空");
  1036. return;
  1037. }
  1038. if (!this.state.outsourceRemarks) {
  1039. message.warning("备注不能为空");
  1040. return;
  1041. }
  1042. if (this.state.pictureUrl.length === 0) {
  1043. message.warning("合同扫描件不能为空");
  1044. return;
  1045. }
  1046. $.ajax({
  1047. method: "POST",
  1048. dataType: "json",
  1049. crossDomain: false,
  1050. url: globalConfig.context + "/api/admin/outsourceOrg/auditOutsource",
  1051. data: {
  1052. id: this.state.id,
  1053. orderNo: this.state.orderNo,
  1054. companyName: this.state.companyName,
  1055. amount: this.state.amount,
  1056. outsourceRemarks: this.state.outsourceRemarks,
  1057. unitNumber: this.state.unitNumber,
  1058. unitPrice: this.state.unitPrice,
  1059. attachmentUrl: this.getUrl(this.state.attachmentUrl).length
  1060. ? this.getUrl(this.state.attachmentUrl)
  1061. : "",
  1062. orderStatus: 2,
  1063. pictureUrl: this.getUrl(this.state.pictureUrl).length
  1064. ? this.getUrl(this.state.pictureUrl)
  1065. : ""
  1066. }
  1067. }).done(
  1068. function (data) {
  1069. this.setState({
  1070. loading: false
  1071. });
  1072. if (!data.error.length) {
  1073. message.success("发起成功!");
  1074. this.outReset();
  1075. this.visitCancel();
  1076. } else {
  1077. message.warning(data.error[0].message);
  1078. }
  1079. }.bind(this)
  1080. );
  1081. },
  1082. //关闭输入理由框
  1083. noCancel() {
  1084. this.setState({
  1085. noVisible: false,
  1086. aloading: false,
  1087. reason: ""
  1088. });
  1089. },
  1090. //重置
  1091. reset() {
  1092. this.setState({
  1093. signBillVisible: false
  1094. });
  1095. this.state.orderNo = "";
  1096. this.state.customerName = "";
  1097. this.state.releaseDate[0] = undefined;
  1098. this.state.releaseDate[1] = undefined;
  1099. this.state.approval = undefined;
  1100. this.loadData(1);
  1101. },
  1102. outReset() {
  1103. this.setState({
  1104. companyName: "",
  1105. amount: "",
  1106. unitPrice: "",
  1107. unitNumber: "",
  1108. outsourceRemarks: "",
  1109. attachmentUrl: [],
  1110. pictureUrl: []
  1111. });
  1112. },
  1113. getOrgCodeUrl(e) {
  1114. this.setState({ pictureUrl: e });
  1115. },
  1116. //关闭详情
  1117. visitCancel() {
  1118. this.setState(
  1119. {
  1120. activeKey: "a"
  1121. },
  1122. () => {
  1123. this.setState({
  1124. visible: false
  1125. });
  1126. }
  1127. );
  1128. this.loadData(this.state.pageNo);
  1129. },
  1130. visitOk() {
  1131. this.setState({
  1132. visible: false
  1133. });
  1134. },
  1135. createTabs() {
  1136. $.ajax({
  1137. url: globalConfig.context + "/api/admin/orderChange/getOrderChange",
  1138. method: "get",
  1139. data: {
  1140. orderNo: this.state.orderNo
  1141. },
  1142. success: data => {
  1143. if (data.error && data.error.length) {
  1144. message.warning(data.error[0].message);
  1145. } else {
  1146. this.setState({
  1147. tabList: data.data
  1148. });
  1149. }
  1150. }
  1151. });
  1152. },
  1153. changeList(arr) {
  1154. const newArr = [];
  1155. this.state.columns.forEach(item => {
  1156. arr.forEach(val => {
  1157. if (val === item.title) {
  1158. newArr.push(item);
  1159. }
  1160. });
  1161. });
  1162. this.setState({
  1163. changeList: newArr
  1164. });
  1165. },
  1166. render() {
  1167. const tabList = this.state.tabList || [];
  1168. const formItemLayout = {
  1169. labelCol: { span: 8 },
  1170. wrapperCol: { span: 14 }
  1171. };
  1172. const FormItem = Form.Item;
  1173. const { TabPane } = Tabs;
  1174. return (
  1175. <div className="user-content">
  1176. <ShowModalDiv ShowModal={this.state.showModal} />
  1177. <div className="content-title" style={{ marginBottom: 10 }}>
  1178. <span style={{ fontWeight: 900, fontSize: 16 }}>
  1179. 合同变更审核订单
  1180. </span>
  1181. </div>
  1182. <div className="user-search">
  1183. <Tabs
  1184. defaultActiveKey="1"
  1185. onChange={this.callback}
  1186. className="test">
  1187. <TabPane tab="搜索" key="1">
  1188. <div style={{ marginLeft: 10 }}>
  1189. <Cascaders
  1190. ref={node => this.Cascaders = node}
  1191. placeholder="订单部门"
  1192. id="id"
  1193. name="name"
  1194. children="list"
  1195. height={28}
  1196. onSel={(e) => {
  1197. const { searchData } = this.state
  1198. searchData["deps"] = JSON.stringify(e);
  1199. this.setState({
  1200. searchData: searchData
  1201. })
  1202. }}
  1203. />
  1204. <SearchInput search={this.search} />
  1205. </div>
  1206. </TabPane>
  1207. <TabPane tab="更改表格显示数据" key="2">
  1208. <div style={{ marginLeft: 10 }}>
  1209. <ChooseList
  1210. columns={this.state.columns}
  1211. changeFn={this.changeList}
  1212. changeList={this.state.changeList}
  1213. top={55}
  1214. margin={11}
  1215. />
  1216. </div>
  1217. </TabPane>
  1218. </Tabs>
  1219. <div className="patent-table">
  1220. <Spin spinning={this.state.loading}>
  1221. <Table
  1222. size="small"
  1223. bordered
  1224. columns={
  1225. this.state.changeList
  1226. ? this.state.changeList
  1227. : this.state.columns
  1228. }
  1229. dataSource={this.state.dataSource}
  1230. pagination={this.state.pagination}
  1231. onRowClick={this.tableRowClick}
  1232. />
  1233. </Spin>
  1234. </div>
  1235. {this.state.visible ? <Modal
  1236. className="customeDetails"
  1237. footer=""
  1238. maskClosable={false}
  1239. width="1200px"
  1240. visible={this.state.visible}
  1241. onOk={this.visitOk}
  1242. onCancel={this.visitCancel}
  1243. >
  1244. <Tabs
  1245. activeKey={this.state.activeKey}
  1246. onChange={this.callback}
  1247. type="card"
  1248. tabBarExtraContent={
  1249. <div style={{ fontWeight: 'bold', paddingRight: '15px' }}>
  1250. <OrderItemStatus deleteSign={this.state.deleteSign} />
  1251. </div>
  1252. }
  1253. >
  1254. <TabPane tab="订单详情" key="a">
  1255. {this.state.activeKey === "a" ? <Form
  1256. layout="horizontal"
  1257. onSubmit={this.handleSubmit}
  1258. id="demand-form"
  1259. style={{ paddingBottom: "40px" }}
  1260. >
  1261. <Spin spinning={this.state.loading}>
  1262. <OrderDetail
  1263. orderUid={this.state.orderUid}
  1264. orderData={this.state.orderData}
  1265. getOrderLog={this.getOrderLog}
  1266. dataSourceX={this.state.dataSourceX}
  1267. contactList={this.state.contactList}
  1268. totalCui={this.state.totalCui}
  1269. contactListNew={this.state.contactListNew}
  1270. orderNo={this.state.orderNo}
  1271. />
  1272. </Spin>
  1273. </Form> : <div />}
  1274. </TabPane>
  1275. {/* <TabPane tab="合同变更记录" key="2">
  1276. <ChangeDetail
  1277. data={this.state.contractData}
  1278. pictureUrl={this.state.voucherUrl}
  1279. processState={this.props.processState}
  1280. loadData={this.callback}
  1281. reset={this.state.visible}
  1282. dataSource={this.state.dataProps}
  1283. proceedsData={this.state.proceedsData}
  1284. proceedsTotal={this.state.proTotal}
  1285. invoiceTotal={this.state.invTotal}
  1286. contactList={this.state.refundInvoice}
  1287. onCancel={this.visitCancel}
  1288. />
  1289. </TabPane> */}
  1290. {tabList.map((item, index, arr) => {
  1291. return (
  1292. <TabPane tab={"合同变更记录" + (index + 1)} key={item.id}>
  1293. {this.state.activeKey === String(item.id) ? <ChangeDetail
  1294. id={item.id}
  1295. orderUid={this.state.orderUid}
  1296. money={index == arr.length - 1 ? this.state.orderData.totalAmount + "" : undefined}
  1297. data={this.state.contractData}
  1298. pictureUrl={this.state.voucherUrl}
  1299. contractPictureUrl={this.state.contractPictureUrl}
  1300. attachment={this.state.attachment}
  1301. processState={this.props.processState}
  1302. loadData={this.callback}
  1303. reset={this.state.visible}
  1304. dataSource={this.state.dataProps}
  1305. proceedsData={this.state.proceedsData}
  1306. proceedsTotal={this.state.proTotal}
  1307. invoiceTotal={this.state.invTotal}
  1308. contactList={this.state.refundInvoice}
  1309. onCancel={this.visitCancel}
  1310. /> : <div />}
  1311. </TabPane>
  1312. );
  1313. })}
  1314. {/* {this.state.status === 4 ? (
  1315. <TabPane tab="原订单" key="3">
  1316. <Form
  1317. layout="horizontal"
  1318. onSubmit={this.handleSubmit}
  1319. id="demand-form"
  1320. style={{ paddingBottom: "40px" }}
  1321. >
  1322. <Spin spinning={this.state.loading}>
  1323. <OrderDetail
  1324. orderData={this.state.primaryOrderData}
  1325. getOrderLog={this.getOrderLog}
  1326. dataSourceX={this.state.dataSourceX}
  1327. contactList={this.state.contactList}
  1328. orderNo={this.state.primaryOrderNo}
  1329. totalCui={this.state.totalCui}
  1330. contactListNew={this.state.contactListNew}
  1331. />
  1332. </Spin>
  1333. </Form>
  1334. </TabPane>
  1335. ) : (
  1336. ""
  1337. )} */}
  1338. {tabList.map((item, index) => {
  1339. if (item.usedOrder) {
  1340. return (
  1341. <TabPane
  1342. tab={"原订单" + (index + 1)}
  1343. key={item.usedOrder}
  1344. >
  1345. {this.state.activeKey === String(item.usedOrder) ? <Form
  1346. layout="horizontal"
  1347. onSubmit={this.handleSubmit}
  1348. id="demand-form"
  1349. style={{ paddingBottom: "40px" }}
  1350. >
  1351. <Spin spinning={this.state.loading}>
  1352. <OrderDetail
  1353. orderData={this.state.primaryOrderData}
  1354. getOrderLog={this.getOrderLog}
  1355. dataSourceX={this.state.dataSourceX}
  1356. contactList={this.state.contactList}
  1357. orderNo={this.state.primaryOrderNo}
  1358. totalCui={this.state.totalCui}
  1359. contactListNew={this.state.contactListNew}
  1360. />
  1361. </Spin>
  1362. </Form> : <div />}
  1363. </TabPane>
  1364. );
  1365. } else {
  1366. return "";
  1367. }
  1368. })}
  1369. {this.state.status === 4 && this.state.isAddition ? (
  1370. this.state.type === 4 || this.state.type === 5 ? (
  1371. <TabPane tab="附加订单" key="c">
  1372. {this.state.activeKey === 'c' ? <OrderDetail
  1373. orderData={this.state.additionalOrderData}
  1374. getOrderLog={this.getOrderLog}
  1375. dataSourceX={this.state.dataSourceX}
  1376. contactList={this.state.contactList}
  1377. orderNo={this.state.additionalOrder}
  1378. totalCui={this.state.totalCui}
  1379. contactListNew={this.state.contactListNew}
  1380. /> : <div />}
  1381. </TabPane>
  1382. ) : (
  1383. ""
  1384. )
  1385. ) : (
  1386. ""
  1387. )}
  1388. </Tabs>
  1389. </Modal> : <div />}
  1390. <Modal
  1391. maskClosable={false}
  1392. visible={this.state.noVisible}
  1393. onOk={this.handleOk}
  1394. onCancel={this.noCancel}
  1395. width="400px"
  1396. title={"拒绝理由"}
  1397. footer=""
  1398. className="admin-desc-content"
  1399. confirmLoading={this.state.confirmLoading}
  1400. >
  1401. <Form layout="horizontal" id="demand-form">
  1402. <Spin spinning={this.state.loading}>
  1403. <div className="clearfix">
  1404. <FormItem
  1405. labelCol={{ span: 4 }}
  1406. wrapperCol={{ span: 16 }}
  1407. label="拒绝理由"
  1408. >
  1409. <Input
  1410. type="textarea"
  1411. placeholder="请输入拒绝理由"
  1412. rows={4}
  1413. value={this.state.reason}
  1414. onChange={e => {
  1415. this.setState({ reason: e.target.value });
  1416. }}
  1417. />
  1418. </FormItem>
  1419. </div>
  1420. <div className="clearfix">
  1421. <Button
  1422. className="cancel"
  1423. type="primary"
  1424. onClick={this.examOks}
  1425. style={{ marginLeft: "50px" }}
  1426. htmlType="submit"
  1427. loading={this.state.aloading}
  1428. >
  1429. 确定
  1430. </Button>
  1431. <Button
  1432. className="cancel"
  1433. type="ghost"
  1434. onClick={this.noCancel}
  1435. style={{ marginLeft: "50px" }}
  1436. >
  1437. 取消
  1438. </Button>
  1439. </div>
  1440. </Spin>
  1441. </Form>
  1442. </Modal>
  1443. {/* <Modal
  1444. visible={this.state.rizhivisible}
  1445. className="admin-desc-content"
  1446. width="800px"
  1447. maskClosable={false}
  1448. title="订单日志"
  1449. footer={null}
  1450. onCancel={this.closeOrderLog}
  1451. >
  1452. <div className="patent-table">
  1453. <Spin spinning={this.state.loading}>
  1454. <Table
  1455. bordered
  1456. columns={this.state.columnsrizhi}
  1457. dataSource={this.state.dataSourcerizhi}
  1458. pagination={false}
  1459. />
  1460. </Spin>
  1461. </div>
  1462. </Modal> */}
  1463. <OrderRiZi
  1464. dataSourcerizhi={this.state.dataSourcerizhi}
  1465. closeOrderLog={this.closeOrderLog}
  1466. visible={this.state.rizhivisible}
  1467. loading={this.state.loading}
  1468. />
  1469. </div>
  1470. {this.state.addnextVisible && <ProjectDetailsReadOnly
  1471. infor={this.state.dataInfor}
  1472. visible={this.state.addnextVisible}
  1473. onCancel={this.nextCancel}
  1474. />}
  1475. </div>
  1476. );
  1477. }
  1478. })
  1479. );
  1480. export default contractChange;