checkOutsourcing.jsx 48 KB

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