contractCwzj.js 37 KB

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