contractJsy.js 45 KB

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