contractJsjl.js 46 KB

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