contractCwzj.js 35 KB

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