taskAssignment.jsx 43 KB

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