personnelAll.jsx 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  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. 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. },
  158. {
  159. title: "项目状态",
  160. dataIndex: "projectStatus",
  161. key: "projectStatus",
  162. render: (text) => {
  163. return getProjectName(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. thisdata.key = i;
  445. theArr.push(thisdata);
  446. }
  447. }
  448. this.setState({
  449. dataSourceX: theArr,
  450. });
  451. }.bind(this),
  452. }).always(
  453. function () {
  454. this.setState({
  455. loading: false,
  456. });
  457. }.bind(this)
  458. );
  459. },
  460. //关闭详情
  461. visitCancel() {
  462. this.setState({
  463. visible: false,
  464. });
  465. this.loadData();
  466. },
  467. visitOk() {
  468. this.setState({
  469. visible: false,
  470. });
  471. this.reset();
  472. },
  473. closeDesc(e, s) {
  474. this.state.showDesc = e;
  475. if (s) {
  476. this.loadData(this.state.page);
  477. }
  478. },
  479. closeAssign(e, s) {
  480. this.state.roleName = "";
  481. this.state.assignVisible = e;
  482. if (s) {
  483. this.loadData(this.state.page);
  484. }
  485. },
  486. nextCancel() {
  487. this.setState({
  488. addnextVisible: false,
  489. });
  490. },
  491. //点击打卡项目详情
  492. tableRowClickX(record) {
  493. this.setState({
  494. jid: record.id, //项目ID
  495. kid: record.commodityId, //商品ID
  496. commodityName: record.commodityName, //金额
  497. commodityPrice: record.commodityPrice, //金额
  498. commodityQuantity: record.commodityQuantity, //数量
  499. taskComment: record.taskComment, //备注
  500. main: record.main.toString(), //是否为主要
  501. addnextVisible: true,
  502. addState: 0,
  503. });
  504. },
  505. search() {
  506. this.loadData();
  507. },
  508. reset() {
  509. this.state.nameSearch = "";
  510. this.state.releaseDate = [];
  511. this.state.orderNoSearch = "";
  512. this.state.taskNoSearch = "";
  513. this.state.departmenttSearch = undefined;
  514. this.state.distribution = undefined;
  515. this.loadData(this.state.page);
  516. },
  517. searchSwitch() {
  518. this.setState({
  519. searchMore: !this.state.searchMore,
  520. });
  521. },
  522. //部门
  523. departmentList() {
  524. this.setState({
  525. loading: true,
  526. });
  527. $.ajax({
  528. method: "get",
  529. dataType: "json",
  530. crossDomain: false,
  531. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  532. data: {},
  533. success: function (data) {
  534. let thedata = data.data;
  535. let theArr = [];
  536. if (!thedata) {
  537. if (data.error && data.error.length) {
  538. message.warning(data.error[0].message);
  539. }
  540. thedata = {};
  541. } else {
  542. thedata.map(function (item, index) {
  543. theArr.push({
  544. key: index,
  545. name: item.name,
  546. id: item.id,
  547. });
  548. });
  549. }
  550. this.setState({
  551. departmentArr: theArr,
  552. });
  553. }.bind(this),
  554. }).always(
  555. function () {
  556. this.setState({
  557. loading: false,
  558. });
  559. }.bind(this)
  560. );
  561. },
  562. resolutionCancel() {
  563. this.setState({
  564. resolutionVisible: false,
  565. });
  566. },
  567. rizhi() {
  568. this.setState({
  569. loading: true,
  570. });
  571. $.ajax({
  572. method: "get",
  573. dataType: "json",
  574. crossDomain: false,
  575. url: "/api/admin/newOrder/selectOrderLog",
  576. data: {
  577. orderNo: this.state.orderNo,
  578. },
  579. success: function (data) {
  580. let theArr = [];
  581. let thisData = data.data;
  582. if (!thisData.length) {
  583. if (data.error && data.error.length) {
  584. message.warning(data.error[0].message);
  585. }
  586. thisData = {};
  587. } else {
  588. for (let i = 0; i < data.data.length; i++) {
  589. let thisdata = data.data[i];
  590. theArr.push({
  591. processName: thisdata.processName,
  592. adminName: thisdata.adminName,
  593. createDate: thisdata.createDate,
  594. remarks: thisdata.remarks,
  595. });
  596. }
  597. }
  598. this.setState({
  599. dataSourceY: theArr,
  600. });
  601. }.bind(this),
  602. }).always(
  603. function () {
  604. this.setState({
  605. loading: false,
  606. });
  607. }.bind(this)
  608. );
  609. },
  610. closeOrderLog() {
  611. this.setState({
  612. avisible: false,
  613. });
  614. },
  615. getOrderLog() {
  616. this.setState({
  617. avisible: true,
  618. });
  619. this.rizhi();
  620. },
  621. render() {
  622. const expandedRowRender = (e) => {
  623. const data = e.splitList;
  624. let columns = [];
  625. if (e.splitList instanceof Array && e.splitList.length) {
  626. columns = [
  627. {
  628. title: "任务编号",
  629. dataIndex: "splitSuper",
  630. key: "splitSuper",
  631. render: (text, record) => {
  632. return text + "-" + record.splitId;
  633. },
  634. },
  635. {
  636. title: "任务名称",
  637. dataIndex: "taskName",
  638. key: "taskName",
  639. },
  640. {
  641. title: "订单编号",
  642. dataIndex: "orderNo",
  643. key: "orderNo",
  644. },
  645. {
  646. title: "业务类别",
  647. dataIndex: "cname",
  648. key: "cname",
  649. },
  650. {
  651. title: "客户名称",
  652. dataIndex: "userName",
  653. key: "userName",
  654. },
  655. {
  656. title: "项目状态",
  657. dataIndex: "projectStatus",
  658. key: "projectStatus",
  659. render: (text) => {
  660. return getProjectName(text);
  661. },
  662. },
  663. {
  664. title: "分配时间",
  665. dataIndex: "taskDate",
  666. key: "taskDate",
  667. },
  668. {
  669. title: "任务数量",
  670. dataIndex: "commodityQuantity",
  671. key: "commodityQuantity",
  672. },
  673. {
  674. title: "订单部门",
  675. dataIndex: "depName",
  676. key: "depName",
  677. },
  678. {
  679. title: "拆分操作人",
  680. dataIndex: "splitAname",
  681. key: "splitAname",
  682. },
  683. {
  684. title: "项目负责人",
  685. dataIndex: "receiverName",
  686. key: "receiverName",
  687. },
  688. {
  689. title: "拆分时间",
  690. dataIndex: "splitTimes",
  691. key: "splitTimes",
  692. },
  693. {
  694. title: "操作",
  695. dataIndex: "caozuo",
  696. key: "caouzo",
  697. render: (text, record) => {
  698. return (
  699. <div>
  700. <Button
  701. type="primary"
  702. style={{ margin: "0 10px" }}
  703. disabled={record.distributeSign == 1 ? true : false}
  704. onClick={(e) => {
  705. e.stopPropagation(), this.evaluate(record, "咨询师经理");
  706. }}
  707. >
  708. 转交
  709. </Button>
  710. <Button
  711. type="primary"
  712. style={{ margin: "0 10px" }}
  713. disabled={record.distributeSign == 1 ? true : false}
  714. onClick={(e) => {
  715. e.stopPropagation(), this.evaluate(record, "咨询师");
  716. }}
  717. >
  718. 分配任务
  719. </Button>
  720. </div>
  721. );
  722. },
  723. },
  724. ];
  725. return (
  726. <Table
  727. columns={columns}
  728. dataSource={data}
  729. pagination={false}
  730. onRowClick={this.tableRowClick.bind(this)}
  731. />
  732. );
  733. } else {
  734. columns = [];
  735. return (
  736. <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
  737. 此项目暂未拆分
  738. </p>
  739. );
  740. }
  741. };
  742. const rowSelection = {
  743. selectedRowKeys: this.state.selectedRowKeys,
  744. onChange: (selectedRowKeys, selectedRows) => {
  745. this.setState({
  746. selectedRows: selectedRows.slice(-1),
  747. selectedRowKeys: selectedRowKeys.slice(-1),
  748. });
  749. },
  750. };
  751. const formItemLayout = {
  752. labelCol: { span: 8 },
  753. wrapperCol: { span: 14 },
  754. };
  755. let departmentArr = this.state.departmentArr || [];
  756. return (
  757. <div className="user-content">
  758. 123
  759. </div>
  760. );
  761. },
  762. });
  763. export default PersonnelAll;