taskAssignment.jsx 44 KB

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