contractJsy.js 42 KB

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