contractJsy.js 34 KB

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