taskAssignment.jsx 44 KB

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