approveds.jsx 44 KB

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