contractCwzy.js 36 KB

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