contractCwzj.js 37 KB

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