projectManageDetaile.jsx 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252
  1. import React from 'react';
  2. import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,AutoComplete} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import '../userMangagement.less';
  6. import {orderType} from '../../../../dataDic.js';
  7. import {getOrderType,getProjectState,getTaskStatus,getOrderChannel,getOrderState,getPaymentState ,getApprovedState} from '../../../../tools.js';
  8. const MySettlementDetaile = Form.create()(React.createClass({
  9. loadData(record) {
  10. this.setState({
  11. loading: true
  12. });
  13. $.ajax({
  14. method: "get",
  15. dataType: "json",
  16. crossDomain: false,
  17. url: globalConfig.context + '/api/admin/techproject/getProjectTask',
  18. data: {
  19. contractId:record?record.id:this.props.datauser.id
  20. },
  21. success: function (data) {
  22. let theArr =[];
  23. if (!data.data) {
  24. if (data.error && data.error.length) {
  25. message.warning(data.error[0].message);
  26. };
  27. } else {
  28. for (let i = 0; i < data.data.length; i++) {
  29. let thisdata = data.data[i];
  30. theArr.push({
  31. key:i,
  32. taskId:thisdata.taskId,
  33. commodityName:thisdata.commodityName,
  34. commodityQuantity:thisdata.commodityQuantity,
  35. technicianName:thisdata.technicianName,
  36. taskStatus:thisdata.taskStatus,
  37. deleteSign:thisdata.deleteSign,
  38. taskComment:thisdata.taskComment,
  39. });
  40. };
  41. }
  42. this.setState({
  43. dataSource: theArr,
  44. });
  45. }.bind(this),
  46. }).always(function () {
  47. this.setState({
  48. loading: false
  49. });
  50. }.bind(this));
  51. },
  52. getInitialState() {
  53. return {
  54. loading: false,
  55. visible: false,
  56. contractState:false,
  57. projectVisible:false,
  58. selectedRowKey:[],
  59. orderSelect:false,
  60. orgCodeUrl:[],
  61. customerArr:[],
  62. checkedKeys: [],
  63. //派单
  64. columns: [
  65. {
  66. title: '任务名称',
  67. dataIndex: 'commodityName',
  68. key: 'commodityName'
  69. },{
  70. title: '任务数量',
  71. dataIndex: 'commodityQuantity',
  72. key: 'commodityQuantity'
  73. }, {
  74. title: '任务负责人',
  75. dataIndex: 'technicianName',
  76. key: 'technicianName'
  77. }, {
  78. title: '任务状态',
  79. dataIndex: 'taskStatus',
  80. key: 'taskStatus',
  81. render:(text)=>{return getTaskStatus(text)}
  82. }, {
  83. title: '是否锁定',
  84. dataIndex: 'deleteSign',
  85. key: 'deleteSign',
  86. render:(text)=>{return text==2?'锁定':'未锁定'}
  87. },{
  88. title: '任务说明',
  89. dataIndex: 'taskComment',
  90. key: 'taskComment',
  91. render:(text) => {
  92. return(
  93. text&&text.length>6?text.substr(0,8)+'...':text
  94. )
  95. }
  96. },{
  97. title: '操作',
  98. dataIndex: 'rrtk',
  99. key: 'rrtk',
  100. render:(text,record,index)=>{
  101. return (
  102. <div>
  103. {record.taskStatus<=1&&<Popconfirm title={'您将删除项目任务 【'+record.commodityName+'】,系统将自动同步作废项目资料单,请确认!'} onConfirm={(e)=>{this.voidOperation(record)}} okText="确认" cancelText="取消">
  104. <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>
  105. </Popconfirm>}
  106. {record.taskStatus<1&&<Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation(),this.confirmDelet(record)}} type="primary">派单</Button>}
  107. </div>
  108. )
  109. }
  110. }
  111. ],
  112. userList:[
  113. {
  114. title: '用户编号',
  115. dataIndex: 'userNo',
  116. key: 'userNo'
  117. }, {
  118. title: '用户姓名',
  119. dataIndex: 'name',
  120. key: 'name'
  121. },{
  122. title: '部门机构',
  123. dataIndex: 'departmentName',
  124. key: 'departmentName'
  125. }, {
  126. title: '职务',
  127. dataIndex: 'position',
  128. key: 'position'
  129. },{
  130. title: '联系手机',
  131. dataIndex: 'mobile',
  132. key: 'mobile'
  133. }, {
  134. title: '操作',
  135. dataIndex: 'abc',
  136. key: 'abc',
  137. render:(text,record,index)=>{
  138. return (
  139. <Popconfirm title={'您确认将订单分配给【'+record.departmentName+'-'+record.name+'】进行业务跟进?'} onConfirm={(e)=>{this.confirmSelect(record)}} okText="确认" cancelText="取消">
  140. <Button style={{marginRight:'5px'}} type="primary">选定</Button>
  141. </Popconfirm>
  142. )
  143. }
  144. }
  145. ],
  146. contractList:[
  147. {
  148. title: '姓名',
  149. dataIndex: 'name',
  150. key: 'name'
  151. }, {
  152. title: '部门',
  153. dataIndex: 'depatrment',
  154. key: 'depatrment'
  155. },{
  156. title: '联系方式',
  157. dataIndex: 'mobile',
  158. key: 'mobile'
  159. },{
  160. title: '是否为主要联系人',
  161. dataIndex: 'major',
  162. key: 'major',
  163. render:(text) => {
  164. return text?'是':"否"
  165. }
  166. }, {
  167. title: '职务',
  168. dataIndex: 'position',
  169. key: 'position'
  170. },{
  171. title: '微信',
  172. dataIndex: 'wechat',
  173. key: 'wechat'
  174. },{
  175. title: 'QQ',
  176. dataIndex: 'qq',
  177. key: 'qq'
  178. },
  179. ],
  180. };
  181. },
  182. seeOrder(){
  183. this.seeOrderAjax();
  184. this.setState({
  185. seeState:true,
  186. orderVisible:true
  187. })
  188. },
  189. seeContract(){
  190. this.contract();
  191. this.setState({
  192. seeState:false,
  193. orderVisible:true
  194. })
  195. },
  196. orderCancel(){
  197. this.setState({
  198. orderVisible:false
  199. })
  200. },
  201. //查看联系人
  202. contract(){
  203. $.ajax({
  204. method: "get",
  205. dataType: "json",
  206. crossDomain: false,
  207. url: globalConfig.context + '/api/admin/customer/findAllContacts',
  208. data: {
  209. uid: this.state.buyerId
  210. },
  211. success: function (data) {
  212. let thisData = data.data;
  213. if (!thisData) {
  214. if (data.error && data.error.length) {
  215. message.warning(data.error[0].message);
  216. };
  217. thisData = {};
  218. };
  219. this.setState({
  220. contractArr:thisData,
  221. });
  222. }.bind(this),
  223. }).always(function () {
  224. this.setState({
  225. loading: false
  226. });
  227. }.bind(this));
  228. },
  229. //查看订单
  230. seeOrderAjax(){
  231. $.ajax({
  232. method: "get",
  233. dataType: "json",
  234. crossDomain: false,
  235. url: globalConfig.context + '/api/admin/order/getServiceOrderDetail',
  236. data: {
  237. orderNo: this.state.orderNok
  238. },
  239. success: function (data) {
  240. let thisData = data.data;
  241. if (!thisData) {
  242. if (data.error && data.error.length) {
  243. message.warning(data.error[0].message);
  244. };
  245. thisData = {};
  246. };
  247. this.setState({
  248. orderArr:thisData,
  249. });
  250. }.bind(this),
  251. }).always(function () {
  252. this.setState({
  253. loading: false
  254. });
  255. }.bind(this));
  256. },
  257. //查看详情
  258. loaduser(record){
  259. if(record){
  260. $.ajax({
  261. method: "get",
  262. dataType: "json",
  263. crossDomain: false,
  264. url: globalConfig.context + '/api/admin/techproject/getProjectDetail',
  265. data: {
  266. contractId: record.id,
  267. buyerType:record.buyerType
  268. },
  269. success: function (data) {
  270. let thisData = data.data;
  271. if (!thisData) {
  272. if (data.error && data.error.length) {
  273. message.warning(data.error[0].message);
  274. };
  275. thisData = {};
  276. };
  277. this.setState({
  278. buyerId:thisData.uid,
  279. id:record.id,
  280. orderNok:thisData.orderNo,
  281. orderList:thisData,
  282. technicianName:thisData.technicianName, //任务负责人
  283. });
  284. }.bind(this),
  285. }).always(function () {
  286. this.setState({
  287. loading: false
  288. });
  289. }.bind(this));
  290. }
  291. },
  292. //删除
  293. voidOperation(record){
  294. this.setState({
  295. loading: true
  296. });
  297. $.ajax({
  298. method: "get",
  299. dataType: "json",
  300. crossDomain: false,
  301. url: globalConfig.context + '/api/admin/techproject/deleteProjectTask',
  302. data: {
  303. taskId:record.taskId
  304. }
  305. }).done(function (data) {
  306. if (!data.error.length) {
  307. message.success('操作成功');
  308. this.setState({
  309. loading: false,
  310. });
  311. this.loadData();
  312. } else {
  313. message.warning(data.error[0].message);
  314. };
  315. }.bind(this));
  316. },
  317. //订单编辑保存
  318. handleOk(e) {
  319. this.setState({
  320. visible: false,
  321. });
  322. this.props.closeDesc(false, true);
  323. },
  324. handleCancel(e) {
  325. this.setState({
  326. visible: false,
  327. });
  328. this.props.closeDesc(false);
  329. },
  330. //新建项目
  331. projectOk(e) {
  332. this.setState({
  333. projectVisible: false,
  334. });
  335. this.props.closeDesc(false, true);
  336. },
  337. projectCancel(e) {
  338. this.setState({
  339. projectVisible: false,
  340. });
  341. this.props.closeDesc(false);
  342. },
  343. //选定订单
  344. orderOk() {
  345. this.setState({
  346. orderSelect: false,
  347. });
  348. },
  349. componentWillMount() {
  350. },
  351. nextCancel() {
  352. this.setState({
  353. addnextVisible: false
  354. })
  355. },
  356. //查看订单明细
  357. orderDetails(record){
  358. if(record){
  359. $.ajax({
  360. method: "get",
  361. dataType: "json",
  362. crossDomain: false,
  363. url: globalConfig.context + '/api/admin/techproject/getProjectTaskDetail',
  364. data: {
  365. taskId: record.taskId
  366. },
  367. success: function (data) {
  368. let thisData = data.data;
  369. if (!thisData) {
  370. if (data.error && data.error.length) {
  371. message.warning(data.error[0].message);
  372. };
  373. thisData = {};
  374. };
  375. this.setState({
  376. taskId:thisData.taskId,
  377. taskNo:thisData.taskNo,
  378. projectNo:thisData.projectNo,
  379. categoryId:thisData.categoryId,
  380. commodityName:thisData.commodityName,
  381. taskStatus:thisData.taskStatus,
  382. taskComment:thisData.taskComment,
  383. deletedSign:thisData.deletedSign,
  384. taskAllocatorName:thisData.taskAllocatorName,
  385. taskReceiverName:thisData.taskReceiverName,
  386. taskDistributionTime:thisData.taskDistributionTime,
  387. });
  388. }.bind(this),
  389. }).always(function () {
  390. this.setState({
  391. loading: false
  392. });
  393. }.bind(this));
  394. }
  395. },
  396. //创建项目保存
  397. admissibleOrder(){
  398. if(!this.state.autoId||!this.state.customerName){
  399. message.warning('客户名称不匹配');
  400. return false;
  401. };
  402. if(!this.state.projectName){
  403. message.warning('请选择项目负责人');
  404. return false;
  405. };
  406. if(!this.state.contractType){
  407. message.warning('请选择业务品类');
  408. return false;
  409. };
  410. if(this.state.signComment&&this.state.signComment.length>45){
  411. message.warning('项目说明字数不能超过45字');
  412. return false;
  413. };
  414. this.setState({
  415. loading: true
  416. });
  417. $.ajax({
  418. method: "POST",
  419. dataType: "json",
  420. crossDomain: false,
  421. url: globalConfig.context + '/api/admin/techproject/createProject',
  422. data: {
  423. uid:this.state.autoId,
  424. signComment:this.state.signComment,
  425. aid:this.state.aid,
  426. projectType:0,
  427. contractType:this.state.contractType
  428. }
  429. }).done(function(data) {
  430. this.setState({
  431. loading: false
  432. });
  433. if(!data.error.length) {
  434. message.success('创建成功!');
  435. this.projectOk()
  436. } else {
  437. message.warning(data.error[0].message);
  438. }
  439. }.bind(this));
  440. },
  441. //派单
  442. //操作分配
  443. confirmDelet(index){
  444. this.setState({
  445. taskIds:index.taskId,
  446. userDetaile:false,
  447. distributionVisible:true
  448. });
  449. },
  450. distributionCancel(){
  451. this.setState({
  452. distributionVisible:false
  453. })
  454. },
  455. distributionOk(){
  456. this.setState({
  457. distributionVisible:false
  458. })
  459. },
  460. //分配对象列表
  461. contactList(){
  462. $.ajax({
  463. method: "get",
  464. dataType: "json",
  465. crossDomain: false,
  466. url: globalConfig.context + '/api/admin/superviser/adminList',
  467. data: {
  468. pageNo: 1,
  469. pageSize: 99,
  470. departmentId:this.state.departmenttList,
  471. name:this.state.financeNameSearch,
  472. },
  473. success: function (data) {
  474. let theArr = [];
  475. if (!data.data) {
  476. if (data.error && data.error.length) {
  477. message.warning(data.error[0].message);
  478. };
  479. } else {
  480. for (let i = 0; i < data.data.list.length; i++) {
  481. let thisdata = data.data.list[i];
  482. theArr.push({
  483. key: i,
  484. id: thisdata.id,
  485. userNo: thisdata.userNo,
  486. name:thisdata.name,
  487. departmentName:thisdata.departmentName,
  488. departmentId:thisdata.departmentId,
  489. position:thisdata.position,
  490. mobile:thisdata.mobile,
  491. });
  492. };
  493. };
  494. this.setState({
  495. distributionList: theArr,
  496. });
  497. }.bind(this),
  498. }).always(function () {
  499. this.setState({
  500. loading: false
  501. });
  502. }.bind(this));
  503. },
  504. //选定对象
  505. confirmSelect(record){
  506. if(this.state.projectVisible){
  507. this.setState({
  508. aid:record.id,
  509. projectName:record.name
  510. })
  511. this.distributionOk();
  512. return false
  513. }
  514. this.setState({
  515. loading: true
  516. });
  517. $.ajax({
  518. method: "POST",
  519. dataType: "json",
  520. crossDomain: false,
  521. url: globalConfig.context + "/api/admin/techproject/distributionTask",
  522. data: {
  523. taskId:this.state.taskIds,
  524. taskReceiverId:record.id
  525. }
  526. }).done(function (data) {
  527. if (!data.error.length) {
  528. message.success('分派成功!');
  529. this.setState({
  530. loading: false,
  531. });
  532. this.distributionOk();
  533. this.loadData();
  534. } else {
  535. message.warning(data.error[0].message);
  536. };
  537. }.bind(this));
  538. },
  539. searchOrder(){
  540. this.contactList();
  541. },
  542. resetOrder(){
  543. this.state.departmenttList=undefined;
  544. this.state.financeNameSearch='';
  545. this.setState({
  546. distributionList:[]
  547. })
  548. },
  549. //添加任务
  550. addTask(){
  551. this.setState({
  552. commodityQuantity:'',
  553. commodityName:'',
  554. taskComment:'',
  555. kid:'',
  556. commodityId:undefined,
  557. addTaskState:true,
  558. addnextVisible:true,
  559. customerArr:[]
  560. });
  561. },
  562. //客户名称自动补全
  563. //加载(自动补全)
  564. supervisor(e,state){ //客户名称与服务名称自动补全
  565. let api=state?'/api/admin/customer/findCustomerByName':'/api/admin/order/getBusinessProjectByName';
  566. $.ajax({
  567. method: "get",
  568. dataType: "json",
  569. crossDomain: false,
  570. url: globalConfig.context + api,
  571. data:state?{
  572. name:e
  573. }:{
  574. businessName:e
  575. },
  576. success: function (data) {
  577. let thedata=data.data;
  578. if (!thedata) {
  579. if (data.error && data.error.length) {
  580. message.warning(data.error[0].message);
  581. };
  582. thedata = {};
  583. };
  584. this.setState({
  585. states:state,
  586. customerArr:thedata,
  587. });
  588. }.bind(this),
  589. }).always(function () {
  590. this.setState({
  591. loading: false
  592. });
  593. }.bind(this));
  594. },
  595. //服务值改变时请求客户名称
  596. httpChange(e){
  597. if(e.length>=2){
  598. this.supervisor(e,false);
  599. }
  600. this.setState({
  601. commodityName:e
  602. })
  603. },
  604. //上级主管输入框失去焦点是判断客户是否存在
  605. selectAuto(value){
  606. let kid=[];
  607. let fwList=this.state.customerArr;
  608. fwList.map(function(item){
  609. if(value==item.bname){
  610. kid=item.id
  611. }
  612. })
  613. this.setState({
  614. kid:kid,
  615. commodityName:value,
  616. })
  617. },
  618. customerChange(e){
  619. if(e.length>=2){
  620. this.supervisor(e,true);
  621. }
  622. this.setState({
  623. customerName:e
  624. })
  625. },
  626. //客户
  627. selectAutoCUT(value){
  628. let autoIds;
  629. let fwList=this.state.customerArr;
  630. fwList.map(function(item){
  631. if(value==item.name){
  632. autoIds=item.id
  633. }
  634. })
  635. this.setState({
  636. customerName:value,
  637. autoId:autoIds
  638. })
  639. },
  640. //任务新建、编辑保存
  641. taskSumbit(e) {
  642. e.preventDefault();
  643. if(this.state.addTaskState){
  644. if(!this.state.kid){
  645. message.warning('请输入服务项目名称');
  646. return false;
  647. };
  648. if(!this.state.commodityQuantity){
  649. message.warning('请输入数量');
  650. return false;
  651. };
  652. }
  653. this.props.form.validateFields((err, values) => {
  654. if(!err) {
  655. this.setState({
  656. loading: true
  657. });
  658. let api=this.state.addTaskState?'/api/admin/techproject/addProjectTask':'/api/admin/techproject/updateProjectTask';
  659. $.ajax({
  660. method: "POST",
  661. dataType: "json",
  662. crossDomain: false,
  663. url: globalConfig.context + api,
  664. data: this.state.addTaskState?{
  665. contractId:this.props.datauser.id,
  666. commodityId:this.state.kid,
  667. commodityName:this.state.commodityName,
  668. commodityQuantity:this.state.commodityQuantity,
  669. taskComment:this.state.taskComment,
  670. }:{
  671. taskId:this.state.taskId,
  672. commodityId:this.state.kid?this.state.kid:this.state.commodityId,
  673. taskComment:this.state.taskComment
  674. }
  675. }).done(function(data) {
  676. this.setState({
  677. loading: false
  678. });
  679. if(!data.error.length) {
  680. message.success('保存成功!');
  681. this.nextCancel();
  682. this.loadData();
  683. } else {
  684. message.warning(data.error[0].message);
  685. }
  686. }.bind(this));
  687. }
  688. });
  689. },
  690. //任务项目各种骚操作
  691. removeItem(){ //撤项
  692. this.removeList(0)
  693. },
  694. Knot(){ //结项
  695. this.removeList(1)
  696. },
  697. removeList(e){
  698. this.setState({
  699. loading: true
  700. });
  701. $.ajax({
  702. method: "get",
  703. dataType: "json",
  704. crossDomain: false,
  705. url: globalConfig.context + '/api/admin/techproject/revokeOrComplete',
  706. data: {
  707. contractId:this.props.datauser.id,
  708. operatorType:e
  709. }
  710. }).done(function(data) {
  711. this.setState({
  712. loading: false
  713. });
  714. if(!data.error.length) {
  715. message.success('操作成功!');
  716. this.handleOk()
  717. } else {
  718. message.warning(data.error[0].message);
  719. }
  720. }.bind(this));
  721. },
  722. tableRowClick(record, index) {
  723. this.setState({
  724. addTaskState:false,
  725. addnextVisible:true,
  726. });
  727. this.orderDetails(record)
  728. },
  729. componentWillReceiveProps(nextProps) { //props改变时触发
  730. this.state.projectVisible = nextProps.newProject;
  731. this.state.visible = nextProps.showDesc;
  732. if(nextProps.userDetaile && nextProps.showDesc ) {
  733. if(nextProps.datauser && nextProps.datauser.id ) {
  734. this.loaduser(nextProps.datauser);
  735. this.loadData(nextProps.datauser);
  736. }
  737. }else{
  738. this.setState({
  739. customerArr:[],
  740. customerName:'',
  741. autoId:'',
  742. signComment:'',
  743. projectName:'',
  744. aid:'',
  745. contractType:undefined
  746. })
  747. }
  748. },
  749. render() {
  750. const FormItem = Form.Item
  751. const formItemLayout = {
  752. labelCol: { span: 8 },
  753. wrapperCol: { span: 14 },
  754. };
  755. const rowSelection = {
  756. selectedRowKey: this.state.selectedRowKey,
  757. onChange: (selectedRowKey, selectedRows) => {
  758. this.setState({
  759. selectedRows: selectedRows.slice(-1),
  760. selectedRowKey: selectedRowKey.slice(-1)
  761. });
  762. },
  763. onSelectAll: (selected, selectedRows, changeRows) => {
  764. this.setState({
  765. selectedRowKey:[]
  766. })
  767. },
  768. };
  769. const categoryList=this.props.categoryArr ||[];
  770. let departmentArr = this.props.departmentArr || [];
  771. const hasSelected = this.state.selectedRowKey.length > 0;
  772. const orderDetaiel=this.state.orderList || [];
  773. const dataSources=this.state.customerArr || [];
  774. const orderArr=this.state.orderArr ||[];
  775. const options = this.state.states?dataSources.map((group,index) =>
  776. <Select.Option key={index} value={group.name}>{group.name}</Select.Option>
  777. ):dataSources.map((group,index) =>
  778. <Select.Option key={index} value={group.bname}>{group.bname}</Select.Option>
  779. )
  780. return(
  781. <div>
  782. <Modal maskClosable={false} visible={this.state.visible}
  783. onOk={this.handleOk} onCancel={this.handleCancel}
  784. width='1000px'
  785. title={this.props.projectState?'项目管理':'项目详情' }
  786. footer=''
  787. className="admin-desc-content">
  788. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} onSubmit={this.handleSubmit}>
  789. <Spin spinning={this.state.loading}>
  790. <div className="clearfix">
  791. <div className="clearfix">
  792. <FormItem className="half-item"
  793. {...formItemLayout}
  794. label="订单编号" >
  795. <span>{orderDetaiel.orderNo}</span>
  796. {orderDetaiel.orderNo&&!this.props.queryProject?<Button onClick={this.seeOrder} style={{float:'right',fontSize:'12px'}}>查看订单</Button>:''}
  797. </FormItem>
  798. <FormItem className="half-item"
  799. {...formItemLayout}
  800. label="项目编号" >
  801. <span>{orderDetaiel.serialNumber}</span>
  802. </FormItem>
  803. <FormItem className="half-item"
  804. {...formItemLayout}
  805. label="客户名称" >
  806. <span>{orderDetaiel.buyerName}</span>
  807. {orderDetaiel.buyerName&&<Button onClick={this.seeContract} style={{float:'right',fontSize:'12px'}}>查看联系人</Button>}
  808. </FormItem>
  809. <FormItem className="half-item"
  810. {...formItemLayout}
  811. label="客户省份" >
  812. <span>{orderDetaiel.buyerProvince}</span>
  813. </FormItem>
  814. <FormItem className="half-item"
  815. {...formItemLayout}
  816. label="项目类型" >
  817. <span>{getOrderType(orderDetaiel.projectType)}</span>
  818. </FormItem>
  819. <FormItem className="half-item"
  820. {...formItemLayout}
  821. label="项目负责人" >
  822. <span>{orderDetaiel.principalName}</span>
  823. </FormItem>
  824. <FormItem className="half-item"
  825. {...formItemLayout}
  826. label="项目状态" >
  827. <span>{getProjectState(orderDetaiel.projectStatus)}</span>
  828. </FormItem>
  829. <FormItem className="half-item"
  830. {...formItemLayout}
  831. label="是否锁定" >
  832. <span>{orderDetaiel.deleteSign==2?'锁定':'未锁定'}</span>
  833. </FormItem>
  834. <FormItem className="half-item"
  835. {...formItemLayout}
  836. label="立项时间" >
  837. <span>{orderDetaiel.signDate}</span>
  838. </FormItem>
  839. <FormItem className="half-item"
  840. {...formItemLayout}
  841. label="业务品类" >
  842. <span>{orderDetaiel.projectType}</span>
  843. </FormItem>
  844. <div className='clearfix'>
  845. <FormItem
  846. labelCol={{ span: 4 }}
  847. wrapperCol={{ span: 16 }}
  848. label="立项说明" >
  849. <span>{orderDetaiel.signComment}</span>
  850. </FormItem>
  851. </div>
  852. </div>
  853. <div className='clearfix'>
  854. <FormItem className="half-item"
  855. {...formItemLayout}
  856. label="结项日期" >
  857. <span>{orderDetaiel.completeDate}</span>
  858. </FormItem>
  859. </div>
  860. <div className='clearfix'>
  861. <FormItem
  862. labelCol={{ span: 4 }}
  863. wrapperCol={{ span: 16 }}
  864. label="结项说明" >
  865. <span>{orderDetaiel.completeComment}</span>
  866. </FormItem>
  867. </div>
  868. <div className='clearfix'>
  869. <FormItem className="half-item"
  870. {...formItemLayout}
  871. label="是否作废" >
  872. <span>{orderDetaiel.deleteSign==1?'作废':'未作废'}</span>
  873. </FormItem>
  874. </div>
  875. <div>
  876. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目任务</span>
  877. {orderDetaiel.projectStatus<3&&!this.props.queryProject?<Button type='primary' onClick={this.addTask} style={{float:'right',marginRight:'100px'}}>添加任务</Button>:''}
  878. </div>
  879. <div className="patent-table">
  880. <Spin spinning={this.state.loading}>
  881. <Table columns={this.state.columns}
  882. dataSource={this.state.dataSource}
  883. pagination={false}
  884. onRowClick={this.tableRowClick}
  885. />
  886. </Spin>
  887. </div>
  888. {!this.props.projectState?<div>
  889. </div>:
  890. <div style={{marginTop:'30px',paddingLeft:'100px'}}>
  891. <Button type="danger" onClick={this.removeItem}>撤项</Button>
  892. <Button type="primary" onClick={this.Knot} style={{margin:'15px'}}>结项</Button>
  893. <Button type="ghost" onClick={this.handleCancel}>返回</Button>
  894. </div>}
  895. </div>
  896. </Spin>
  897. </Form >
  898. </Modal>
  899. <Modal maskClosable={false} visible={this.state.addnextVisible}
  900. onOk={this.nextCancel} onCancel={this.nextCancel}
  901. width='800px'
  902. title={this.state.addTaskState?'添加任务':'任务详情'}
  903. footer=''
  904. className="admin-desc-content">
  905. <Form layout="horizontal" id="demand-form" onSubmit={this.taskSumbit}>
  906. <Spin spinning={this.state.loading}>
  907. {this.state.addTaskState?<div className="clearfix">
  908. <FormItem className="half-item"
  909. {...formItemLayout}
  910. label="服务项目名称" >
  911. <AutoComplete
  912. className="certain-category-search"
  913. dropdownClassName="certain-category-search-dropdown"
  914. dropdownMatchSelectWidth={false}
  915. dropdownStyle={{ width: 200 }}
  916. style={{ width: '200px' }}
  917. dataSource={options}
  918. placeholder="输入服务名称"
  919. value={this.state.commodityName}
  920. onChange={this.httpChange}
  921. filterOption={true}
  922. onSelect={this.selectAuto}
  923. >
  924. <Input/>
  925. </AutoComplete>
  926. <span className="mandatory">*</span>
  927. </FormItem>
  928. <FormItem className="half-item"
  929. {...formItemLayout}
  930. label="数量" >
  931. <Input style={{ width: '200px' }} placeholder="输入数量"
  932. value={this.state.commodityQuantity}
  933. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}}/>
  934. <span className="mandatory">*</span>
  935. </FormItem>
  936. <div className='clearfix'>
  937. <FormItem
  938. labelCol={{ span: 4 }}
  939. wrapperCol={{ span: 16 }}
  940. label="任务说明" >
  941. <Input type="textarea" placeholder="请输入订单留言" rows={4}
  942. value={this.state.taskComment}
  943. onChange={(e)=>{this.setState({taskComment:e.target.value})}}/>
  944. </FormItem>
  945. </div>
  946. </div>:
  947. <div className="clearfix">
  948. <FormItem className="half-item"
  949. {...formItemLayout}
  950. label="项目编号" >
  951. <span>{this.state.projectNo}</span>
  952. </FormItem>
  953. <FormItem className="half-item"
  954. {...formItemLayout}
  955. label="任务编号" >
  956. <span>{this.state.taskNo}</span>
  957. </FormItem>
  958. {this.state.taskStatus<1?<FormItem className="half-item"
  959. {...formItemLayout}
  960. label="服务项目名称" >
  961. <AutoComplete
  962. className="certain-category-search"
  963. dropdownClassName="certain-category-search-dropdown"
  964. dropdownMatchSelectWidth={false}
  965. dropdownStyle={{ width: 200 }}
  966. style={{ width: '200px' }}
  967. dataSource={options}
  968. placeholder="输入服务名称"
  969. value={this.state.commodityName}
  970. onChange={this.httpChange}
  971. filterOption={true}
  972. onSelect={this.selectAuto}
  973. >
  974. <Input/>
  975. </AutoComplete>
  976. <span className="mandatory">*</span>
  977. </FormItem>:
  978. <FormItem className="half-item"
  979. {...formItemLayout}
  980. label="服务项目名称" >
  981. <span>{this.state.commodityName}</span>
  982. </FormItem>}
  983. <FormItem className="half-item"
  984. {...formItemLayout}
  985. label="任务状态" >
  986. <span>{getTaskStatus(this.state.taskStatus)}</span>
  987. </FormItem>
  988. <FormItem className="half-item"
  989. {...formItemLayout}
  990. label="是否锁定" >
  991. <span>{this.state.deletedSign==2?'锁定':'未锁定'}</span>
  992. </FormItem>
  993. <div className='clearfix'>
  994. {this.state.taskStatus<1?<FormItem
  995. labelCol={{ span: 4 }}
  996. wrapperCol={{ span: 16 }}
  997. label="任务说明" >
  998. <Input type="textarea" placeholder="请输入订单留言" rows={4} value={this.state.taskComment}
  999. onChange={(e)=>{this.setState({taskComment:e.target.value})}}/>
  1000. </FormItem>:
  1001. <FormItem className="half-item"
  1002. {...formItemLayout}
  1003. label="任务说明" >
  1004. <span>{this.state.taskComment}</span>
  1005. </FormItem>}
  1006. </div>
  1007. <div className='clearfix'>
  1008. <FormItem className="half-item"
  1009. {...formItemLayout}
  1010. label="派单人" >
  1011. <span>{this.state.taskAllocatorName}</span>
  1012. </FormItem>
  1013. <FormItem className="half-item"
  1014. {...formItemLayout}
  1015. label="派单时间" >
  1016. <span>{this.state.taskDistributionTime}</span>
  1017. </FormItem>
  1018. <FormItem className="half-item"
  1019. {...formItemLayout}
  1020. label="资料负责人" >
  1021. <span>{this.state.taskReceiverName}</span>
  1022. </FormItem>
  1023. </div>
  1024. </div>}
  1025. {this.state.taskStatus<1||this.state.addTaskState?<div className="clearfix" style={{marginBottom:'20px'}}>
  1026. <Button className="setSave" type="primary" htmlType="submit">保存</Button>
  1027. <Button className="cancel" type="ghost" onClick={this.nextCancel}>返回</Button>
  1028. </div>:''}
  1029. </Spin>
  1030. </Form >
  1031. </Modal>
  1032. <Modal maskClosable={false} visible={this.state.projectVisible}
  1033. onOk={this.projectOk} onCancel={this.projectCancel}
  1034. width='600px'
  1035. title='创建项目'
  1036. footer=''
  1037. className="admin-desc-content">
  1038. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  1039. <Spin spinning={this.state.loading}>
  1040. <div className="clearfix">
  1041. <div className='clearfix'>
  1042. <div className="clearfix">
  1043. <FormItem
  1044. {...formItemLayout}
  1045. label="客户名称" >
  1046. <AutoComplete
  1047. className="certain-category-search"
  1048. dropdownClassName="certain-category-search-dropdown"
  1049. dropdownMatchSelectWidth={false}
  1050. dropdownStyle={{ width: 200 }}
  1051. size="large"
  1052. style={{ width: '200px' }}
  1053. dataSource={options}
  1054. placeholder="输入客户名称"
  1055. value={this.state.customerName}
  1056. onChange={this.customerChange}
  1057. filterOption={true}
  1058. onBlur={this.blurCutor}
  1059. onSelect={this.selectAutoCUT}
  1060. >
  1061. <Input/>
  1062. </AutoComplete>
  1063. <span className="mandatory">*</span>
  1064. </FormItem>
  1065. </div>
  1066. <div className='clearfix'>
  1067. <FormItem
  1068. {...formItemLayout}
  1069. label="项目负责人" >
  1070. <span style={{width:'150px'}}>{this.state.projectName}</span>
  1071. <Button onClick={this.confirmDelet} style={{float:'right',marginRight:'50px'}}>选择</Button>
  1072. </FormItem>
  1073. </div>
  1074. <div className='clearfix'>
  1075. <FormItem
  1076. {...formItemLayout}
  1077. label="业务品类" >
  1078. <Select placeholder="请选择业务品类"
  1079. style={{ width:'200px'}}
  1080. value={this.state.contractType}
  1081. onChange={(e)=>{this.setState({contractType:e})}}>
  1082. {
  1083. categoryList.map(function (item) {
  1084. return <Select.Option key={item.id} >{item.name}</Select.Option>
  1085. })
  1086. }
  1087. </Select>
  1088. <span className="mandatory">*</span>
  1089. </FormItem>
  1090. </div>
  1091. <div className='clearfix'>
  1092. <FormItem
  1093. labelCol={{ span: 8 }}
  1094. wrapperCol={{ span: 12 }}
  1095. label="项目说明" >
  1096. <Input type="textarea" placeholder="请输入签单备注" rows={4} value={this.state.signComment}
  1097. onChange={(e)=>{this.setState({signComment:e.target.value})}}/>
  1098. </FormItem>
  1099. </div>
  1100. </div>
  1101. </div>
  1102. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1103. <Button type="primary" onClick={this.admissibleOrder} style={{marginLeft:'55px'}}>保存</Button>
  1104. <Button className="submitSave" type="ghost" onClick={this.projectCancel}>返回</Button>
  1105. </FormItem>
  1106. </Spin>
  1107. </Form >
  1108. </Modal>
  1109. <Modal maskClosable={false} visible={this.state.distributionVisible}
  1110. onOk={this.distributionOk} onCancel={this.distributionCancel}
  1111. width='800px'
  1112. title='分派任务单'
  1113. footer=''
  1114. className="admin-desc-content">
  1115. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  1116. <Spin spinning={this.state.loading}>
  1117. <div>
  1118. <Select placeholder="部门"
  1119. style={{ width: 150 ,marginRight:'10px',marginLeft:'10px'}}
  1120. value={this.state.departmenttList}
  1121. onChange={(e) => { this.setState({ departmenttList: e }) }}>
  1122. {
  1123. departmentArr.map(function (item) {
  1124. return <Select.Option key={item.id} >{item.name}</Select.Option>
  1125. })
  1126. }
  1127. </Select>
  1128. <Input placeholder="咨询师" style={{width:'150px',marginLeft:'10px'}}
  1129. value={this.state.financeNameSearch}
  1130. onChange={(e) => { this.setState({ financeNameSearch: e.target.value }); }} />
  1131. <Button type="primary" onClick={this.searchOrder} style={{marginLeft:'10px',marginRight:'10px'}}>搜索</Button>
  1132. <Button onClick={this.resetOrder}>重置</Button>
  1133. </div>
  1134. <div className="patent-table" style={{marginTop:'10px'}}>
  1135. <Spin spinning={this.state.loading}>
  1136. <Table columns={this.state.userList}
  1137. dataSource={this.state.distributionList}
  1138. pagination={false}
  1139. />
  1140. </Spin>
  1141. </div>
  1142. </Spin>
  1143. </Form>
  1144. </Modal>
  1145. <Modal maskClosable={false} visible={this.state.orderVisible}
  1146. onOk={this.orderCancel} onCancel={this.orderCancel}
  1147. width='800px'
  1148. title={this.state.seeState?'查看订单':'查看联系人'}
  1149. footer=''
  1150. className="admin-desc-content">
  1151. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  1152. <Spin spinning={this.state.loading}>
  1153. <div className="patent-table" style={{marginTop:'10px'}}>
  1154. <Spin spinning={this.state.loading}>
  1155. {this.state.seeState?
  1156. <div className="clearfix">
  1157. <FormItem className="half-item"
  1158. {...formItemLayout}
  1159. label="订单编号" >
  1160. <span>{orderArr.orderNo}</span>
  1161. </FormItem>
  1162. <FormItem className="half-item"
  1163. {...formItemLayout}
  1164. label="下单时间" >
  1165. <span>{orderArr.createTime}</span>
  1166. </FormItem>
  1167. <FormItem className="half-item"
  1168. {...formItemLayout}
  1169. label="客户名称" >
  1170. <span>{orderArr.buyerName}</span>
  1171. </FormItem>
  1172. <FormItem className="half-item"
  1173. {...formItemLayout}
  1174. label="订单类型" >
  1175. <span>{getOrderType(orderArr.orderType)}</span>
  1176. </FormItem>
  1177. <FormItem className="half-item"
  1178. {...formItemLayout}
  1179. label="订单渠道" >
  1180. <span>{getOrderChannel(orderArr.orderChannel)}</span>
  1181. </FormItem>
  1182. <FormItem className="half-item"
  1183. {...formItemLayout}
  1184. label="订单状态" >
  1185. <span>{getOrderState(orderArr.orderStatus)}</span>
  1186. </FormItem>
  1187. <FormItem className="half-item"
  1188. {...formItemLayout}
  1189. label="已收款项" >
  1190. <span>{orderArr.actuallyTotalAmount+'万元'}</span>
  1191. </FormItem>
  1192. <FormItem className="half-item"
  1193. {...formItemLayout}
  1194. label="结算状态" >
  1195. <span>{getPaymentState(orderArr.liquidationStatus)}</span>
  1196. </FormItem>
  1197. <FormItem className="half-item"
  1198. {...formItemLayout}
  1199. label="市价订单金额" >
  1200. <span>{orderArr.orderAmount+'万元'}</span>
  1201. </FormItem>
  1202. <FormItem className="half-item"
  1203. {...formItemLayout}
  1204. label="市价首款金额" >
  1205. <span>{orderArr.firstPayment+'万元'}</span>
  1206. </FormItem>
  1207. <div className='clearfix'>
  1208. <FormItem className="half-item"
  1209. {...formItemLayout}
  1210. label="实签订单金额" >
  1211. <span>{orderArr.signTotalAmount+'万元'}</span>
  1212. </FormItem>
  1213. <FormItem className="half-item"
  1214. {...formItemLayout}
  1215. label="实签首款金额" >
  1216. <span>{orderArr.signFirstPayment+'万元'}</span>
  1217. </FormItem>
  1218. <FormItem className="half-item"
  1219. {...formItemLayout}
  1220. label="特批立项" >
  1221. <span>{getApprovedState(orderArr.approval)}</span>
  1222. </FormItem>
  1223. <div className='clearfix'>
  1224. <FormItem
  1225. labelCol={{ span: 4 }}
  1226. wrapperCol={{ span: 16 }}
  1227. label="订单留言" >
  1228. <span>{orderArr.orderRemarks}</span>
  1229. </FormItem>
  1230. </div>
  1231. </div>
  1232. </div>:
  1233. <Table columns={this.state.contractList}
  1234. dataSource={this.state.contractArr}
  1235. pagination={false}
  1236. />}
  1237. </Spin>
  1238. </div>
  1239. </Spin>
  1240. </Form>
  1241. </Modal>
  1242. </div>
  1243. )
  1244. }
  1245. }));
  1246. export default MySettlementDetaile;