personnelAll.jsx 21 KB

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