taskAssignment.jsx 43 KB

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