contractCwzj.js 44 KB

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