contractJsjl.js 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253
  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. sort: thisdata.cSort
  555. });
  556. }
  557. }
  558. this.setState({
  559. dataSourceX: theArr
  560. });
  561. }.bind(this)
  562. });
  563. },
  564. search(obj) {
  565. this.setState(
  566. {
  567. searchData: obj
  568. },
  569. () => {
  570. this.loadData(1);
  571. }
  572. );
  573. },
  574. rizhi(orderNo) {
  575. $.ajax({
  576. method: "get",
  577. dataType: "json",
  578. crossDomain: false,
  579. url: "/api/admin/newOrder/selectOrderLog",
  580. data: {
  581. orderNo: orderNo
  582. },
  583. success: function(data) {
  584. let theArr = [];
  585. let thisData = data.data;
  586. if (!thisData.length) {
  587. if (data.error && data.error.length) {
  588. message.warning(data.error[0].message);
  589. }
  590. thisData = {};
  591. } else {
  592. for (let i = 0; i < data.data.length; i++) {
  593. let thisdata = data.data[i];
  594. theArr.push({
  595. processName: thisdata.processName,
  596. adminName: thisdata.adminName,
  597. createDate: thisdata.createDate
  598. });
  599. }
  600. }
  601. this.setState({
  602. dataSourcerizhi: theArr
  603. });
  604. }.bind(this)
  605. });
  606. },
  607. getOrderLog(orderNo) {
  608. this.setState({
  609. rizhivisible: true
  610. });
  611. this.rizhi(orderNo);
  612. },
  613. closeOrderLog() {
  614. this.setState({
  615. rizhivisible: false
  616. });
  617. },
  618. //节点列表
  619. jiedian(orderNos) {
  620. $.ajax({
  621. method: "get",
  622. dataType: "json",
  623. crossDomain: false,
  624. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  625. data: {
  626. orderNo: orderNos
  627. },
  628. success: function(data) {
  629. let theArr = [];
  630. let thisData = [];
  631. if (data.error.length || data.data.list == "") {
  632. if (data.error && data.error.length) {
  633. message.warning(data.error[0].message);
  634. }
  635. } else {
  636. for (let i = 0; i < data.data.length; i++) {
  637. thisData = data.data[i];
  638. theArr.push({
  639. key: i,
  640. dunSubject: thisData.dunSubject
  641. ? thisData.dunSubject.toString()
  642. : "", //催款科目
  643. id: thisData.id, //节点Id
  644. money: thisData.money, //催款金额
  645. dunStatus: thisData.dunStatus //催款状态
  646. });
  647. }
  648. this.setState({
  649. contactList: theArr
  650. });
  651. }
  652. }.bind(this)
  653. });
  654. },
  655. //审核通过
  656. examOk() {
  657. $.ajax({
  658. method: "post",
  659. dataType: "json",
  660. crossDomain: false,
  661. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  662. data: {
  663. orderNo: this.state.orderNo,
  664. orderStatus: 2
  665. },
  666. success: function(data) {
  667. if (data.error.length || data.data.list == "") {
  668. if (data.error && data.error.length) {
  669. message.warning(data.error[0].message);
  670. }
  671. } else {
  672. message.success("该订单已通过审核~");
  673. this.setState({
  674. visible: false
  675. });
  676. this.reset();
  677. }
  678. }.bind(this)
  679. }).always(
  680. function() {
  681. this.setState({
  682. loading: false
  683. });
  684. }.bind(this)
  685. );
  686. },
  687. //通过发给外包
  688. outsourcing() {
  689. $.ajax({
  690. method: "post",
  691. dataType: "json",
  692. crossDomain: false,
  693. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  694. data: {
  695. orderNo: this.state.orderNo,
  696. orderStatus: 2,
  697. outsource: 1
  698. },
  699. success: function(data) {
  700. if (data.error.length || data.data.list == "") {
  701. if (data.error && data.error.length) {
  702. message.warning(data.error[0].message);
  703. }
  704. } else {
  705. message.success("该订单已通过审核~");
  706. this.setState({
  707. visible: false
  708. });
  709. this.reset();
  710. }
  711. }.bind(this)
  712. }).always(
  713. function() {
  714. this.setState({
  715. loading: false
  716. });
  717. }.bind(this)
  718. );
  719. },
  720. //审核不通过
  721. examOks() {
  722. this.setState({
  723. aloading: true
  724. });
  725. $.ajax({
  726. method: "post",
  727. dataType: "json",
  728. crossDomain: false,
  729. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  730. data: {
  731. orderNo: this.state.orderNo,
  732. orderStatus: 3,
  733. reason: this.state.reason
  734. },
  735. success: function(data) {
  736. if (data.error.length || data.data.list == "") {
  737. if (data.error && data.error.length) {
  738. message.warning(data.error[0].message);
  739. this.setState({
  740. aloading: true
  741. });
  742. }
  743. } else {
  744. message.success("该订单已被拒绝~");
  745. this.setState({
  746. visible: false,
  747. aloading: false,
  748. noVisible: false,
  749. reason: ""
  750. });
  751. this.reset();
  752. }
  753. }.bind(this)
  754. }).always(
  755. function() {
  756. this.setState({
  757. loading: false
  758. });
  759. }.bind(this)
  760. );
  761. },
  762. //点击拒绝
  763. examNo() {
  764. this.setState({
  765. noVisible: true
  766. });
  767. },
  768. loadDataChange() {
  769. $.ajax({
  770. method: "get",
  771. dataType: "json",
  772. async: false,
  773. crossDomain: false,
  774. url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  775. data: {
  776. changeId: this.state.id
  777. },
  778. success: function(data) {
  779. if (data.error.length || data.data.list == "") {
  780. if (data.error && data.error.length) {
  781. message.warning(data.error[0].message);
  782. }
  783. } else {
  784. // console.log("拿到历史", data.data);
  785. this.setState({
  786. dataProps: data.data
  787. });
  788. }
  789. }.bind(this)
  790. });
  791. },
  792. callback(key) {
  793. this.setState({
  794. activeKey: key
  795. });
  796. // console.log("change",this.state.activeKey);
  797. if (key === "1") {
  798. this.xiangmu(this.state.orderNo);
  799. this.jiedian(this.state.orderNo);
  800. }
  801. if (key === "2") {
  802. this.ChangeDetail(this.state.id);
  803. this.loadDataChange();
  804. }
  805. if (key === "3") {
  806. this.primaryOrder(this.state.primaryOrderNo);
  807. this.xiangmu(this.state.primaryOrderNo);
  808. this.jiedian(this.state.primaryOrderNo);
  809. }
  810. if (key === "4") {
  811. this.additionalOrder(this.state.additionalOrder);
  812. this.xiangmu(this.state.additionalOrder);
  813. this.jiedian(this.state.additionalOrder);
  814. this.setState({
  815. buttonStatusA: false
  816. });
  817. } else {
  818. this.setState({
  819. buttonStatusA: true
  820. });
  821. }
  822. },
  823. closeDesc(e, s) {
  824. this.state.activeKey = "1";
  825. this.state.userDetaile = false;
  826. this.state.signBillVisible = false;
  827. this.state.visible = e;
  828. if (s) {
  829. this.loadData(this.state.pageNo);
  830. }
  831. },
  832. // 获取原订单编号
  833. getPrimaryOrder(value) {
  834. this.setState({
  835. primaryOrder: value
  836. });
  837. },
  838. getAdditionalOrder(value) {
  839. this.setState({
  840. additionalOrder: value
  841. });
  842. },
  843. getUrl(url) {
  844. let theorgCodeUrl = [];
  845. if (url.length) {
  846. let picArr = [];
  847. url.map(function(item) {
  848. if (
  849. item.response &&
  850. item.response.data &&
  851. item.response.data.length
  852. ) {
  853. picArr.push(item.response.data);
  854. }
  855. });
  856. theorgCodeUrl = picArr.join(",");
  857. }
  858. return theorgCodeUrl;
  859. },
  860. sureOut() {
  861. if (!this.state.companyName) {
  862. message.warning("公司名称不能为空");
  863. return;
  864. }
  865. if (!this.state.unitPrice) {
  866. message.warning("单价不能为空");
  867. return;
  868. }
  869. if (!this.state.unitNumber) {
  870. message.warning("数量不能为空");
  871. return;
  872. }
  873. if (!this.state.amount) {
  874. message.warning("总金额不能为空");
  875. return;
  876. }
  877. if (!this.state.outsourceRemarks) {
  878. message.warning("备注不能为空");
  879. return;
  880. }
  881. if (this.state.pictureUrl.length === 0) {
  882. message.warning("合同扫描件不能为空");
  883. return;
  884. }
  885. $.ajax({
  886. method: "POST",
  887. dataType: "json",
  888. crossDomain: false,
  889. url: globalConfig.context + "/api/admin/outsourceOrg/auditOutsource",
  890. data: {
  891. id: this.state.id,
  892. orderNo: this.state.orderNo,
  893. companyName: this.state.companyName,
  894. amount: this.state.amount,
  895. outsourceRemarks: this.state.outsourceRemarks,
  896. unitNumber: this.state.unitNumber,
  897. unitPrice: this.state.unitPrice,
  898. attachmentUrl: this.getUrl(this.state.attachmentUrl).length
  899. ? this.getUrl(this.state.attachmentUrl)
  900. : "",
  901. orderStatus: 2,
  902. pictureUrl: this.getUrl(this.state.pictureUrl).length
  903. ? this.getUrl(this.state.pictureUrl)
  904. : ""
  905. }
  906. }).done(
  907. function(data) {
  908. this.setState({
  909. loading: false
  910. });
  911. if (!data.error.length) {
  912. message.success("发起成功!");
  913. this.outReset();
  914. this.visitCancel();
  915. } else {
  916. message.warning(data.error[0].message);
  917. }
  918. }.bind(this)
  919. );
  920. },
  921. //关闭输入理由框
  922. noCancel() {
  923. this.setState({
  924. noVisible: false,
  925. aloading: false,
  926. reason: ""
  927. });
  928. },
  929. //重置
  930. reset() {
  931. this.setState({
  932. signBillVisible: false
  933. });
  934. this.state.orderNo = "";
  935. this.state.customerName = "";
  936. this.state.releaseDate[0] = undefined;
  937. this.state.releaseDate[1] = undefined;
  938. this.state.approval = undefined;
  939. this.loadData(1);
  940. },
  941. outReset() {
  942. this.setState({
  943. companyName: "",
  944. amount: "",
  945. unitPrice: "",
  946. unitNumber: "",
  947. outsourceRemarks: "",
  948. attachmentUrl: [],
  949. pictureUrl: []
  950. });
  951. },
  952. getOrgCodeUrl(e) {
  953. this.setState({ pictureUrl: e });
  954. },
  955. //关闭详情
  956. visitCancel() {
  957. this.setState(
  958. {
  959. visible: false,
  960. activeKey: "1"
  961. },
  962. () => {
  963. this.setState({
  964. activeKey: "1"
  965. });
  966. }
  967. );
  968. this.loadData(this.state.page);
  969. // console.log("table",this.state.activeKey);
  970. },
  971. visitOk() {
  972. this.setState({
  973. visible: false
  974. });
  975. },
  976. render() {
  977. const formItemLayout = {
  978. labelCol: { span: 8 },
  979. wrapperCol: { span: 14 }
  980. };
  981. const FormItem = Form.Item;
  982. const { TabPane } = Tabs;
  983. return (
  984. <div className="user-content">
  985. <ShowModalDiv ShowModal={this.state.showModal} />
  986. <div className="content-title">
  987. <span>合同变更审核订单</span>
  988. </div>
  989. <div className="user-search">
  990. <SearchInput search={this.search} />
  991. <div className="patent-table">
  992. <Spin spinning={this.state.loading}>
  993. <Table
  994. size="small"
  995. bordered
  996. columns={this.state.columns}
  997. dataSource={this.state.dataSource}
  998. pagination={this.state.pagination}
  999. onRowClick={this.tableRowClick}
  1000. />
  1001. </Spin>
  1002. </div>
  1003. <Modal
  1004. className="customeDetails"
  1005. footer=""
  1006. maskClosable={false}
  1007. width="900px"
  1008. visible={this.state.visible}
  1009. onOk={this.visitOk}
  1010. onCancel={this.visitCancel}
  1011. >
  1012. <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
  1013. <TabPane tab="订单详情" key="1">
  1014. <Form
  1015. layout="horizontal"
  1016. onSubmit={this.handleSubmit}
  1017. id="demand-form"
  1018. style={{ paddingBottom: "40px" }}
  1019. >
  1020. <Spin spinning={this.state.loading}>
  1021. <OrderDetail
  1022. orderData={this.state.orderData}
  1023. getOrderLog={this.getOrderLog}
  1024. dataSourceX={this.state.dataSourceX}
  1025. contactList={this.state.contactList}
  1026. orderNo={this.state.orderNo}
  1027. />
  1028. </Spin>
  1029. </Form>
  1030. </TabPane>
  1031. <TabPane tab="合同变更记录" key="2">
  1032. <ChangeDetail
  1033. data={this.state.contractData}
  1034. pictureUrl={this.state.voucherUrl}
  1035. processState={this.props.processState}
  1036. // loadData={this.callback}
  1037. reset={this.state.visible}
  1038. dataSource={this.state.dataProps}
  1039. proceedsData={this.state.proceedsData}
  1040. proceedsTotal={this.state.proTotal}
  1041. invoiceTotal={this.state.invTotal}
  1042. contactList={this.state.refundInvoice}
  1043. onCancel={this.visitCancel}
  1044. />
  1045. </TabPane>
  1046. {this.state.status === 4 ? (
  1047. <TabPane tab="原订单" key="3">
  1048. <Form
  1049. layout="horizontal"
  1050. onSubmit={this.handleSubmit}
  1051. id="demand-form"
  1052. style={{ paddingBottom: "40px" }}
  1053. >
  1054. <Spin spinning={this.state.loading}>
  1055. <OrderDetail
  1056. orderData={this.state.primaryOrderData}
  1057. getOrderLog={this.getOrderLog}
  1058. dataSourceX={this.state.dataSourceX}
  1059. contactList={this.state.contactList}
  1060. orderNo={this.state.primaryOrderNo}
  1061. />
  1062. </Spin>
  1063. </Form>
  1064. </TabPane>
  1065. ) : (
  1066. ""
  1067. )}
  1068. {this.state.status === 4 ? (
  1069. this.state.type === 4 || this.state.type === 5 ? (
  1070. <TabPane tab="附加订单" key="4">
  1071. <OrderDetail
  1072. orderData={this.state.additionalOrderData}
  1073. getOrderLog={this.getOrderLog}
  1074. dataSourceX={this.state.dataSourceX}
  1075. contactList={this.state.contactList}
  1076. orderNo={this.state.additionalOrder}
  1077. />
  1078. </TabPane>
  1079. ) : (
  1080. ""
  1081. )
  1082. ) : (
  1083. ""
  1084. )}
  1085. </Tabs>
  1086. </Modal>
  1087. <Modal
  1088. maskClosable={false}
  1089. visible={this.state.addnextVisible}
  1090. onOk={this.nextCancel}
  1091. onCancel={this.nextCancel}
  1092. confirmLoading={this.state.confirmLoading}
  1093. width="800px"
  1094. title={"项目任务详情"}
  1095. footer=""
  1096. className="admin-desc-content"
  1097. >
  1098. <Form layout="horizontal" id="demand-form">
  1099. <Spin spinning={this.state.loading}>
  1100. <div className="clearfix">
  1101. <FormItem
  1102. className="half-item"
  1103. {...formItemLayout}
  1104. label="项目名称"
  1105. >
  1106. <span>{this.state.commodityName}</span>
  1107. </FormItem>
  1108. <FormItem
  1109. className="half-item"
  1110. {...formItemLayout}
  1111. label="项目数量"
  1112. >
  1113. <span>{this.state.commodityQuantity}</span>
  1114. </FormItem>
  1115. <FormItem
  1116. className="half-item"
  1117. {...formItemLayout}
  1118. label="金额(万元)"
  1119. >
  1120. <span>{this.state.commodityPrice}</span>
  1121. </FormItem>
  1122. <FormItem
  1123. className="half-item"
  1124. {...formItemLayout}
  1125. label="主要项目"
  1126. >
  1127. <span>{getboutique(this.state.main)}</span>
  1128. </FormItem>
  1129. <div className="clearfix">
  1130. <FormItem
  1131. labelCol={{ span: 4 }}
  1132. wrapperCol={{ span: 16 }}
  1133. label="服务说明"
  1134. >
  1135. <span>{this.state.taskComment}</span>
  1136. </FormItem>
  1137. </div>
  1138. </div>
  1139. </Spin>
  1140. </Form>
  1141. </Modal>
  1142. <Modal
  1143. maskClosable={false}
  1144. visible={this.state.noVisible}
  1145. onOk={this.handleOk}
  1146. onCancel={this.noCancel}
  1147. width="400px"
  1148. title={"拒绝理由"}
  1149. footer=""
  1150. className="admin-desc-content"
  1151. confirmLoading={this.state.confirmLoading}
  1152. >
  1153. <Form layout="horizontal" id="demand-form">
  1154. <Spin spinning={this.state.loading}>
  1155. <div className="clearfix">
  1156. <FormItem
  1157. labelCol={{ span: 4 }}
  1158. wrapperCol={{ span: 16 }}
  1159. label="拒绝理由"
  1160. >
  1161. <Input
  1162. type="textarea"
  1163. placeholder="请输入拒绝理由"
  1164. rows={4}
  1165. value={this.state.reason}
  1166. onChange={e => {
  1167. this.setState({ reason: e.target.value });
  1168. }}
  1169. />
  1170. </FormItem>
  1171. </div>
  1172. <div className="clearfix">
  1173. <Button
  1174. className="cancel"
  1175. type="primary"
  1176. onClick={this.examOks}
  1177. style={{ marginLeft: "50px" }}
  1178. htmlType="submit"
  1179. loading={this.state.aloading}
  1180. >
  1181. 确定
  1182. </Button>
  1183. <Button
  1184. className="cancel"
  1185. type="ghost"
  1186. onClick={this.noCancel}
  1187. style={{ marginLeft: "50px" }}
  1188. >
  1189. 取消
  1190. </Button>
  1191. </div>
  1192. </Spin>
  1193. </Form>
  1194. </Modal>
  1195. {/* <Modal
  1196. visible={this.state.rizhivisible}
  1197. className="admin-desc-content"
  1198. width="800px"
  1199. maskClosable={false}
  1200. title="订单日志"
  1201. footer={null}
  1202. onCancel={this.closeOrderLog}
  1203. >
  1204. <div className="patent-table">
  1205. <Spin spinning={this.state.loading}>
  1206. <Table
  1207. bordered
  1208. columns={this.state.columnsrizhi}
  1209. dataSource={this.state.dataSourcerizhi}
  1210. pagination={false}
  1211. />
  1212. </Spin>
  1213. </div>
  1214. </Modal> */}
  1215. <OrderRiZi
  1216. dataSourcerizhi={this.state.dataSourcerizhi}
  1217. closeOrderLog={this.closeOrderLog}
  1218. visible={this.state.rizhivisible}
  1219. loading={this.state.loading}
  1220. />
  1221. </div>
  1222. </div>
  1223. );
  1224. }
  1225. })
  1226. );
  1227. export default contractChange;