contractJsy.js 34 KB

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