contractYxgly.js 43 KB

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