contractYxgly.js 46 KB

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