personnelAll.jsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  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. render: (text, record) => {
  267. return (
  268. <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span></span>
  269. )
  270. }
  271. },
  272. {
  273. title: "项目类别",
  274. dataIndex: "cname",
  275. key: "cname",
  276. },
  277. {
  278. title: "项目数量",
  279. dataIndex: "commodityQuantity",
  280. key: "commodityQuantity",
  281. render: (text, record) => {
  282. if (record.splitStatus == 1) {
  283. return (
  284. <span>
  285. {text}{" "}
  286. <Tag
  287. color="#108ee9"
  288. onClick={(e) => {
  289. e.stopPropagation();
  290. this.showRes(record);
  291. }}
  292. >
  293. 已拆
  294. </Tag>
  295. </span>
  296. );
  297. } else {
  298. return text;
  299. }
  300. },
  301. },
  302. {
  303. title: "金额(万元)",
  304. dataIndex: "commodityPrice",
  305. key: "commodityPrice",
  306. },
  307. {
  308. title: "负责人",
  309. dataIndex: "contacts",
  310. key: "contacts",
  311. },
  312. {
  313. title: "负责人电话",
  314. dataIndex: "contactsMobile",
  315. key: "contactsMobile",
  316. },
  317. {
  318. title: "主要项目",
  319. dataIndex: "main",
  320. key: "main",
  321. render: (text) => {
  322. return text ? "是" : "否";
  323. },
  324. },
  325. {
  326. title: "项目说明",
  327. dataIndex: "taskComment",
  328. key: "taskComment",
  329. render: (text) => {
  330. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  331. },
  332. },
  333. ],
  334. dataSourceX: [],
  335. resVisible: false,
  336. };
  337. },
  338. /* 分派 */
  339. evaluate(record, nub) {
  340. this.state.assignData = record;
  341. this.setState(
  342. {
  343. nub,
  344. },
  345. () => {
  346. this.setState({
  347. assignVisible: true,
  348. });
  349. }
  350. );
  351. },
  352. componentWillMount() {
  353. this.departmentList();
  354. this.loadData();
  355. },
  356. tableRowClick(record) {
  357. this.state.RowData = record;
  358. this.setState({
  359. visible: true,
  360. });
  361. this.xiangqing(record.orderNo);
  362. this.xiangmu(record.orderNo);
  363. },
  364. // 拆分详细
  365. showRes(record) {
  366. this.setState({
  367. resVisible: true,
  368. resRecord: record,
  369. });
  370. },
  371. resCancel() {
  372. this.setState({
  373. resVisible: false,
  374. });
  375. },
  376. //订单详情
  377. xiangqing(orderNos) {
  378. $.ajax({
  379. method: "get",
  380. dataType: "json",
  381. crossDomain: false,
  382. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  383. data: {
  384. orderNo: orderNos,
  385. },
  386. success: function (data) {
  387. if (data.error.length || data.data.list == "") {
  388. if (data.error && data.error.length) {
  389. message.warning(data.error[0].message);
  390. }
  391. } else {
  392. let thisdata = data.data;
  393. this.setState({
  394. orderNo: thisdata.orderNo, //订单编号
  395. contractNo: thisdata.contractNo, //合同编号
  396. userName: thisdata.userName, //客户名称
  397. signDate: thisdata.signDate, //签单时间
  398. processStatus: thisdata.processStatus, //流程状态
  399. liquidationStatus: thisdata.liquidationStatus, //结算状态
  400. contacts: thisdata.contacts, //企业联系人
  401. contactMobile: thisdata.contactMobile, //联系人电话
  402. legalPerson: thisdata.legalPerson, //法人
  403. legalPersonTel: thisdata.legalPersonTel, //法人电话
  404. firstAmount: thisdata.firstAmount, //签单金额
  405. totalAmount: thisdata.totalAmount, //首付金额
  406. approval: thisdata.approval, //特批状态
  407. settlementAmount: thisdata.settlementAmount, //已收款项
  408. orderRemarks: thisdata.orderRemarks, //订单留言
  409. orgCodeUrl: thisdata.contractPictureUrl
  410. ? splitUrl(
  411. thisdata.contractPictureUrl,
  412. ",",
  413. globalConfig.avatarHost + "/upload"
  414. )
  415. : [], //图片地址
  416. replenishUrl: thisdata.agreementUrl
  417. ? splitUrl(
  418. thisdata.agreementUrl,
  419. ",",
  420. globalConfig.avatarHost + "/upload"
  421. )
  422. : [],
  423. salesmanName: thisdata.salesmanName, //营销员名称
  424. salesmanMobile: thisdata.salesmanMobile, //营销员电话
  425. financeName: thisdata.financeName, //财务名称
  426. financeMobile: thisdata.financeMobile, //财务电话
  427. oldSalesmanName: thisdata.oldSalesmanName, //营销员名称
  428. oldSalesmanMobile: thisdata.oldSalesmanMobile, //营销员电话
  429. nowFinance: thisdata.nowFinance, //财务名称
  430. nowFinanceMobile: thisdata.nowFinanceMobile, //财务电话
  431. depName: thisdata.depName, //订单部门
  432. });
  433. }
  434. }.bind(this),
  435. }).always(
  436. function () {
  437. this.setState({
  438. loading: false,
  439. });
  440. }.bind(this)
  441. );
  442. },
  443. //项目列表
  444. xiangmu(orderNos) {
  445. $.ajax({
  446. method: "get",
  447. dataType: "json",
  448. crossDomain: false,
  449. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  450. data: {
  451. orderNo: orderNos,
  452. },
  453. success: function (data) {
  454. let theArr = [];
  455. if (data.error.length || data.data.list == "") {
  456. if (data.error && data.error.length) {
  457. message.warning(data.error[0].message);
  458. }
  459. } else {
  460. for (let i = 0; i < data.data.length; i++) {
  461. let thisdata = data.data[i];
  462. thisdata.key = i;
  463. theArr.push(thisdata);
  464. }
  465. }
  466. this.setState({
  467. dataSourceX: theArr,
  468. });
  469. }.bind(this),
  470. }).always(
  471. function () {
  472. this.setState({
  473. loading: false,
  474. });
  475. }.bind(this)
  476. );
  477. },
  478. //关闭详情
  479. visitCancel() {
  480. this.setState({
  481. visible: false,
  482. });
  483. this.loadData();
  484. },
  485. visitOk() {
  486. this.setState({
  487. visible: false,
  488. });
  489. this.reset();
  490. },
  491. closeDesc(e, s) {
  492. this.state.showDesc = e;
  493. if (s) {
  494. this.loadData(this.state.page);
  495. }
  496. },
  497. closeAssign(e, s) {
  498. this.state.roleName = "";
  499. this.state.assignVisible = e;
  500. if (s) {
  501. this.loadData(this.state.page);
  502. }
  503. },
  504. nextCancel() {
  505. this.setState({
  506. addnextVisible: false,
  507. });
  508. },
  509. //点击打卡项目详情
  510. tableRowClickX(record) {
  511. this.setState({
  512. jid: record.id, //项目ID
  513. kid: record.commodityId, //商品ID
  514. commodityName: record.commodityName, //金额
  515. commodityPrice: record.commodityPrice, //金额
  516. commodityQuantity: record.commodityQuantity, //数量
  517. taskComment: record.taskComment, //备注
  518. main: record.main.toString(), //是否为主要
  519. addnextVisible: true,
  520. addState: 0,
  521. });
  522. },
  523. search() {
  524. this.loadData();
  525. },
  526. reset() {
  527. this.state.nameSearch = "";
  528. this.state.releaseDate = [];
  529. this.state.orderNoSearch = "";
  530. this.state.taskNoSearch = "";
  531. this.state.departmenttSearch = undefined;
  532. this.state.distribution = undefined;
  533. this.loadData(this.state.page);
  534. },
  535. searchSwitch() {
  536. this.setState({
  537. searchMore: !this.state.searchMore,
  538. });
  539. },
  540. //部门
  541. departmentList() {
  542. this.setState({
  543. loading: true,
  544. });
  545. $.ajax({
  546. method: "get",
  547. dataType: "json",
  548. crossDomain: false,
  549. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  550. data: {},
  551. success: function (data) {
  552. let thedata = data.data;
  553. let theArr = [];
  554. if (!thedata) {
  555. if (data.error && data.error.length) {
  556. message.warning(data.error[0].message);
  557. }
  558. thedata = {};
  559. } else {
  560. thedata.map(function (item, index) {
  561. theArr.push({
  562. key: index,
  563. name: item.name,
  564. id: item.id,
  565. });
  566. });
  567. }
  568. this.setState({
  569. departmentArr: theArr,
  570. });
  571. }.bind(this),
  572. }).always(
  573. function () {
  574. this.setState({
  575. loading: false,
  576. });
  577. }.bind(this)
  578. );
  579. },
  580. resolutionCancel() {
  581. this.setState({
  582. resolutionVisible: false,
  583. });
  584. },
  585. rizhi() {
  586. this.setState({
  587. loading: true,
  588. });
  589. $.ajax({
  590. method: "get",
  591. dataType: "json",
  592. crossDomain: false,
  593. url: "/api/admin/newOrder/selectOrderLog",
  594. data: {
  595. orderNo: this.state.orderNo,
  596. },
  597. success: function (data) {
  598. let theArr = [];
  599. let thisData = data.data;
  600. if (!thisData.length) {
  601. if (data.error && data.error.length) {
  602. message.warning(data.error[0].message);
  603. }
  604. thisData = {};
  605. } else {
  606. for (let i = 0; i < data.data.length; i++) {
  607. let thisdata = data.data[i];
  608. theArr.push({
  609. processName: thisdata.processName,
  610. adminName: thisdata.adminName,
  611. createDate: thisdata.createDate,
  612. remarks: thisdata.remarks,
  613. });
  614. }
  615. }
  616. this.setState({
  617. dataSourceY: theArr,
  618. });
  619. }.bind(this),
  620. }).always(
  621. function () {
  622. this.setState({
  623. loading: false,
  624. });
  625. }.bind(this)
  626. );
  627. },
  628. closeOrderLog() {
  629. this.setState({
  630. avisible: false,
  631. });
  632. },
  633. getOrderLog() {
  634. this.setState({
  635. avisible: true,
  636. });
  637. this.rizhi();
  638. },
  639. render() {
  640. const expandedRowRender = (e) => {
  641. const data = e.splitList;
  642. let columns = [];
  643. if (e.splitList instanceof Array && e.splitList.length) {
  644. columns = [
  645. {
  646. title: "任务编号",
  647. dataIndex: "splitSuper",
  648. key: "splitSuper",
  649. render: (text, record) => {
  650. return text + "-" + record.splitId;
  651. },
  652. },
  653. {
  654. title: "任务名称",
  655. dataIndex: "taskName",
  656. key: "taskName",
  657. },
  658. {
  659. title: "订单编号",
  660. dataIndex: "orderNo",
  661. key: "orderNo",
  662. },
  663. {
  664. title: "业务类别",
  665. dataIndex: "cname",
  666. key: "cname",
  667. },
  668. {
  669. title: "客户名称",
  670. dataIndex: "userName",
  671. key: "userName",
  672. width: 150,
  673. render: (text) => {
  674. return (
  675. <Tooltip title={text}>
  676. <div style={{
  677. maxWidth:'150px',
  678. overflow:'hidden',
  679. textOverflow: "ellipsis",
  680. whiteSpace:'nowrap',
  681. }}>{text}</div>
  682. </Tooltip>
  683. )
  684. },
  685. },
  686. {
  687. title: "项目状态",
  688. dataIndex: "projectStatus",
  689. key: "projectStatus",
  690. render: (text) => {
  691. return getProjectName(text);
  692. },
  693. },
  694. {
  695. title: "分配时间",
  696. dataIndex: "taskDate",
  697. key: "taskDate",
  698. },
  699. {
  700. title: "任务数量",
  701. dataIndex: "commodityQuantity",
  702. key: "commodityQuantity",
  703. },
  704. {
  705. title: "订单部门",
  706. dataIndex: "depName",
  707. key: "depName",
  708. },
  709. {
  710. title: "拆分操作人",
  711. dataIndex: "splitAname",
  712. key: "splitAname",
  713. },
  714. {
  715. title: "项目负责人",
  716. dataIndex: "receiverName",
  717. key: "receiverName",
  718. },
  719. {
  720. title: "拆分时间",
  721. dataIndex: "splitTimes",
  722. key: "splitTimes",
  723. },
  724. {
  725. title: "操作",
  726. dataIndex: "caozuo",
  727. key: "caouzo",
  728. render: (text, record) => {
  729. return (
  730. <div>
  731. <Button
  732. type="primary"
  733. style={{ margin: "0 10px" }}
  734. disabled={record.distributeSign == 1 ? true : false}
  735. onClick={(e) => {
  736. e.stopPropagation(), this.evaluate(record, "咨询师经理");
  737. }}
  738. >
  739. 转交
  740. </Button>
  741. <Button
  742. type="primary"
  743. style={{ margin: "0 10px" }}
  744. disabled={record.distributeSign == 1 ? true : false}
  745. onClick={(e) => {
  746. e.stopPropagation(), this.evaluate(record, "咨询师");
  747. }}
  748. >
  749. 分配任务
  750. </Button>
  751. </div>
  752. );
  753. },
  754. },
  755. ];
  756. return (
  757. <Table
  758. columns={columns}
  759. dataSource={data}
  760. pagination={false}
  761. onRowClick={this.tableRowClick.bind(this)}
  762. />
  763. );
  764. } else {
  765. columns = [];
  766. return (
  767. <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
  768. 此项目暂未拆分
  769. </p>
  770. );
  771. }
  772. };
  773. const rowSelection = {
  774. selectedRowKeys: this.state.selectedRowKeys,
  775. onChange: (selectedRowKeys, selectedRows) => {
  776. this.setState({
  777. selectedRows: selectedRows.slice(-1),
  778. selectedRowKeys: selectedRowKeys.slice(-1),
  779. });
  780. },
  781. };
  782. const formItemLayout = {
  783. labelCol: { span: 8 },
  784. wrapperCol: { span: 14 },
  785. };
  786. let departmentArr = this.state.departmentArr || [];
  787. return (
  788. <div className="user-content">
  789. 123
  790. </div>
  791. );
  792. },
  793. });
  794. export default PersonnelAll;