outsourceTaskAssignment.jsx 46 KB

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