taskAssignment.jsx 45 KB

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