contractYxgly.js 36 KB

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