taskAssignment.jsx 43 KB

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