contractJsy.js 35 KB

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