projectAssignment.jsx 39 KB

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