contractJszj.js 33 KB

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