contractJszj.js 33 KB

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