contractYxy.js 41 KB

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