taskAssignment.jsx 42 KB

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