contractJsy.js 43 KB

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