contractJsjl.js 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251
  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/changeDetailJsjl.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. // console.log("row",this.state.activeKey);
  340. },
  341. //点击打卡项目详情
  342. tableRowClickX(record) {
  343. this.setState({
  344. jid: record.id, //项目ID
  345. kid: record.commodityId, //商品ID
  346. commodityName: record.commodityName, //金额
  347. commodityPrice: record.commodityPrice, //金额
  348. commodityQuantity: record.commodityQuantity, //数量
  349. taskComment: record.taskComment, //备注
  350. main: record.main.toString(), //是否为主要
  351. addnextVisible: true,
  352. addState: 0
  353. });
  354. },
  355. //项目详情关闭
  356. nextCancel() {
  357. this.setState({
  358. addnextVisible: false
  359. });
  360. },
  361. // 合同变更详情
  362. ChangeDetail(id) {
  363. let url = window.location.href.substring(7);
  364. $.ajax({
  365. method: "get",
  366. dataType: "json",
  367. crossDomain: false,
  368. url:
  369. globalConfig.context +
  370. "/api/admin/orderChange/orderChangeDetailsById",
  371. data: {
  372. id: id
  373. },
  374. success: function(data) {
  375. if (data.data) {
  376. let thisdata = data.data;
  377. Object.assign(thisdata, {
  378. processStateText: this.state.processStateText,
  379. userName: this.state.userName,
  380. contractNo: this.state.contractNo
  381. });
  382. this.setState({
  383. contractData: thisdata,
  384. voucherUrl: thisdata.voucherUrl
  385. ? splitUrl(
  386. thisdata.voucherUrl,
  387. ",",
  388. globalConfig.avatarHost + "/upload",
  389. url
  390. )
  391. : []
  392. });
  393. }
  394. }.bind(this)
  395. });
  396. $.ajax({
  397. method: "get",
  398. dataType: "json",
  399. crossDomain: false,
  400. url:
  401. globalConfig.context +
  402. "/api/admin/orderChange/listOrderInvoiceAndBill",
  403. data: {
  404. orderNo: this.state.orderNo
  405. },
  406. success: function(data) {
  407. if(!data.data) return
  408. let proTotal = 0
  409. let invTotal = 0
  410. data.data.bill.forEach(item => {
  411. proTotal += item.transactionAmount;
  412. });
  413. data.data.invoice.forEach(item => {
  414. invTotal += item.amount;
  415. });
  416. this.setState({
  417. proceedsData: data.data,
  418. proTotal,
  419. invTotal
  420. });
  421. }.bind(this)
  422. });
  423. $.ajax({
  424. method: "get",
  425. dataType: "json",
  426. crossDomain: false,
  427. url:
  428. globalConfig.context +
  429. "/api/admin/orderChange/listOrderRefundInvoice",
  430. data: {
  431. orderNo: this.state.orderNo
  432. },
  433. success: data => {
  434. if(!data) return
  435. data.data.forEach((item) => {
  436. item.load = true
  437. })
  438. this.setState({
  439. refundInvoice: data.data
  440. });
  441. }
  442. });
  443. },
  444. //订单详情
  445. xiangqing(orderNos) {
  446. $.ajax({
  447. method: "get",
  448. dataType: "json",
  449. crossDomain: false,
  450. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  451. data: {
  452. orderNo: orderNos
  453. },
  454. success: function(data) {
  455. if (data.error.length || data.data.list == "") {
  456. if (data.error && data.error.length) {
  457. message.warning(data.error[0].message);
  458. }
  459. } else {
  460. let thisdata = data.data;
  461. this.setState({
  462. userName: thisdata.userName,
  463. primaryOrderNo: thisdata.primaryOrder,
  464. additionalOrder: thisdata.additionalOrder,
  465. contractNo: thisdata.contractNo,
  466. // arrears: thisdata.arrears,
  467. orderData: thisdata
  468. });
  469. }
  470. }.bind(this)
  471. });
  472. },
  473. // 原订单数据
  474. primaryOrder(primaryOrder) {
  475. $.ajax({
  476. method: "get",
  477. dataType: "json",
  478. crossDomain: false,
  479. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  480. data: {
  481. orderNo: primaryOrder
  482. },
  483. success: function(data) {
  484. if (data.error.length || data.data.list == "") {
  485. if (data.error && data.error.length) {
  486. message.warning(data.error[0].message);
  487. }
  488. } else {
  489. let thisdata = data.data;
  490. this.setState({
  491. primaryOrderData: thisdata
  492. });
  493. }
  494. }.bind(this)
  495. });
  496. },
  497. // 附加订单数据
  498. additionalOrder(additionalOrder) {
  499. $.ajax({
  500. method: "get",
  501. dataType: "json",
  502. crossDomain: false,
  503. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  504. data: {
  505. orderNo: additionalOrder
  506. },
  507. success: function(data) {
  508. if (data.error.length || data.data.list == "") {
  509. if (data.error && data.error.length) {
  510. message.warning(data.error[0].message);
  511. }
  512. } else {
  513. let thisdata = data.data;
  514. this.setState({
  515. additionalOrderData: thisdata
  516. });
  517. }
  518. }.bind(this)
  519. });
  520. },
  521. //项目列表
  522. xiangmu(orderNos) {
  523. $.ajax({
  524. method: "get",
  525. dataType: "json",
  526. crossDomain: false,
  527. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  528. data: {
  529. orderNo: orderNos
  530. },
  531. success: function(data) {
  532. let theArr = [];
  533. if (data.error.length || data.data.list == "") {
  534. if (data.error && data.error.length) {
  535. message.warning(data.error[0].message);
  536. }
  537. } else {
  538. for (let i = 0; i < data.data.length; i++) {
  539. let thisdata = data.data[i];
  540. theArr.push({
  541. key: i,
  542. id: thisdata.id,
  543. orderNo: thisdata.orderNo, //订单编号
  544. commodityId: thisdata.commodityId, //项目ID
  545. commodityName: thisdata.commodityName, //项目名称
  546. cname: thisdata.cname, //项目类别
  547. commodityPrice: thisdata.commodityPrice, //项目价格
  548. commodityQuantity: thisdata.commodityQuantity, //项目数量
  549. main: thisdata.main, //是否为主要任务
  550. taskComment: thisdata.taskComment, //任务说明
  551. contacts: thisdata.contacts, //联系人
  552. contactsMobile: thisdata.contactsMobile, //联系人电话
  553. projectStatus: thisdata.projectStatus //项目状态
  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. // console.log("change",this.state.activeKey);
  796. if (key === "1") {
  797. this.xiangmu(this.state.orderNo);
  798. this.jiedian(this.state.orderNo);
  799. }
  800. if (key === "2") {
  801. this.ChangeDetail(this.state.id);
  802. this.loadDataChange();
  803. }
  804. if (key === "3") {
  805. this.primaryOrder(this.state.primaryOrderNo);
  806. this.xiangmu(this.state.primaryOrderNo);
  807. this.jiedian(this.state.primaryOrderNo);
  808. }
  809. if (key === "4") {
  810. this.additionalOrder(this.state.additionalOrder);
  811. this.xiangmu(this.state.additionalOrder);
  812. this.jiedian(this.state.additionalOrder);
  813. this.setState({
  814. buttonStatusA: false
  815. });
  816. } else {
  817. this.setState({
  818. buttonStatusA: true
  819. });
  820. }
  821. },
  822. closeDesc(e, s) {
  823. this.state.activeKey = "1";
  824. this.state.userDetaile = false;
  825. this.state.signBillVisible = false;
  826. this.state.visible = e;
  827. if (s) {
  828. this.loadData(this.state.pageNo);
  829. }
  830. },
  831. // 获取原订单编号
  832. getPrimaryOrder(value) {
  833. this.setState({
  834. primaryOrder: value
  835. });
  836. },
  837. getAdditionalOrder(value) {
  838. this.setState({
  839. additionalOrder: value
  840. });
  841. },
  842. getUrl(url) {
  843. let theorgCodeUrl = [];
  844. if (url.length) {
  845. let picArr = [];
  846. url.map(function(item) {
  847. if (
  848. item.response &&
  849. item.response.data &&
  850. item.response.data.length
  851. ) {
  852. picArr.push(item.response.data);
  853. }
  854. });
  855. theorgCodeUrl = picArr.join(",");
  856. }
  857. return theorgCodeUrl;
  858. },
  859. sureOut() {
  860. if (!this.state.companyName) {
  861. message.warning("公司名称不能为空");
  862. return;
  863. }
  864. if (!this.state.unitPrice) {
  865. message.warning("单价不能为空");
  866. return;
  867. }
  868. if (!this.state.unitNumber) {
  869. message.warning("数量不能为空");
  870. return;
  871. }
  872. if (!this.state.amount) {
  873. message.warning("总金额不能为空");
  874. return;
  875. }
  876. if (!this.state.outsourceRemarks) {
  877. message.warning("备注不能为空");
  878. return;
  879. }
  880. if (this.state.pictureUrl.length === 0) {
  881. message.warning("合同扫描件不能为空");
  882. return;
  883. }
  884. $.ajax({
  885. method: "POST",
  886. dataType: "json",
  887. crossDomain: false,
  888. url: globalConfig.context + "/api/admin/outsourceOrg/auditOutsource",
  889. data: {
  890. id: this.state.id,
  891. orderNo: this.state.orderNo,
  892. companyName: this.state.companyName,
  893. amount: this.state.amount,
  894. outsourceRemarks: this.state.outsourceRemarks,
  895. unitNumber: this.state.unitNumber,
  896. unitPrice: this.state.unitPrice,
  897. attachmentUrl: this.getUrl(this.state.attachmentUrl).length
  898. ? this.getUrl(this.state.attachmentUrl)
  899. : "",
  900. orderStatus: 2,
  901. pictureUrl: this.getUrl(this.state.pictureUrl).length
  902. ? this.getUrl(this.state.pictureUrl)
  903. : ""
  904. }
  905. }).done(
  906. function(data) {
  907. this.setState({
  908. loading: false
  909. });
  910. if (!data.error.length) {
  911. message.success("发起成功!");
  912. this.outReset();
  913. this.visitCancel();
  914. } else {
  915. message.warning(data.error[0].message);
  916. }
  917. }.bind(this)
  918. );
  919. },
  920. //关闭输入理由框
  921. noCancel() {
  922. this.setState({
  923. noVisible: false,
  924. aloading: false,
  925. reason: ""
  926. });
  927. },
  928. //重置
  929. reset() {
  930. this.setState({
  931. signBillVisible: false
  932. });
  933. this.state.orderNo = "";
  934. this.state.customerName = "";
  935. this.state.releaseDate[0] = undefined;
  936. this.state.releaseDate[1] = undefined;
  937. this.state.approval = undefined;
  938. this.loadData(1);
  939. },
  940. outReset() {
  941. this.setState({
  942. companyName: "",
  943. amount: "",
  944. unitPrice: "",
  945. unitNumber: "",
  946. outsourceRemarks: "",
  947. attachmentUrl: [],
  948. pictureUrl: []
  949. });
  950. },
  951. getOrgCodeUrl(e) {
  952. this.setState({ pictureUrl: e });
  953. },
  954. //关闭详情
  955. visitCancel() {
  956. this.setState(
  957. {
  958. visible: false,
  959. activeKey: "1"
  960. },
  961. () => {
  962. this.setState({
  963. activeKey: "1"
  964. });
  965. }
  966. );
  967. this.loadData(this.state.page);
  968. // console.log("table",this.state.activeKey);
  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. <ShowModalDiv ShowModal={this.state.showModal} />
  985. <div className="content-title">
  986. <span>合同变更审核订单</span>
  987. </div>
  988. <div className="user-search">
  989. <SearchInput search={this.search} />
  990. <div className="patent-table">
  991. <Spin spinning={this.state.loading}>
  992. <Table
  993. bordered
  994. columns={this.state.columns}
  995. dataSource={this.state.dataSource}
  996. pagination={this.state.pagination}
  997. onRowClick={this.tableRowClick}
  998. />
  999. </Spin>
  1000. </div>
  1001. <Modal
  1002. className="customeDetails"
  1003. footer=""
  1004. maskClosable={false}
  1005. width="900px"
  1006. visible={this.state.visible}
  1007. onOk={this.visitOk}
  1008. onCancel={this.visitCancel}
  1009. >
  1010. <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
  1011. <TabPane tab="订单详情" key="1">
  1012. <Form
  1013. layout="horizontal"
  1014. onSubmit={this.handleSubmit}
  1015. id="demand-form"
  1016. style={{ paddingBottom: "40px" }}
  1017. >
  1018. <Spin spinning={this.state.loading}>
  1019. <OrderDetail
  1020. orderData={this.state.orderData}
  1021. getOrderLog={this.getOrderLog}
  1022. dataSourceX={this.state.dataSourceX}
  1023. contactList={this.state.contactList}
  1024. orderNo={this.state.orderNo}
  1025. />
  1026. </Spin>
  1027. </Form>
  1028. </TabPane>
  1029. <TabPane tab="合同变更记录" key="2">
  1030. <ChangeDetail
  1031. data={this.state.contractData}
  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. <OrderRiZi
  1214. dataSourcerizhi={this.state.dataSourcerizhi}
  1215. closeOrderLog={this.closeOrderLog}
  1216. visible={this.state.rizhivisible}
  1217. loading={this.state.loading}
  1218. />
  1219. </div>
  1220. </div>
  1221. );
  1222. }
  1223. })
  1224. );
  1225. export default contractChange;