contractYxgly.js 36 KB

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