contractJsy.js 33 KB

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