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