contractJsy.js 41 KB

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