contractJsy.js 34 KB

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