contractJsy.js 35 KB

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