taskAssignment.jsx 43 KB

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