personnelAll.jsx 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. import React from "react";
  2. import $ from "jquery/src/ajax";
  3. import "@/manageCenter/financialManage/distribute/public.less";
  4. import {
  5. Button,
  6. Form,
  7. Input,
  8. Select,
  9. Spin,
  10. Table,
  11. message,
  12. Modal,
  13. Tabs,
  14. Tag, Tooltip,
  15. } from "antd";
  16. import Assign from "@/manageCenter/publicComponent/assign";
  17. import ResolutionDetail from "@/resolutionDetail";
  18. import OrderRiZi from "@/orderRiZi.jsx";
  19. import {
  20. getProcessStatus,
  21. getLiquidationStatus,
  22. getApprovedState,
  23. splitUrl,
  24. getProjectName,
  25. getboutique,
  26. ShowModal,
  27. } from "@/tools";
  28. import ShowModalDiv from "@/showModal.jsx";
  29. // import ResolutionPro from "../task/resolutionPro";
  30. const FormItem = Form.Item;
  31. const { TabPane } = Tabs;
  32. const PersonnelAll = React.createClass({
  33. loadData(pageNo) {
  34. this.state.data = [];
  35. this.setState({
  36. page: pageNo,
  37. loading: true,
  38. });
  39. $.ajax({
  40. method: "get",
  41. dataType: "json",
  42. crossDomain: false,
  43. url: globalConfig.context + "/api/admin/orderProject/orderTaskList",
  44. data: {
  45. pageNo: pageNo || 1,
  46. pageSize: this.state.pagination.pageSize,
  47. specially: 1, //经理
  48. name: this.state.nameSearch, //客户名称
  49. orderNo: this.state.orderNoSearch, //订单编号
  50. taskId: this.state.taskNoSearch, //任务编号
  51. depId: this.state.departmenttSearch, //订单部门
  52. taskStatus: this.state.taskStatus, //任务状态
  53. adminName: this.state.adminName, //任务受理人
  54. outsource: 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. if (thisdata.splitList) {
  67. thisdata.splitList.forEach((item) => {
  68. item.key = item.id;
  69. });
  70. }
  71. theArr.push({
  72. key: thisdata.id,
  73. orderNo: thisdata.orderNo, //订单编号
  74. id: thisdata.id, //任务ID
  75. taskName: thisdata.taskName, //名称
  76. cname: thisdata.cname, //项目品类
  77. receiverName: thisdata.receiverName, //受理人
  78. projectStatus: thisdata.projectStatus, //项目状态
  79. taskStatus: thisdata.taskStatus, //任务状态
  80. taskDate: thisdata.taskDate, //分配时间
  81. commodityQuantity: thisdata.commodityQuantity, //数量
  82. userName: thisdata.userName, //用户名
  83. depName: thisdata.depName, //部门名称
  84. splitStatus: thisdata.splitStatus, //拆分状态
  85. splitList: thisdata.splitList,
  86. });
  87. }
  88. }
  89. this.state.pagination.current = data.data.pageNo;
  90. this.state.pagination.total = data.data.totalCount;
  91. if (data.data && data.data.list && !data.data.list.length) {
  92. this.state.pagination.current = 0;
  93. this.state.pagination.total = 0;
  94. }
  95. this.setState({
  96. dataSource: theArr,
  97. pagination: this.state.pagination,
  98. });
  99. }.bind(this),
  100. }).always(
  101. function () {
  102. this.setState({
  103. loading: false,
  104. });
  105. }.bind(this)
  106. );
  107. },
  108. getInitialState() {
  109. return {
  110. searchMore: true,
  111. assignVisible: false,
  112. releaseDate: [],
  113. roleName: "",
  114. boHuivisible: false,
  115. departmentArr: [],
  116. selectedRowKeys: [],
  117. selectedRows: [],
  118. paginations: false,
  119. loading: 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: "id",
  136. key: "id",
  137. },
  138. {
  139. title: "任务名称",
  140. dataIndex: "taskName",
  141. key: "taskName",
  142. },
  143. {
  144. title: "订单编号",
  145. dataIndex: "orderNo",
  146. key: "orderNo",
  147. },
  148. {
  149. title: "业务类别",
  150. dataIndex: "cname",
  151. key: "cname",
  152. },
  153. {
  154. title: "客户名称",
  155. dataIndex: "userName",
  156. key: "userName",
  157. width: 150,
  158. render: (text) => {
  159. return (
  160. <Tooltip title={text}>
  161. <div style={{
  162. maxWidth:'150px',
  163. overflow:'hidden',
  164. textOverflow: "ellipsis",
  165. whiteSpace:'nowrap',
  166. }}>{text}</div>
  167. </Tooltip>
  168. )
  169. },
  170. },
  171. {
  172. title: "项目状态",
  173. dataIndex: "projectStatus",
  174. key: "projectStatus",
  175. render: (text) => {
  176. return getProjectName(text);
  177. },
  178. },
  179. {
  180. title: "分配时间",
  181. dataIndex: "taskDate",
  182. key: "taskDate",
  183. },
  184. {
  185. title: "任务数量",
  186. dataIndex: "commodityQuantity",
  187. key: "commodityQuantity",
  188. render: (text, record) => {
  189. if (record.splitStatus == 1) {
  190. return (
  191. <span>
  192. {text}{" "}
  193. <Tag color="#108ee9" style={{ float: "right" }}>
  194. 已拆
  195. </Tag>
  196. </span>
  197. );
  198. } else {
  199. return text;
  200. }
  201. },
  202. },
  203. {
  204. title: "订单部门",
  205. dataIndex: "depName",
  206. key: "depName",
  207. },
  208. {
  209. title: "操作",
  210. dataIndex: "caozuo",
  211. key: "caouzo",
  212. render: (text, record) => {
  213. return (
  214. <div>
  215. <Button
  216. type="primary"
  217. style={{ margin: "0 10px" }}
  218. disabled={record.splitStatus == 1 ? true : false}
  219. onClick={(e) => {
  220. e.stopPropagation(), this.evaluate(record, "咨询师经理");
  221. }}
  222. >
  223. 转交
  224. </Button>
  225. <Button
  226. type="primary"
  227. style={{ margin: "0 10px" }}
  228. disabled={record.splitStatus == 1 ? true : false}
  229. onClick={(e) => {
  230. e.stopPropagation(), this.evaluate(record, "咨询师");
  231. }}
  232. >
  233. 分配任务
  234. </Button>
  235. {record.splitStatus == 0 ? (
  236. <Button
  237. type="primary"
  238. style={{ margin: "0 10px" }}
  239. onClick={(e) => {
  240. e.stopPropagation();
  241. this.setState({
  242. resolutionVisible: true,
  243. resolutionName: record.taskName,
  244. resolutionNumber: record.commodityQuantity,
  245. resolutionId: record.id,
  246. });
  247. }}
  248. >
  249. 拆分项目
  250. </Button>
  251. ) : (
  252. ""
  253. )}
  254. </div>
  255. );
  256. },
  257. },
  258. ],
  259. dataSource: [],
  260. searchTime: [],
  261. columnsX: [
  262. {
  263. title: "业务项目名称",
  264. dataIndex: "commodityName",
  265. key: "commodityName",
  266. },
  267. {
  268. title: "项目类别",
  269. dataIndex: "cname",
  270. key: "cname",
  271. },
  272. {
  273. title: "项目数量",
  274. dataIndex: "commodityQuantity",
  275. key: "commodityQuantity",
  276. render: (text, record) => {
  277. if (record.splitStatus == 1) {
  278. return (
  279. <span>
  280. {text}{" "}
  281. <Tag
  282. color="#108ee9"
  283. onClick={(e) => {
  284. e.stopPropagation();
  285. this.showRes(record);
  286. }}
  287. >
  288. 已拆
  289. </Tag>
  290. </span>
  291. );
  292. } else {
  293. return text;
  294. }
  295. },
  296. },
  297. {
  298. title: "金额(万元)",
  299. dataIndex: "commodityPrice",
  300. key: "commodityPrice",
  301. },
  302. {
  303. title: "负责人",
  304. dataIndex: "contacts",
  305. key: "contacts",
  306. },
  307. {
  308. title: "负责人电话",
  309. dataIndex: "contactsMobile",
  310. key: "contactsMobile",
  311. },
  312. {
  313. title: "主要项目",
  314. dataIndex: "main",
  315. key: "main",
  316. render: (text) => {
  317. return text ? "是" : "否";
  318. },
  319. },
  320. {
  321. title: "项目说明",
  322. dataIndex: "taskComment",
  323. key: "taskComment",
  324. render: (text) => {
  325. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  326. },
  327. },
  328. ],
  329. dataSourceX: [],
  330. resVisible: false,
  331. };
  332. },
  333. /* 分派 */
  334. evaluate(record, nub) {
  335. this.state.assignData = record;
  336. this.setState(
  337. {
  338. nub,
  339. },
  340. () => {
  341. this.setState({
  342. assignVisible: true,
  343. });
  344. }
  345. );
  346. },
  347. componentWillMount() {
  348. this.departmentList();
  349. this.loadData();
  350. },
  351. tableRowClick(record) {
  352. this.state.RowData = record;
  353. this.setState({
  354. visible: true,
  355. });
  356. this.xiangqing(record.orderNo);
  357. this.xiangmu(record.orderNo);
  358. },
  359. // 拆分详细
  360. showRes(record) {
  361. this.setState({
  362. resVisible: true,
  363. resRecord: record,
  364. });
  365. },
  366. resCancel() {
  367. this.setState({
  368. resVisible: false,
  369. });
  370. },
  371. //订单详情
  372. xiangqing(orderNos) {
  373. $.ajax({
  374. method: "get",
  375. dataType: "json",
  376. crossDomain: false,
  377. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  378. data: {
  379. orderNo: orderNos,
  380. },
  381. success: function (data) {
  382. if (data.error.length || data.data.list == "") {
  383. if (data.error && data.error.length) {
  384. message.warning(data.error[0].message);
  385. }
  386. } else {
  387. let thisdata = data.data;
  388. this.setState({
  389. orderNo: thisdata.orderNo, //订单编号
  390. contractNo: thisdata.contractNo, //合同编号
  391. userName: thisdata.userName, //客户名称
  392. signDate: thisdata.signDate, //签单时间
  393. processStatus: thisdata.processStatus, //流程状态
  394. liquidationStatus: thisdata.liquidationStatus, //结算状态
  395. contacts: thisdata.contacts, //企业联系人
  396. contactMobile: thisdata.contactMobile, //联系人电话
  397. legalPerson: thisdata.legalPerson, //法人
  398. legalPersonTel: thisdata.legalPersonTel, //法人电话
  399. firstAmount: thisdata.firstAmount, //签单金额
  400. totalAmount: thisdata.totalAmount, //首付金额
  401. approval: thisdata.approval, //特批状态
  402. settlementAmount: thisdata.settlementAmount, //已收款项
  403. orderRemarks: thisdata.orderRemarks, //订单留言
  404. orgCodeUrl: thisdata.contractPictureUrl
  405. ? splitUrl(
  406. thisdata.contractPictureUrl,
  407. ",",
  408. globalConfig.avatarHost + "/upload"
  409. )
  410. : [], //图片地址
  411. replenishUrl: thisdata.agreementUrl
  412. ? splitUrl(
  413. thisdata.agreementUrl,
  414. ",",
  415. globalConfig.avatarHost + "/upload"
  416. )
  417. : [],
  418. salesmanName: thisdata.salesmanName, //营销员名称
  419. salesmanMobile: thisdata.salesmanMobile, //营销员电话
  420. financeName: thisdata.financeName, //财务名称
  421. financeMobile: thisdata.financeMobile, //财务电话
  422. oldSalesmanName: thisdata.oldSalesmanName, //营销员名称
  423. oldSalesmanMobile: thisdata.oldSalesmanMobile, //营销员电话
  424. nowFinance: thisdata.nowFinance, //财务名称
  425. nowFinanceMobile: thisdata.nowFinanceMobile, //财务电话
  426. depName: thisdata.depName, //订单部门
  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. //关闭详情
  474. visitCancel() {
  475. this.setState({
  476. visible: false,
  477. });
  478. this.loadData();
  479. },
  480. visitOk() {
  481. this.setState({
  482. visible: false,
  483. });
  484. this.reset();
  485. },
  486. closeDesc(e, s) {
  487. this.state.showDesc = e;
  488. if (s) {
  489. this.loadData(this.state.page);
  490. }
  491. },
  492. closeAssign(e, s) {
  493. this.state.roleName = "";
  494. this.state.assignVisible = e;
  495. if (s) {
  496. this.loadData(this.state.page);
  497. }
  498. },
  499. nextCancel() {
  500. this.setState({
  501. addnextVisible: false,
  502. });
  503. },
  504. //点击打卡项目详情
  505. tableRowClickX(record) {
  506. this.setState({
  507. jid: record.id, //项目ID
  508. kid: record.commodityId, //商品ID
  509. commodityName: record.commodityName, //金额
  510. commodityPrice: record.commodityPrice, //金额
  511. commodityQuantity: record.commodityQuantity, //数量
  512. taskComment: record.taskComment, //备注
  513. main: record.main.toString(), //是否为主要
  514. addnextVisible: true,
  515. addState: 0,
  516. });
  517. },
  518. search() {
  519. this.loadData();
  520. },
  521. reset() {
  522. this.state.nameSearch = "";
  523. this.state.releaseDate = [];
  524. this.state.orderNoSearch = "";
  525. this.state.taskNoSearch = "";
  526. this.state.departmenttSearch = undefined;
  527. this.state.distribution = undefined;
  528. this.loadData(this.state.page);
  529. },
  530. searchSwitch() {
  531. this.setState({
  532. searchMore: !this.state.searchMore,
  533. });
  534. },
  535. //部门
  536. departmentList() {
  537. this.setState({
  538. loading: true,
  539. });
  540. $.ajax({
  541. method: "get",
  542. dataType: "json",
  543. crossDomain: false,
  544. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  545. data: {},
  546. success: function (data) {
  547. let thedata = data.data;
  548. let theArr = [];
  549. if (!thedata) {
  550. if (data.error && data.error.length) {
  551. message.warning(data.error[0].message);
  552. }
  553. thedata = {};
  554. } else {
  555. thedata.map(function (item, index) {
  556. theArr.push({
  557. key: index,
  558. name: item.name,
  559. id: item.id,
  560. });
  561. });
  562. }
  563. this.setState({
  564. departmentArr: theArr,
  565. });
  566. }.bind(this),
  567. }).always(
  568. function () {
  569. this.setState({
  570. loading: false,
  571. });
  572. }.bind(this)
  573. );
  574. },
  575. resolutionCancel() {
  576. this.setState({
  577. resolutionVisible: false,
  578. });
  579. },
  580. rizhi() {
  581. this.setState({
  582. loading: true,
  583. });
  584. $.ajax({
  585. method: "get",
  586. dataType: "json",
  587. crossDomain: false,
  588. url: "/api/admin/newOrder/selectOrderLog",
  589. data: {
  590. orderNo: this.state.orderNo,
  591. },
  592. success: function (data) {
  593. let theArr = [];
  594. let thisData = data.data;
  595. if (!thisData.length) {
  596. if (data.error && data.error.length) {
  597. message.warning(data.error[0].message);
  598. }
  599. thisData = {};
  600. } else {
  601. for (let i = 0; i < data.data.length; i++) {
  602. let thisdata = data.data[i];
  603. theArr.push({
  604. processName: thisdata.processName,
  605. adminName: thisdata.adminName,
  606. createDate: thisdata.createDate,
  607. remarks: thisdata.remarks,
  608. });
  609. }
  610. }
  611. this.setState({
  612. dataSourceY: theArr,
  613. });
  614. }.bind(this),
  615. }).always(
  616. function () {
  617. this.setState({
  618. loading: false,
  619. });
  620. }.bind(this)
  621. );
  622. },
  623. closeOrderLog() {
  624. this.setState({
  625. avisible: false,
  626. });
  627. },
  628. getOrderLog() {
  629. this.setState({
  630. avisible: true,
  631. });
  632. this.rizhi();
  633. },
  634. render() {
  635. const expandedRowRender = (e) => {
  636. const data = e.splitList;
  637. let columns = [];
  638. if (e.splitList instanceof Array && e.splitList.length) {
  639. columns = [
  640. {
  641. title: "任务编号",
  642. dataIndex: "splitSuper",
  643. key: "splitSuper",
  644. render: (text, record) => {
  645. return text + "-" + record.splitId;
  646. },
  647. },
  648. {
  649. title: "任务名称",
  650. dataIndex: "taskName",
  651. key: "taskName",
  652. },
  653. {
  654. title: "订单编号",
  655. dataIndex: "orderNo",
  656. key: "orderNo",
  657. },
  658. {
  659. title: "业务类别",
  660. dataIndex: "cname",
  661. key: "cname",
  662. },
  663. {
  664. title: "客户名称",
  665. dataIndex: "userName",
  666. key: "userName",
  667. width: 150,
  668. render: (text) => {
  669. return (
  670. <Tooltip title={text}>
  671. <div style={{
  672. maxWidth:'150px',
  673. overflow:'hidden',
  674. textOverflow: "ellipsis",
  675. whiteSpace:'nowrap',
  676. }}>{text}</div>
  677. </Tooltip>
  678. )
  679. },
  680. },
  681. {
  682. title: "项目状态",
  683. dataIndex: "projectStatus",
  684. key: "projectStatus",
  685. render: (text) => {
  686. return getProjectName(text);
  687. },
  688. },
  689. {
  690. title: "分配时间",
  691. dataIndex: "taskDate",
  692. key: "taskDate",
  693. },
  694. {
  695. title: "任务数量",
  696. dataIndex: "commodityQuantity",
  697. key: "commodityQuantity",
  698. },
  699. {
  700. title: "订单部门",
  701. dataIndex: "depName",
  702. key: "depName",
  703. },
  704. {
  705. title: "拆分操作人",
  706. dataIndex: "splitAname",
  707. key: "splitAname",
  708. },
  709. {
  710. title: "项目负责人",
  711. dataIndex: "receiverName",
  712. key: "receiverName",
  713. },
  714. {
  715. title: "拆分时间",
  716. dataIndex: "splitTimes",
  717. key: "splitTimes",
  718. },
  719. {
  720. title: "操作",
  721. dataIndex: "caozuo",
  722. key: "caouzo",
  723. render: (text, record) => {
  724. return (
  725. <div>
  726. <Button
  727. type="primary"
  728. style={{ margin: "0 10px" }}
  729. disabled={record.distributeSign == 1 ? true : false}
  730. onClick={(e) => {
  731. e.stopPropagation(), this.evaluate(record, "咨询师经理");
  732. }}
  733. >
  734. 转交
  735. </Button>
  736. <Button
  737. type="primary"
  738. style={{ margin: "0 10px" }}
  739. disabled={record.distributeSign == 1 ? true : false}
  740. onClick={(e) => {
  741. e.stopPropagation(), this.evaluate(record, "咨询师");
  742. }}
  743. >
  744. 分配任务
  745. </Button>
  746. </div>
  747. );
  748. },
  749. },
  750. ];
  751. return (
  752. <Table
  753. columns={columns}
  754. dataSource={data}
  755. pagination={false}
  756. onRowClick={this.tableRowClick.bind(this)}
  757. />
  758. );
  759. } else {
  760. columns = [];
  761. return (
  762. <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
  763. 此项目暂未拆分
  764. </p>
  765. );
  766. }
  767. };
  768. const rowSelection = {
  769. selectedRowKeys: this.state.selectedRowKeys,
  770. onChange: (selectedRowKeys, selectedRows) => {
  771. this.setState({
  772. selectedRows: selectedRows.slice(-1),
  773. selectedRowKeys: selectedRowKeys.slice(-1),
  774. });
  775. },
  776. };
  777. const formItemLayout = {
  778. labelCol: { span: 8 },
  779. wrapperCol: { span: 14 },
  780. };
  781. let departmentArr = this.state.departmentArr || [];
  782. return (
  783. <div className="user-content">
  784. 123
  785. </div>
  786. );
  787. },
  788. });
  789. export default PersonnelAll;