projectManageDetaile.jsx 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802
  1. import React from 'react';
  2. import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form, Upload, Popconfirm, AutoComplete, Radio, DatePicker } 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, getChangeState, getApprovedState, getPublishStatus } from '../../../../tools.js';
  8. import moment from 'moment';
  9. const MySettlementDetaile = Form.create()(React.createClass({
  10. loadData(record) {
  11. this.setState({
  12. loading: true
  13. });
  14. $.ajax({
  15. method: "get",
  16. dataType: "json",
  17. crossDomain: false,
  18. url: globalConfig.context + '/api/admin/techproject/getProjectTask',
  19. data: {
  20. contractId: record ? record.id : this.props.datauser.id
  21. },
  22. success: function (data) {
  23. let theArr = [];
  24. if (!data.data) {
  25. if (data.error && data.error.length) {
  26. message.warning(data.error[0].message);
  27. };
  28. } else {
  29. for (let i = 0; i < data.data.length; i++) {
  30. let thisdata = data.data[i];
  31. theArr.push({
  32. key: i,
  33. taskId: thisdata.taskId,
  34. commodityName: thisdata.commodityName,
  35. commodityQuantity: thisdata.commodityQuantity,
  36. technicianName: thisdata.technicianName,
  37. technicianMobile: thisdata.technicianMobile,
  38. taskStatus: thisdata.taskStatus,
  39. deleteSign: thisdata.deleteSign,
  40. taskComment: thisdata.taskComment,
  41. publishStatus: thisdata.publishStatus,
  42. });
  43. };
  44. }
  45. this.setState({
  46. dataSource: theArr,
  47. });
  48. }.bind(this),
  49. }).always(function () {
  50. this.setState({
  51. loading: false
  52. });
  53. }.bind(this));
  54. },
  55. getInitialState() {
  56. return {
  57. loading: false,
  58. visible: false,
  59. contractState: false,
  60. projectVisible: false,
  61. selectedRowKey: [],
  62. orderSelect: false,
  63. transferState: false,
  64. orgCodeUrl: [],
  65. lvState: true,
  66. lvRadio: 0,
  67. customerArr: [],
  68. checkedKeys: [],
  69. //派单
  70. columns: [
  71. {
  72. title: '任务名称',
  73. dataIndex: 'commodityName',
  74. key: 'commodityName'
  75. }, {
  76. title: '任务负责人',
  77. dataIndex: 'technicianName',
  78. key: 'technicianName'
  79. }, {
  80. title: '负责人联系方式',
  81. dataIndex: 'technicianMobile',
  82. key: 'technicianMobile'
  83. }, {
  84. title: '任务状态',
  85. dataIndex: 'taskStatus',
  86. key: 'taskStatus',
  87. render: (text) => { return getTaskStatus(text) }
  88. }, {
  89. title: '公示状态',
  90. dataIndex: 'publishStatus',
  91. key: 'publishStatus',
  92. render: (text) => {
  93. { return getPublishStatus(text) }
  94. }
  95. }, {
  96. title: '是否锁定',
  97. dataIndex: 'deleteSign',
  98. key: 'deleteSign',
  99. render: (text) => { return text == 2 ? '锁定' : '未锁定' }
  100. }, {
  101. title: '任务说明',
  102. dataIndex: 'taskComment',
  103. key: 'taskComment',
  104. render: (text) => {
  105. return (
  106. text && text.length > 6 ? text.substr(0, 8) + '...' : text
  107. )
  108. }
  109. }, {
  110. title: '操作',
  111. dataIndex: 'rrtk',
  112. key: 'rrtk',
  113. render: (text, record, index) => {
  114. return (
  115. <div style={{ display: !this.props.queryProject ? 'block' : 'none' }}>
  116. {record.taskStatus <= 1 && <Popconfirm title={'您将删除项目任务 【' + record.commodityName + '】,系统将自动同步作废项目资料单,请确认!'} onConfirm={(e) => { this.voidOperation(record) }} okText="确认" cancelText="取消">
  117. <Button style={{ marginRight: '5px' }} onClick={(e) => { e.stopPropagation() }} type="danger">删除</Button>
  118. </Popconfirm>}
  119. {record.taskStatus < 1 && <Button style={{ marginRight: '5px' }} onClick={(e) => { e.stopPropagation(), this.confirmDelet(record) }} type="primary">派单</Button>}
  120. </div>
  121. )
  122. }
  123. }
  124. ],
  125. userList: [
  126. {
  127. title: '用户编号',
  128. dataIndex: 'userNo',
  129. key: 'userNo'
  130. }, {
  131. title: '用户姓名',
  132. dataIndex: 'name',
  133. key: 'name'
  134. }, {
  135. title: '部门机构',
  136. dataIndex: 'departmentName',
  137. key: 'departmentName'
  138. }, {
  139. title: '职务',
  140. dataIndex: 'position',
  141. key: 'position'
  142. }, {
  143. title: '联系手机',
  144. dataIndex: 'mobile',
  145. key: 'mobile'
  146. }, {
  147. title: '操作',
  148. dataIndex: 'abc',
  149. key: 'abc',
  150. render: (text, record, index) => {
  151. return (
  152. <div>{this.state.transferState ? <Popconfirm title={'您确认转交给【' + record.departmentName + '-' + record.name + '】'} onConfirm={(e) => { this.transterSelect(record) }} okText="确认" cancelText="取消">
  153. <Button style={{ marginRight: '5px' }} type="primary">转交</Button>
  154. </Popconfirm> :
  155. <Popconfirm title={'您确认将订单分配给【' + record.departmentName + '-' + record.name + '】进行业务跟进?'} onConfirm={(e) => { this.confirmSelect(record) }} okText="确认" cancelText="取消">
  156. <Button style={{ marginRight: '5px' }} type="primary">选定</Button>
  157. </Popconfirm>}
  158. </div>
  159. )
  160. }
  161. }
  162. ],
  163. contractList: [
  164. {
  165. title: '姓名',
  166. dataIndex: 'name',
  167. key: 'name'
  168. }, {
  169. title: '部门',
  170. dataIndex: 'depatrment',
  171. key: 'depatrment'
  172. }, {
  173. title: '联系方式',
  174. dataIndex: 'mobile',
  175. key: 'mobile'
  176. }, {
  177. title: '是否为主要联系人',
  178. dataIndex: 'major',
  179. key: 'major',
  180. render: (text) => {
  181. return text ? '是' : "否"
  182. }
  183. }, {
  184. title: '职务',
  185. dataIndex: 'position',
  186. key: 'position'
  187. }, {
  188. title: '微信',
  189. dataIndex: 'wechat',
  190. key: 'wechat'
  191. }, {
  192. title: 'QQ',
  193. dataIndex: 'qq',
  194. key: 'qq'
  195. },
  196. ],
  197. };
  198. },
  199. seeContract() {
  200. this.contract();
  201. this.setState({
  202. seeState: false,
  203. orderVisible: true
  204. })
  205. },
  206. orderCancel() {
  207. this.setState({
  208. orderVisible: false
  209. })
  210. },
  211. //查看联系人
  212. contract() {
  213. $.ajax({
  214. method: "get",
  215. dataType: "json",
  216. crossDomain: false,
  217. url: globalConfig.context + '/api/admin/customer/findAllContacts',
  218. data: {
  219. uid: this.state.buyerId
  220. },
  221. success: function (data) {
  222. let thisData = data.data;
  223. if (!thisData) {
  224. if (data.error && data.error.length) {
  225. message.warning(data.error[0].message);
  226. };
  227. thisData = {};
  228. };
  229. this.setState({
  230. contractArr: thisData,
  231. });
  232. }.bind(this),
  233. }).always(function () {
  234. this.setState({
  235. loading: false
  236. });
  237. }.bind(this));
  238. },
  239. //查看订单
  240. seeOrderAjax(data) {
  241. if (!data.orderNo) {
  242. return false;
  243. };
  244. this.setState({
  245. loading: true
  246. });
  247. $.ajax({
  248. method: "get",
  249. dataType: "json",
  250. crossDomain: false,
  251. url: globalConfig.context + '/api/admin/order/getServiceOrderDetail',
  252. data: {
  253. orderNo: data.orderNo
  254. },
  255. success: function (data) {
  256. let thisData = data.data;
  257. if (!thisData) {
  258. if (data.error && data.error.length) {
  259. message.warning(data.error[0].message);
  260. };
  261. thisData = {};
  262. };
  263. this.setState({
  264. orderArr: thisData,
  265. });
  266. }.bind(this),
  267. }).always(function () {
  268. this.setState({
  269. loading: false
  270. });
  271. }.bind(this));
  272. },
  273. //时间选择
  274. selTime(e, index) {
  275. this.setState({
  276. completeDate: e,
  277. selTime: index
  278. })
  279. },
  280. setTime(e, index) {
  281. this.setState({
  282. signDate: e,
  283. setTime: index
  284. })
  285. },
  286. //查看详情
  287. loaduser(record) {
  288. if (record) {
  289. $.ajax({
  290. method: "get",
  291. dataType: "json",
  292. crossDomain: false,
  293. url: globalConfig.context + '/api/admin/techproject/getProjectDetail',
  294. data: {
  295. contractId: record.id,
  296. buyerType: record.buyerType
  297. },
  298. success: function (data) {
  299. let thisData = data.data;
  300. if (!thisData) {
  301. if (data.error && data.error.length) {
  302. message.warning(data.error[0].message);
  303. };
  304. thisData = {};
  305. };
  306. this.setState({
  307. signTime: thisData.signDate,
  308. completeTime: thisData.completeDate,
  309. signComment: thisData.signComment,
  310. contractNo: thisData.signComment,
  311. completeComment: thisData.completeComment,
  312. completeDate: thisData.completeDate ? moment(thisData.completeDate, 'YYYY-MM-DD HH:mm:ss') : undefined,
  313. signDate: thisData.signDate ? moment(thisData.signDate, 'YYYY-MM-DD HH:mm:ss') : undefined,
  314. buyerId: thisData.uid,
  315. id: record.id,
  316. orderNok: thisData.orderNo,
  317. orderList: thisData,
  318. technicianName: thisData.technicianName, //任务负责人
  319. selTime: '',
  320. setTime: ''
  321. });
  322. }.bind(this),
  323. }).always(function () {
  324. this.setState({
  325. loading: false
  326. });
  327. }.bind(this));
  328. }
  329. },
  330. //删除
  331. voidOperation(record) {
  332. this.setState({
  333. loading: true
  334. });
  335. $.ajax({
  336. method: "get",
  337. dataType: "json",
  338. crossDomain: false,
  339. url: globalConfig.context + '/api/admin/techproject/deleteProjectTask',
  340. data: {
  341. taskId: record.taskId
  342. }
  343. }).done(function (data) {
  344. if (!data.error.length) {
  345. message.success('操作成功');
  346. this.setState({
  347. loading: false,
  348. });
  349. this.loadData();
  350. this.props.closeDesc(true, true);
  351. } else {
  352. message.warning(data.error[0].message);
  353. };
  354. }.bind(this));
  355. },
  356. //订单编辑保存
  357. handleOk(e) {
  358. this.setState({
  359. visible: false,
  360. });
  361. this.props.closeDesc(false, true);
  362. },
  363. handleCancel(e) {
  364. this.setState({
  365. visible: false,
  366. });
  367. this.props.closeDesc(false);
  368. },
  369. //新建项目
  370. projectOk(e) {
  371. this.setState({
  372. projectVisible: false,
  373. });
  374. this.props.closeDesc(false, true);
  375. },
  376. projectCancel(e) {
  377. this.setState({
  378. projectVisible: false,
  379. });
  380. this.props.closeDesc(false);
  381. },
  382. //选定订单
  383. orderOk() {
  384. this.setState({
  385. orderSelect: false,
  386. });
  387. },
  388. componentWillMount() {
  389. },
  390. nextCancel() {
  391. this.setState({
  392. addnextVisible: false
  393. })
  394. },
  395. //查看订单明细
  396. orderDetails(record) {
  397. if (record) {
  398. $.ajax({
  399. method: "get",
  400. dataType: "json",
  401. crossDomain: false,
  402. url: globalConfig.context + '/api/admin/techproject/getProjectTaskDetail',
  403. data: {
  404. taskId: record.taskId
  405. },
  406. success: function (data) {
  407. let thisData = data.data;
  408. if (!thisData) {
  409. if (data.error && data.error.length) {
  410. message.warning(data.error[0].message);
  411. };
  412. thisData = {};
  413. };
  414. this.setState({
  415. taskId: thisData.taskId,
  416. taskNo: thisData.taskNo,
  417. projectNo: thisData.projectNo,
  418. categoryId: thisData.categoryId,
  419. commodityName: thisData.commodityName,
  420. taskStatus: thisData.taskStatus,
  421. taskComment: thisData.taskComment,
  422. deletedSign: thisData.deletedSign,
  423. taskAllocatorName: thisData.taskAllocatorName,
  424. taskReceiverName: thisData.taskReceiverName,
  425. taskDistributionTime: thisData.taskDistributionTime,
  426. });
  427. }.bind(this),
  428. }).always(function () {
  429. this.setState({
  430. loading: false
  431. });
  432. }.bind(this));
  433. }
  434. },
  435. //创建项目保存
  436. admissibleOrder() {
  437. if (!this.state.autoId || !this.state.customerName) {
  438. message.warning('客户名称不匹配');
  439. return false;
  440. };
  441. if (!this.state.projectName) {
  442. message.warning('请选择项目负责人');
  443. return false;
  444. };
  445. if (!this.state.contractType) {
  446. message.warning('请选择业务品类');
  447. return false;
  448. };
  449. if (this.state.signComment && this.state.signComment.length > 45) {
  450. message.warning('项目说明字数不能超过45字');
  451. return false;
  452. };
  453. this.setState({
  454. loading: true
  455. });
  456. $.ajax({
  457. method: "POST",
  458. dataType: "json",
  459. crossDomain: false,
  460. url: globalConfig.context + '/api/admin/techproject/createProject',
  461. data: {
  462. uid: this.state.autoId,
  463. signComment: this.state.signComment,
  464. aid: this.state.aid,
  465. projectType: 0,
  466. contractType: this.state.contractType
  467. }
  468. }).done(function (data) {
  469. this.setState({
  470. loading: false
  471. });
  472. if (!data.error.length) {
  473. message.success('创建成功!');
  474. this.projectOk()
  475. } else {
  476. message.warning(data.error[0].message);
  477. }
  478. }.bind(this));
  479. },
  480. //派单
  481. //操作分配
  482. confirmDelet(index) {
  483. this.setState({
  484. taskIds: index.taskId,
  485. userDetaile: false,
  486. distributionVisible: true,
  487. transferState: false,
  488. lvState: false,
  489. distributionList: []
  490. });
  491. this.state.departmenttList = undefined;
  492. this.state.financeNameSearch = '';
  493. this.state.lvRadio = 0;
  494. //this.contactLists();
  495. },
  496. distributionCancel() {
  497. this.setState({
  498. distributionVisible: false
  499. })
  500. },
  501. distributionOk() {
  502. this.setState({
  503. distributionVisible: false
  504. })
  505. },
  506. //分配对象列表
  507. contactList() {
  508. this.setState({
  509. loading: true
  510. });
  511. let api = this.state.lvRadio == 2 ? '/api/admin/superviser/adminList' : '/api/admin/superviser/selectAdminByOrg'
  512. $.ajax({
  513. method: "get",
  514. dataType: "json",
  515. crossDomain: false,
  516. url: globalConfig.context + api,
  517. data: this.state.lvRadio == 2 ? {
  518. pageNo: 1,
  519. pageSize: 99,
  520. departmentId: this.state.departmenttList,
  521. name: this.state.financeNameSearch,
  522. } : {
  523. //subOrSame:!this.state.lvRadio?"SUB":"SAME"
  524. },
  525. success: function (data) {
  526. let theArr = [];
  527. if (!data.data) {
  528. if (data.error && data.error.length) {
  529. message.warning(data.error[0].message);
  530. };
  531. } else {
  532. if (data.data.list) {
  533. for (let i = 0; i < data.data.list.length; i++) {
  534. let thisdata = data.data.list[i];
  535. theArr.push({
  536. key: i,
  537. id: thisdata.id,
  538. userNo: thisdata.userNo,
  539. name: thisdata.name,
  540. departmentName: thisdata.departmentName,
  541. departmentId: thisdata.departmentId,
  542. position: thisdata.position,
  543. mobile: thisdata.mobile,
  544. });
  545. };
  546. } else {
  547. for (let i = 0; i < data.data.length; i++) {
  548. let thisdata = data.data[i];
  549. theArr.push({
  550. key: i,
  551. id: thisdata.id,
  552. userNo: thisdata.userNo,
  553. name: thisdata.name,
  554. departmentName: thisdata.departmentName,
  555. departmentId: thisdata.departmentId,
  556. position: thisdata.position,
  557. mobile: thisdata.mobile,
  558. });
  559. };
  560. }
  561. };
  562. this.setState({
  563. distributionList: theArr,
  564. });
  565. }.bind(this),
  566. }).always(function () {
  567. this.setState({
  568. loading: false
  569. });
  570. }.bind(this));
  571. },
  572. //分配对象列表
  573. contactLists() {
  574. this.setState({
  575. loading: true
  576. });
  577. let api = '/api/admin/superviser/adminList';
  578. $.ajax({
  579. method: "get",
  580. dataType: "json",
  581. crossDomain: false,
  582. url: globalConfig.context + api,
  583. data: {
  584. pageNo: 1,
  585. pageSize: 99,
  586. departmentId: this.state.departmenttList,
  587. name: this.state.financeNameSearch,
  588. },
  589. success: function (data) {
  590. let theArr = [];
  591. if (!data.data) {
  592. if (data.error && data.error.length) {
  593. message.warning(data.error[0].message);
  594. };
  595. } else {
  596. if (data.data.list) {
  597. for (let i = 0; i < data.data.list.length; i++) {
  598. let thisdata = data.data.list[i];
  599. theArr.push({
  600. key: i,
  601. id: thisdata.id,
  602. userNo: thisdata.userNo,
  603. name: thisdata.name,
  604. departmentName: thisdata.departmentName,
  605. departmentId: thisdata.departmentId,
  606. position: thisdata.position,
  607. mobile: thisdata.mobile,
  608. });
  609. };
  610. } else {
  611. for (let i = 0; i < data.data.length; i++) {
  612. let thisdata = data.data[i];
  613. theArr.push({
  614. key: i,
  615. id: thisdata.id,
  616. userNo: thisdata.userNo,
  617. name: thisdata.name,
  618. departmentName: thisdata.departmentName,
  619. departmentId: thisdata.departmentId,
  620. position: thisdata.position,
  621. mobile: thisdata.mobile,
  622. });
  623. };
  624. }
  625. };
  626. this.setState({
  627. distributionList: theArr,
  628. });
  629. }.bind(this),
  630. }).always(function () {
  631. this.setState({
  632. loading: false
  633. });
  634. }.bind(this));
  635. },
  636. //选定对象
  637. confirmSelect(record) {
  638. if (this.state.projectVisible) {
  639. this.setState({
  640. aid: record.id,
  641. projectName: record.name
  642. })
  643. this.distributionOk();
  644. return false
  645. }
  646. this.setState({
  647. loading: true
  648. });
  649. $.ajax({
  650. method: "POST",
  651. dataType: "json",
  652. crossDomain: false,
  653. url: globalConfig.context + "/api/admin/techproject/distributionTask",
  654. data: {
  655. taskId: this.state.taskIds,
  656. taskReceiverId: record.id
  657. }
  658. }).done(function (data) {
  659. if (!data.error.length) {
  660. message.success('分派成功!');
  661. this.setState({
  662. loading: false,
  663. });
  664. this.distributionOk();
  665. this.loadData();
  666. this.props.closeDesc(true, true);
  667. } else {
  668. message.warning(data.error[0].message);
  669. };
  670. }.bind(this));
  671. },
  672. //指派
  673. //选定对象
  674. transterSelect(record) {
  675. this.setState({
  676. loading: true
  677. });
  678. $.ajax({
  679. method: "get",
  680. dataType: "json",
  681. crossDomain: false,
  682. url: globalConfig.context + "/api/admin/techproject/transferProject",
  683. data: {
  684. contractId: this.state.id,
  685. projectReceiveId: record.id,
  686. orderNo: this.state.orderNok || ''
  687. }
  688. }).done(function (data) {
  689. if (!data.error.length) {
  690. message.success('转交成功!');
  691. this.setState({
  692. loading: false,
  693. });
  694. this.distributionOk();
  695. this.loaduser(this.props.datauser);
  696. } else {
  697. message.warning(data.error[0].message);
  698. };
  699. }.bind(this));
  700. },
  701. searchOrder() {
  702. this.contactLists();
  703. },
  704. resetOrder() {
  705. this.state.departmenttList = undefined;
  706. this.state.financeNameSearch = '';
  707. this.state.lvRadio = 0;
  708. this.setState({
  709. lvState: false,
  710. distributionList: []
  711. })
  712. this.contactLists();
  713. },
  714. //添加任务
  715. addTask() {
  716. this.setState({
  717. commodityQuantity: '',
  718. commodityName: '',
  719. taskComment: '',
  720. kid: '',
  721. commodityId: undefined,
  722. addTaskState: true,
  723. addnextVisible: true,
  724. customerArr: []
  725. });
  726. },
  727. //客户名称自动补全
  728. //加载(自动补全)
  729. supervisor(e, state) { //客户名称与服务名称自动补全
  730. let api = state ? '/api/admin/customer/findCustomerByName' : '/api/admin/order/getBusinessProjectByName';
  731. $.ajax({
  732. method: "get",
  733. dataType: "json",
  734. crossDomain: false,
  735. url: globalConfig.context + api,
  736. data: state ? {
  737. name: e
  738. } : {
  739. businessName: e
  740. },
  741. success: function (data) {
  742. let thedata = data.data;
  743. if (!thedata) {
  744. if (data.error && data.error.length) {
  745. message.warning(data.error[0].message);
  746. };
  747. thedata = {};
  748. };
  749. this.setState({
  750. states: state,
  751. customerArr: thedata,
  752. });
  753. }.bind(this),
  754. }).always(function () {
  755. this.setState({
  756. loading: false
  757. });
  758. }.bind(this));
  759. },
  760. //服务值改变时请求客户名称
  761. httpChange(e) {
  762. if (e.length >= 2) {
  763. this.supervisor(e, false);
  764. }
  765. this.setState({
  766. commodityName: e
  767. })
  768. },
  769. //上级主管输入框失去焦点是判断客户是否存在
  770. selectAuto(value) {
  771. let kid = [];
  772. let fwList = this.state.customerArr;
  773. fwList.map(function (item) {
  774. if (value == item.bname) {
  775. kid = item.id
  776. }
  777. })
  778. this.setState({
  779. kid: kid,
  780. commodityName: value,
  781. })
  782. },
  783. customerChange(e) {
  784. if (e.length >= 2) {
  785. this.supervisor(e, true);
  786. }
  787. this.setState({
  788. customerName: e
  789. })
  790. },
  791. //客户
  792. selectAutoCUT(value) {
  793. let autoIds;
  794. let fwList = this.state.customerArr;
  795. fwList.map(function (item) {
  796. if (value == item.name) {
  797. autoIds = item.id
  798. }
  799. })
  800. this.setState({
  801. customerName: value,
  802. autoId: autoIds
  803. })
  804. },
  805. //任务新建、编辑保存
  806. taskSumbit(e) {
  807. e.preventDefault();
  808. if (this.state.addTaskState) {
  809. if (!this.state.kid) {
  810. message.warning('请输入服务项目名称');
  811. return false;
  812. };
  813. if (!this.state.commodityQuantity) {
  814. message.warning('请输入数量');
  815. return false;
  816. };
  817. }
  818. this.props.form.validateFields((err, values) => {
  819. if (!err) {
  820. this.setState({
  821. loading: true
  822. });
  823. let api = this.state.addTaskState ? '/api/admin/techproject/addProjectTask' : '/api/admin/techproject/updateProjectTask';
  824. $.ajax({
  825. method: "POST",
  826. dataType: "json",
  827. crossDomain: false,
  828. url: globalConfig.context + api,
  829. data: this.state.addTaskState ? {
  830. contractId: this.props.datauser.id,
  831. commodityId: this.state.kid,
  832. commodityName: this.state.commodityName,
  833. commodityQuantity: this.state.commodityQuantity,
  834. taskComment: this.state.taskComment,
  835. } : {
  836. taskId: this.state.taskId,
  837. commodityId: this.state.kid ? this.state.kid : this.state.commodityId,
  838. taskComment: this.state.taskComment
  839. }
  840. }).done(function (data) {
  841. this.setState({
  842. loading: false
  843. });
  844. if (!data.error.length) {
  845. message.success('保存成功!');
  846. this.nextCancel();
  847. this.loadData();
  848. this.props.closeDesc(true, true);
  849. } else {
  850. message.warning(data.error[0].message);
  851. }
  852. }.bind(this));
  853. }
  854. });
  855. },
  856. //任务项目各种骚操作
  857. removeItem() { //撤项
  858. this.removeList(0)
  859. },
  860. Knot() { //结项
  861. this.removeList(1)
  862. },
  863. removeList(e) {
  864. this.setState({
  865. loading: true
  866. });
  867. $.ajax({
  868. method: "get",
  869. dataType: "json",
  870. crossDomain: false,
  871. url: globalConfig.context + '/api/admin/techproject/revokeOrComplete',
  872. data: {
  873. contractId: this.props.datauser.id,
  874. operatorType: e
  875. }
  876. }).done(function (data) {
  877. this.setState({
  878. loading: false
  879. });
  880. if (!data.error.length) {
  881. message.success('操作成功!');
  882. this.handleOk()
  883. } else {
  884. message.warning(data.error[0].message);
  885. }
  886. }.bind(this));
  887. },
  888. //保存详情
  889. knotSave() {
  890. this.setState({
  891. loading: true
  892. });
  893. $.ajax({
  894. method: "post",
  895. dataType: "json",
  896. crossDomain: false,
  897. url: globalConfig.context + '/api/admin/techproject/updateProject',
  898. data: {
  899. contractId: this.props.datauser.id,
  900. completeComment: this.state.completeComment,
  901. signComment: this.state.signComment,
  902. signDate: this.state.setTime ? this.state.setTime : this.state.signTime,
  903. completeDate: this.state.selTime ? this.state.selTime : this.state.completeTime
  904. }
  905. }).done(function (data) {
  906. this.setState({
  907. loading: false
  908. });
  909. if (!data.error.length) {
  910. message.success('保存成功!');
  911. this.handleOk()
  912. } else {
  913. message.warning(data.error[0].message);
  914. }
  915. }.bind(this));
  916. },
  917. //负责人转交
  918. transfer() {
  919. this.setState({
  920. distributionVisible: true,
  921. transferState: true,
  922. lvState: false,
  923. distributionList: []
  924. });
  925. this.state.departmenttList = undefined;
  926. this.state.financeNameSearch = '';
  927. this.state.lvRadio = 0;
  928. //this.contactLists();
  929. },
  930. /* -----变更操作开始----- */
  931. //新建变更
  932. addChange() {
  933. this.setState({
  934. addChangeState: true,
  935. stateAdd: 1,
  936. changeRemarks: ''
  937. })
  938. },
  939. //产看变更记录
  940. lookChange() {
  941. this.setState({
  942. addChangeState: true,
  943. stateAdd: 0
  944. })
  945. this.lookChangeData()
  946. },
  947. //查看变更列表修改变更
  948. modifyChangeCancel() {
  949. this.setState({
  950. modifyChangeState: false
  951. })
  952. },
  953. //获取变更记录
  954. lookChangeData() {
  955. this.setState({
  956. loading: true
  957. });
  958. $.ajax({
  959. method: "get",
  960. dataType: "json",
  961. crossDomain: false,
  962. url: globalConfig.context + '/api/admin/order/viewOrderChange',
  963. data: {
  964. orderNo: this.props.datauser.orderNo,
  965. },
  966. success: function (data) {
  967. let theArr = [];
  968. if (!data.data) {
  969. if (data.error && data.error.length) {
  970. message.warning(data.error[0].message);
  971. };
  972. } else {
  973. for (let i = 0; i < data.data.length; i++) {
  974. theArr = data.data;
  975. };
  976. };
  977. this.setState({
  978. changeHtml: theArr,
  979. });
  980. }.bind(this),
  981. }).always(function () {
  982. this.setState({
  983. loading: false
  984. });
  985. }.bind(this));
  986. },
  987. //添加变更状态
  988. addChangeCancel() {
  989. this.setState({
  990. addChangeState: false
  991. })
  992. },
  993. //新建变更
  994. subChangeState(e) {
  995. e.preventDefault();
  996. this.setState({
  997. loading: true
  998. });
  999. $.ajax({
  1000. method: "POST",
  1001. dataType: "json",
  1002. crossDomain: false,
  1003. url: globalConfig.context + '/api/admin/order/addOrderChange',
  1004. data: {
  1005. orderNo: this.props.datauser.orderNo,
  1006. changeComment: this.state.changeRemarks
  1007. }
  1008. }).done(function (data) {
  1009. this.setState({
  1010. loading: false
  1011. });
  1012. if (!data.error.length) {
  1013. message.success('保存成功!');
  1014. this.addChangeCancel();
  1015. this.seeOrderAjax(this.props.datauser);
  1016. } else {
  1017. message.warning(data.error[0].message);
  1018. }
  1019. }.bind(this));
  1020. },
  1021. //查看修改变更
  1022. modifyChange(item) {
  1023. this.setState({
  1024. modifyChangeState: true,
  1025. changePromoter: item.creater,
  1026. changeTime: item.createTime,
  1027. changeState: item.changeStatus,
  1028. changeRemarks: item.changeComment,
  1029. idt: item.changeId,
  1030. orderNot: item.orderNo
  1031. })
  1032. },
  1033. //删除变更
  1034. modifyDelete(item) {
  1035. this.setState({
  1036. loading: true
  1037. });
  1038. $.ajax({
  1039. method: "get",
  1040. dataType: "json",
  1041. crossDomain: false,
  1042. url: globalConfig.context + '/api/admin/order/deleteOrderChange',
  1043. data: {
  1044. changeId: item.changeId,
  1045. }
  1046. }).done(function (data) {
  1047. this.setState({
  1048. loading: false
  1049. });
  1050. if (!data.error.length) {
  1051. message.success('删除成功!');
  1052. this.lookChangeData();
  1053. this.seeOrderAjax(this.props.datauser)
  1054. } else {
  1055. message.warning(data.error[0].message);
  1056. }
  1057. }.bind(this));
  1058. },
  1059. //修改变更保存
  1060. changeModify(e) {
  1061. e.preventDefault();
  1062. this.setState({
  1063. loading: true
  1064. });
  1065. $.ajax({
  1066. method: "POST",
  1067. dataType: "json",
  1068. crossDomain: false,
  1069. url: globalConfig.context + '/api/admin/order/updateOrderChange',
  1070. data: {
  1071. changeId: this.state.idt,
  1072. changeStatus: this.state.changeState,
  1073. changeComment: this.state.changeRemarks
  1074. }
  1075. }).done(function (data) {
  1076. this.setState({
  1077. loading: false
  1078. });
  1079. if (!data.error.length) {
  1080. message.success('保存成功!');
  1081. this.modifyChangeCancel();
  1082. this.lookChangeData();
  1083. this.seeOrderAjax(this.props.datauser)
  1084. } else {
  1085. message.warning(data.error[0].message);
  1086. }
  1087. }.bind(this));
  1088. },
  1089. /*-----变更操作结束----*/
  1090. //切换其他下级
  1091. lvRadioFn(e) {
  1092. if (e.target.value == 0) {
  1093. this.setState({
  1094. lvRadio: e.target.value,
  1095. lvState: false
  1096. })
  1097. this.setState({
  1098. distributionList: [],
  1099. })
  1100. } else {
  1101. this.setState({
  1102. lvRadio: e.target.value,
  1103. lvState: true
  1104. })
  1105. this.contactList();
  1106. }
  1107. },
  1108. tableRowClick(record, index) {
  1109. this.setState({
  1110. addTaskState: false,
  1111. addnextVisible: true,
  1112. });
  1113. this.orderDetails(record)
  1114. },
  1115. componentWillReceiveProps(nextProps) { //props改变时触发
  1116. this.state.projectVisible = nextProps.newProject;
  1117. this.state.visible = nextProps.showDesc;
  1118. if (nextProps.userDetaile && nextProps.showDesc) {
  1119. if (nextProps.datauser && nextProps.datauser.id) {
  1120. this.loaduser(nextProps.datauser);
  1121. this.loadData(nextProps.datauser);
  1122. this.seeOrderAjax(nextProps.datauser);
  1123. }
  1124. } else {
  1125. this.setState({
  1126. customerArr: [],
  1127. customerName: '',
  1128. autoId: '',
  1129. signComment: '',
  1130. projectName: '',
  1131. aid: '',
  1132. contractType: undefined
  1133. })
  1134. }
  1135. },
  1136. render() {
  1137. const FormItem = Form.Item
  1138. const formItemLayout = {
  1139. labelCol: { span: 8 },
  1140. wrapperCol: { span: 14 },
  1141. };
  1142. const rowSelection = {
  1143. selectedRowKey: this.state.selectedRowKey,
  1144. onChange: (selectedRowKey, selectedRows) => {
  1145. this.setState({
  1146. selectedRows: selectedRows.slice(-1),
  1147. selectedRowKey: selectedRowKey.slice(-1)
  1148. });
  1149. },
  1150. onSelectAll: (selected, selectedRows, changeRows) => {
  1151. this.setState({
  1152. selectedRowKey: []
  1153. })
  1154. },
  1155. };
  1156. const changeHtml = this.state.changeHtml || [];
  1157. const categoryList = this.props.categoryArr || [];
  1158. let departmentArr = this.props.departmentArr || [];
  1159. const hasSelected = this.state.selectedRowKey.length > 0;
  1160. const orderDetaiel = this.state.orderList || [];
  1161. const dataSources = this.state.customerArr || [];
  1162. const orderArr = this.state.orderArr || [];
  1163. const options = this.state.states ? dataSources.map((group, index) =>
  1164. <Select.Option key={index} value={group.name}>{group.name}</Select.Option>
  1165. ) : dataSources.map((group, index) =>
  1166. <Select.Option key={index} value={group.bname}>{group.bname}</Select.Option>
  1167. )
  1168. return (
  1169. <div>
  1170. <Modal maskClosable={false} visible={this.state.visible}
  1171. onOk={this.handleOk} onCancel={this.handleCancel}
  1172. width='1200px'
  1173. title={this.props.projectState ? '项目管理' : '项目详情'}
  1174. footer=''
  1175. className="admin-desc-content">
  1176. <Form layout="horizontal" id="demand-form" style={{ paddingBottom: '40px' }} onSubmit={this.handleSubmit}>
  1177. <Spin spinning={this.state.loading}>
  1178. <div className="clearfix">
  1179. <div className="clearfix">
  1180. <FormItem className="half-item"
  1181. {...formItemLayout}
  1182. label="订单编号" >
  1183. <span>{orderDetaiel.orderNo}</span>
  1184. </FormItem>
  1185. <FormItem className="half-item"
  1186. {...formItemLayout}
  1187. label="项目编号" >
  1188. <span>{orderDetaiel.serialNumber}</span>
  1189. </FormItem>
  1190. {orderDetaiel.orderNo && <div>
  1191. <FormItem className="half-item"
  1192. {...formItemLayout}
  1193. label="订单类型" >
  1194. <span>{getOrderType(orderArr.orderType)}</span>
  1195. </FormItem>
  1196. <FormItem className="half-item"
  1197. {...formItemLayout}
  1198. label="订单外联" >
  1199. <span>{getOrderChannel(orderArr.orderChannel)}</span>
  1200. </FormItem>
  1201. <FormItem className="half-item"
  1202. {...formItemLayout}
  1203. label="订单状态" >
  1204. <span>{getOrderState(orderArr.orderStatus)}</span>
  1205. </FormItem>
  1206. <FormItem className="half-item"
  1207. {...formItemLayout}
  1208. label="已收款项" >
  1209. <span>{orderArr.actuallyTotalAmount + '万元'}</span>
  1210. </FormItem>
  1211. <FormItem className="half-item"
  1212. {...formItemLayout}
  1213. label="结算状态" >
  1214. <span>{getPaymentState(orderArr.liquidationStatus)}</span>
  1215. </FormItem>
  1216. <FormItem className="half-item"
  1217. {...formItemLayout}
  1218. label="订单部门" >
  1219. <span>{orderArr.departmentName}</span>
  1220. </FormItem>
  1221. <div className='clearfix'>
  1222. <FormItem className="half-item"
  1223. {...formItemLayout}
  1224. label="实签订单金额" >
  1225. <span>{orderArr.signTotalAmount + '万元'}</span>
  1226. </FormItem>
  1227. <FormItem className="half-item"
  1228. {...formItemLayout}
  1229. label="实签首款金额" >
  1230. <span>{orderArr.signFirstPayment + '万元'}</span>
  1231. </FormItem>
  1232. <FormItem className="half-item"
  1233. {...formItemLayout}
  1234. label="合同编号" >
  1235. <span>{orderDetaiel.contractNo}</span>
  1236. </FormItem>
  1237. <FormItem className="half-item"
  1238. {...formItemLayout}
  1239. label="客户名称" >
  1240. <span>{orderDetaiel.buyerName}</span>
  1241. {orderDetaiel.buyerName && <Button onClick={this.seeContract} style={{ float: 'right', fontSize: '12px' }}>查看联系人</Button>}
  1242. </FormItem>
  1243. <FormItem className="half-item"
  1244. {...formItemLayout}
  1245. label="客户省份" >
  1246. <span>{orderDetaiel.buyerProvince}</span>
  1247. </FormItem>
  1248. <FormItem className="half-item"
  1249. {...formItemLayout}
  1250. label="下单时间" >
  1251. <span>{orderArr.createTime}</span>
  1252. </FormItem>
  1253. <FormItem className="half-item"
  1254. {...formItemLayout}
  1255. label="营销员" >
  1256. <span>{orderArr.salesmanName}</span>
  1257. </FormItem>
  1258. <FormItem className="half-item"
  1259. {...formItemLayout}
  1260. label="特批立项" >
  1261. <span>{getApprovedState(orderArr.approval)}</span>
  1262. </FormItem>
  1263. <div className='clearfix'>
  1264. <FormItem
  1265. labelCol={{ span: 4 }}
  1266. wrapperCol={{ span: 16 }}
  1267. label="订单留言" >
  1268. <span>{orderArr.orderRemarks}</span>
  1269. </FormItem>
  1270. </div>
  1271. </div>
  1272. </div>}
  1273. </div>
  1274. <div className="clearfix">
  1275. <FormItem className="half-item"
  1276. {...formItemLayout}
  1277. label="项目负责人" >
  1278. <span>{orderDetaiel.principalName}</span>
  1279. {!this.props.queryProject ? <Button onClick={this.transfer} style={{ 'float': "right" }}>转交</Button> : ''}
  1280. </FormItem>
  1281. <FormItem className="half-item"
  1282. {...formItemLayout}
  1283. label="项目状态" >
  1284. <span>{getProjectState(orderDetaiel.projectStatus)}</span>
  1285. </FormItem>
  1286. <FormItem className="half-item"
  1287. {...formItemLayout}
  1288. label="是否锁定" >
  1289. <span>{orderDetaiel.deleteSign == 2 ? '锁定' : '未锁定'}</span>
  1290. </FormItem>
  1291. <FormItem className="half-item"
  1292. {...formItemLayout}
  1293. label="立项时间" >
  1294. {!this.props.queryProject && orderDetaiel.projectStatus == 2 ?
  1295. <DatePicker style={{ marginTop: '2px', width: '200px' }}
  1296. showTime
  1297. format="YYYY-MM-DD HH:mm:ss"
  1298. placeholder="选择时间"
  1299. value={this.state.signDate}
  1300. onChange={(e, time) => { this.setTime(e, time) }}
  1301. /> :
  1302. <span>{orderDetaiel.signDate}</span>}
  1303. </FormItem>
  1304. <FormItem className="half-item"
  1305. {...formItemLayout}
  1306. label="业务品类" >
  1307. <span>{orderDetaiel.projectType}</span>
  1308. </FormItem>
  1309. {/* <div className='clearfix'>
  1310. <FormItem
  1311. labelCol={{ span: 4 }}
  1312. wrapperCol={{ span: 16 }}
  1313. label="立项说明" >
  1314. {!this.props.queryProject&&orderDetaiel.projectStatus==2?<Input type="textarea" placeholder="请输入立项说明" rows={4} value={this.state.signComment}
  1315. onChange={(e)=>{this.setState({signComment:e.target.value})}}/>:<span>{orderDetaiel.signComment}</span>}
  1316. </FormItem>
  1317. </div>*/}
  1318. </div>
  1319. <div className='clearfix'>
  1320. <FormItem className="half-item"
  1321. {...formItemLayout}
  1322. label="结项日期" >
  1323. {!this.props.queryProject && orderDetaiel.projectStatus == 3 ?
  1324. <DatePicker style={{ marginTop: '2px', width: '200px' }}
  1325. showTime
  1326. format="YYYY-MM-DD HH:mm:ss"
  1327. placeholder="选择时间"
  1328. value={this.state.completeDate}
  1329. onChange={(e, time) => { this.selTime(e, time) }}
  1330. /> :
  1331. <span>{orderDetaiel.completeDate}</span>}
  1332. </FormItem>
  1333. <FormItem className="half-item"
  1334. {...formItemLayout}
  1335. label="结项说明" >
  1336. {!this.props.queryProject && orderDetaiel.projectStatus == 3 ? <Input type="textarea" placeholder="请输入结项说明" rows={4} value={this.state.completeComment}
  1337. onChange={(e) => { this.setState({ completeComment: e.target.value }) }} /> :
  1338. <span>{orderDetaiel.completeComment}</span>
  1339. }
  1340. </FormItem>
  1341. </div>
  1342. <div className='clearfix'>
  1343. <FormItem className="half-item"
  1344. {...formItemLayout}
  1345. label="是否作废" >
  1346. <span>{orderDetaiel.deleteSign == 1 ? '作废' : '未作废'}</span>
  1347. </FormItem>
  1348. </div>
  1349. {orderDetaiel.orderNo && <div className='clearfix'>
  1350. <div className="changeStatusTxt">
  1351. <FormItem className="half-item"
  1352. {...formItemLayout}
  1353. style={{ color: 'red' }}
  1354. label="变更状态" >
  1355. <span>{getChangeState(orderArr.changeStatus)}</span>
  1356. </FormItem>
  1357. </div>
  1358. <div className="clearfix">
  1359. {!this.props.queryProject && <FormItem className="half-item"
  1360. {...formItemLayout}
  1361. label="变更操作" >
  1362. <Button onClick={this.addChange}>添加变更</Button>
  1363. </FormItem>}
  1364. <FormItem className="half-item"
  1365. {...formItemLayout}
  1366. label="变更操作" >
  1367. <Button onClick={this.lookChange}>查看变更纪录</Button>
  1368. </FormItem>
  1369. </div>
  1370. </div>}
  1371. <div>
  1372. <span style={{ marginLeft: '50px', fontSize: '20px' }}>项目任务</span>
  1373. {orderDetaiel.projectStatus < 3 && !this.props.queryProject ? <Button type='primary' onClick={this.addTask} style={{ float: 'right', marginRight: '100px' }}>添加任务</Button> : ''}
  1374. </div>
  1375. <div className="patent-table">
  1376. <Spin spinning={this.state.loading}>
  1377. <Table columns={this.state.columns}
  1378. dataSource={this.state.dataSource}
  1379. pagination={false}
  1380. onRowClick={this.tableRowClick}
  1381. />
  1382. </Spin>
  1383. </div>
  1384. {!this.props.projectState ? <div style={{ marginTop: '30px', paddingLeft: '160px' }}>
  1385. <div style={{ display: orderDetaiel.projectStatus == 3 || orderDetaiel.projectStatus == 2 && !this.props.queryProject ? 'block' : 'none' }}>
  1386. <Button type="primary" onClick={this.knotSave} style={{ margin: '15px' }}>保存</Button>
  1387. <Button type="ghost" onClick={this.handleCancel}>返回</Button>
  1388. </div>
  1389. </div> :
  1390. <div style={{ marginTop: '30px', paddingLeft: '100px' }}>
  1391. {orderDetaiel.projectStatus == 3 || orderDetaiel.projectStatus == 2 ? <Button type="primary" onClick={this.knotSave} style={{ margin: '15px' }}>保存</Button> : ''}
  1392. <Button type="danger" onClick={this.removeItem}>撤项</Button>
  1393. <Button type="primary" onClick={this.Knot} style={{ margin: '15px' }}>结项</Button>
  1394. <Button type="ghost" onClick={this.handleCancel}>返回</Button>
  1395. </div>}
  1396. </div>
  1397. </Spin>
  1398. </Form >
  1399. </Modal>
  1400. <Modal maskClosable={false} visible={this.state.addnextVisible}
  1401. onOk={this.nextCancel} onCancel={this.nextCancel}
  1402. width='800px'
  1403. title={this.state.addTaskState ? '添加任务' : '任务详情'}
  1404. footer=''
  1405. className="admin-desc-content">
  1406. <Form layout="horizontal" id="demand-form" onSubmit={this.taskSumbit}>
  1407. <Spin spinning={this.state.loading}>
  1408. {this.state.addTaskState ? <div className="clearfix">
  1409. <FormItem className="half-item"
  1410. {...formItemLayout}
  1411. label="服务项目名称" >
  1412. <AutoComplete
  1413. className="certain-category-search"
  1414. dropdownClassName="certain-category-search-dropdown"
  1415. dropdownMatchSelectWidth={false}
  1416. dropdownStyle={{ width: 200 }}
  1417. style={{ width: '200px' }}
  1418. dataSource={options}
  1419. placeholder="输入服务名称"
  1420. value={this.state.commodityName}
  1421. onChange={this.httpChange}
  1422. filterOption={true}
  1423. onSelect={this.selectAuto}
  1424. >
  1425. <Input />
  1426. </AutoComplete>
  1427. <span className="mandatory">*</span>
  1428. </FormItem>
  1429. <FormItem className="half-item"
  1430. {...formItemLayout}
  1431. label="数量" >
  1432. <Input style={{ width: '200px' }} placeholder="输入数量"
  1433. value={this.state.commodityQuantity}
  1434. onChange={(e) => { this.setState({ commodityQuantity: e.target.value }) }} />
  1435. <span className="mandatory">*</span>
  1436. </FormItem>
  1437. <div className='clearfix'>
  1438. <FormItem
  1439. labelCol={{ span: 4 }}
  1440. wrapperCol={{ span: 16 }}
  1441. label="任务说明" >
  1442. <Input type="textarea" placeholder="请输入订单留言" rows={4}
  1443. value={this.state.taskComment}
  1444. onChange={(e) => { this.setState({ taskComment: e.target.value }) }} />
  1445. </FormItem>
  1446. </div>
  1447. </div> :
  1448. <div className="clearfix">
  1449. <FormItem className="half-item"
  1450. {...formItemLayout}
  1451. label="项目编号" >
  1452. <span>{this.state.projectNo}</span>
  1453. </FormItem>
  1454. <FormItem className="half-item"
  1455. {...formItemLayout}
  1456. label="任务编号" >
  1457. <span>{this.state.taskNo}</span>
  1458. </FormItem>
  1459. {this.state.taskStatus < 1 ? <FormItem className="half-item"
  1460. {...formItemLayout}
  1461. label="服务项目名称" >
  1462. <AutoComplete
  1463. className="certain-category-search"
  1464. dropdownClassName="certain-category-search-dropdown"
  1465. dropdownMatchSelectWidth={false}
  1466. dropdownStyle={{ width: 200 }}
  1467. style={{ width: '200px' }}
  1468. dataSource={options}
  1469. placeholder="输入服务名称"
  1470. value={this.state.commodityName}
  1471. onChange={this.httpChange}
  1472. filterOption={true}
  1473. onSelect={this.selectAuto}
  1474. >
  1475. <Input />
  1476. </AutoComplete>
  1477. <span className="mandatory">*</span>
  1478. </FormItem> :
  1479. <FormItem className="half-item"
  1480. {...formItemLayout}
  1481. label="服务项目名称" >
  1482. <span>{this.state.commodityName}</span>
  1483. </FormItem>}
  1484. <FormItem className="half-item"
  1485. {...formItemLayout}
  1486. label="任务状态" >
  1487. <span>{getTaskStatus(this.state.taskStatus)}</span>
  1488. </FormItem>
  1489. <FormItem className="half-item"
  1490. {...formItemLayout}
  1491. label="是否锁定" >
  1492. <span>{this.state.deletedSign == 2 ? '锁定' : '未锁定'}</span>
  1493. </FormItem>
  1494. <div className='clearfix'>
  1495. {this.state.taskStatus < 1 ? <FormItem
  1496. labelCol={{ span: 4 }}
  1497. wrapperCol={{ span: 16 }}
  1498. label="任务说明" >
  1499. <Input type="textarea" placeholder="请输入订单留言" rows={4} value={this.state.taskComment}
  1500. onChange={(e) => { this.setState({ taskComment: e.target.value }) }} />
  1501. </FormItem> :
  1502. <FormItem className="half-item"
  1503. {...formItemLayout}
  1504. label="任务说明" >
  1505. <span>{this.state.taskComment}</span>
  1506. </FormItem>}
  1507. </div>
  1508. <div className='clearfix'>
  1509. <FormItem className="half-item"
  1510. {...formItemLayout}
  1511. label="派单人" >
  1512. <span>{this.state.taskAllocatorName}</span>
  1513. </FormItem>
  1514. <FormItem className="half-item"
  1515. {...formItemLayout}
  1516. label="派单时间" >
  1517. <span>{this.state.taskDistributionTime}</span>
  1518. </FormItem>
  1519. <FormItem className="half-item"
  1520. {...formItemLayout}
  1521. label="资料负责人" >
  1522. <span>{this.state.taskReceiverName}</span>
  1523. </FormItem>
  1524. </div>
  1525. </div>}
  1526. {this.state.taskStatus < 1 || this.state.addTaskState ? <div className="clearfix" style={{ marginBottom: '20px' }}>
  1527. <Button className="setSave" type="primary" htmlType="submit">保存</Button>
  1528. <Button className="cancel" type="ghost" onClick={this.nextCancel}>返回</Button>
  1529. </div> : ''}
  1530. </Spin>
  1531. </Form >
  1532. </Modal>
  1533. <Modal maskClosable={false} visible={this.state.projectVisible}
  1534. onOk={this.projectOk} onCancel={this.projectCancel}
  1535. width='600px'
  1536. title='创建项目'
  1537. footer=''
  1538. className="admin-desc-content">
  1539. <Form layout="horizontal" id="demand-form" style={{ paddingBottom: '40px' }} >
  1540. <Spin spinning={this.state.loading}>
  1541. <div className="clearfix">
  1542. <div className='clearfix'>
  1543. <div className="clearfix">
  1544. <FormItem
  1545. {...formItemLayout}
  1546. label="客户名称" >
  1547. <AutoComplete
  1548. className="certain-category-search"
  1549. dropdownClassName="certain-category-search-dropdown"
  1550. dropdownMatchSelectWidth={false}
  1551. dropdownStyle={{ width: 200 }}
  1552. size="large"
  1553. style={{ width: '200px' }}
  1554. dataSource={options}
  1555. placeholder="输入客户名称"
  1556. value={this.state.customerName}
  1557. onChange={this.customerChange}
  1558. filterOption={true}
  1559. onBlur={this.blurCutor}
  1560. onSelect={this.selectAutoCUT}
  1561. >
  1562. <Input />
  1563. </AutoComplete>
  1564. <span className="mandatory">*</span>
  1565. </FormItem>
  1566. </div>
  1567. <div className='clearfix'>
  1568. <FormItem
  1569. {...formItemLayout}
  1570. label="项目负责人" >
  1571. <span style={{ width: '150px' }}>{this.state.projectName}</span>
  1572. <Button onClick={this.confirmDelet} style={{ float: 'right', marginRight: '50px' }}>选择</Button>
  1573. </FormItem>
  1574. </div>
  1575. <div className='clearfix'>
  1576. <FormItem
  1577. {...formItemLayout}
  1578. label="业务品类" >
  1579. <Select placeholder="请选择业务品类"
  1580. style={{ width: '200px' }}
  1581. value={this.state.contractType}
  1582. onChange={(e) => { this.setState({ contractType: e }) }}>
  1583. {
  1584. categoryList.map(function (item) {
  1585. return <Select.Option key={item.id} >{item.name}</Select.Option>
  1586. })
  1587. }
  1588. </Select>
  1589. <span className="mandatory">*</span>
  1590. </FormItem>
  1591. </div>
  1592. <div className='clearfix'>
  1593. <FormItem
  1594. labelCol={{ span: 8 }}
  1595. wrapperCol={{ span: 12 }}
  1596. label="项目说明" >
  1597. <Input type="textarea" placeholder="请输入签单备注" rows={4} value={this.state.signComment}
  1598. onChange={(e) => { this.setState({ signComment: e.target.value }) }} />
  1599. </FormItem>
  1600. </div>
  1601. </div>
  1602. </div>
  1603. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1604. <Button type="primary" onClick={this.admissibleOrder} style={{ marginLeft: '55px' }}>保存</Button>
  1605. <Button className="submitSave" type="ghost" onClick={this.projectCancel}>返回</Button>
  1606. </FormItem>
  1607. </Spin>
  1608. </Form >
  1609. </Modal>
  1610. <Modal maskClosable={false} visible={this.state.distributionVisible}
  1611. onOk={this.distributionOk} onCancel={this.distributionCancel}
  1612. width='800px'
  1613. title={this.state.transferState ? '转交责任人' : '分派任务单'}
  1614. footer=''
  1615. className="admin-desc-content">
  1616. <Form layout="horizontal" id="demand-form" style={{ paddingBottom: '40px' }} >
  1617. <Spin spinning={this.state.loading}>
  1618. <div>
  1619. <Radio.Group onChange={this.lvRadioFn} value={this.state.lvRadio}>
  1620. <Radio value={2}>下级</Radio>
  1621. <Radio value={0}>其他</Radio>
  1622. </Radio.Group>
  1623. {!this.state.lvState && <Select placeholder="部门"
  1624. style={{ width: 150, marginRight: '10px', marginLeft: '10px' }}
  1625. value={this.state.departmenttList}
  1626. onChange={(e) => { this.setState({ departmenttList: e }) }}>
  1627. {
  1628. departmentArr.map(function (item) {
  1629. return <Select.Option key={item.id} >{item.name}</Select.Option>
  1630. })
  1631. }
  1632. </Select>}
  1633. {!this.state.lvState && <Input placeholder={this.state.transferState ? "责任人" : "咨询师"} style={{ width: '150px', marginLeft: '10px' }}
  1634. value={this.state.financeNameSearch}
  1635. onChange={(e) => { this.setState({ financeNameSearch: e.target.value }); }} />}
  1636. {!this.state.lvState && <Button type="primary" onClick={this.searchOrder} style={{ marginLeft: '10px', marginRight: '10px' }}>搜索</Button>}
  1637. {!this.state.lvState && <Button onClick={this.resetOrder}>重置</Button>}
  1638. </div>
  1639. <div className="patent-table" style={{ marginTop: '10px' }}>
  1640. <Spin spinning={this.state.loading}>
  1641. <Table columns={this.state.userList}
  1642. dataSource={this.state.distributionList}
  1643. pagination={false}
  1644. />
  1645. </Spin>
  1646. </div>
  1647. </Spin>
  1648. </Form>
  1649. </Modal>
  1650. <Modal maskClosable={false} visible={this.state.orderVisible}
  1651. onOk={this.orderCancel} onCancel={this.orderCancel}
  1652. width='800px'
  1653. title={this.state.seeState ? '查看订单' : '查看联系人'}
  1654. footer=''
  1655. className="admin-desc-content">
  1656. <Form layout="horizontal" id="demand-form" style={{ paddingBottom: '40px' }} >
  1657. <Spin spinning={this.state.loading}>
  1658. <div className="patent-table" style={{ marginTop: '10px' }}>
  1659. <Spin spinning={this.state.loading}>
  1660. {this.state.seeState ?
  1661. <div className="clearfix">
  1662. </div> :
  1663. <Table columns={this.state.contractList}
  1664. dataSource={this.state.contractArr}
  1665. pagination={false}
  1666. />}
  1667. </Spin>
  1668. </div>
  1669. </Spin>
  1670. </Form>
  1671. </Modal>
  1672. <Modal maskClosable={false} visible={this.state.addChangeState}
  1673. onOk={this.addChangeCancel} onCancel={this.addChangeCancel}
  1674. width='800px'
  1675. title={this.state.stateAdd ? '添加变更' : '查看变更记录'}
  1676. footer=''
  1677. className="admin-desc-content">
  1678. <Form layout="horizontal" id="demand-form">
  1679. <Spin spinning={this.state.loading}>
  1680. <div className="clearfix">
  1681. {this.state.stateAdd ? <div className="clearfix">
  1682. <FormItem
  1683. labelCol={{ span: 4 }}
  1684. wrapperCol={{ span: 16 }}
  1685. label="变更说明" >
  1686. <Input type="textarea" placeholder="请输入变更说明" rows={4} value={this.state.changeRemarks}
  1687. onChange={(e) => { this.setState({ changeRemarks: e.target.value }) }} />
  1688. </FormItem>
  1689. <div className="clearfix">
  1690. <Button type="primary" onClick={this.subChangeState} style={{ margin: "10px 50px 10px 128px" }}>保存</Button>
  1691. <Button onClick={this.addChangeCancel}>取消</Button>
  1692. </div>
  1693. </div> :
  1694. <div>
  1695. {
  1696. changeHtml.length ? changeHtml.map(function (item, index) {
  1697. return (<div className="changeBorder" key={index}>
  1698. <FormItem className="half-item"
  1699. {...formItemLayout}
  1700. label="变更发起人" >
  1701. <span>{item.creater}</span>
  1702. </FormItem>
  1703. <FormItem className="half-item"
  1704. {...formItemLayout}
  1705. label="变更申请时间" >
  1706. <span>{item.createTime}</span>
  1707. </FormItem>
  1708. <div className='clearfix'>
  1709. <FormItem className="half-item"
  1710. {...formItemLayout}
  1711. label="变更状态" >
  1712. <span>{getChangeState(item.changeStatus)}</span>
  1713. </FormItem>
  1714. <FormItem className="half-item"
  1715. {...formItemLayout}
  1716. label="变更操作" >
  1717. <Button onClick={(e) => { this.modifyChange(item) }}>修改</Button>
  1718. {/*<Button type="danger" onClick={(e)=>{this.modifyDelete(item)}}>删除</Button>*/}
  1719. </FormItem>
  1720. </div>
  1721. <div className='clearfix changeRemark'>
  1722. <FormItem
  1723. labelCol={{ span: 4 }}
  1724. wrapperCol={{ span: 16 }}
  1725. label="变更说明" >
  1726. <p>{item.changeComment}</p>
  1727. </FormItem>
  1728. </div>
  1729. </div>)
  1730. }, this) : <p style={{ textAlign: "center" }}>暂无变更记录</p>}
  1731. </div>
  1732. }
  1733. </div>
  1734. </Spin>
  1735. </Form >
  1736. </Modal>
  1737. <Modal maskClosable={false} visible={this.state.modifyChangeState}
  1738. onOk={this.modifyChangeCancel} onCancel={this.modifyChangeCancel}
  1739. width='600px'
  1740. title="修改变更 "
  1741. footer=''
  1742. className="admin-desc-content">
  1743. <Form layout="horizontal" id="demand-form">
  1744. <Spin spinning={this.state.loading}>
  1745. <div className="clearfix">
  1746. <div className="clearfix">
  1747. <FormItem className="half-item"
  1748. {...formItemLayout}
  1749. label="变更发起人" >
  1750. <span>{this.state.changePromoter}</span>
  1751. </FormItem>
  1752. <FormItem className="half-item"
  1753. {...formItemLayout}
  1754. label="变更申请时间" >
  1755. <span>{this.state.changeTime}</span>
  1756. </FormItem>
  1757. <div className='clearfix'>
  1758. <FormItem
  1759. labelCol={{ span: 4 }}
  1760. wrapperCol={{ span: 16 }}
  1761. label="变更状态" >
  1762. <Radio.Group onChange={(e) => { this.setState({ changeState: e.target.value }) }} value={this.state.changeState}>
  1763. <Radio value={1}>变更中</Radio>
  1764. <Radio value={2}>变更完成</Radio>
  1765. </Radio.Group>
  1766. </FormItem>
  1767. </div>
  1768. <div className='clearfix'>
  1769. <FormItem
  1770. labelCol={{ span: 4 }}
  1771. wrapperCol={{ span: 16 }}
  1772. label="变更说明" >
  1773. <Input type="textarea" placeholder="请输入变更说明" rows={4} value={this.state.changeRemarks}
  1774. onChange={(e) => { this.setState({ changeRemarks: e.target.value }) }} />
  1775. </FormItem>
  1776. </div>
  1777. <div className="clearfix">
  1778. <Button type="primary" onClick={this.changeModify} style={{ margin: "10px 95px" }}>保存</Button>
  1779. <Button onClick={this.modifyChangeCancel}>取消</Button>
  1780. </div>
  1781. </div>
  1782. </div>
  1783. </Spin>
  1784. </Form >
  1785. </Modal>
  1786. </div>
  1787. )
  1788. }
  1789. }));
  1790. export default MySettlementDetaile;