contractJsy.js 40 KB

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