contractJszj.js 35 KB

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