contractJsy.js 42 KB

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