taskAssignment.jsx 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388
  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. officialCost: thisdata.officialCost,
  448. costReduction: thisdata.costReduction,
  449. type: thisdata.type,
  450. });
  451. }
  452. }
  453. this.setState({
  454. dataSourceX: theArr,
  455. });
  456. }.bind(this),
  457. }).always(
  458. function () {
  459. this.setState({
  460. loading: false,
  461. });
  462. }.bind(this)
  463. );
  464. },
  465. //关闭详情
  466. visitCancel() {
  467. this.setState({
  468. visible: false,
  469. activeKey: "1",
  470. });
  471. this.loadData();
  472. },
  473. visitOk() {
  474. this.setState({
  475. visible: false,
  476. });
  477. this.reset();
  478. },
  479. closeDesc(e, s) {
  480. this.state.showDesc = e;
  481. if (s) {
  482. this.loadData(this.state.page);
  483. }
  484. },
  485. closeAssign(e, s) {
  486. this.state.roleName = "";
  487. this.state.assignVisible = e;
  488. if (s) {
  489. this.loadData(this.state.page);
  490. }
  491. },
  492. nextCancel() {
  493. this.setState({
  494. addnextVisible: false,
  495. displayFees: "none",
  496. officialCost: "", //是否有官费
  497. costReduction: "", //是否有费减
  498. });
  499. },
  500. //点击打卡项目详情
  501. tableRowClickX(record) {
  502. if (record.type == "1") {
  503. this.setState({
  504. displayFees: "block",
  505. costReduction: record.costReduction,
  506. officialCost: record.officialCost,
  507. });
  508. }
  509. this.setState({
  510. jid: record.id, //项目ID
  511. kid: record.commodityId, //商品ID
  512. commodityName: record.commodityName, //金额
  513. commodityPrice: record.commodityPrice, //金额
  514. commodityQuantity: record.commodityQuantity, //数量
  515. taskComment: record.taskComment, //备注
  516. main: record.main.toString(), //是否为主要
  517. addnextVisible: true,
  518. addState: 0,
  519. });
  520. },
  521. search() {
  522. this.loadData();
  523. },
  524. reset() {
  525. this.state.nameSearch = "";
  526. this.state.releaseDate = [];
  527. this.state.orderNoSearch = "";
  528. this.state.taskNoSearch = "";
  529. this.state.departmenttSearch = undefined;
  530. this.state.distribution = undefined;
  531. this.loadData(this.state.page);
  532. },
  533. searchSwitch() {
  534. this.setState({
  535. searchMore: !this.state.searchMore,
  536. });
  537. },
  538. //部门
  539. departmentList() {
  540. this.setState({
  541. loading: true,
  542. });
  543. $.ajax({
  544. method: "get",
  545. dataType: "json",
  546. crossDomain: false,
  547. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  548. data: {},
  549. success: function (data) {
  550. let thedata = data.data;
  551. let theArr = [];
  552. if (!thedata) {
  553. if (data.error && data.error.length) {
  554. message.warning(data.error[0].message);
  555. }
  556. thedata = {};
  557. } else {
  558. thedata.map(function (item, index) {
  559. theArr.push({
  560. key: index,
  561. name: item.name,
  562. id: item.id,
  563. });
  564. });
  565. }
  566. this.setState({
  567. departmentArr: theArr,
  568. });
  569. }.bind(this),
  570. }).always(
  571. function () {
  572. this.setState({
  573. loading: false,
  574. });
  575. }.bind(this)
  576. );
  577. },
  578. resolutionCancel() {
  579. this.setState({
  580. resolutionVisible: false,
  581. });
  582. },
  583. rizhi() {
  584. this.setState({
  585. loading: true,
  586. });
  587. $.ajax({
  588. method: "get",
  589. dataType: "json",
  590. crossDomain: false,
  591. url: "/api/admin/newOrder/selectOrderLog",
  592. data: {
  593. orderNo: this.state.orderNo,
  594. },
  595. success: function (data) {
  596. let theArr = [];
  597. let thisData = data.data;
  598. if (!thisData.length) {
  599. if (data.error && data.error.length) {
  600. message.warning(data.error[0].message);
  601. }
  602. thisData = {};
  603. } else {
  604. for (let i = 0; i < data.data.length; i++) {
  605. let thisdata = data.data[i];
  606. theArr.push({
  607. processName: thisdata.processName,
  608. adminName: thisdata.adminName,
  609. createDate: thisdata.createDate,
  610. remarks: thisdata.remarks,
  611. });
  612. }
  613. }
  614. this.setState({
  615. dataSourceY: theArr,
  616. });
  617. }.bind(this),
  618. }).always(
  619. function () {
  620. this.setState({
  621. loading: false,
  622. });
  623. }.bind(this)
  624. );
  625. },
  626. closeOrderLog() {
  627. this.setState({
  628. avisible: false,
  629. });
  630. },
  631. getOrderLog() {
  632. this.setState({
  633. avisible: true,
  634. });
  635. this.rizhi();
  636. },
  637. orderChange(key) {
  638. this.setState({
  639. activeKey: key,
  640. });
  641. if (key == 2) {
  642. this.orderDetailData(this.state.orderNo);
  643. this.xiangmu(this.state.orderNo);
  644. this.jiedian(this.state.orderNo);
  645. this.jiedianNew(this.state.orderNo);
  646. }
  647. },
  648. //节点列表
  649. jiedian(orderNos) {
  650. $.ajax({
  651. method: "get",
  652. dataType: "json",
  653. crossDomain: false,
  654. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  655. data: {
  656. orderNo: orderNos,
  657. },
  658. success: function (data) {
  659. let theArr = [];
  660. let thisData = [];
  661. if (data.error.length || data.data.list == "") {
  662. if (data.error && data.error.length) {
  663. message.warning(data.error[0].message);
  664. }
  665. } else {
  666. for (let i = 0; i < data.data.length; i++) {
  667. thisData = data.data[i];
  668. theArr.push({
  669. key: i,
  670. dunSubject: thisData.dunSubject
  671. ? thisData.dunSubject.toString()
  672. : "", //催款科目
  673. id: thisData.id, //节点Id
  674. money: thisData.money, //催款金额
  675. dunStatus: thisData.dunStatus, //催款状态
  676. });
  677. }
  678. this.setState({
  679. jiedian: theArr,
  680. });
  681. }
  682. }.bind(this),
  683. });
  684. },
  685. jiedianNew(orderNos) {
  686. $.ajax({
  687. method: "get",
  688. dataType: "json",
  689. crossDomain: false,
  690. url:
  691. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  692. data: {
  693. orderNo: orderNos,
  694. },
  695. success: function (data) {
  696. if (data.error && data.error.length) {
  697. message.warning(data.error[0].message);
  698. } else {
  699. let theArr = [];
  700. let thisData = [];
  701. let arr = data.data || [];
  702. let totalCui = 0;
  703. for (let i = 0; i < arr.length; i++) {
  704. thisData = arr[i];
  705. totalCui += +thisData.money;
  706. theArr.push({
  707. key: i,
  708. dunSubject: thisData.dunSubject
  709. ? thisData.dunSubject.toString()
  710. : "", //催款科目
  711. id: thisData.id, //节点Id
  712. money: thisData.money, //催款金额
  713. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  714. commodityName: thisData.commodityName,
  715. projectType: thisData.projectType,
  716. dunTypeName: thisData.dunTypeName,
  717. status: thisData.status,
  718. waitDay: thisData.waitDay,
  719. effectiveCount: thisData.effectiveCount,
  720. startDate: thisData.startDate,
  721. dunType: thisData.dunType,
  722. appropriationRatio: thisData.appropriationRatio,
  723. customizeName: thisData.customizeName,
  724. customizeTimes: thisData.customizeTimes,
  725. });
  726. }
  727. if (!totalCui) {
  728. totalCui = 0;
  729. }
  730. totalCui = (Math.round(totalCui * 10000) / 10000).toFixed(4);
  731. this.setState({
  732. jiedianNew: theArr,
  733. totalCui,
  734. });
  735. }
  736. }.bind(this),
  737. }).always(
  738. function () {
  739. this.setState({
  740. loading: false,
  741. });
  742. }.bind(this)
  743. );
  744. },
  745. orderDetailData(orderNos) {
  746. this.setState({
  747. loading: true,
  748. });
  749. $.ajax({
  750. method: "get",
  751. dataType: "json",
  752. crossDomain: false,
  753. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  754. data: {
  755. orderNo: orderNos,
  756. },
  757. success: function (data) {
  758. if (data.error.length || data.data.list == "") {
  759. if (data.error && data.error.length) {
  760. message.warning(data.error[0].message);
  761. this.setState({
  762. loading: false,
  763. });
  764. }
  765. } else {
  766. let thisdata = data.data;
  767. this.setState({
  768. loading: false,
  769. userName: thisdata.userName,
  770. primaryOrderNo: thisdata.primaryOrder,
  771. additionalOrder: thisdata.additionalOrder,
  772. contractNo: thisdata.contractNo,
  773. orderData: thisdata,
  774. isAddition: thisdata.additionalOrder ? true : false,
  775. contractPictureUrl: thisdata.contractPictureUrl
  776. ? splitUrl(
  777. thisdata.contractPictureUrl,
  778. ",",
  779. globalConfig.avatarHost + "/upload"
  780. )
  781. : [],
  782. });
  783. }
  784. }.bind(this),
  785. });
  786. },
  787. render() {
  788. const expandedRowRender = (e) => {
  789. const data = e.splitList;
  790. let columns = [];
  791. if (e.splitList instanceof Array && e.splitList.length) {
  792. columns = [
  793. {
  794. title: "任务编号",
  795. dataIndex: "splitSuper",
  796. key: "splitSuper",
  797. render: (text, record) => {
  798. return text + "-" + record.splitId;
  799. },
  800. },
  801. {
  802. title: "任务名称",
  803. dataIndex: "taskName",
  804. key: "taskName",
  805. },
  806. {
  807. title: "订单编号",
  808. dataIndex: "orderNo",
  809. key: "orderNo",
  810. },
  811. {
  812. title: "业务类别",
  813. dataIndex: "cname",
  814. key: "cname",
  815. },
  816. {
  817. title: "客户名称",
  818. dataIndex: "userName",
  819. key: "userName",
  820. },
  821. {
  822. title: "项目状态",
  823. dataIndex: "projectStatus",
  824. key: "projectStatus",
  825. render: (text) => {
  826. return getProjectStatus(text);
  827. },
  828. },
  829. {
  830. title: "分配时间",
  831. dataIndex: "taskDate",
  832. key: "taskDate",
  833. },
  834. {
  835. title: "任务数量",
  836. dataIndex: "commodityQuantity",
  837. key: "commodityQuantity",
  838. },
  839. {
  840. title: "订单部门",
  841. dataIndex: "depName",
  842. key: "depName",
  843. },
  844. {
  845. title: "拆分操作人",
  846. dataIndex: "splitAname",
  847. key: "splitAname",
  848. },
  849. {
  850. title: "项目负责人",
  851. dataIndex: "receiverName",
  852. key: "receiverName",
  853. },
  854. {
  855. title: "拆分时间",
  856. dataIndex: "splitTimes",
  857. key: "splitTimes",
  858. },
  859. {
  860. title: "操作",
  861. dataIndex: "caozuo",
  862. key: "caouzo",
  863. render: (text, record) => {
  864. return (
  865. <div>
  866. <Button
  867. type="primary"
  868. style={{ margin: "0 10px" }}
  869. disabled={record.distributeSign == 1 ? true : false}
  870. onClick={(e) => {
  871. e.stopPropagation(), this.evaluate(record, "咨询师经理");
  872. }}
  873. >
  874. 转交
  875. </Button>
  876. <Button
  877. type="primary"
  878. style={{ margin: "0 10px" }}
  879. disabled={record.distributeSign == 1 ? true : false}
  880. onClick={(e) => {
  881. e.stopPropagation(), this.evaluate(record, "咨询师");
  882. }}
  883. >
  884. 分配任务
  885. </Button>
  886. </div>
  887. );
  888. },
  889. },
  890. ];
  891. return (
  892. <Table
  893. columns={columns}
  894. dataSource={data}
  895. pagination={false}
  896. onRowClick={this.tableRowClick.bind(this)}
  897. />
  898. );
  899. } else {
  900. columns = [];
  901. return (
  902. <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
  903. 此项目暂未拆分
  904. </p>
  905. );
  906. }
  907. };
  908. const rowSelection = {
  909. selectedRowKeys: this.state.selectedRowKeys,
  910. onChange: (selectedRowKeys, selectedRows) => {
  911. this.setState({
  912. selectedRows: selectedRows.slice(-1),
  913. selectedRowKeys: selectedRowKeys.slice(-1),
  914. });
  915. },
  916. };
  917. const formItemLayout = {
  918. labelCol: { span: 8 },
  919. wrapperCol: { span: 14 },
  920. };
  921. let departmentArr = this.state.departmentArr || [];
  922. return (
  923. <div className="user-content">
  924. {this.state.resVisible ? (
  925. <ResolutionDetail
  926. cancel={this.resCancel}
  927. detail={this.state.resRecord}
  928. visible={this.state.resVisible}
  929. id={this.state.resRecord.orderNo}
  930. />
  931. ) : (
  932. ""
  933. )}
  934. <ResolutionPro
  935. resolutionVisible={this.state.resolutionVisible}
  936. number={this.state.resolutionNumber}
  937. name={this.state.resolutionName}
  938. cancel={this.resolutionCancel}
  939. id={this.state.resolutionId}
  940. loadData={this.loadData}
  941. />
  942. <ShowModalDiv ShowModal={this.state.showModal} />
  943. <div className="content-title">
  944. <span>任务派单</span>
  945. </div>
  946. <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
  947. <TabPane tab="搜索" key="1">
  948. <div className="user-search">
  949. <Input
  950. placeholder="客户名称"
  951. value={this.state.nameSearch}
  952. style={{ marginLeft: 10 }}
  953. onChange={(e) => {
  954. this.setState({ nameSearch: e.target.value });
  955. }}
  956. />
  957. <Input
  958. placeholder="订单编号"
  959. value={this.state.orderNoSearch}
  960. onChange={(e) => {
  961. this.setState({ orderNoSearch: e.target.value });
  962. }}
  963. />
  964. <Input
  965. placeholder="任务编号"
  966. value={this.state.taskNoSearch}
  967. onChange={(e) => {
  968. this.setState({ taskNoSearch: e.target.value });
  969. }}
  970. />
  971. <Select
  972. placeholder="选择部门"
  973. style={{ width: 150, marginRight: "10px" }}
  974. value={this.state.departmenttSearch}
  975. onChange={(e) => {
  976. this.setState({ departmenttSearch: e });
  977. }}
  978. >
  979. {departmentArr.map(function (item) {
  980. return (
  981. <Select.Option key={item.id}>{item.name}</Select.Option>
  982. );
  983. })}
  984. </Select>
  985. <Button type="primary" onClick={this.search}>
  986. 搜索
  987. </Button>
  988. <Button onClick={this.reset}>重置</Button>
  989. {/* <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch.bind(this)} /></span>
  990. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  991. <span>订单时间 :</span>
  992. <RangePicker
  993. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  994. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  995. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  996. </div> */}
  997. </div>
  998. </TabPane>
  999. </Tabs>
  1000. <div className="patent-table">
  1001. <Spin spinning={this.state.loading}>
  1002. <Table
  1003. columns={this.state.columns}
  1004. dataSource={this.state.dataSource}
  1005. expandedRowRender={expandedRowRender}
  1006. // rowSelection={rowSelection}
  1007. pagination={this.state.pagination}
  1008. onRowClick={this.tableRowClick.bind(this)}
  1009. bordered
  1010. size="small"
  1011. />
  1012. </Spin>
  1013. </div>
  1014. <Assign
  1015. title="任务"
  1016. selApi={"/api/admin/orderProject/projectDistribution"}
  1017. data={this.state.assignData}
  1018. showDesc={this.state.assignVisible}
  1019. closeDesc={this.closeAssign.bind(this)}
  1020. fenpaiData={8}
  1021. specially={this.state.nub == "咨询师经理" ? 1 : 0}
  1022. // 判断是转交按钮还是分配任务按钮
  1023. // chooseBtn={this.state.nub == "咨询师经理" ? true : false}
  1024. roleName={this.state.nub}
  1025. requestMethod={"post"}
  1026. />
  1027. <Modal
  1028. className="customeDetails"
  1029. footer=""
  1030. title=""
  1031. width="900px"
  1032. visible={this.state.visible}
  1033. onOk={this.visitOk}
  1034. onCancel={this.visitCancel}
  1035. >
  1036. <Tabs activeKey={this.state.activeKey} onChange={this.orderChange}>
  1037. <TabPane tab="任务详情" key="1">
  1038. <Form
  1039. layout="horizontal"
  1040. onSubmit={this.handleSubmit}
  1041. id="demand-form"
  1042. style={{ paddingBottom: "40px" }}
  1043. >
  1044. <Spin spinning={this.state.loading}>
  1045. <div className="clearfix">
  1046. <FormItem
  1047. className="half-item"
  1048. {...formItemLayout}
  1049. label="订单编号"
  1050. >
  1051. <span>{this.state.orderNo}</span>
  1052. </FormItem>
  1053. <FormItem
  1054. className="half-item"
  1055. {...formItemLayout}
  1056. label="合同编号"
  1057. >
  1058. <span>{this.state.contractNo}</span>
  1059. </FormItem>
  1060. <FormItem
  1061. className="half-item"
  1062. {...formItemLayout}
  1063. label="客户名称"
  1064. >
  1065. <span>{this.state.userName}</span>
  1066. </FormItem>
  1067. <FormItem
  1068. className="half-item"
  1069. {...formItemLayout}
  1070. label="合同签订时间"
  1071. >
  1072. <span>{this.state.signDate}</span>
  1073. </FormItem>
  1074. <FormItem
  1075. className="half-item"
  1076. {...formItemLayout}
  1077. label="流程状态"
  1078. >
  1079. <span>{getProcessStatus(this.state.processStatus)}</span>
  1080. </FormItem>
  1081. <FormItem
  1082. className="half-item"
  1083. {...formItemLayout}
  1084. label="结算状态"
  1085. >
  1086. <span>
  1087. {getLiquidationStatus(this.state.liquidationStatus)}
  1088. </span>
  1089. </FormItem>
  1090. <FormItem
  1091. className="half-item"
  1092. {...formItemLayout}
  1093. label="企业联系人"
  1094. >
  1095. <span>{this.state.contacts}</span>
  1096. </FormItem>
  1097. <FormItem
  1098. className="half-item"
  1099. {...formItemLayout}
  1100. label="联系人电话"
  1101. >
  1102. <span>{this.state.contactMobile}</span>
  1103. </FormItem>
  1104. <FormItem
  1105. className="half-item"
  1106. {...formItemLayout}
  1107. label="企业法人"
  1108. >
  1109. <span>{this.state.legalPerson}</span>
  1110. </FormItem>
  1111. <FormItem
  1112. className="half-item"
  1113. {...formItemLayout}
  1114. label="法人电话"
  1115. >
  1116. <span>{this.state.legalPersonTel}</span>
  1117. </FormItem>
  1118. <FormItem
  1119. className="half-item"
  1120. {...formItemLayout}
  1121. label="签单金额(万元)"
  1122. >
  1123. <span>{this.state.totalAmount}</span>
  1124. </FormItem>
  1125. <FormItem
  1126. className="half-item"
  1127. {...formItemLayout}
  1128. label="首付金额(万元)"
  1129. >
  1130. <span>{this.state.firstAmount}</span>
  1131. </FormItem>
  1132. <FormItem
  1133. className="half-item"
  1134. {...formItemLayout}
  1135. label="特批立项"
  1136. >
  1137. <span>{getApprovedState(this.state.approval)}</span>
  1138. </FormItem>
  1139. <FormItem
  1140. className="half-item"
  1141. {...formItemLayout}
  1142. label="已收款项(万元)"
  1143. >
  1144. <span>{this.state.settlementAmount}</span>
  1145. </FormItem>
  1146. <div className="clearfix">
  1147. <FormItem
  1148. labelCol={{ span: 4 }}
  1149. wrapperCol={{ span: 16 }}
  1150. label="订单留言"
  1151. >
  1152. <p style={{ width: 500, wordWrap: "break-word" }}>
  1153. {this.state.orderRemarks}
  1154. </p>
  1155. </FormItem>
  1156. </div>
  1157. <div className="clearfix">
  1158. <FormItem
  1159. className="half-item"
  1160. {...formItemLayout}
  1161. label="订单负责人"
  1162. >
  1163. <span>{this.state.salesmanName}</span>
  1164. </FormItem>
  1165. <FormItem
  1166. className="half-item"
  1167. {...formItemLayout}
  1168. label="订单负责人电话"
  1169. >
  1170. <span>{this.state.salesmanMobile}</span>
  1171. </FormItem>
  1172. <FormItem
  1173. className="half-item"
  1174. {...formItemLayout}
  1175. label="订单部门"
  1176. >
  1177. <span>{this.state.depName}</span>
  1178. </FormItem>
  1179. </div>
  1180. <div className="clearfix">
  1181. <FormItem
  1182. className="half-item"
  1183. {...formItemLayout}
  1184. label="当前财务负责人"
  1185. >
  1186. <span>{this.state.nowFinance}</span>
  1187. </FormItem>
  1188. <FormItem
  1189. className="half-item"
  1190. {...formItemLayout}
  1191. label="当前财务负责人电话"
  1192. >
  1193. <span>{this.state.nowFinanceMobile}</span>
  1194. </FormItem>
  1195. </div>
  1196. <div className="clearfix">
  1197. <FormItem
  1198. className="half-item"
  1199. {...formItemLayout}
  1200. style={{ opacity: ".5" }}
  1201. label="原订单负责人"
  1202. >
  1203. <span>{this.state.oldSalesmanName}</span>
  1204. </FormItem>
  1205. <FormItem
  1206. className="half-item"
  1207. {...formItemLayout}
  1208. style={{ opacity: ".5" }}
  1209. label="原订单负责人电话"
  1210. >
  1211. <span>{this.state.oldSalesmanMobile}</span>
  1212. </FormItem>
  1213. </div>
  1214. <div className="clearfix">
  1215. <FormItem
  1216. className="half-item"
  1217. {...formItemLayout}
  1218. style={{ opacity: ".5" }}
  1219. label="实际财务操作人"
  1220. >
  1221. <span>{this.state.financeName}</span>
  1222. </FormItem>
  1223. <FormItem
  1224. className="half-item"
  1225. {...formItemLayout}
  1226. style={{ opacity: ".5" }}
  1227. label="实际财务操作人电话"
  1228. >
  1229. <span>{this.state.financeMobile}</span>
  1230. </FormItem>
  1231. </div>
  1232. <div className="clearfix">
  1233. <FormItem
  1234. className="half-item"
  1235. {...formItemLayout}
  1236. label="订单留言"
  1237. >
  1238. <span>{this.state.orderRemarks}</span>
  1239. </FormItem>
  1240. <FormItem
  1241. className="half-item"
  1242. {...formItemLayout}
  1243. label=""
  1244. >
  1245. <Button onClick={this.getOrderLog}>查看订单日志</Button>
  1246. </FormItem>
  1247. </div>
  1248. <OrderRiZi
  1249. dataSourcerizhi={this.state.dataSourceY}
  1250. closeOrderLog={this.closeOrderLog}
  1251. visible={this.state.avisible}
  1252. loading={this.state.loading}
  1253. />
  1254. <div>
  1255. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  1256. 项目业务
  1257. </span>
  1258. {this.state.processStatus == 0 ? (
  1259. <Button
  1260. type="primary"
  1261. onClick={this.addDetailed}
  1262. style={{
  1263. float: "right",
  1264. marginRight: "50px",
  1265. marginBottom: "15px",
  1266. }}
  1267. >
  1268. 添加项目明细
  1269. </Button>
  1270. ) : (
  1271. ""
  1272. )}
  1273. </div>
  1274. <div className="patent-table">
  1275. <Spin spinning={this.state.loading}>
  1276. <Table
  1277. columns={this.state.columnsX}
  1278. dataSource={this.state.dataSourceX}
  1279. pagination={this.state.paginations}
  1280. onRowClick={this.tableRowClickX}
  1281. bordered
  1282. size="small"
  1283. />
  1284. </Spin>
  1285. </div>
  1286. </div>
  1287. </Spin>
  1288. </Form>
  1289. </TabPane>
  1290. <TabPane tab="订单详情" key="2">
  1291. <Spin spinning={this.state.loading}>
  1292. <OrderDetail
  1293. orderData={this.state.orderData}
  1294. getOrderLog={this.getOrderLog}
  1295. dataSourceX={this.state.dataSourceX}
  1296. contactList={this.state.jiedian}
  1297. orderNo={this.state.orderNo}
  1298. totalCui={this.state.totalCui}
  1299. contactListNew={this.state.jiedianNew}
  1300. pictureUrl={this.state.contractPictureUrl}
  1301. />
  1302. </Spin>
  1303. </TabPane>
  1304. </Tabs>
  1305. </Modal>
  1306. <Modal
  1307. maskClosable={false}
  1308. visible={this.state.addnextVisible}
  1309. onOk={this.nextCancel}
  1310. onCancel={this.nextCancel}
  1311. width="800px"
  1312. title="项目任务详情"
  1313. footer=""
  1314. className="admin-desc-content"
  1315. >
  1316. <Form layout="horizontal" onSubmit={this.nextSubmit} id="demand-form">
  1317. <Spin spinning={this.state.loading}>
  1318. <div className="clearfix">
  1319. <FormItem
  1320. className="half-item"
  1321. {...formItemLayout}
  1322. label="项目名称"
  1323. >
  1324. <span>{this.state.commodityName}</span>
  1325. </FormItem>
  1326. <FormItem
  1327. className="half-item"
  1328. {...formItemLayout}
  1329. label="项目数量"
  1330. >
  1331. <span>{this.state.commodityQuantity}</span>
  1332. </FormItem>
  1333. <FormItem
  1334. className="half-item"
  1335. {...formItemLayout}
  1336. label="官费"
  1337. style={{ display: this.state.displayFees }}
  1338. >
  1339. <span>
  1340. {this.state.officialCost == 0 ? "无官费" : "有官费"}
  1341. </span>
  1342. </FormItem>
  1343. <FormItem
  1344. className="half-item"
  1345. {...formItemLayout}
  1346. label="费减"
  1347. style={{ display: this.state.displayFees }}
  1348. >
  1349. <span>
  1350. {this.state.costReduction == 0 ? "无费减" : "有费减"}
  1351. </span>
  1352. </FormItem>
  1353. <FormItem
  1354. className="half-item"
  1355. {...formItemLayout}
  1356. label="金额(万元)"
  1357. >
  1358. <span>{this.state.commodityPrice}</span>
  1359. </FormItem>
  1360. <FormItem
  1361. className="half-item"
  1362. {...formItemLayout}
  1363. label="主要项目"
  1364. >
  1365. <span>{getboutique(this.state.main)}</span>
  1366. </FormItem>
  1367. <div className="clearfix">
  1368. <FormItem
  1369. labelCol={{ span: 4 }}
  1370. wrapperCol={{ span: 16 }}
  1371. label="服务说明"
  1372. >
  1373. <span>{this.state.taskComment}</span>
  1374. </FormItem>
  1375. </div>
  1376. </div>
  1377. </Spin>
  1378. </Form>
  1379. </Modal>
  1380. </div>
  1381. );
  1382. },
  1383. });
  1384. export default Task;