taskAssignment.jsx 45 KB

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