projectQuery.jsx 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367
  1. import React, { Component } from 'react';
  2. import ajax from 'jquery/src/ajax/xhr.js';
  3. import $ from 'jquery/src/ajax';
  4. import moment from 'moment';
  5. import '@/manageCenter/financialManage/distribute/public.less';
  6. import { Icon, Button, Form, Input, Select, Spin, Tag, Table, Switch, message, DatePicker, Modal, Upload, Col, Tabs, Tooltip } from 'antd';
  7. import OrderDesc from '@/manageCenter/financialManage/orderDetail/orderDesc'
  8. import Assign from '@/manageCenter/publicComponent/assign';
  9. import ResolutionDetail from "@/resolutionDetail";
  10. import {
  11. getProcessStatus,
  12. getApproval,
  13. getLiquidationStatus,
  14. getApprovedState,
  15. splitUrl,
  16. getjiedian,
  17. getboutique,
  18. ShowModal
  19. } from "@/tools";
  20. import ShowModalDiv from "@/showModal.jsx";
  21. import OrderRiZi from "@/orderRiZi.jsx";
  22. import ImgList from "../../../common/imgList";
  23. import { ChooseList } from "../../order/orderNew/chooseList";
  24. import ProjectDetailsReadOnly from "../../../common/projectDetailsReadOnly";
  25. import NewEditProject from "../../../common/projectOperation/newEditProject";
  26. import OrderItemStatus from "../../../common/orderItemStatus";
  27. import EnterpriseNameChange from "../../../common/enterpriseNameChange";
  28. import OrderCoor from '../../order/orderNew/changeComponent/orderCoor';
  29. import ContentUrl from '../../order/orderNew/contentUrl';
  30. import { salesList } from "@/dataDic.js";
  31. import Cascaders from "../../../common/cascaders";
  32. const { TabPane } = Tabs
  33. const PaiDan = React.createClass({
  34. loadData(pageNo) {
  35. this.state.data = [];
  36. this.setState({
  37. page: pageNo,
  38. loading: true
  39. });
  40. $.ajax({
  41. method: "get",
  42. dataType: "json",
  43. crossDomain: false,
  44. url: globalConfig.context + "/api/admin/newOrder/orderNewList",
  45. data: {
  46. pageNo: pageNo || 1,
  47. pageSize: this.state.pagination.pageSize,
  48. specially: 4, //咨询师管理列表
  49. distribution: this.state.distribution, //全部列表
  50. name: this.state.customerName, //名称
  51. deps: this.state.departmenttSearch, //订单部门
  52. orderNo: this.state.orderNoSearch, //订单编号
  53. starTime: this.state.releaseDate[0], //开始时间
  54. endTime: this.state.releaseDate[1] //结束时间
  55. },
  56. success: function (data) {
  57. ShowModal(this);
  58. let theArr = [];
  59. if (!data.data || !data.data.list) {
  60. if (data.error && data.error.length) {
  61. message.warning(data.error[0].message);
  62. }
  63. } else {
  64. for (let i = 0; i < data.data.list.length; i++) {
  65. let thisdata = data.data.list[i];
  66. theArr.push({
  67. key: i,
  68. id: thisdata.id, //任务ID
  69. orderNo: thisdata.orderNo, //订单编号
  70. totalAmount: thisdata.totalAmount, //签单金额
  71. processStatus: thisdata.processStatus, //流程状态
  72. liquidationStatus: thisdata.liquidationStatus, //结算状态
  73. approval: thisdata.approval, //特批状态
  74. signDate: thisdata.signDate, //签单时间
  75. userName: thisdata.userName, //客户名称
  76. salesmanName: thisdata.salesmanName, //营销员名称
  77. financeName: thisdata.financeName, //财务名称
  78. consultantName: thisdata.consultantName, //项目负责人
  79. createDate: thisdata.createDate, //下单时间
  80. depName: thisdata.depName //部门名称
  81. });
  82. }
  83. }
  84. this.state.pagination.current = data.data.pageNo;
  85. this.state.pagination.total = data.data.totalCount;
  86. if (data.data && data.data.list && !data.data.list.length) {
  87. this.state.pagination.current = 0;
  88. this.state.pagination.total = 0;
  89. }
  90. this.setState({
  91. dataSource: theArr,
  92. pagination: this.state.pagination
  93. });
  94. }.bind(this)
  95. }).always(
  96. function () {
  97. this.setState({
  98. loading: false
  99. });
  100. }.bind(this)
  101. );
  102. },
  103. getInitialState() {
  104. return {
  105. rotateDeg: 0,
  106. orderNos: '',
  107. searchMore: true,
  108. releaseDate: [],
  109. activeKey: "1",
  110. orgCodeUrl: [],
  111. voucherUrl: [],
  112. boHuivisible: false,
  113. selectedRowKeys: [],
  114. declarationBatch: 1,
  115. dataInfor: {},
  116. selectedRows: [],
  117. loading: false,
  118. resVisible: false,
  119. paginations: false,
  120. pagination: {
  121. defaultCurrent: 1,
  122. defaultPageSize: 10,
  123. showQuickJumper: true,
  124. pageSize: 10,
  125. onChange: function (page) {
  126. this.loadData(page);
  127. }.bind(this),
  128. showTotal: function (total) {
  129. return "共" + total + "条数据";
  130. }
  131. },
  132. columns: [
  133. {
  134. title: "订单编号",
  135. dataIndex: "orderNo",
  136. key: "orderNo"
  137. },
  138. {
  139. title: "签单客户",
  140. dataIndex: "userName",
  141. key: "userName"
  142. },
  143. {
  144. title: "下单时间",
  145. dataIndex: "createDate",
  146. key: "createDate"
  147. },
  148. {
  149. title: "签单时间",
  150. dataIndex: "signDate",
  151. key: "signDate"
  152. },
  153. {
  154. title: "订单总金额(万)",
  155. dataIndex: "totalAmount",
  156. key: "totalAmount"
  157. },
  158. {
  159. title: "是否特批",
  160. dataIndex: "approval",
  161. key: "approval",
  162. render: text => {
  163. return getApproval(text);
  164. }
  165. },
  166. {
  167. title: "订单负责人",
  168. dataIndex: "salesmanName",
  169. key: "salesmanName"
  170. },
  171. {
  172. title: "财务负责人",
  173. dataIndex: "financeName",
  174. key: "financeName"
  175. },
  176. {
  177. title: "项目负责人",
  178. dataIndex: "consultantName",
  179. key: "consultantName"
  180. },
  181. {
  182. title: "订单部门",
  183. dataIndex: "depName",
  184. key: "depName"
  185. },
  186. {
  187. title: "分派状态",
  188. dataIndex: "processStatus",
  189. key: "processStatus",
  190. render: (text, record) => {
  191. return text == 5 || text == 6 ? getProcessStatus(text, record.examineName, record.approval) : "未分配";
  192. }
  193. }
  194. ],
  195. columnsrizhi: [
  196. {
  197. title: "流程",
  198. dataIndex: "processName",
  199. key: "processName"
  200. },
  201. {
  202. title: "操作人",
  203. dataIndex: "adminName",
  204. key: "adminName"
  205. },
  206. {
  207. title: "时间",
  208. dataIndex: "createDate",
  209. key: "createDate"
  210. }
  211. ],
  212. dataSource: [],
  213. searchTime: [],
  214. columnsX: [
  215. {
  216. title: "业务项目名称",
  217. dataIndex: "commodityName",
  218. key: "commodityName",
  219. render: (text, record) => {
  220. return (
  221. <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span></span>
  222. )
  223. }
  224. },
  225. {
  226. title: "项目类别",
  227. dataIndex: "cname",
  228. key: "cname"
  229. },
  230. {
  231. title: "项目数量",
  232. dataIndex: "commodityQuantity",
  233. key: "commodityQuantity",
  234. render: (text, record) => {
  235. if (record.splitStatus == 1) {
  236. return (
  237. <span>
  238. {text}{" "}
  239. <Tag
  240. color="#108ee9"
  241. onClick={e => {
  242. e.stopPropagation();
  243. this.showRes(record);
  244. }}
  245. >
  246. 已拆
  247. </Tag>
  248. </span>
  249. );
  250. } else {
  251. return text;
  252. }
  253. }
  254. },
  255. {
  256. title: "金额(万元)",
  257. dataIndex: "commodityPrice",
  258. key: "commodityPrice"
  259. },
  260. {
  261. title: "负责人",
  262. dataIndex: "contacts",
  263. key: "contacts"
  264. },
  265. {
  266. title: "负责人电话",
  267. dataIndex: "contactsMobile",
  268. key: "contactsMobile"
  269. },
  270. {
  271. title: "主要项目",
  272. dataIndex: "main",
  273. key: "main",
  274. render: text => {
  275. return text ? "是" : "否";
  276. }
  277. },
  278. {
  279. title: "总年限",
  280. dataIndex: "yearSum",
  281. key: "yearSum",
  282. render: (text, record) => {
  283. return (
  284. <div>{["", "一年", "二年", "三年", "四年", "五年"][text]}</div>
  285. );
  286. }
  287. },
  288. {
  289. title: "年限",
  290. dataIndex: "serviceLife",
  291. key: "serviceLife",
  292. render: (text, record) => {
  293. return (
  294. <div>{!!text && JSON.parse(text).toString()}</div>
  295. );
  296. }
  297. },
  298. {
  299. title: "本次派单",
  300. dataIndex: "serviceYear",
  301. key: "serviceYear",
  302. render: (text, record) => {
  303. return (
  304. <div>{!text ? "" : text}</div>
  305. );
  306. }
  307. },
  308. {
  309. title: "项目说明",
  310. dataIndex: "taskComment",
  311. key: "taskComment",
  312. render: text => {
  313. return (
  314. <Tooltip title={text}>
  315. <div
  316. style={{
  317. width: 100,
  318. overflow: "hidden",
  319. whiteSpace: "nowrap",
  320. textOverflow: "ellipsis",
  321. }}
  322. >{text}</div>
  323. </Tooltip>
  324. )
  325. }
  326. }
  327. ],
  328. dataSourceX: []
  329. };
  330. },
  331. componentWillMount() {
  332. // this.departmentList();
  333. this.loadData();
  334. },
  335. tableRowClick(record, index) {
  336. this.state.RowData = record;
  337. this.setState({
  338. visible: true,
  339. orderNos: record.orderNo
  340. });
  341. this.xiangqing(record.orderNo);
  342. this.xiangmu(record.orderNo);
  343. },
  344. // 拆分详细
  345. showRes(record) {
  346. this.setState({
  347. resVisible: true,
  348. resRecord: record
  349. });
  350. },
  351. resCancel() {
  352. this.setState({
  353. resVisible: false
  354. });
  355. },
  356. //订单详情
  357. xiangqing(orderNos) {
  358. $.ajax({
  359. method: "get",
  360. dataType: "json",
  361. crossDomain: false,
  362. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  363. data: {
  364. orderNo: orderNos
  365. },
  366. success: function (data) {
  367. let theArr = [];
  368. if (data.error.length || data.data.list == "") {
  369. if (data.error && data.error.length) {
  370. message.warning(data.error[0].message);
  371. }
  372. } else {
  373. let thisdata = data.data;
  374. this.setState({
  375. orderUid: thisdata.uid,
  376. userType: thisdata.userType,
  377. salesType: thisdata.salesType,
  378. other: thisdata.other,
  379. orderNo: thisdata.orderNo, //订单编号
  380. contractNo: thisdata.contractNo, //合同编号
  381. userName: thisdata.userName, //客户名称
  382. signDate: thisdata.signDate, //签单时间
  383. examineName: thisdata.examineName,
  384. processStatus: thisdata.processStatus, //流程状态
  385. liquidationStatus: thisdata.liquidationStatus, //结算状态
  386. contacts: thisdata.contacts, //企业联系人
  387. contactMobile: thisdata.contactMobile, //联系人电话
  388. legalPerson: thisdata.legalPerson, //法人
  389. legalPersonTel: thisdata.legalPersonTel, //法人电话
  390. firstAmount: thisdata.firstAmount, //签单金额
  391. totalAmount: thisdata.totalAmount, //首付金额
  392. approval: thisdata.approval, //特批状态
  393. settlementAmount: thisdata.settlementAmount, //已收款项
  394. orderRemarks: thisdata.orderRemarks, //订单留言
  395. orgCodeUrl: thisdata.contractPictureUrl
  396. ? splitUrl(
  397. thisdata.contractPictureUrl,
  398. ",",
  399. globalConfig.avatarHost + "/upload"
  400. )
  401. : [], //图片地址
  402. replenishUrl: thisdata.agreementUrl
  403. ? splitUrl(
  404. thisdata.agreementUrl,
  405. ",",
  406. globalConfig.avatarHost + "/upload"
  407. )
  408. : [], //图片地址
  409. contentUrl: thisdata.serviceContent
  410. ? splitUrl(
  411. thisdata.serviceContent,
  412. ",",
  413. globalConfig.avatarHost + "/upload"
  414. )
  415. : [], //图片地址
  416. salesmanName: thisdata.salesmanName, //营销员名称
  417. salesmanMobile: thisdata.salesmanMobile, //营销员电话
  418. financeName: thisdata.financeName, //财务名称
  419. financeMobile: thisdata.financeMobile, //财务电话
  420. oldSalesmanName: thisdata.oldSalesmanName, //营销员名称
  421. oldSalesmanMobile: thisdata.oldSalesmanMobile, //营销员电话
  422. nowFinance: thisdata.nowFinance, //财务名称
  423. nowFinanceMobile: thisdata.nowFinanceMobile, //财务电话
  424. depName: thisdata.depName, //订单部门
  425. outsource: thisdata.outsource == 0 ? "否" : "是",
  426. deleteSign: thisdata.deleteSign,
  427. });
  428. }
  429. }.bind(this)
  430. }).always(
  431. function () {
  432. this.setState({
  433. loading: false
  434. });
  435. }.bind(this)
  436. );
  437. },
  438. //项目列表
  439. xiangmu(orderNos) {
  440. $.ajax({
  441. method: "get",
  442. dataType: "json",
  443. crossDomain: false,
  444. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  445. data: {
  446. orderNo: orderNos
  447. },
  448. success: function (data) {
  449. let theArr = [];
  450. if (data.error.length || data.data.list == "") {
  451. if (data.error && data.error.length) {
  452. message.warning(data.error[0].message);
  453. }
  454. } else {
  455. for (let i = 0; i < data.data.length; i++) {
  456. let thisdata = data.data[i];
  457. thisdata.key = i;
  458. theArr.push(thisdata);
  459. }
  460. }
  461. this.setState({
  462. dataSourceX: theArr
  463. });
  464. }.bind(this)
  465. }).always(
  466. function () {
  467. this.setState({
  468. loading: false
  469. });
  470. }.bind(this)
  471. );
  472. },
  473. closeDesc(e, s) {
  474. this.state.showDesc = e;
  475. if (s) {
  476. this.loadData(this.state.page);
  477. }
  478. },
  479. search() {
  480. this.loadData();
  481. },
  482. reset() {
  483. this.state.nameSearch = "";
  484. this.state.customerName = "";
  485. this.state.releaseDate = [];
  486. this.state.orderNoSearch = "";
  487. this.state.departmenttSearch = undefined;
  488. this.state.distribution = undefined;
  489. this.Cascaders.empty();
  490. this.loadData(this.state.page);
  491. },
  492. resetAll() {
  493. this.state.nameSearch = "";
  494. this.state.customerName = "";
  495. this.state.releaseDate = [];
  496. this.state.orderNoSearch = "";
  497. this.state.departmenttSearch = undefined;
  498. this.state.distribution = undefined;
  499. this.Cascaders.empty();
  500. this.loadData();
  501. },
  502. searchSwitch() {
  503. this.setState({
  504. searchMore: !this.state.searchMore
  505. });
  506. },
  507. rizhi() {
  508. // console.log(this.state.orderNo);
  509. this.setState({
  510. loading: true
  511. });
  512. $.ajax({
  513. method: "get",
  514. dataType: "json",
  515. crossDomain: false,
  516. url: "/api/admin/newOrder/selectOrderLog",
  517. data: {
  518. orderNo: this.state.orderNo
  519. },
  520. success: function (data) {
  521. let theArr = [];
  522. let thisData = data.data;
  523. if (!thisData.length) {
  524. if (data.error && data.error.length) {
  525. message.warning(data.error[0].message);
  526. }
  527. thisData = {};
  528. } else {
  529. for (let i = 0; i < data.data.length; i++) {
  530. let thisdata = data.data[i];
  531. theArr.push({
  532. processName: thisdata.processName,
  533. adminName: thisdata.adminName,
  534. createDate: thisdata.createDate,
  535. remarks: thisdata.remarks
  536. });
  537. }
  538. }
  539. this.setState({
  540. dataSourcerizhi: theArr
  541. });
  542. }.bind(this)
  543. }).always(
  544. function () {
  545. this.setState({
  546. loading: false
  547. });
  548. }.bind(this)
  549. );
  550. },
  551. //查看订单日志
  552. getOrderLog() {
  553. this.setState({
  554. rizhivisible: true
  555. });
  556. this.rizhi();
  557. },
  558. closeOrderLog() {
  559. this.setState({
  560. rizhivisible: false
  561. });
  562. },
  563. //关闭详情
  564. visitCancel(e) {
  565. this.setState({
  566. visible: false
  567. });
  568. this.reset();
  569. },
  570. visitOk(e) {
  571. this.setState({
  572. visible: false
  573. });
  574. this.reset();
  575. },
  576. nextCancel() {
  577. this.setState({
  578. addnextVisible: false
  579. });
  580. },
  581. //点击打卡项目详情
  582. tableRowClickX(record, index) {
  583. this.setState({
  584. jid: record.id, //项目ID
  585. kid: record.commodityId, //商品ID
  586. commodityName: record.commodityName, //金额
  587. commodityPrice: record.commodityPrice, //金额
  588. commodityQuantity: record.commodityQuantity, //数量
  589. taskComment: record.taskComment, //备注
  590. main: record.main.toString(), //是否为主要
  591. addnextVisible: true,
  592. dataInfor: record,
  593. addState: 0
  594. });
  595. },
  596. resets() {
  597. this.state.orderNo = "";
  598. this.state.customerName = "";
  599. this.state.departmenttSearch = undefined;
  600. this.state.releaseDate[0] = undefined;
  601. this.state.releaseDate[1] = undefined;
  602. },
  603. //部门
  604. departmentList() {
  605. this.setState({
  606. loading: true
  607. });
  608. $.ajax({
  609. method: "get",
  610. dataType: "json",
  611. crossDomain: false,
  612. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  613. data: {},
  614. success: function (data) {
  615. let thedata = data.data;
  616. let theArr = [];
  617. if (!thedata) {
  618. if (data.error && data.error.length) {
  619. message.warning(data.error[0].message);
  620. }
  621. thedata = {};
  622. } else {
  623. thedata.map(function (item, index) {
  624. theArr.push({
  625. key: index,
  626. name: item.name,
  627. id: item.id
  628. });
  629. });
  630. }
  631. this.setState({
  632. departmentArr: theArr
  633. });
  634. }.bind(this)
  635. }).always(
  636. function () {
  637. this.setState({
  638. loading: false
  639. });
  640. }.bind(this)
  641. );
  642. },
  643. downImg() {
  644. let num = 0;
  645. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  646. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  647. num = i;
  648. }
  649. }
  650. if (num == this.state.orgCodeUrl.length - 1) {
  651. return message.warning("已经是最后一张了哦");
  652. }
  653. this.state.previewImage = this.state.orgCodeUrl[num + 1].url;
  654. this.setState({
  655. previewImage: this.state.previewImage,
  656. rotateDeg: 0
  657. });
  658. },
  659. upImg() {
  660. let num = 0;
  661. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  662. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  663. num = i;
  664. }
  665. }
  666. if (num == 0) {
  667. return message.warning("已经是第一张了哦");
  668. }
  669. this.state.previewImage = this.state.orgCodeUrl[num - 1].url;
  670. this.setState({
  671. previewImage: this.state.previewImage,
  672. rotateDeg: 0
  673. });
  674. },
  675. rotate() {
  676. let rotateDeg = this.state.rotateDeg + 90;
  677. this.setState({
  678. rotateDeg
  679. });
  680. },
  681. downImgs() {
  682. let num = 0;
  683. for (let i = 0; i < this.state.replenishUrl.length; i++) {
  684. if (this.state.replenishUrl[i].url == this.state.previewImage) {
  685. num = i;
  686. }
  687. }
  688. if (num == this.state.replenishUrl.length - 1) {
  689. return message.warning("已经是最后一张了哦");
  690. }
  691. this.state.previewImage = this.state.replenishUrl[num + 1].url;
  692. this.setState({
  693. previewImage: this.state.previewImage,
  694. rotateDeg: 0
  695. });
  696. },
  697. upImgs() {
  698. let num = 0;
  699. for (let i = 0; i < this.state.replenishUrl.length; i++) {
  700. if (this.state.replenishUrl[i].url == this.state.previewImage) {
  701. num = i;
  702. }
  703. }
  704. if (num == 0) {
  705. return message.warning("已经是第一张了哦");
  706. }
  707. this.state.previewImage = this.state.replenishUrl[num - 1].url;
  708. this.setState({
  709. previewImage: this.state.previewImage,
  710. rotateDeg: 0
  711. });
  712. },
  713. rotates() {
  714. let rotateDeg = this.state.rotateDeg + 90;
  715. this.setState({
  716. rotateDeg
  717. });
  718. },
  719. changeList(arr) {
  720. const newArr = [];
  721. this.state.columns.forEach(item => {
  722. arr.forEach(val => {
  723. if (val === item.title) {
  724. newArr.push(item);
  725. }
  726. });
  727. });
  728. this.setState({
  729. changeList: newArr
  730. });
  731. },
  732. render() {
  733. const rowSelection = {
  734. selectedRowKeys: this.state.selectedRowKeys,
  735. onChange: (selectedRowKeys, selectedRows) => {
  736. this.setState({
  737. selectedRows: selectedRows.slice(-1),
  738. selectedRowKeys: selectedRowKeys.slice(-1)
  739. });
  740. }
  741. };
  742. const formItemLayout = {
  743. labelCol: { span: 8 },
  744. wrapperCol: { span: 14 }
  745. };
  746. const FormItem = Form.Item;
  747. let departmentArr = this.state.departmentArr || [];
  748. const hasSelected = this.state.selectedRowKeys.length > 0;
  749. const { RangePicker } = DatePicker;
  750. return (
  751. <div className="user-content">
  752. {this.state.resVisible ? (
  753. <ResolutionDetail
  754. cancel={this.resCancel}
  755. detail={this.state.resRecord}
  756. visible={this.state.resVisible}
  757. id={this.state.resRecord.orderNo}
  758. />
  759. ) : (
  760. ""
  761. )}
  762. <ShowModalDiv ShowModal={this.state.showModal} />
  763. <div className="content-title" style={{ marginBottom: 10 }}>
  764. <span style={{ fontWeight: 900, fontSize: 16 }}>项目派单管理</span>
  765. </div>
  766. <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
  767. <TabPane tab="搜索" key="1">
  768. <div className="user-search">
  769. <Input
  770. placeholder="客户名称"
  771. value={this.state.customerName}
  772. style={{ marginLeft: 10 }}
  773. onChange={(e) => {
  774. this.setState({ customerName: e.target.value });
  775. }}
  776. />
  777. <Input
  778. placeholder="订单编号"
  779. value={this.state.orderNoSearch}
  780. onChange={(e) => {
  781. this.setState({ orderNoSearch: e.target.value });
  782. }}
  783. />
  784. <Cascaders
  785. ref={node => this.Cascaders = node}
  786. placeholder="订单部门"
  787. id="id"
  788. name="name"
  789. children="list"
  790. height={28}
  791. onSel={(e) => {
  792. this.setState({
  793. departmenttSearch: JSON.stringify(e),
  794. });
  795. }}
  796. />
  797. {/* <Select
  798. placeholder="选择部门"
  799. style={{ width: 200, marginRight: "10px" }}
  800. value={this.state.departmenttSearch}
  801. onChange={(e) => {
  802. this.setState({ departmenttSearch: e });
  803. }}
  804. >
  805. {departmentArr.map(function (item) {
  806. return (
  807. <Select.Option key={item.id}>{item.name}</Select.Option>
  808. );
  809. })}
  810. </Select> */}
  811. <Select
  812. onChange={(e) => {
  813. this.setState({ distribution: e });
  814. }}
  815. style={{ width: 160, marginRight: 5 }}
  816. placeholder="分派状态"
  817. value={this.state.distribution}
  818. >
  819. <Option value="0">未分配</Option>
  820. <Option value="1">部分分配</Option>
  821. <Option value="2">全部分配</Option>
  822. </Select>
  823. <Button type="primary" onClick={this.search}>
  824. 搜索
  825. </Button>
  826. <Button onClick={this.resetAll}>重置</Button>
  827. <span>
  828. 更多搜索
  829. <Switch
  830. defaultChecked={false}
  831. onChange={this.searchSwitch.bind(this)}
  832. />
  833. </span>
  834. <div
  835. className="search-more"
  836. style={this.state.searchMore ? { display: "none" } : {}}
  837. >
  838. <span>订单时间 :</span>
  839. <RangePicker
  840. value={[
  841. this.state.releaseDate[0]
  842. ? moment(this.state.releaseDate[0])
  843. : null,
  844. this.state.releaseDate[1]
  845. ? moment(this.state.releaseDate[1])
  846. : null,
  847. ]}
  848. onChange={(data, dataString) => {
  849. this.setState({ releaseDate: dataString });
  850. }}
  851. />
  852. </div>
  853. </div>
  854. </TabPane>
  855. <TabPane tab="更改表格显示数据" key="2">
  856. <div style={{ marginLeft: 10 }}>
  857. <ChooseList
  858. columns={this.state.columns}
  859. changeFn={this.changeList}
  860. changeList={this.state.changeList}
  861. top={55}
  862. margin={11}
  863. />
  864. </div>
  865. </TabPane>
  866. </Tabs>
  867. <div className="patent-table">
  868. <Spin spinning={this.state.loading}>
  869. <Table
  870. columns={
  871. this.state.changeList
  872. ? this.state.changeList
  873. : this.state.columns
  874. }
  875. dataSource={this.state.dataSource}
  876. rowSelection={rowSelection}
  877. pagination={this.state.pagination}
  878. onRowClick={this.tableRowClick.bind(this)}
  879. bordered
  880. size="middle"
  881. />
  882. </Spin>
  883. </div>
  884. {this.state.visible ? <Modal
  885. className="customeDetails"
  886. footer=""
  887. title="订单详情"
  888. width="1200px"
  889. visible={this.state.visible}
  890. onOk={this.visitOk}
  891. onCancel={this.visitCancel}
  892. >
  893. <Form
  894. layout="horizontal"
  895. onSubmit={this.handleSubmit}
  896. id="demand-form"
  897. style={{ paddingBottom: "40px" }}
  898. >
  899. <Spin spinning={this.state.loading}>
  900. <div className="clearfix">
  901. <div style={{ position: "absolute", top: '-52px', left: '81px', zIndex: 10000 }}>
  902. <OrderItemStatus deleteSign={this.state.deleteSign} />
  903. </div>
  904. <FormItem
  905. className="half-item"
  906. {...formItemLayout}
  907. label="订单编号"
  908. >
  909. <span>{this.state.orderNo}</span>
  910. </FormItem>
  911. <FormItem
  912. className="half-item"
  913. {...formItemLayout}
  914. label="合同编号"
  915. >
  916. <span>{this.state.contractNo}</span>
  917. </FormItem>
  918. <FormItem
  919. className="half-item"
  920. {...formItemLayout}
  921. label="客户名称"
  922. >
  923. <span>{this.state.userName}</span>
  924. <EnterpriseNameChange
  925. type='journal'
  926. style={{ marginLeft: 10 }}
  927. enterpriseId={this.state.orderUid} />
  928. </FormItem>
  929. <FormItem
  930. className="half-item"
  931. {...formItemLayout}
  932. label="销售类型"
  933. >
  934. <span>
  935. {(["私有客户-", "签单客户-"][this.state.userType] || " ") +
  936. (salesList[this.state.salesType] || "")}
  937. {
  938. this.state.other != null && this.state.other != "" &&
  939. <Tooltip title={this.state.other}>
  940. <span>
  941. {"(" + this.state.other.toString().slice(0, 10) + (this.state.other.toString().length > 9 ? "...)" : ")")}
  942. </span>
  943. </Tooltip>
  944. }
  945. </span>
  946. </FormItem>
  947. <FormItem
  948. className="half-item"
  949. {...formItemLayout}
  950. label="合同签订时间"
  951. >
  952. <span>{this.state.signDate}</span>
  953. </FormItem>
  954. <FormItem
  955. className="half-item"
  956. {...formItemLayout}
  957. label="流程状态"
  958. >
  959. <span>{getProcessStatus(this.state.processStatus, this.state.examineName, this.state.approval)}</span>
  960. </FormItem>
  961. <FormItem
  962. className="half-item"
  963. {...formItemLayout}
  964. label="结算状态"
  965. >
  966. <span>
  967. {getLiquidationStatus(this.state.liquidationStatus)}
  968. </span>
  969. </FormItem>
  970. <FormItem
  971. className="half-item"
  972. {...formItemLayout}
  973. label="企业联系人"
  974. >
  975. <span>{this.state.contacts}</span>
  976. </FormItem>
  977. <FormItem
  978. className="half-item"
  979. {...formItemLayout}
  980. label="联系人电话"
  981. >
  982. <span>{this.state.contactMobile}</span>
  983. </FormItem>
  984. <FormItem
  985. className="half-item"
  986. {...formItemLayout}
  987. label="企业法人"
  988. >
  989. <span>{this.state.legalPerson}</span>
  990. </FormItem>
  991. <FormItem
  992. className="half-item"
  993. {...formItemLayout}
  994. label="法人电话"
  995. >
  996. <span>{this.state.legalPersonTel}</span>
  997. </FormItem>
  998. <FormItem
  999. className="half-item"
  1000. {...formItemLayout}
  1001. label="签单金额(万元)"
  1002. >
  1003. <span>{this.state.totalAmount}</span>
  1004. </FormItem>
  1005. <FormItem
  1006. className="half-item"
  1007. {...formItemLayout}
  1008. label="首付金额(万元)"
  1009. >
  1010. <span>{this.state.firstAmount}</span>
  1011. </FormItem>
  1012. <FormItem
  1013. className="half-item"
  1014. {...formItemLayout}
  1015. label="特批立项"
  1016. >
  1017. <span>{getApprovedState(this.state.approval)}</span>
  1018. </FormItem>
  1019. <FormItem
  1020. className="half-item"
  1021. {...formItemLayout}
  1022. label="已收款项(万元)"
  1023. >
  1024. <span>{this.state.settlementAmount}</span>
  1025. </FormItem>
  1026. <FormItem
  1027. className="half-item"
  1028. {...formItemLayout}
  1029. label="是否外包"
  1030. >
  1031. <span>{this.state.outsource}</span>
  1032. </FormItem>
  1033. <div className="clearfix">
  1034. <FormItem
  1035. labelCol={{ span: 4 }}
  1036. wrapperCol={{ span: 16 }}
  1037. label="订单留言"
  1038. >
  1039. <span>{this.state.orderRemarks}</span>
  1040. </FormItem>
  1041. </div>
  1042. <div className="clearfix">
  1043. <FormItem
  1044. labelCol={{ span: 4 }}
  1045. wrapperCol={{ span: 18 }}
  1046. label="合同扫描件"
  1047. >
  1048. {/*<Upload*/}
  1049. {/* className="demandDetailShow-upload"*/}
  1050. {/* listType="picture-card"*/}
  1051. {/* fileList={this.state.orgCodeUrl}*/}
  1052. {/* onPreview={(file) => {*/}
  1053. {/* this.setState({*/}
  1054. {/* previewImage: file.url || file.thumbUrl,*/}
  1055. {/* previewVisible: true,*/}
  1056. {/* });*/}
  1057. {/* }}*/}
  1058. {/*/>*/}
  1059. <div style={{ paddingTop: '10px', paddingBottom: '10px' }}>
  1060. {this.state.visible && this.state.orgCodeUrl ? <ImgList fileList={this.state.orgCodeUrl} domId={'projectQuery1'} /> : <div />}
  1061. </div>
  1062. <Modal
  1063. maskClosable={false}
  1064. footer={null}
  1065. width={"50%"}
  1066. visible={this.state.previewVisible}
  1067. onCancel={() => {
  1068. this.setState({ previewVisible: false, rotateDeg: 0 });
  1069. }}
  1070. >
  1071. <img
  1072. alt=""
  1073. style={{
  1074. width: "100%",
  1075. transform: `rotate(${this.state.rotateDeg}deg)`,
  1076. }}
  1077. src={this.state.previewImage || ""}
  1078. />
  1079. <Button
  1080. onClick={this.rotate}
  1081. style={{
  1082. position: "relative",
  1083. left: "50%",
  1084. transform: "translateX(-50%)",
  1085. }}
  1086. >
  1087. 旋转
  1088. </Button>
  1089. <Button
  1090. onClick={this.upImg}
  1091. style={{
  1092. position: "absolute",
  1093. left: -81,
  1094. top: "50%",
  1095. transform: "translateY(-50%)",
  1096. }}
  1097. >
  1098. 上一张
  1099. </Button>
  1100. <Button
  1101. onClick={this.downImg}
  1102. style={{
  1103. position: "absolute",
  1104. right: -81,
  1105. top: "50%",
  1106. transform: "translateY(-50%)",
  1107. }}
  1108. >
  1109. 下一张
  1110. </Button>
  1111. </Modal>
  1112. <Button
  1113. style={{
  1114. float: "right",
  1115. marginRight: "140px",
  1116. marginTop: "20px",
  1117. }}
  1118. onClick={this.getOrderLog}
  1119. >
  1120. 查看订单 日志
  1121. </Button>
  1122. </FormItem>
  1123. <FormItem
  1124. labelCol={{ span: 4 }}
  1125. wrapperCol={{ span: 18 }}
  1126. label="补充协议"
  1127. >
  1128. {/*<Upload*/}
  1129. {/* className="demandDetailShow-upload"*/}
  1130. {/* listType="picture-card"*/}
  1131. {/* fileList={this.state.replenishUrl}*/}
  1132. {/* onPreview={(file) => {*/}
  1133. {/* this.setState({*/}
  1134. {/* previewImage: file.url || file.thumbUrl,*/}
  1135. {/* previewVisibles: true,*/}
  1136. {/* });*/}
  1137. {/* }}*/}
  1138. {/*/>*/}
  1139. <div style={{ paddingTop: '10px', paddingBottom: '10px' }}>
  1140. {this.state.visible && this.state.replenishUrl ? <ImgList fileList={this.state.replenishUrl} domId={'projectQuery2'} /> : <div />}
  1141. </div>
  1142. <Modal
  1143. maskClosable={false}
  1144. footer={null}
  1145. width={"50%"}
  1146. visible={this.state.previewVisibles}
  1147. onCancel={() => {
  1148. this.setState({ previewVisibles: false, rotateDeg: 0 });
  1149. }}
  1150. >
  1151. <img
  1152. alt=""
  1153. style={{
  1154. width: "100%",
  1155. transform: `rotate(${this.state.rotateDeg}deg)`,
  1156. }}
  1157. src={this.state.previewImage || ""}
  1158. />
  1159. <Button
  1160. onClick={this.rotate}
  1161. style={{
  1162. position: "relative",
  1163. left: "50%",
  1164. transform: "translateX(-50%)",
  1165. }}
  1166. >
  1167. 旋转
  1168. </Button>
  1169. <Button
  1170. onClick={this.upImgs}
  1171. style={{
  1172. position: "absolute",
  1173. left: -81,
  1174. top: "50%",
  1175. transform: "translateY(-50%)",
  1176. }}
  1177. >
  1178. 上一张
  1179. </Button>
  1180. <Button
  1181. onClick={this.downImgs}
  1182. style={{
  1183. position: "absolute",
  1184. right: -81,
  1185. top: "50%",
  1186. transform: "translateY(-50%)",
  1187. }}
  1188. >
  1189. 下一张
  1190. </Button>
  1191. </Modal>
  1192. </FormItem>
  1193. </div>
  1194. <ContentUrl
  1195. processStatus={1}
  1196. domId={"projectQueryContents"}
  1197. contentUrl={this.state.contentUrl}
  1198. imgId={"projectQueryContentsImg"}
  1199. />
  1200. <div className="clearfix">
  1201. <FormItem
  1202. className="half-item"
  1203. {...formItemLayout}
  1204. label="订单负责人"
  1205. >
  1206. <span>{this.state.salesmanName}</span>
  1207. </FormItem>
  1208. <FormItem
  1209. className="half-item"
  1210. {...formItemLayout}
  1211. label="订单负责人电话"
  1212. >
  1213. <span>{this.state.salesmanMobile}</span>
  1214. </FormItem>
  1215. <FormItem
  1216. className="half-item"
  1217. {...formItemLayout}
  1218. label="订单部门"
  1219. >
  1220. <span>{this.state.depName}</span>
  1221. </FormItem>
  1222. </div>
  1223. <div className="clearfix">
  1224. <FormItem
  1225. className="half-item"
  1226. {...formItemLayout}
  1227. label="当前财务负责人"
  1228. >
  1229. <span>{this.state.nowFinance}</span>
  1230. </FormItem>
  1231. <FormItem
  1232. className="half-item"
  1233. {...formItemLayout}
  1234. label="当前财务负责人电话"
  1235. >
  1236. <span>{this.state.nowFinanceMobile}</span>
  1237. </FormItem>
  1238. </div>
  1239. <div className="clearfix">
  1240. <FormItem
  1241. className="half-item"
  1242. {...formItemLayout}
  1243. style={{ opacity: ".5" }}
  1244. label="原订单负责人"
  1245. >
  1246. <span>{this.state.oldSalesmanName}</span>
  1247. </FormItem>
  1248. <FormItem
  1249. className="half-item"
  1250. {...formItemLayout}
  1251. style={{ opacity: ".5" }}
  1252. label="原订单负责人电话"
  1253. >
  1254. <span>{this.state.oldSalesmanMobile}</span>
  1255. </FormItem>
  1256. </div>
  1257. <div className="clearfix">
  1258. <FormItem
  1259. className="half-item"
  1260. {...formItemLayout}
  1261. style={{ opacity: ".5" }}
  1262. label="实际财务操作人"
  1263. >
  1264. <span>{this.state.financeName}</span>
  1265. </FormItem>
  1266. <FormItem
  1267. className="half-item"
  1268. {...formItemLayout}
  1269. style={{ opacity: ".5" }}
  1270. label="实际财务操作人电话"
  1271. >
  1272. <span>{this.state.financeMobile}</span>
  1273. </FormItem>
  1274. </div>
  1275. <div>
  1276. <OrderCoor orderNo={this.state.orderNos} />
  1277. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  1278. 项目业务
  1279. </span>
  1280. {this.state.processStatus == 0 ? (
  1281. <Button
  1282. type="primary"
  1283. onClick={this.addDetailed}
  1284. style={{
  1285. float: "right",
  1286. marginRight: "50px",
  1287. marginBottom: "15px",
  1288. }}
  1289. >
  1290. 添加项目明细
  1291. </Button>
  1292. ) : (
  1293. ""
  1294. )}
  1295. </div>
  1296. <div className="patent-table">
  1297. <Spin spinning={this.state.loading}>
  1298. <Table
  1299. columns={this.state.columnsX}
  1300. size="small"
  1301. bordered
  1302. dataSource={this.state.dataSourceX}
  1303. pagination={this.state.paginations}
  1304. onRowClick={this.tableRowClickX}
  1305. />
  1306. </Spin>
  1307. </div>
  1308. </div>
  1309. </Spin>
  1310. </Form>
  1311. </Modal> : <div />}
  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. columns={this.state.columnsrizhi}
  1325. dataSource={this.state.dataSourcerizhi}
  1326. pagination={false}
  1327. />
  1328. </Spin>
  1329. </div>
  1330. </Modal> */}
  1331. <OrderRiZi
  1332. dataSourcerizhi={this.state.dataSourcerizhi}
  1333. closeOrderLog={this.closeOrderLog}
  1334. visible={this.state.rizhivisible}
  1335. loading={this.state.loading}
  1336. />
  1337. {/* {this.state.addnextVisible && <ProjectDetailsReadOnly
  1338. infor={this.state.dataInfor}
  1339. visible={this.state.addnextVisible}
  1340. onCancel={this.nextCancel}
  1341. />} */}
  1342. {
  1343. // 项目业务详情
  1344. this.state.addnextVisible &&
  1345. <NewEditProject
  1346. readOnly={true}
  1347. visible={this.state.addnextVisible}
  1348. dataInfor={this.state.dataInfor}
  1349. onCancel={this.nextCancel}
  1350. />
  1351. }
  1352. </div>
  1353. );
  1354. }
  1355. });
  1356. export default PaiDan;