contractJsjl.js 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244
  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. const contractChange = Form.create()(
  21. React.createClass({
  22. loadData(pageNo) {
  23. this.setState({
  24. loading: true
  25. });
  26. $.ajax({
  27. method: "get",
  28. dataType: "json",
  29. crossDomain: false,
  30. url: globalConfig.context + "/api/admin/orderChange/orderChangeList",
  31. data: {
  32. pageNo: pageNo || 1,
  33. pageSize: this.state.pagination.pageSize,
  34. userName: this.state.searchData.userNameSearch,
  35. processState: this.props.processState,
  36. timeType: this.state.searchData.timeTypeSearch,
  37. startTime: this.state.searchData.releaseDate[0],
  38. endTime: this.state.searchData.releaseDate[1],
  39. salesmanName: this.state.searchData.salesmanNameSearch,
  40. complete: this.state.searchData.completeSearch || 1,
  41. depId: this.state.searchData.depIdSearch
  42. },
  43. success: function(data) {
  44. ShowModal(this);
  45. let theArr = [];
  46. if (data.error.length || data.data.list == "") {
  47. if (data.error && data.error.length) {
  48. message.warning(data.error[0].message);
  49. }
  50. } else {
  51. for (let i = 0; i < data.data.list.length; i++) {
  52. let thisdata = data.data.list[i];
  53. theArr.push({
  54. key: i,
  55. orderNo: thisdata.orderNo,
  56. createTimes: thisdata.createTimes,
  57. nickname: thisdata.nickname,
  58. orderType: thisdata.orderType,
  59. establishTimes: thisdata.establishTimes,
  60. orderStatus: thisdata.orderStatus,
  61. totalAmount: thisdata.totalAmount,
  62. settlementAmount: thisdata.settlementAmount,
  63. arrears: thisdata.arrears,
  64. salesmanName: thisdata.salesmanName,
  65. depName: thisdata.depName,
  66. processState: thisdata.processState,
  67. type: thisdata.type,
  68. status: thisdata.status,
  69. id: thisdata.id,
  70. contractNo: thisdata.contractNo,
  71. processStateText: getProcessStatusNew(
  72. thisdata.processState,
  73. thisdata.status
  74. )
  75. });
  76. }
  77. this.state.pagination.total = data.data.totalCount;
  78. this.state.pagination.current = data.data.pageNo;
  79. }
  80. if (data.data && data.data.list && !data.data.list.length) {
  81. this.state.pagination.total = 0;
  82. }
  83. this.setState({
  84. dataSource: theArr,
  85. pageNo: pageNo,
  86. pagination: this.state.pagination
  87. });
  88. }.bind(this)
  89. }).always(
  90. function() {
  91. this.setState({
  92. loading: false
  93. });
  94. }.bind(this)
  95. );
  96. },
  97. getInitialState() {
  98. return {
  99. page: 1,
  100. searchData: {
  101. releaseDate: []
  102. },
  103. primaryOrderData: {}, //原订单数据
  104. orderData: {}, //现订单数据
  105. pictureUrl: [],
  106. voucherUrl: [],
  107. attachmentUrl: [],
  108. proceedsData: {},
  109. proTotal: 0,
  110. invTotal: 0,
  111. contractData: {},
  112. // 回收退票数据
  113. refundInvoice: [],
  114. RefundInvoice: [],
  115. additionalOrderData: {},
  116. paginations: false,
  117. activeKey: "1",
  118. confirmLoading: false,
  119. aloading: false,
  120. pagination: {
  121. defaultCurrent: 1,
  122. defaultPageSize: 10,
  123. showQuickJumper: true,
  124. pageSize: 10,
  125. onChange: function(page) {
  126. this.loadData(page);
  127. }.bind(this),
  128. showTotal: function(total) {
  129. return "共" + total + "条数据";
  130. }
  131. },
  132. columns: [
  133. {
  134. title: "合同编号",
  135. dataIndex: "contractNo",
  136. key: "contractNo"
  137. },
  138. {
  139. title: "订单编号",
  140. dataIndex: "orderNo",
  141. key: "orderNo"
  142. },
  143. {
  144. title: "客户名称",
  145. dataIndex: "nickname",
  146. key: "nickname"
  147. },
  148. {
  149. title: "订单部门",
  150. dataIndex: "depName",
  151. key: "depName"
  152. },
  153. {
  154. title: "订单类型",
  155. dataIndex: "orderType",
  156. key: "orderType",
  157. render: text => {
  158. return text ? "科技项目" : "认证项目";
  159. }
  160. },
  161. {
  162. title: "下单时间",
  163. dataIndex: "establishTimes",
  164. key: "establishTimes"
  165. },
  166. {
  167. title: "订单状态",
  168. dataIndex: "orderStatus",
  169. key: "orderStatus",
  170. render: text => {
  171. return getNewOrderStatus(text);
  172. }
  173. },
  174. {
  175. title: "合同额(万元)",
  176. dataIndex: "totalAmount",
  177. key: "totalAmount"
  178. },
  179. {
  180. title: "已付额(万元)",
  181. dataIndex: "settlementAmount",
  182. key: "settlementAmount"
  183. },
  184. {
  185. title: "欠款(万元)",
  186. dataIndex: "arrears",
  187. key: "arrears"
  188. },
  189. {
  190. title: "订单负责人",
  191. dataIndex: "salesmanName",
  192. key: "salesmanName"
  193. },
  194. {
  195. title: "变更类型",
  196. dataIndex: "type",
  197. key: "type",
  198. render: text => {
  199. return getType(text);
  200. }
  201. },
  202. {
  203. title: "审核状态",
  204. dataIndex: "processStateText",
  205. key: "processStateText"
  206. },
  207. {
  208. title: "提交时间",
  209. dataIndex: "createTimes",
  210. key: "createTimes"
  211. }
  212. ],
  213. dataSource: [],
  214. // 传递给子组件的
  215. dataProps: [],
  216. columnsX: [
  217. {
  218. title: "业务项目名称",
  219. dataIndex: "commodityName",
  220. key: "commodityName"
  221. },
  222. {
  223. title: "项目类别",
  224. dataIndex: "cname",
  225. key: "cname"
  226. },
  227. {
  228. title: "项目数量",
  229. dataIndex: "commodityQuantity",
  230. key: "commodityQuantity"
  231. },
  232. {
  233. title: "金额(万元)",
  234. dataIndex: "commodityPrice",
  235. key: "commodityPrice"
  236. },
  237. {
  238. title: "负责人",
  239. dataIndex: "contacts",
  240. key: "contacts"
  241. },
  242. {
  243. title: "负责人电话",
  244. dataIndex: "contactsMobile",
  245. key: "contactsMobile"
  246. },
  247. {
  248. title: "项目状态",
  249. dataIndex: "projectStatus",
  250. key: "projectStatus",
  251. render: text => {
  252. return getProjectStatus(text);
  253. }
  254. },
  255. {
  256. title: "主要项目",
  257. dataIndex: "main",
  258. key: "main",
  259. render: text => {
  260. return text ? "是" : "否";
  261. }
  262. },
  263. {
  264. title: "项目说明",
  265. dataIndex: "taskComment",
  266. key: "taskComment",
  267. render: text => {
  268. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  269. }
  270. }
  271. ],
  272. columnsrizhi: [
  273. {
  274. title: "流程",
  275. dataIndex: "processName",
  276. key: "processName"
  277. },
  278. {
  279. title: "操作人",
  280. dataIndex: "adminName",
  281. key: "adminName"
  282. },
  283. {
  284. title: "时间",
  285. dataIndex: "createDate",
  286. key: "createDate"
  287. }
  288. ],
  289. dataSourceX: [],
  290. ContactsLists: [
  291. {
  292. title: "催款科目",
  293. dataIndex: "dunSubject",
  294. key: "dunSubject",
  295. render: text => {
  296. return getjiedian(text);
  297. }
  298. },
  299. {
  300. title: "金额(万)",
  301. dataIndex: "money",
  302. key: "money"
  303. },
  304. {
  305. title: "催款状态",
  306. dataIndex: "dunStatus",
  307. key: "dunStatus",
  308. render: text => {
  309. return getCuikuan(text);
  310. }
  311. }
  312. ]
  313. };
  314. },
  315. //页面加载函数
  316. componentWillMount() {
  317. this.loadData();
  318. },
  319. //整行点击
  320. tableRowClick(record) {
  321. this.setState(
  322. {
  323. visible: true,
  324. type: record.type,
  325. status: record.status,
  326. buttonStatus: true,
  327. orderStatus: record.orderStatus,
  328. processStateText: record.processStateText,
  329. id: record.id,
  330. orderNo: record.orderNo
  331. },
  332. () => {
  333. this.xiangqing(record.orderNo);
  334. this.xiangmu(record.orderNo);
  335. this.jiedian(record.orderNo);
  336. }
  337. );
  338. // console.log("row",this.state.activeKey);
  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. });
  554. }
  555. }
  556. this.setState({
  557. dataSourceX: theArr
  558. });
  559. }.bind(this)
  560. });
  561. },
  562. search(obj) {
  563. this.setState(
  564. {
  565. searchData: obj
  566. },
  567. () => {
  568. this.loadData(1);
  569. }
  570. );
  571. },
  572. rizhi(orderNo) {
  573. $.ajax({
  574. method: "get",
  575. dataType: "json",
  576. crossDomain: false,
  577. url: "/api/admin/newOrder/selectOrderLog",
  578. data: {
  579. orderNo: orderNo
  580. },
  581. success: function(data) {
  582. let theArr = [];
  583. let thisData = data.data;
  584. if (!thisData.length) {
  585. if (data.error && data.error.length) {
  586. message.warning(data.error[0].message);
  587. }
  588. thisData = {};
  589. } else {
  590. for (let i = 0; i < data.data.length; i++) {
  591. let thisdata = data.data[i];
  592. theArr.push({
  593. processName: thisdata.processName,
  594. adminName: thisdata.adminName,
  595. createDate: thisdata.createDate
  596. });
  597. }
  598. }
  599. this.setState({
  600. dataSourcerizhi: theArr
  601. });
  602. }.bind(this)
  603. });
  604. },
  605. getOrderLog(orderNo) {
  606. this.setState({
  607. rizhivisible: true
  608. });
  609. this.rizhi(orderNo);
  610. },
  611. closeOrderLog() {
  612. this.setState({
  613. rizhivisible: false
  614. });
  615. },
  616. //节点列表
  617. jiedian(orderNos) {
  618. $.ajax({
  619. method: "get",
  620. dataType: "json",
  621. crossDomain: false,
  622. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  623. data: {
  624. orderNo: orderNos
  625. },
  626. success: function(data) {
  627. let theArr = [];
  628. let thisData = [];
  629. if (data.error.length || data.data.list == "") {
  630. if (data.error && data.error.length) {
  631. message.warning(data.error[0].message);
  632. }
  633. } else {
  634. for (let i = 0; i < data.data.length; i++) {
  635. thisData = data.data[i];
  636. theArr.push({
  637. key: i,
  638. dunSubject: thisData.dunSubject
  639. ? thisData.dunSubject.toString()
  640. : "", //催款科目
  641. id: thisData.id, //节点Id
  642. money: thisData.money, //催款金额
  643. dunStatus: thisData.dunStatus //催款状态
  644. });
  645. }
  646. this.setState({
  647. contactList: theArr
  648. });
  649. }
  650. }.bind(this)
  651. });
  652. },
  653. //审核通过
  654. examOk() {
  655. $.ajax({
  656. method: "post",
  657. dataType: "json",
  658. crossDomain: false,
  659. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  660. data: {
  661. orderNo: this.state.orderNo,
  662. orderStatus: 2
  663. },
  664. success: function(data) {
  665. if (data.error.length || data.data.list == "") {
  666. if (data.error && data.error.length) {
  667. message.warning(data.error[0].message);
  668. }
  669. } else {
  670. message.success("该订单已通过审核~");
  671. this.setState({
  672. visible: false
  673. });
  674. this.reset();
  675. }
  676. }.bind(this)
  677. }).always(
  678. function() {
  679. this.setState({
  680. loading: false
  681. });
  682. }.bind(this)
  683. );
  684. },
  685. //通过发给外包
  686. outsourcing() {
  687. $.ajax({
  688. method: "post",
  689. dataType: "json",
  690. crossDomain: false,
  691. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  692. data: {
  693. orderNo: this.state.orderNo,
  694. orderStatus: 2,
  695. outsource: 1
  696. },
  697. success: function(data) {
  698. if (data.error.length || data.data.list == "") {
  699. if (data.error && data.error.length) {
  700. message.warning(data.error[0].message);
  701. }
  702. } else {
  703. message.success("该订单已通过审核~");
  704. this.setState({
  705. visible: false
  706. });
  707. this.reset();
  708. }
  709. }.bind(this)
  710. }).always(
  711. function() {
  712. this.setState({
  713. loading: false
  714. });
  715. }.bind(this)
  716. );
  717. },
  718. //审核不通过
  719. examOks() {
  720. this.setState({
  721. aloading: true
  722. });
  723. $.ajax({
  724. method: "post",
  725. dataType: "json",
  726. crossDomain: false,
  727. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  728. data: {
  729. orderNo: this.state.orderNo,
  730. orderStatus: 3,
  731. reason: this.state.reason
  732. },
  733. success: function(data) {
  734. if (data.error.length || data.data.list == "") {
  735. if (data.error && data.error.length) {
  736. message.warning(data.error[0].message);
  737. this.setState({
  738. aloading: true
  739. });
  740. }
  741. } else {
  742. message.success("该订单已被拒绝~");
  743. this.setState({
  744. visible: false,
  745. aloading: false,
  746. noVisible: false,
  747. reason: ""
  748. });
  749. this.reset();
  750. }
  751. }.bind(this)
  752. }).always(
  753. function() {
  754. this.setState({
  755. loading: false
  756. });
  757. }.bind(this)
  758. );
  759. },
  760. //点击拒绝
  761. examNo() {
  762. this.setState({
  763. noVisible: true
  764. });
  765. },
  766. loadDataChange() {
  767. $.ajax({
  768. method: "get",
  769. dataType: "json",
  770. async: false,
  771. crossDomain: false,
  772. url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  773. data: {
  774. changeId: this.state.id
  775. },
  776. success: function(data) {
  777. if (data.error.length || data.data.list == "") {
  778. if (data.error && data.error.length) {
  779. message.warning(data.error[0].message);
  780. }
  781. } else {
  782. // console.log("拿到历史", data.data);
  783. this.setState({
  784. dataProps: data.data
  785. });
  786. }
  787. }.bind(this)
  788. });
  789. },
  790. callback(key) {
  791. this.setState({
  792. activeKey: key
  793. });
  794. // console.log("change",this.state.activeKey);
  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. visible: false,
  958. activeKey: "1"
  959. },
  960. () => {
  961. this.setState({
  962. activeKey: "1"
  963. });
  964. }
  965. );
  966. this.loadData(this.state.page);
  967. // console.log("table",this.state.activeKey);
  968. },
  969. visitOk() {
  970. this.setState({
  971. visible: false
  972. });
  973. },
  974. render() {
  975. const formItemLayout = {
  976. labelCol: { span: 8 },
  977. wrapperCol: { span: 14 }
  978. };
  979. const FormItem = Form.Item;
  980. const { TabPane } = Tabs;
  981. return (
  982. <div className="user-content">
  983. <ShowModalDiv ShowModal={this.state.showModal} />
  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. pictureUrl={this.state.voucherUrl}
  1032. processState={this.props.processState}
  1033. // loadData={this.callback}
  1034. reset={this.state.visible}
  1035. dataSource={this.state.dataProps}
  1036. proceedsData={this.state.proceedsData}
  1037. proceedsTotal={this.state.proTotal}
  1038. invoiceTotal={this.state.invTotal}
  1039. contactList={this.state.refundInvoice}
  1040. onCancel={this.visitCancel}
  1041. />
  1042. </TabPane>
  1043. {this.state.status === 4 ? (
  1044. <TabPane tab="原订单" key="3">
  1045. <Form
  1046. layout="horizontal"
  1047. onSubmit={this.handleSubmit}
  1048. id="demand-form"
  1049. style={{ paddingBottom: "40px" }}
  1050. >
  1051. <Spin spinning={this.state.loading}>
  1052. <OrderDetail
  1053. orderData={this.state.primaryOrderData}
  1054. getOrderLog={this.getOrderLog}
  1055. dataSourceX={this.state.dataSourceX}
  1056. contactList={this.state.contactList}
  1057. orderNo={this.state.primaryOrderNo}
  1058. />
  1059. </Spin>
  1060. </Form>
  1061. </TabPane>
  1062. ) : (
  1063. ""
  1064. )}
  1065. {this.state.status === 4 ? (
  1066. this.state.type === 4 || this.state.type === 5 ? (
  1067. <TabPane tab="附加订单" key="4">
  1068. <OrderDetail
  1069. orderData={this.state.additionalOrderData}
  1070. getOrderLog={this.getOrderLog}
  1071. dataSourceX={this.state.dataSourceX}
  1072. contactList={this.state.contactList}
  1073. orderNo={this.state.additionalOrder}
  1074. />
  1075. </TabPane>
  1076. ) : (
  1077. ""
  1078. )
  1079. ) : (
  1080. ""
  1081. )}
  1082. </Tabs>
  1083. </Modal>
  1084. <Modal
  1085. maskClosable={false}
  1086. visible={this.state.addnextVisible}
  1087. onOk={this.nextCancel}
  1088. onCancel={this.nextCancel}
  1089. confirmLoading={this.state.confirmLoading}
  1090. width="800px"
  1091. title={"项目任务详情"}
  1092. footer=""
  1093. className="admin-desc-content"
  1094. >
  1095. <Form layout="horizontal" id="demand-form">
  1096. <Spin spinning={this.state.loading}>
  1097. <div className="clearfix">
  1098. <FormItem
  1099. className="half-item"
  1100. {...formItemLayout}
  1101. label="项目名称"
  1102. >
  1103. <span>{this.state.commodityName}</span>
  1104. </FormItem>
  1105. <FormItem
  1106. className="half-item"
  1107. {...formItemLayout}
  1108. label="项目数量"
  1109. >
  1110. <span>{this.state.commodityQuantity}</span>
  1111. </FormItem>
  1112. <FormItem
  1113. className="half-item"
  1114. {...formItemLayout}
  1115. label="金额(万元)"
  1116. >
  1117. <span>{this.state.commodityPrice}</span>
  1118. </FormItem>
  1119. <FormItem
  1120. className="half-item"
  1121. {...formItemLayout}
  1122. label="主要项目"
  1123. >
  1124. <span>{getboutique(this.state.main)}</span>
  1125. </FormItem>
  1126. <div className="clearfix">
  1127. <FormItem
  1128. labelCol={{ span: 4 }}
  1129. wrapperCol={{ span: 16 }}
  1130. label="服务说明"
  1131. >
  1132. <span>{this.state.taskComment}</span>
  1133. </FormItem>
  1134. </div>
  1135. </div>
  1136. </Spin>
  1137. </Form>
  1138. </Modal>
  1139. <Modal
  1140. maskClosable={false}
  1141. visible={this.state.noVisible}
  1142. onOk={this.handleOk}
  1143. onCancel={this.noCancel}
  1144. width="400px"
  1145. title={"拒绝理由"}
  1146. footer=""
  1147. className="admin-desc-content"
  1148. confirmLoading={this.state.confirmLoading}
  1149. >
  1150. <Form layout="horizontal" id="demand-form">
  1151. <Spin spinning={this.state.loading}>
  1152. <div className="clearfix">
  1153. <FormItem
  1154. labelCol={{ span: 4 }}
  1155. wrapperCol={{ span: 16 }}
  1156. label="拒绝理由"
  1157. >
  1158. <Input
  1159. type="textarea"
  1160. placeholder="请输入拒绝理由"
  1161. rows={4}
  1162. value={this.state.reason}
  1163. onChange={e => {
  1164. this.setState({ reason: e.target.value });
  1165. }}
  1166. />
  1167. </FormItem>
  1168. </div>
  1169. <div className="clearfix">
  1170. <Button
  1171. className="cancel"
  1172. type="primary"
  1173. onClick={this.examOks}
  1174. style={{ marginLeft: "50px" }}
  1175. htmlType="submit"
  1176. loading={this.state.aloading}
  1177. >
  1178. 确定
  1179. </Button>
  1180. <Button
  1181. className="cancel"
  1182. type="ghost"
  1183. onClick={this.noCancel}
  1184. style={{ marginLeft: "50px" }}
  1185. >
  1186. 取消
  1187. </Button>
  1188. </div>
  1189. </Spin>
  1190. </Form>
  1191. </Modal>
  1192. <Modal
  1193. visible={this.state.rizhivisible}
  1194. className="admin-desc-content"
  1195. width="800px"
  1196. maskClosable={false}
  1197. title="订单日志"
  1198. footer={null}
  1199. onCancel={this.closeOrderLog}
  1200. >
  1201. <div className="patent-table">
  1202. <Spin spinning={this.state.loading}>
  1203. <Table
  1204. bordered
  1205. columns={this.state.columnsrizhi}
  1206. dataSource={this.state.dataSourcerizhi}
  1207. pagination={false}
  1208. />
  1209. </Spin>
  1210. </div>
  1211. </Modal>
  1212. </div>
  1213. </div>
  1214. );
  1215. }
  1216. })
  1217. );
  1218. export default contractChange;