taskAssignment.jsx 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378
  1. import React from "react";
  2. import $ from "jquery/src/ajax";
  3. import "@/manageCenter/financialManage/distribute/public.less";
  4. import {Button, Form, Input, Select, Spin, Table, message, Modal, Tabs, Tag, Tooltip} from "antd";
  5. import Assign from "@/manageCenter/publicComponent/assign";
  6. import ResolutionDetail from "@/resolutionDetail"
  7. import OrderDetail from "../../order/orderNew/changeComponent/orderDetail";
  8. import OrderRiZi from "@/orderRiZi.jsx";
  9. import {
  10. getProcessStatus,
  11. getLiquidationStatus,
  12. getApprovedState,
  13. splitUrl,
  14. getProjectName,
  15. getboutique,
  16. ShowModal
  17. } from "@/tools";
  18. import ShowModalDiv from "@/showModal.jsx";
  19. import ResolutionPro from "./resolutionPro"
  20. import {ChooseList} from "../../order/orderNew/chooseList";
  21. import ProjectDetailsReadOnly from "../../../common/projectDetailsReadOnly";
  22. import OrderItemStatus from "../../../common/orderItemStatus";
  23. import EnterpriseNameChange from "../../../common/enterpriseNameChange";
  24. const FormItem = Form.Item;
  25. const {TabPane} = Tabs
  26. const Task = React.createClass({
  27. loadData(pageNo) {
  28. this.state.data = [];
  29. this.setState({
  30. loading: true,
  31. });
  32. $.ajax({
  33. method: "get",
  34. dataType: "json",
  35. crossDomain: false,
  36. url: globalConfig.context + "/api/admin/orderProject/orderTaskList",
  37. data: {
  38. pageNo: pageNo || 1,
  39. pageSize: this.state.pagination.pageSize,
  40. specially: 1, //经理
  41. name: this.state.nameSearch, //客户名称
  42. orderNo: this.state.orderNoSearch, //订单编号
  43. taskId: this.state.taskNoSearch, //任务编号
  44. depId: this.state.departmenttSearch, //订单部门
  45. taskStatus: this.state.taskStatus, //任务状态
  46. adminName: this.state.adminName, //任务受理人
  47. },
  48. success: function (data) {
  49. ShowModal(this);
  50. let theArr = [];
  51. if (!data.data || !data.data.list) {
  52. if (data.error && data.error.length) {
  53. message.warning(data.error[0].message);
  54. }
  55. } else {
  56. for (let i = 0; i < data.data.list.length; i++) {
  57. let thisdata = data.data.list[i];
  58. if (thisdata.splitList) {
  59. thisdata.splitList.forEach((item) => {
  60. item.key = item.id;
  61. });
  62. }
  63. theArr.push({
  64. key: thisdata.id,
  65. orderNo: thisdata.orderNo, //订单编号
  66. id: thisdata.id, //任务ID
  67. taskName: thisdata.taskName, //名称
  68. cname: thisdata.cname, //项目品类
  69. receiverName: thisdata.receiverName, //受理人
  70. projectStatus: thisdata.projectStatus, //项目状态
  71. taskStatus: thisdata.taskStatus, //任务状态
  72. taskDate: thisdata.taskDate, //分配时间
  73. commodityQuantity: thisdata.commodityQuantity, //数量
  74. userName: thisdata.userName, //用户名
  75. depName: thisdata.depName, //部门名称
  76. splitStatus: thisdata.splitStatus, //拆分状态
  77. splitList: thisdata.splitList,
  78. });
  79. }
  80. }
  81. this.state.pagination.current = data.data.pageNo;
  82. this.state.pagination.total = data.data.totalCount;
  83. if (data.data && data.data.list && !data.data.list.length) {
  84. this.state.pagination.current = 0;
  85. this.state.pagination.total = 0;
  86. }
  87. this.setState({
  88. dataSource: theArr,
  89. page: data.data.pageNo,
  90. pagination: this.state.pagination,
  91. });
  92. }.bind(this),
  93. }).always(
  94. function () {
  95. this.setState({
  96. loading: false,
  97. });
  98. }.bind(this)
  99. );
  100. },
  101. getInitialState() {
  102. return {
  103. orderData: [],
  104. orderNo: "",
  105. jiedian: [],
  106. jiedianNew: [],
  107. declarationBatch: 1,
  108. dataInfor: {},
  109. activeKey: "1",
  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. render: text => {
  158. return (
  159. <Tooltip title={text}>
  160. <div style={{
  161. maxWidth:'150px',
  162. overflow:'hidden',
  163. textOverflow: "ellipsis",
  164. whiteSpace:'nowrap',
  165. }}>{text}</div>
  166. </Tooltip>
  167. )
  168. }
  169. },
  170. {
  171. title: "项目状态",
  172. dataIndex: "projectStatus",
  173. key: "projectStatus",
  174. render: (text) => {
  175. return getProjectName(text);
  176. },
  177. },
  178. {
  179. title: "分配时间",
  180. dataIndex: "taskDate",
  181. key: "taskDate",
  182. },
  183. {
  184. title: "任务数量",
  185. dataIndex: "commodityQuantity",
  186. key: "commodityQuantity",
  187. render: (text, record) => {
  188. if (record.splitStatus == 1) {
  189. return (
  190. <span>
  191. {text}{" "}
  192. <Tag color="#108ee9" style={{ float: "right" }}>
  193. 已拆
  194. </Tag>
  195. </span>
  196. );
  197. } else {
  198. return text;
  199. }
  200. },
  201. },
  202. {
  203. title: "订单部门",
  204. dataIndex: "depName",
  205. key: "depName",
  206. },
  207. {
  208. title: "操作",
  209. dataIndex: "caozuo",
  210. key: "caouzo",
  211. render: (text, record) => {
  212. return (
  213. <div>
  214. <Button
  215. type="primary"
  216. style={{ margin: "0 10px" }}
  217. disabled={record.splitStatus == 1 ? true : false}
  218. onClick={(e) => {
  219. e.stopPropagation(), this.evaluate(record, "咨询师经理");
  220. }}
  221. >
  222. 转交
  223. </Button>
  224. <Button
  225. type="primary"
  226. style={{ margin: "0 10px" }}
  227. disabled={record.splitStatus == 1 ? true : false}
  228. onClick={(e) => {
  229. e.stopPropagation(), this.evaluate(record, "咨询师");
  230. }}
  231. >
  232. 分配任务
  233. </Button>
  234. {record.splitStatus == 0 ? (
  235. <Button
  236. type="primary"
  237. style={{ margin: "0 10px" }}
  238. onClick={(e) => {
  239. e.stopPropagation();
  240. this.setState({
  241. resolutionVisible: true,
  242. resolutionName: record.taskName,
  243. resolutionNumber: record.commodityQuantity,
  244. resolutionId: record.id,
  245. });
  246. }}
  247. >
  248. 拆分项目
  249. </Button>
  250. ) : (
  251. ""
  252. )}
  253. </div>
  254. );
  255. },
  256. },
  257. ],
  258. dataSource: [],
  259. resolutionVisible: false,
  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. orderUid: thisdata.uid,
  390. orderNo: thisdata.orderNo, //订单编号
  391. contractNo: thisdata.contractNo, //合同编号
  392. userName: thisdata.userName, //客户名称
  393. signDate: thisdata.signDate, //签单时间
  394. processStatus: thisdata.processStatus, //流程状态
  395. liquidationStatus: thisdata.liquidationStatus, //结算状态
  396. contacts: thisdata.contacts, //企业联系人
  397. contactMobile: thisdata.contactMobile, //联系人电话
  398. legalPerson: thisdata.legalPerson, //法人
  399. legalPersonTel: thisdata.legalPersonTel, //法人电话
  400. firstAmount: thisdata.firstAmount, //签单金额
  401. totalAmount: thisdata.totalAmount, //首付金额
  402. approval: thisdata.approval, //特批状态
  403. settlementAmount: thisdata.settlementAmount, //已收款项
  404. orderRemarks: thisdata.orderRemarks, //订单留言
  405. orgCodeUrl: thisdata.contractPictureUrl
  406. ? splitUrl(
  407. thisdata.contractPictureUrl,
  408. ",",
  409. globalConfig.avatarHost + "/upload"
  410. )
  411. : [], //图片地址
  412. salesmanName: thisdata.salesmanName, //营销员名称
  413. salesmanMobile: thisdata.salesmanMobile, //营销员电话
  414. financeName: thisdata.financeName, //财务名称
  415. financeMobile: thisdata.financeMobile, //财务电话
  416. oldSalesmanName: thisdata.oldSalesmanName, //营销员名称
  417. oldSalesmanMobile: thisdata.oldSalesmanMobile, //营销员电话
  418. nowFinance: thisdata.nowFinance, //财务名称
  419. nowFinanceMobile: thisdata.nowFinanceMobile, //财务电话
  420. depName: thisdata.depName, //订单部门
  421. deleteSign:thisdata.deleteSign,
  422. });
  423. }
  424. }.bind(this),
  425. }).always(
  426. function () {
  427. this.setState({
  428. loading: false,
  429. });
  430. }.bind(this)
  431. );
  432. },
  433. //项目列表
  434. xiangmu(orderNos) {
  435. $.ajax({
  436. method: "get",
  437. dataType: "json",
  438. crossDomain: false,
  439. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  440. data: {
  441. orderNo: orderNos,
  442. },
  443. success: function (data) {
  444. let theArr = [];
  445. if (data.error.length || data.data.list == "") {
  446. if (data.error && data.error.length) {
  447. message.warning(data.error[0].message);
  448. }
  449. } else {
  450. for (let i = 0; i < data.data.length; i++) {
  451. let thisdata = data.data[i];
  452. thisdata.key = i;
  453. theArr.push(thisdata);
  454. }
  455. }
  456. this.setState({
  457. dataSourceX: theArr,
  458. });
  459. }.bind(this),
  460. }).always(
  461. function () {
  462. this.setState({
  463. loading: false,
  464. });
  465. }.bind(this)
  466. );
  467. },
  468. //关闭详情
  469. visitCancel() {
  470. this.setState({
  471. visible: false,
  472. activeKey: "1",
  473. });
  474. this.loadData(this.state.page);
  475. },
  476. visitOk() {
  477. this.setState({
  478. visible: false,
  479. });
  480. this.loadData(this.state.page);
  481. },
  482. closeDesc(e, s) {
  483. this.state.showDesc = e;
  484. if (s) {
  485. this.loadData(this.state.page);
  486. }
  487. },
  488. closeAssign(e, s) {
  489. this.state.roleName = "";
  490. this.state.assignVisible = e;
  491. if (s) {
  492. this.loadData(this.state.page);
  493. }
  494. },
  495. nextCancel() {
  496. this.setState({
  497. addnextVisible: false,
  498. displayFees: "none",
  499. officialCost: "", //是否有官费
  500. costReduction: "", //是否有费减
  501. });
  502. },
  503. //点击打卡项目详情
  504. tableRowClickX(record) {
  505. if (record.type == "1") {
  506. this.setState({
  507. displayFees: "block",
  508. costReduction: record.costReduction,
  509. officialCost: record.officialCost,
  510. });
  511. }else{
  512. this.setState({
  513. displayFees: "none",
  514. });
  515. }
  516. this.setState({
  517. jid: record.id, //项目ID
  518. kid: record.commodityId, //商品ID
  519. commodityName: record.commodityName, //金额
  520. commodityPrice: record.commodityPrice, //金额
  521. commodityQuantity: record.commodityQuantity, //数量
  522. taskComment: record.taskComment, //备注
  523. main: record.main.toString(), //是否为主要
  524. addnextVisible: true,
  525. dataInfor:record,
  526. addState: 0,
  527. });
  528. },
  529. search() {
  530. this.loadData();
  531. },
  532. reset() {
  533. this.state.nameSearch = "";
  534. this.state.releaseDate = [];
  535. this.state.orderNoSearch = "";
  536. this.state.taskNoSearch = "";
  537. this.state.departmenttSearch = undefined;
  538. this.state.distribution = undefined;
  539. this.loadData();
  540. },
  541. searchSwitch() {
  542. this.setState({
  543. searchMore: !this.state.searchMore,
  544. });
  545. },
  546. //部门
  547. departmentList() {
  548. this.setState({
  549. loading: true,
  550. });
  551. $.ajax({
  552. method: "get",
  553. dataType: "json",
  554. crossDomain: false,
  555. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  556. data: {},
  557. success: function (data) {
  558. let thedata = data.data;
  559. let theArr = [];
  560. if (!thedata) {
  561. if (data.error && data.error.length) {
  562. message.warning(data.error[0].message);
  563. }
  564. thedata = {};
  565. } else {
  566. thedata.map(function (item, index) {
  567. theArr.push({
  568. key: index,
  569. name: item.name,
  570. id: item.id,
  571. });
  572. });
  573. }
  574. this.setState({
  575. departmentArr: theArr,
  576. });
  577. }.bind(this),
  578. }).always(
  579. function () {
  580. this.setState({
  581. loading: false,
  582. });
  583. }.bind(this)
  584. );
  585. },
  586. resolutionCancel() {
  587. this.setState({
  588. resolutionVisible: false,
  589. });
  590. },
  591. rizhi() {
  592. this.setState({
  593. loading: true,
  594. });
  595. $.ajax({
  596. method: "get",
  597. dataType: "json",
  598. crossDomain: false,
  599. url: "/api/admin/newOrder/selectOrderLog",
  600. data: {
  601. orderNo: this.state.orderNo,
  602. },
  603. success: function (data) {
  604. let theArr = [];
  605. let thisData = data.data;
  606. if (!thisData.length) {
  607. if (data.error && data.error.length) {
  608. message.warning(data.error[0].message);
  609. }
  610. thisData = {};
  611. } else {
  612. for (let i = 0; i < data.data.length; i++) {
  613. let thisdata = data.data[i];
  614. theArr.push({
  615. processName: thisdata.processName,
  616. adminName: thisdata.adminName,
  617. createDate: thisdata.createDate,
  618. remarks: thisdata.remarks,
  619. });
  620. }
  621. }
  622. this.setState({
  623. dataSourceY: theArr,
  624. });
  625. }.bind(this),
  626. }).always(
  627. function () {
  628. this.setState({
  629. loading: false,
  630. });
  631. }.bind(this)
  632. );
  633. },
  634. closeOrderLog() {
  635. this.setState({
  636. avisible: false,
  637. });
  638. },
  639. getOrderLog() {
  640. this.setState({
  641. avisible: true,
  642. });
  643. this.rizhi();
  644. },
  645. orderChange(key) {
  646. this.setState({
  647. activeKey: key,
  648. });
  649. if (key == 2) {
  650. this.orderDetailData(this.state.orderNo);
  651. this.xiangmu(this.state.orderNo);
  652. this.jiedian(this.state.orderNo);
  653. this.jiedianNew(this.state.orderNo);
  654. }
  655. },
  656. //节点列表
  657. jiedian(orderNos) {
  658. $.ajax({
  659. method: "get",
  660. dataType: "json",
  661. crossDomain: false,
  662. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  663. data: {
  664. orderNo: orderNos,
  665. },
  666. success: function (data) {
  667. let theArr = [];
  668. let thisData = [];
  669. if (data.error.length || data.data.list == "") {
  670. if (data.error && data.error.length) {
  671. message.warning(data.error[0].message);
  672. }
  673. } else {
  674. for (let i = 0; i < data.data.length; i++) {
  675. thisData = data.data[i];
  676. theArr.push({
  677. key: i,
  678. dunSubject: thisData.dunSubject
  679. ? thisData.dunSubject.toString()
  680. : "", //催款科目
  681. id: thisData.id, //节点Id
  682. money: thisData.money, //催款金额
  683. dunStatus: thisData.dunStatus, //催款状态
  684. });
  685. }
  686. this.setState({
  687. jiedian: theArr,
  688. });
  689. }
  690. }.bind(this),
  691. });
  692. },
  693. jiedianNew(orderNos) {
  694. $.ajax({
  695. method: "get",
  696. dataType: "json",
  697. crossDomain: false,
  698. url:
  699. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  700. data: {
  701. orderNo: orderNos,
  702. },
  703. success: function (data) {
  704. if (data.error && data.error.length) {
  705. message.warning(data.error[0].message);
  706. } else {
  707. let theArr = [];
  708. let thisData = [];
  709. let arr = data.data || [];
  710. let totalCui = 0;
  711. for (let i = 0; i < arr.length; i++) {
  712. thisData = arr[i];
  713. totalCui += +thisData.money;
  714. theArr.push({
  715. key: i,
  716. dunSubject: thisData.dunSubject
  717. ? thisData.dunSubject.toString()
  718. : "", //催款科目
  719. id: thisData.id, //节点Id
  720. money: thisData.money, //催款金额
  721. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  722. commodityName: thisData.commodityName,
  723. projectType: thisData.projectType,
  724. dunTypeName: thisData.dunTypeName,
  725. status: thisData.status,
  726. waitDay: thisData.waitDay,
  727. effectiveCount: thisData.effectiveCount,
  728. startDate: thisData.startDate,
  729. dunType: thisData.dunType,
  730. appropriationRatio: thisData.appropriationRatio,
  731. customizeName: thisData.customizeName,
  732. customizeTimes: thisData.customizeTimes,
  733. });
  734. }
  735. if (!totalCui) {
  736. totalCui = 0;
  737. }
  738. totalCui = (Math.round(totalCui * 1000000) / 1000000).toFixed(6);
  739. this.setState({
  740. jiedianNew: theArr,
  741. totalCui,
  742. });
  743. }
  744. }.bind(this),
  745. }).always(
  746. function () {
  747. this.setState({
  748. loading: false,
  749. });
  750. }.bind(this)
  751. );
  752. },
  753. orderDetailData(orderNos) {
  754. this.setState({
  755. loading: true,
  756. });
  757. $.ajax({
  758. method: "get",
  759. dataType: "json",
  760. crossDomain: false,
  761. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  762. data: {
  763. orderNo: orderNos,
  764. },
  765. success: function (data) {
  766. if (data.error.length || data.data.list == "") {
  767. if (data.error && data.error.length) {
  768. message.warning(data.error[0].message);
  769. this.setState({
  770. loading: false,
  771. });
  772. }
  773. } else {
  774. let thisdata = data.data;
  775. this.setState({
  776. orderUid: thisdata.uid,
  777. loading: false,
  778. userName: thisdata.userName,
  779. primaryOrderNo: thisdata.primaryOrder,
  780. additionalOrder: thisdata.additionalOrder,
  781. contractNo: thisdata.contractNo,
  782. orderData: thisdata,
  783. isAddition: thisdata.additionalOrder ? true : false,
  784. contractPictureUrl: thisdata.contractPictureUrl
  785. ? splitUrl(
  786. thisdata.contractPictureUrl,
  787. ",",
  788. globalConfig.avatarHost + "/upload"
  789. )
  790. : [],
  791. deleteSign:thisdata.deleteSign,
  792. });
  793. }
  794. }.bind(this),
  795. });
  796. },
  797. changeList(arr) {
  798. const newArr = [];
  799. this.state.columns.forEach(item => {
  800. arr.forEach(val => {
  801. if (val === item.title) {
  802. newArr.push(item);
  803. }
  804. });
  805. });
  806. this.setState({
  807. changeList: newArr
  808. });
  809. },
  810. render() {
  811. const expandedRowRender = (e) => {
  812. const data = e.splitList;
  813. let columns = [];
  814. if (e.splitList instanceof Array && e.splitList.length) {
  815. columns = [
  816. {
  817. title: "任务编号",
  818. dataIndex: "splitSuper",
  819. key: "splitSuper",
  820. render: (text, record) => {
  821. return text + "-" + record.splitId;
  822. },
  823. },
  824. {
  825. title: "任务名称",
  826. dataIndex: "taskName",
  827. key: "taskName",
  828. },
  829. {
  830. title: "订单编号",
  831. dataIndex: "orderNo",
  832. key: "orderNo",
  833. },
  834. {
  835. title: "业务类别",
  836. dataIndex: "cname",
  837. key: "cname",
  838. },
  839. {
  840. title: "客户名称",
  841. dataIndex: "userName",
  842. key: "userName",
  843. render: text => {
  844. return (
  845. <Tooltip title={text}>
  846. <div style={{
  847. maxWidth:'150px',
  848. overflow:'hidden',
  849. textOverflow: "ellipsis",
  850. whiteSpace:'nowrap',
  851. }}>{text}</div>
  852. </Tooltip>
  853. )
  854. }
  855. },
  856. {
  857. title: "项目状态",
  858. dataIndex: "projectStatus",
  859. key: "projectStatus",
  860. render: (text) => {
  861. return getProjectName(text);
  862. },
  863. },
  864. {
  865. title: "分配时间",
  866. dataIndex: "taskDate",
  867. key: "taskDate",
  868. },
  869. {
  870. title: "任务数量",
  871. dataIndex: "commodityQuantity",
  872. key: "commodityQuantity",
  873. },
  874. {
  875. title: "订单部门",
  876. dataIndex: "depName",
  877. key: "depName",
  878. },
  879. {
  880. title: "拆分操作人",
  881. dataIndex: "splitAname",
  882. key: "splitAname",
  883. },
  884. {
  885. title: "项目负责人",
  886. dataIndex: "receiverName",
  887. key: "receiverName",
  888. },
  889. {
  890. title: "拆分时间",
  891. dataIndex: "splitTimes",
  892. key: "splitTimes",
  893. },
  894. {
  895. title: "操作",
  896. dataIndex: "caozuo",
  897. key: "caouzo",
  898. render: (text, record) => {
  899. return (
  900. <div>
  901. <Button
  902. type="primary"
  903. style={{ margin: "0 10px" }}
  904. disabled={record.distributeSign == 1 ? true : false}
  905. onClick={(e) => {
  906. e.stopPropagation(), this.evaluate(record, "咨询师经理");
  907. }}
  908. >
  909. 转交
  910. </Button>
  911. <Button
  912. type="primary"
  913. style={{ margin: "0 10px" }}
  914. disabled={record.distributeSign == 1 ? true : false}
  915. onClick={(e) => {
  916. e.stopPropagation(), this.evaluate(record, "咨询师");
  917. }}
  918. >
  919. 分配任务
  920. </Button>
  921. </div>
  922. );
  923. },
  924. },
  925. ];
  926. return (
  927. <Table
  928. columns={columns}
  929. dataSource={data}
  930. pagination={false}
  931. onRowClick={this.tableRowClick.bind(this)}
  932. />
  933. );
  934. } else {
  935. columns = [];
  936. return (
  937. <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
  938. 此项目暂未拆分
  939. </p>
  940. );
  941. }
  942. };
  943. const rowSelection = {
  944. selectedRowKeys: this.state.selectedRowKeys,
  945. onChange: (selectedRowKeys, selectedRows) => {
  946. this.setState({
  947. selectedRows: selectedRows.slice(-1),
  948. selectedRowKeys: selectedRowKeys.slice(-1),
  949. });
  950. },
  951. };
  952. const formItemLayout = {
  953. labelCol: { span: 8 },
  954. wrapperCol: { span: 14 },
  955. };
  956. let departmentArr = this.state.departmentArr || [];
  957. return (
  958. <div className="user-content">
  959. {this.state.resVisible ? (
  960. <ResolutionDetail
  961. cancel={this.resCancel}
  962. detail={this.state.resRecord}
  963. visible={this.state.resVisible}
  964. id={this.state.resRecord.orderNo}
  965. />
  966. ) : (
  967. ""
  968. )}
  969. <ResolutionPro
  970. resolutionVisible={this.state.resolutionVisible}
  971. number={this.state.resolutionNumber}
  972. name={this.state.resolutionName}
  973. cancel={this.resolutionCancel}
  974. id={this.state.resolutionId}
  975. loadData={this.loadData}
  976. />
  977. <ShowModalDiv ShowModal={this.state.showModal} />
  978. <div className="content-title">
  979. <span>任务派单</span>
  980. </div>
  981. <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
  982. <TabPane tab="搜索" key="1">
  983. <div className="user-search">
  984. <Input
  985. placeholder="客户名称"
  986. value={this.state.nameSearch}
  987. style={{ marginLeft: 10 }}
  988. onChange={(e) => {
  989. this.setState({ nameSearch: e.target.value });
  990. }}
  991. />
  992. <Input
  993. placeholder="订单编号"
  994. value={this.state.orderNoSearch}
  995. onChange={(e) => {
  996. this.setState({ orderNoSearch: e.target.value });
  997. }}
  998. />
  999. <Input
  1000. placeholder="任务编号"
  1001. value={this.state.taskNoSearch}
  1002. onChange={(e) => {
  1003. this.setState({ taskNoSearch: e.target.value });
  1004. }}
  1005. />
  1006. <Select
  1007. placeholder="选择部门"
  1008. style={{ width: 150, marginRight: "10px" }}
  1009. value={this.state.departmenttSearch}
  1010. onChange={(e) => {
  1011. this.setState({ departmenttSearch: e });
  1012. }}
  1013. >
  1014. {departmentArr.map(function (item) {
  1015. return (
  1016. <Select.Option key={item.id}>{item.name}</Select.Option>
  1017. );
  1018. })}
  1019. </Select>
  1020. <Button type="primary" onClick={this.search}>
  1021. 搜索
  1022. </Button>
  1023. <Button onClick={this.reset}>重置</Button>
  1024. {/* <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch.bind(this)} /></span>
  1025. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  1026. <span>订单时间 :</span>
  1027. <RangePicker
  1028. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  1029. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  1030. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  1031. </div> */}
  1032. </div>
  1033. </TabPane>
  1034. <TabPane tab="更改表格显示数据" key="2">
  1035. <div style={{ marginLeft: 10 }}>
  1036. <ChooseList
  1037. columns={this.state.columns}
  1038. changeFn={this.changeList}
  1039. changeList={this.state.changeList}
  1040. top={55}
  1041. margin={11}
  1042. />
  1043. </div>
  1044. </TabPane>
  1045. </Tabs>
  1046. <div className="patent-table">
  1047. <Spin spinning={this.state.loading}>
  1048. <Table
  1049. columns={
  1050. this.state.changeList
  1051. ? this.state.changeList
  1052. : this.state.columns
  1053. }
  1054. dataSource={this.state.dataSource}
  1055. expandedRowRender={expandedRowRender}
  1056. // rowSelection={rowSelection}
  1057. pagination={this.state.pagination}
  1058. onRowClick={this.tableRowClick.bind(this)}
  1059. bordered
  1060. size="small"
  1061. />
  1062. </Spin>
  1063. </div>
  1064. <Assign
  1065. title="任务"
  1066. selApi={"/api/admin/orderProject/projectDistribution"}
  1067. data={this.state.assignData}
  1068. showDesc={this.state.assignVisible}
  1069. closeDesc={this.closeAssign.bind(this)}
  1070. fenpaiData={8}
  1071. type={this.state.nub == "咨询师经理" ? 1 : 2}
  1072. // 判断是转交按钮还是分配任务按钮
  1073. // chooseBtn={this.state.nub == "咨询师经理" ? true : false}
  1074. roleName={this.state.nub}
  1075. requestMethod={"post"}
  1076. />
  1077. <Modal
  1078. className="customeDetails"
  1079. footer=""
  1080. title=""
  1081. width="900px"
  1082. visible={this.state.visible}
  1083. onOk={this.visitOk}
  1084. onCancel={this.visitCancel}
  1085. >
  1086. <Tabs activeKey={this.state.activeKey} onChange={this.orderChange} tabBarExtraContent={
  1087. <div style={{fontWeight:'bold',paddingRight:'15px'}}>
  1088. <OrderItemStatus deleteSign={this.state.deleteSign}/>
  1089. </div>
  1090. }>
  1091. <TabPane tab="任务详情" key="1">
  1092. <Form
  1093. layout="horizontal"
  1094. onSubmit={this.handleSubmit}
  1095. id="demand-form"
  1096. style={{ paddingBottom: "40px" }}
  1097. >
  1098. <Spin spinning={this.state.loading}>
  1099. <div className="clearfix">
  1100. <FormItem
  1101. className="half-item"
  1102. {...formItemLayout}
  1103. label="订单编号"
  1104. >
  1105. <span>{this.state.orderNo}</span>
  1106. </FormItem>
  1107. <FormItem
  1108. className="half-item"
  1109. {...formItemLayout}
  1110. label="合同编号"
  1111. >
  1112. <span>{this.state.contractNo}</span>
  1113. </FormItem>
  1114. <FormItem
  1115. className="half-item"
  1116. {...formItemLayout}
  1117. label="客户名称"
  1118. >
  1119. <span>{this.state.userName}</span>
  1120. <EnterpriseNameChange
  1121. type='journal'
  1122. style={{ marginLeft: 10 }}
  1123. enterpriseId={this.state.orderUid}/>
  1124. </FormItem>
  1125. <FormItem
  1126. className="half-item"
  1127. {...formItemLayout}
  1128. label="合同签订时间"
  1129. >
  1130. <span>{this.state.signDate}</span>
  1131. </FormItem>
  1132. <FormItem
  1133. className="half-item"
  1134. {...formItemLayout}
  1135. label="流程状态"
  1136. >
  1137. <span>{getProcessStatus(this.state.processStatus)}</span>
  1138. </FormItem>
  1139. <FormItem
  1140. className="half-item"
  1141. {...formItemLayout}
  1142. label="结算状态"
  1143. >
  1144. <span>
  1145. {getLiquidationStatus(this.state.liquidationStatus)}
  1146. </span>
  1147. </FormItem>
  1148. <FormItem
  1149. className="half-item"
  1150. {...formItemLayout}
  1151. label="企业联系人"
  1152. >
  1153. <span>{this.state.contacts}</span>
  1154. </FormItem>
  1155. <FormItem
  1156. className="half-item"
  1157. {...formItemLayout}
  1158. label="联系人电话"
  1159. >
  1160. <span>{this.state.contactMobile}</span>
  1161. </FormItem>
  1162. <FormItem
  1163. className="half-item"
  1164. {...formItemLayout}
  1165. label="企业法人"
  1166. >
  1167. <span>{this.state.legalPerson}</span>
  1168. </FormItem>
  1169. <FormItem
  1170. className="half-item"
  1171. {...formItemLayout}
  1172. label="法人电话"
  1173. >
  1174. <span>{this.state.legalPersonTel}</span>
  1175. </FormItem>
  1176. <FormItem
  1177. className="half-item"
  1178. {...formItemLayout}
  1179. label="签单金额(万元)"
  1180. >
  1181. <span>{this.state.totalAmount}</span>
  1182. </FormItem>
  1183. <FormItem
  1184. className="half-item"
  1185. {...formItemLayout}
  1186. label="首付金额(万元)"
  1187. >
  1188. <span>{this.state.firstAmount}</span>
  1189. </FormItem>
  1190. <FormItem
  1191. className="half-item"
  1192. {...formItemLayout}
  1193. label="特批立项"
  1194. >
  1195. <span>{getApprovedState(this.state.approval)}</span>
  1196. </FormItem>
  1197. <FormItem
  1198. className="half-item"
  1199. {...formItemLayout}
  1200. label="已收款项(万元)"
  1201. >
  1202. <span>{this.state.settlementAmount}</span>
  1203. </FormItem>
  1204. <div className="clearfix">
  1205. <FormItem
  1206. labelCol={{ span: 4 }}
  1207. wrapperCol={{ span: 16 }}
  1208. label="订单留言"
  1209. >
  1210. <p style={{ width: 500, wordWrap: "break-word" }}>
  1211. {this.state.orderRemarks}
  1212. </p>
  1213. </FormItem>
  1214. </div>
  1215. <div className="clearfix">
  1216. <FormItem
  1217. className="half-item"
  1218. {...formItemLayout}
  1219. label="订单负责人"
  1220. >
  1221. <span>{this.state.salesmanName}</span>
  1222. </FormItem>
  1223. <FormItem
  1224. className="half-item"
  1225. {...formItemLayout}
  1226. label="订单负责人电话"
  1227. >
  1228. <span>{this.state.salesmanMobile}</span>
  1229. </FormItem>
  1230. <FormItem
  1231. className="half-item"
  1232. {...formItemLayout}
  1233. label="订单部门"
  1234. >
  1235. <span>{this.state.depName}</span>
  1236. </FormItem>
  1237. </div>
  1238. <div className="clearfix">
  1239. <FormItem
  1240. className="half-item"
  1241. {...formItemLayout}
  1242. label="当前财务负责人"
  1243. >
  1244. <span>{this.state.nowFinance}</span>
  1245. </FormItem>
  1246. <FormItem
  1247. className="half-item"
  1248. {...formItemLayout}
  1249. label="当前财务负责人电话"
  1250. >
  1251. <span>{this.state.nowFinanceMobile}</span>
  1252. </FormItem>
  1253. </div>
  1254. <div className="clearfix">
  1255. <FormItem
  1256. className="half-item"
  1257. {...formItemLayout}
  1258. style={{ opacity: ".5" }}
  1259. label="原订单负责人"
  1260. >
  1261. <span>{this.state.oldSalesmanName}</span>
  1262. </FormItem>
  1263. <FormItem
  1264. className="half-item"
  1265. {...formItemLayout}
  1266. style={{ opacity: ".5" }}
  1267. label="原订单负责人电话"
  1268. >
  1269. <span>{this.state.oldSalesmanMobile}</span>
  1270. </FormItem>
  1271. </div>
  1272. <div className="clearfix">
  1273. <FormItem
  1274. className="half-item"
  1275. {...formItemLayout}
  1276. style={{ opacity: ".5" }}
  1277. label="实际财务操作人"
  1278. >
  1279. <span>{this.state.financeName}</span>
  1280. </FormItem>
  1281. <FormItem
  1282. className="half-item"
  1283. {...formItemLayout}
  1284. style={{ opacity: ".5" }}
  1285. label="实际财务操作人电话"
  1286. >
  1287. <span>{this.state.financeMobile}</span>
  1288. </FormItem>
  1289. </div>
  1290. <div className="clearfix">
  1291. <FormItem
  1292. className="half-item"
  1293. {...formItemLayout}
  1294. label="订单留言"
  1295. >
  1296. <span>{this.state.orderRemarks}</span>
  1297. </FormItem>
  1298. <FormItem
  1299. className="half-item"
  1300. {...formItemLayout}
  1301. label=""
  1302. >
  1303. <Button onClick={this.getOrderLog}>查看订单日志</Button>
  1304. </FormItem>
  1305. </div>
  1306. <OrderRiZi
  1307. dataSourcerizhi={this.state.dataSourceY}
  1308. closeOrderLog={this.closeOrderLog}
  1309. visible={this.state.avisible}
  1310. loading={this.state.loading}
  1311. />
  1312. <div>
  1313. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  1314. 项目业务
  1315. </span>
  1316. {this.state.processStatus == 0 ? (
  1317. <Button
  1318. type="primary"
  1319. onClick={this.addDetailed}
  1320. style={{
  1321. float: "right",
  1322. marginRight: "50px",
  1323. marginBottom: "15px",
  1324. }}
  1325. >
  1326. 添加项目明细
  1327. </Button>
  1328. ) : (
  1329. ""
  1330. )}
  1331. </div>
  1332. <div className="patent-table">
  1333. <Spin spinning={this.state.loading}>
  1334. <Table
  1335. columns={this.state.columnsX}
  1336. dataSource={this.state.dataSourceX}
  1337. pagination={this.state.paginations}
  1338. onRowClick={this.tableRowClickX}
  1339. bordered
  1340. size="small"
  1341. />
  1342. </Spin>
  1343. </div>
  1344. </div>
  1345. </Spin>
  1346. </Form>
  1347. </TabPane>
  1348. <TabPane tab="订单详情" key="2">
  1349. <Spin spinning={this.state.loading}>
  1350. <OrderDetail
  1351. orderUid={this.state.orderUid}
  1352. orderData={this.state.orderData}
  1353. getOrderLog={this.getOrderLog}
  1354. dataSourceX={this.state.dataSourceX}
  1355. contactList={this.state.jiedian}
  1356. orderNo={this.state.orderNo}
  1357. totalCui={this.state.totalCui}
  1358. contactListNew={this.state.jiedianNew}
  1359. pictureUrl={this.state.contractPictureUrl}
  1360. />
  1361. </Spin>
  1362. </TabPane>
  1363. </Tabs>
  1364. </Modal>
  1365. {this.state.addnextVisible && <ProjectDetailsReadOnly
  1366. infor={this.state.dataInfor}
  1367. visible={this.state.addnextVisible}
  1368. onCancel={this.nextCancel}
  1369. />}
  1370. </div>
  1371. );
  1372. },
  1373. });
  1374. export default Task;