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