contractJszj.js 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221
  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. bordered
  974. columns={this.state.columns}
  975. dataSource={this.state.dataSource}
  976. pagination={this.state.pagination}
  977. onRowClick={this.tableRowClick}
  978. />
  979. </Spin>
  980. </div>
  981. <Modal
  982. className="customeDetails"
  983. footer=""
  984. maskClosable={false}
  985. width="900px"
  986. visible={this.state.visible}
  987. onOk={this.visitOk}
  988. onCancel={this.visitCancel}
  989. >
  990. <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
  991. <TabPane tab="订单详情" key="1">
  992. <Form
  993. layout="horizontal"
  994. onSubmit={this.handleSubmit}
  995. id="demand-form"
  996. style={{ paddingBottom: "40px" }}
  997. >
  998. <Spin spinning={this.state.loading}>
  999. <OrderDetail
  1000. orderData={this.state.orderData}
  1001. getOrderLog={this.getOrderLog}
  1002. dataSourceX={this.state.dataSourceX}
  1003. contactList={this.state.contactList}
  1004. orderNo={this.state.orderNo}
  1005. />
  1006. </Spin>
  1007. </Form>
  1008. </TabPane>
  1009. <TabPane tab="合同变更记录" key="2">
  1010. <ChangeDetail
  1011. data={this.state.contractData}
  1012. pictureUrl={this.state.voucherUrl}
  1013. processState={this.props.processState}
  1014. loadData={this.callback}
  1015. reset={this.state.visible}
  1016. dataSource={this.state.dataProps}
  1017. proceedsData={this.state.proceedsData}
  1018. proceedsTotal={this.state.proTotal}
  1019. invoiceTotal={this.state.invTotal}
  1020. contactList={this.state.refundInvoice}
  1021. onCancel={this.visitCancel}
  1022. />
  1023. </TabPane>
  1024. {this.state.status === 4 ? (
  1025. <TabPane tab="原订单" key="3">
  1026. <Form
  1027. layout="horizontal"
  1028. onSubmit={this.handleSubmit}
  1029. id="demand-form"
  1030. style={{ paddingBottom: "40px" }}
  1031. >
  1032. <Spin spinning={this.state.loading}>
  1033. <OrderDetail
  1034. orderData={this.state.primaryOrderData}
  1035. getOrderLog={this.getOrderLog}
  1036. dataSourceX={this.state.dataSourceX}
  1037. contactList={this.state.contactList}
  1038. orderNo={this.state.primaryOrderNo}
  1039. />
  1040. </Spin>
  1041. </Form>
  1042. </TabPane>
  1043. ) : (
  1044. ""
  1045. )}
  1046. {this.state.status === 4 ? (
  1047. this.state.type === 4 || this.state.type === 5 ? (
  1048. <TabPane tab="附加订单" key="4">
  1049. <OrderDetail
  1050. orderData={this.state.additionalOrderData}
  1051. getOrderLog={this.getOrderLog}
  1052. dataSourceX={this.state.dataSourceX}
  1053. contactList={this.state.contactList}
  1054. orderNo={this.state.additionalOrder}
  1055. />
  1056. </TabPane>
  1057. ) : (
  1058. ""
  1059. )
  1060. ) : (
  1061. ""
  1062. )}
  1063. </Tabs>
  1064. </Modal>
  1065. <Modal
  1066. maskClosable={false}
  1067. visible={this.state.addnextVisible}
  1068. onOk={this.nextCancel}
  1069. onCancel={this.nextCancel}
  1070. confirmLoading={this.state.confirmLoading}
  1071. width="800px"
  1072. title={"项目任务详情"}
  1073. footer=""
  1074. className="admin-desc-content"
  1075. >
  1076. <Form layout="horizontal" id="demand-form">
  1077. <Spin spinning={this.state.loading}>
  1078. <div className="clearfix">
  1079. <FormItem
  1080. className="half-item"
  1081. {...formItemLayout}
  1082. label="项目名称"
  1083. >
  1084. <span>{this.state.commodityName}</span>
  1085. </FormItem>
  1086. <FormItem
  1087. className="half-item"
  1088. {...formItemLayout}
  1089. label="项目数量"
  1090. >
  1091. <span>{this.state.commodityQuantity}</span>
  1092. </FormItem>
  1093. <FormItem
  1094. className="half-item"
  1095. {...formItemLayout}
  1096. label="金额(万元)"
  1097. >
  1098. <span>{this.state.commodityPrice}</span>
  1099. </FormItem>
  1100. <FormItem
  1101. className="half-item"
  1102. {...formItemLayout}
  1103. label="主要项目"
  1104. >
  1105. <span>{getboutique(this.state.main)}</span>
  1106. </FormItem>
  1107. <div className="clearfix">
  1108. <FormItem
  1109. labelCol={{ span: 4 }}
  1110. wrapperCol={{ span: 16 }}
  1111. label="服务说明"
  1112. >
  1113. <span>{this.state.taskComment}</span>
  1114. </FormItem>
  1115. </div>
  1116. </div>
  1117. </Spin>
  1118. </Form>
  1119. </Modal>
  1120. <Modal
  1121. maskClosable={false}
  1122. visible={this.state.noVisible}
  1123. onOk={this.handleOk}
  1124. onCancel={this.noCancel}
  1125. width="400px"
  1126. title={"拒绝理由"}
  1127. footer=""
  1128. className="admin-desc-content"
  1129. confirmLoading={this.state.confirmLoading}
  1130. >
  1131. <Form layout="horizontal" id="demand-form">
  1132. <Spin spinning={this.state.loading}>
  1133. <div className="clearfix">
  1134. <FormItem
  1135. labelCol={{ span: 4 }}
  1136. wrapperCol={{ span: 16 }}
  1137. label="拒绝理由"
  1138. >
  1139. <Input
  1140. type="textarea"
  1141. placeholder="请输入拒绝理由"
  1142. rows={4}
  1143. value={this.state.reason}
  1144. onChange={e => {
  1145. this.setState({ reason: e.target.value });
  1146. }}
  1147. />
  1148. </FormItem>
  1149. </div>
  1150. <div className="clearfix">
  1151. <Button
  1152. className="cancel"
  1153. type="primary"
  1154. onClick={this.examOks}
  1155. style={{ marginLeft: "50px" }}
  1156. htmlType="submit"
  1157. loading={this.state.aloading}
  1158. >
  1159. 确定
  1160. </Button>
  1161. <Button
  1162. className="cancel"
  1163. type="ghost"
  1164. onClick={this.noCancel}
  1165. style={{ marginLeft: "50px" }}
  1166. >
  1167. 取消
  1168. </Button>
  1169. </div>
  1170. </Spin>
  1171. </Form>
  1172. </Modal>
  1173. <Modal
  1174. visible={this.state.rizhivisible}
  1175. className="admin-desc-content"
  1176. width="800px"
  1177. maskClosable={false}
  1178. title="订单日志"
  1179. footer={null}
  1180. onCancel={this.closeOrderLog}
  1181. >
  1182. <div className="patent-table">
  1183. <Spin spinning={this.state.loading}>
  1184. <Table
  1185. bordered
  1186. columns={this.state.columnsrizhi}
  1187. dataSource={this.state.dataSourcerizhi}
  1188. pagination={false}
  1189. />
  1190. </Spin>
  1191. </div>
  1192. </Modal>
  1193. </div>
  1194. </div>
  1195. );
  1196. }
  1197. })
  1198. );
  1199. export default contractChange;