contractJszj.js 45 KB

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