checkOutsourcing.jsx 48 KB

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