contractCwzy.js 45 KB

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