taskAssignment.jsx 42 KB

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