contractJsjl.js 44 KB

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