approveds.jsx 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426
  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.orderNoSearch, //订单编号
  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. if (record.appropriationRatio && !record.money) {
  354. return <span>{record.appropriationRatio}(拨款比例)</span>;
  355. } else if (record.appropriationRatio && record.money) {
  356. return (
  357. <span>
  358. {text}(比例:{record.appropriationRatio})
  359. </span>
  360. );
  361. } else {
  362. return <span>{text}</span>;
  363. }
  364. }
  365. }
  366. },
  367. {
  368. title: "服务年限",
  369. dataIndex: "startDate",
  370. key: "startDate",
  371. render: (text, record) => {
  372. if (record.dunTypeName) {
  373. return <span>{text}</span>;
  374. }
  375. }
  376. },
  377. {
  378. title: "催款状态",
  379. dataIndex: "status",
  380. key: "status",
  381. render: text => {
  382. return <span>{text == 1 ? "已启动" : "未启动"}</span>;
  383. }
  384. }
  385. ],
  386. ContactsLists: [
  387. {
  388. title: "催款科目",
  389. dataIndex: "dunSubject",
  390. key: "dunSubject",
  391. render: text => {
  392. return getjiedian(text);
  393. }
  394. },
  395. {
  396. title: "金额(万元)",
  397. dataIndex: "money",
  398. key: "money"
  399. },
  400. {
  401. title: "催款状态",
  402. dataIndex: "dunStatus",
  403. key: "dunStatus",
  404. render: text => {
  405. return getCuikuan(text);
  406. }
  407. }
  408. ]
  409. };
  410. },
  411. //页面加载函数
  412. componentWillMount() {
  413. this.departmentList();
  414. this.loadData();
  415. },
  416. //整行点击
  417. tableRowClick(record) {
  418. this.setState({
  419. visible: true
  420. });
  421. this.xiangqing(record.orderNo);
  422. this.xiangmu(record.orderNo);
  423. this.jiedian(record.orderNo);
  424. this.jiedianNew(record.orderNo);
  425. },
  426. //点击打卡项目详情
  427. tableRowClickX(record) {
  428. console.log(record);
  429. this.setState({
  430. jid: record.id, //项目ID
  431. kid: record.commodityId, //商品ID
  432. commodityName: record.commodityName, //金额
  433. commodityPrice: record.commodityPrice, //金额
  434. commodityQuantity: record.commodityQuantity, //数量
  435. taskComment: record.taskComment, //备注
  436. main: record.main.toString(), //是否为主要
  437. addnextVisible: true,
  438. addState: 0
  439. });
  440. },
  441. //项目详情关闭
  442. nextCancel() {
  443. this.setState({
  444. addnextVisible: false
  445. });
  446. },
  447. //订单详情
  448. xiangqing(orderNos) {
  449. $.ajax({
  450. method: "get",
  451. dataType: "json",
  452. crossDomain: false,
  453. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  454. data: {
  455. orderNo: orderNos
  456. },
  457. success: function(data) {
  458. if (data.error.length || data.data.list == "") {
  459. if (data.error && data.error.length) {
  460. message.warning(data.error[0].message);
  461. }
  462. } else {
  463. let thisdata = data.data;
  464. this.setState({
  465. orderNo: thisdata.orderNo, //订单编号
  466. contractNo: thisdata.contractNo, //合同编号
  467. userName: thisdata.userName, //客户名称
  468. signDate: thisdata.signDate, //签单时间
  469. processStatus: thisdata.processStatus, //流程状态
  470. liquidationStatus: thisdata.liquidationStatus, //结算状态
  471. contacts: thisdata.contacts, //企业联系人
  472. contactMobile: thisdata.contactMobile, //联系人电话
  473. legalPerson: thisdata.legalPerson, //法人
  474. legalPersonTel: thisdata.legalPersonTel, //法人电话
  475. firstAmount: thisdata.firstAmount, //签单金额
  476. totalAmount: thisdata.totalAmount, //首付金额
  477. approval: thisdata.approval, //特批状态
  478. settlementAmount: thisdata.settlementAmount, //已收款项
  479. orderRemarks: thisdata.orderRemarks, //订单留言
  480. orgCodeUrl: thisdata.contractPictureUrl
  481. ? splitUrl(
  482. thisdata.contractPictureUrl,
  483. ",",
  484. globalConfig.avatarHost + "/upload"
  485. )
  486. : [], //图片地址
  487. salesmanName: thisdata.salesmanName, //营销员名称
  488. salesmanMobile: thisdata.salesmanMobile, //营销员电话
  489. financeName: thisdata.financeName, //财务名称
  490. financeMobile: thisdata.financeMobile, //财务电话
  491. outsource: thisdata.outsource == 0 ? "否" : "是"
  492. });
  493. }
  494. }.bind(this)
  495. }).always(
  496. function() {
  497. this.setState({
  498. loading: false
  499. });
  500. }.bind(this)
  501. );
  502. },
  503. //项目列表
  504. xiangmu(orderNos) {
  505. $.ajax({
  506. method: "get",
  507. dataType: "json",
  508. crossDomain: false,
  509. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  510. data: {
  511. orderNo: orderNos
  512. },
  513. success: function(data) {
  514. let theArr = [];
  515. if (data.error.length || data.data.list == "") {
  516. if (data.error && data.error.length) {
  517. message.warning(data.error[0].message);
  518. }
  519. } else {
  520. for (let i = 0; i < data.data.length; i++) {
  521. let thisdata = data.data[i];
  522. theArr.push({
  523. key: i,
  524. id: thisdata.id,
  525. orderNo: thisdata.orderNo, //订单编号
  526. commodityId: thisdata.commodityId, //项目ID
  527. commodityName: thisdata.commodityName, //项目名称
  528. cname: thisdata.cname, //项目类别
  529. commodityPrice: thisdata.commodityPrice, //项目价格
  530. commodityQuantity: thisdata.commodityQuantity, //项目数量
  531. main: thisdata.main, //是否为主要任务
  532. taskComment: thisdata.taskComment, //任务说明
  533. contacts: thisdata.contacts, //联系人
  534. contactsMobile: thisdata.contactsMobile //联系人电话
  535. });
  536. }
  537. }
  538. this.setState({
  539. dataSourceX: theArr
  540. });
  541. }.bind(this)
  542. }).always(
  543. function() {
  544. this.setState({
  545. loading: false
  546. });
  547. }.bind(this)
  548. );
  549. },
  550. rizhi() {
  551. console.log(this.state.orderNo);
  552. this.setState({
  553. loading: true
  554. });
  555. $.ajax({
  556. method: "get",
  557. dataType: "json",
  558. crossDomain: false,
  559. url: "/api/admin/newOrder/selectOrderLog",
  560. data: {
  561. orderNo: this.state.orderNo
  562. },
  563. success: function(data) {
  564. let theArr = [];
  565. let thisData = data.data;
  566. if (!thisData.length) {
  567. if (data.error && data.error.length) {
  568. message.warning(data.error[0].message);
  569. }
  570. thisData = {};
  571. } else {
  572. for (let i = 0; i < data.data.length; i++) {
  573. let thisdata = data.data[i];
  574. theArr.push({
  575. processName: thisdata.processName,
  576. adminName: thisdata.adminName,
  577. createDate: thisdata.createDate
  578. });
  579. }
  580. }
  581. this.setState({
  582. dataSourcerizhi: theArr
  583. });
  584. }.bind(this)
  585. }).always(
  586. function() {
  587. this.setState({
  588. loading: false
  589. });
  590. }.bind(this)
  591. );
  592. },
  593. //查看订单日志
  594. getOrderLog() {
  595. this.setState({
  596. rizhivisible: true
  597. });
  598. this.rizhi();
  599. },
  600. closeOrderLog() {
  601. this.setState({
  602. rizhivisible: false
  603. });
  604. },
  605. //节点列表
  606. jiedian(orderNos) {
  607. $.ajax({
  608. method: "get",
  609. dataType: "json",
  610. crossDomain: false,
  611. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  612. data: {
  613. orderNo: orderNos
  614. },
  615. success: function(data) {
  616. let theArr = [];
  617. let thisData = [];
  618. if (data.error.length || data.data.list == "") {
  619. if (data.error && data.error.length) {
  620. message.warning(data.error[0].message);
  621. }
  622. } else {
  623. for (let i = 0; i < data.data.length; i++) {
  624. thisData = data.data[i];
  625. theArr.push({
  626. key: i,
  627. dunSubject: thisData.dunSubject
  628. ? thisData.dunSubject.toString()
  629. : "", //催款科目
  630. id: thisData.id, //节点Id
  631. money: thisData.money, //催款金额
  632. dunStatus: thisData.dunStatus //催款状态
  633. });
  634. }
  635. this.setState({
  636. contactList: theArr
  637. });
  638. }
  639. }.bind(this)
  640. }).always(
  641. function() {
  642. this.setState({
  643. loading: false
  644. });
  645. }.bind(this)
  646. );
  647. },
  648. //查看催款节点
  649. jiedianNew(orderNos) {
  650. $.ajax({
  651. method: "get",
  652. dataType: "json",
  653. crossDomain: false,
  654. url:
  655. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  656. data: {
  657. orderNo: orderNos
  658. },
  659. success: function(data) {
  660. if (data.error && data.error.length) {
  661. message.warning(data.error[0].message);
  662. } else {
  663. let theArr = [];
  664. let thisData = [];
  665. let arr = data.data || [];
  666. let totalCui = 0;
  667. for (let i = 0; i < arr.length; i++) {
  668. thisData = arr[i];
  669. totalCui += +thisData.money;
  670. theArr.push({
  671. key: i,
  672. dunSubject: thisData.dunSubject
  673. ? thisData.dunSubject.toString()
  674. : "", //催款科目
  675. id: thisData.id, //节点Id
  676. money: thisData.money, //催款金额
  677. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  678. commodityName: thisData.commodityName,
  679. projectType: thisData.projectType,
  680. dunTypeName: thisData.dunTypeName,
  681. status: thisData.status,
  682. waitDay: thisData.waitDay,
  683. effectiveCount: thisData.effectiveCount,
  684. startDate: thisData.startDate,
  685. dunType: thisData.dunType,
  686. appropriationRatio: thisData.appropriationRatio
  687. });
  688. }
  689. if (!totalCui) {
  690. totalCui = 0;
  691. }
  692. totalCui = (Math.round(totalCui * 10000) / 10000).toFixed(4);
  693. this.setState({
  694. contactListNew: theArr,
  695. totalCui
  696. });
  697. }
  698. }.bind(this)
  699. }).always(
  700. function() {
  701. this.setState({
  702. loading: false
  703. });
  704. }.bind(this)
  705. );
  706. },
  707. //审核通过
  708. examOk() {
  709. if (this.state.flagE) return;
  710. this.setState({
  711. flagE: true
  712. });
  713. $.ajax({
  714. method: "post",
  715. dataType: "json",
  716. crossDomain: false,
  717. url: globalConfig.context + "/api/admin/newOrder/approvalOrder",
  718. data: {
  719. orderNo: this.state.orderNo,
  720. confirm: 2
  721. },
  722. success: function(data) {
  723. if (data.error.length || data.data.list == "") {
  724. if (data.error && data.error.length) {
  725. message.warning(data.error[0].message);
  726. this.setState({
  727. flagE: false
  728. });
  729. }
  730. } else {
  731. message.success("该特批订单已通过审核~");
  732. this.setState({
  733. visible: false
  734. });
  735. this.reset();
  736. this.setState({
  737. flagE: false
  738. });
  739. }
  740. }.bind(this)
  741. }).always(
  742. function() {
  743. this.setState({
  744. loading: false
  745. });
  746. }.bind(this)
  747. );
  748. },
  749. //审核不通过
  750. examOks() {
  751. if (this.state.flagE) return;
  752. this.setState({
  753. flagE: true
  754. });
  755. $.ajax({
  756. method: "post",
  757. dataType: "json",
  758. crossDomain: false,
  759. url: globalConfig.context + "/api/admin/newOrder/approvalOrder",
  760. data: {
  761. orderNo: this.state.orderNo,
  762. confirm: 3,
  763. reason: this.state.reason
  764. },
  765. success: function(data) {
  766. if (data.error.length || data.data.list == "") {
  767. if (data.error && data.error.length) {
  768. message.warning(data.error[0].message);
  769. this.setState({
  770. flagE: false
  771. });
  772. }
  773. } else {
  774. message.success("该特批订单已被驳回~");
  775. this.setState({
  776. visible: false,
  777. noVisible: false,
  778. reason: ""
  779. });
  780. this.loadData();
  781. this.resets();
  782. this.setState({
  783. flagE: false
  784. });
  785. }
  786. }.bind(this)
  787. }).always(
  788. function() {
  789. this.setState({
  790. loading: false
  791. });
  792. }.bind(this)
  793. );
  794. },
  795. //点击拒绝
  796. examNo() {
  797. this.setState({
  798. noVisible: true
  799. });
  800. },
  801. //关闭输入理由框
  802. noCancel() {
  803. this.setState({
  804. noVisible: false,
  805. reason: ""
  806. });
  807. },
  808. //搜索
  809. search() {
  810. this.setState({
  811. //signBillVisible:false
  812. });
  813. this.loadData();
  814. },
  815. //重置
  816. reset() {
  817. this.setState({
  818. signBillVisible: false
  819. });
  820. this.state.orderNo = "";
  821. this.state.customerName = "";
  822. this.state.departmenttSearch = undefined;
  823. this.state.releaseDate[0] = undefined;
  824. this.state.releaseDate[1] = undefined;
  825. this.state.approval = undefined;
  826. this.loadData();
  827. },
  828. resets() {
  829. this.state.orderNo = "";
  830. this.state.customerName = "";
  831. this.state.departmenttSearch = undefined;
  832. this.state.releaseDate[0] = undefined;
  833. this.state.releaseDate[1] = undefined;
  834. },
  835. getOrgCodeUrl(e) {
  836. this.setState({ orgCodeUrl: e });
  837. },
  838. //关闭详情
  839. visitCancel() {
  840. this.setState({
  841. visible: false
  842. });
  843. this.resets();
  844. },
  845. visitOk() {
  846. this.setState({
  847. visible: false
  848. });
  849. this.resets();
  850. },
  851. //部门
  852. departmentList() {
  853. this.setState({
  854. loading: true
  855. });
  856. $.ajax({
  857. method: "get",
  858. dataType: "json",
  859. crossDomain: false,
  860. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  861. data: {},
  862. success: function(data) {
  863. let thedata = data.data;
  864. let theArr = [];
  865. if (!thedata) {
  866. if (data.error && data.error.length) {
  867. message.warning(data.error[0].message);
  868. }
  869. thedata = {};
  870. } else {
  871. thedata.map(function(item, index) {
  872. theArr.push({
  873. key: index,
  874. name: item.name,
  875. id: item.id
  876. });
  877. });
  878. }
  879. this.setState({
  880. departmentArr: theArr
  881. });
  882. }.bind(this)
  883. }).always(
  884. function() {
  885. this.setState({
  886. loading: false
  887. });
  888. }.bind(this)
  889. );
  890. },
  891. render() {
  892. const formItemLayout = {
  893. labelCol: { span: 8 },
  894. wrapperCol: { span: 14 }
  895. };
  896. const FormItem = Form.Item;
  897. const { RangePicker } = DatePicker;
  898. const cuiDataList = this.state.contactList || [];
  899. const rowSelection = {
  900. selectedRowKeys: this.state.selectedRowKeys,
  901. onChange: (selectedRowKeys, selectedRows) => {
  902. this.setState({
  903. modalVisible: false,
  904. selectedRows: selectedRows.slice(-1),
  905. selectedRowKeys: selectedRowKeys.slice(-1)
  906. });
  907. },
  908. onSelect: recordt => {
  909. this.setState({
  910. modalVisible: false,
  911. recordt: recordt.id
  912. });
  913. }
  914. };
  915. let departmentArr = this.state.departmentArr || [];
  916. return (
  917. <div className="user-content">
  918. <ShowModalDiv ShowModal={this.state.showModal} />
  919. <div className="content-title">
  920. <span>特批订单审核</span>
  921. </div>
  922. <div className="user-search">
  923. <Input
  924. placeholder="客户名称"
  925. style={{ width: "150px", marginBottom: "10px" }}
  926. value={this.state.customerName}
  927. onChange={e => {
  928. this.setState({ customerName: e.target.value });
  929. }}
  930. />
  931. <Input
  932. placeholder="订单编号"
  933. style={{ width: "150px" }}
  934. value={this.state.orderNoSearch}
  935. onChange={e => {
  936. this.setState({ orderNoSearch: e.target.value });
  937. }}
  938. />
  939. <Select
  940. placeholder="选择部门"
  941. style={{ width: 150, marginRight: "10px" }}
  942. value={this.state.departmenttSearch}
  943. onChange={e => {
  944. this.setState({ departmenttSearch: e });
  945. }}
  946. >
  947. {departmentArr.map(function(item) {
  948. return <Select.Option key={item.id}>{item.name}</Select.Option>;
  949. })}
  950. </Select>
  951. <span style={{ marginRight: "10px" }}>下单时间 :</span>
  952. <RangePicker
  953. value={[
  954. this.state.releaseDate[0]
  955. ? moment(this.state.releaseDate[0])
  956. : null,
  957. this.state.releaseDate[1]
  958. ? moment(this.state.releaseDate[1])
  959. : null
  960. ]}
  961. onChange={(data, dataString) => {
  962. this.setState({ releaseDate: dataString });
  963. }}
  964. />
  965. <Button
  966. type="primary"
  967. onClick={this.search}
  968. style={{ marginLeft: "10px" }}
  969. >
  970. 搜索
  971. </Button>
  972. <Button onClick={this.reset}>重置</Button>
  973. <div className="patent-table">
  974. <Spin spinning={this.state.loading}>
  975. <Table
  976. columns={this.state.columns}
  977. dataSource={this.state.dataSource}
  978. rowSelection={rowSelection}
  979. pagination={this.state.pagination}
  980. onRowClick={this.tableRowClick}
  981. bordered
  982. size="small"
  983. />
  984. </Spin>
  985. </div>
  986. <Modal
  987. className="customeDetails"
  988. footer=""
  989. title="订单详情"
  990. width="900px"
  991. visible={this.state.visible}
  992. onOk={this.visitOk}
  993. onCancel={this.visitCancel}
  994. >
  995. <Form
  996. layout="horizontal"
  997. onSubmit={this.handleSubmit}
  998. id="demand-form"
  999. style={{ paddingBottom: "40px" }}
  1000. >
  1001. <Spin spinning={this.state.loading}>
  1002. <div className="clearfix">
  1003. <FormItem
  1004. className="half-item"
  1005. {...formItemLayout}
  1006. label="订单编号"
  1007. >
  1008. <span>{this.state.orderNo}</span>
  1009. </FormItem>
  1010. <FormItem
  1011. className="half-item"
  1012. {...formItemLayout}
  1013. label="合同编号"
  1014. >
  1015. <span>{this.state.contractNo}</span>
  1016. </FormItem>
  1017. <FormItem
  1018. className="half-item"
  1019. {...formItemLayout}
  1020. label="客户名称"
  1021. >
  1022. <span>{this.state.userName}</span>
  1023. </FormItem>
  1024. <FormItem
  1025. className="half-item"
  1026. {...formItemLayout}
  1027. label="合同签订时间"
  1028. >
  1029. <span>{this.state.signDate}</span>
  1030. </FormItem>
  1031. <FormItem
  1032. className="half-item"
  1033. {...formItemLayout}
  1034. label="流程状态"
  1035. >
  1036. <span>{getProcessStatus(this.state.processStatus)}</span>
  1037. </FormItem>
  1038. <FormItem
  1039. className="half-item"
  1040. {...formItemLayout}
  1041. label="结算状态"
  1042. >
  1043. <span>
  1044. {getLiquidationStatus(this.state.liquidationStatus)}
  1045. </span>
  1046. </FormItem>
  1047. <FormItem
  1048. className="half-item"
  1049. {...formItemLayout}
  1050. label="企业联系人"
  1051. >
  1052. <span>{this.state.contacts}</span>
  1053. </FormItem>
  1054. <FormItem
  1055. className="half-item"
  1056. {...formItemLayout}
  1057. label="联系人电话"
  1058. >
  1059. <span>{this.state.contactMobile}</span>
  1060. </FormItem>
  1061. <FormItem
  1062. className="half-item"
  1063. {...formItemLayout}
  1064. label="企业法人"
  1065. >
  1066. <span>{this.state.legalPerson}</span>
  1067. </FormItem>
  1068. <FormItem
  1069. className="half-item"
  1070. {...formItemLayout}
  1071. label="法人电话"
  1072. >
  1073. <span>{this.state.legalPersonTel}</span>
  1074. </FormItem>
  1075. <FormItem
  1076. className="half-item"
  1077. {...formItemLayout}
  1078. label="签单金额(万元)"
  1079. >
  1080. <span>{this.state.totalAmount}</span>
  1081. </FormItem>
  1082. <FormItem
  1083. className="half-item"
  1084. {...formItemLayout}
  1085. label="首付金额(万元)"
  1086. >
  1087. <span>{this.state.firstAmount}</span>
  1088. </FormItem>
  1089. <FormItem
  1090. className="half-item"
  1091. {...formItemLayout}
  1092. label="特批立项"
  1093. >
  1094. <span>{getApprovedState(this.state.approval)}</span>
  1095. </FormItem>
  1096. <FormItem
  1097. className="half-item"
  1098. {...formItemLayout}
  1099. label="已收款项(万元)"
  1100. >
  1101. <span>{this.state.settlementAmount}</span>
  1102. </FormItem>
  1103. <FormItem
  1104. className="half-item"
  1105. {...formItemLayout}
  1106. label="是否外包"
  1107. >
  1108. <span>{this.state.outsource}</span>
  1109. </FormItem>
  1110. <div className="clearfix">
  1111. <FormItem
  1112. labelCol={{ span: 4 }}
  1113. wrapperCol={{ span: 16 }}
  1114. label="订单留言"
  1115. >
  1116. <span>{this.state.orderRemarks}</span>
  1117. </FormItem>
  1118. </div>
  1119. <div className="clearfix">
  1120. <FormItem
  1121. labelCol={{ span: 4 }}
  1122. wrapperCol={{ span: 18 }}
  1123. label={
  1124. <span>
  1125. <strong style={{ color: "#f00" }}>*</strong>
  1126. 合同扫描件
  1127. </span>
  1128. }
  1129. >
  1130. <PicturesWall
  1131. fileList={this.getOrgCodeUrl}
  1132. pictureUrl={this.state.orgCodeUrl}
  1133. />
  1134. <p>图片建议:要清晰。</p>
  1135. <Button
  1136. style={{
  1137. float: "right",
  1138. marginRight: "140px",
  1139. marginTop: "20px"
  1140. }}
  1141. onClick={this.getOrderLog}
  1142. >
  1143. 查看订单 日志
  1144. </Button>
  1145. </FormItem>
  1146. </div>
  1147. <div className="clearfix">
  1148. <FormItem
  1149. className="half-item"
  1150. {...formItemLayout}
  1151. label="订单负责人"
  1152. >
  1153. <span>{this.state.salesmanName}</span>
  1154. </FormItem>
  1155. <FormItem
  1156. className="half-item"
  1157. {...formItemLayout}
  1158. label="订单负责人电话"
  1159. >
  1160. <span>{this.state.salesmanMobile}</span>
  1161. </FormItem>
  1162. </div>
  1163. <div className="clearfix">
  1164. <FormItem
  1165. className="half-item"
  1166. {...formItemLayout}
  1167. label="财务负责人"
  1168. >
  1169. <span>{this.state.financeName}</span>
  1170. </FormItem>
  1171. <FormItem
  1172. className="half-item"
  1173. {...formItemLayout}
  1174. label="财务负责人电话"
  1175. >
  1176. <span>{this.state.financeMobile}</span>
  1177. </FormItem>
  1178. </div>
  1179. <div>
  1180. <span style={{ marginLeft: "50px", fontSize: "18px" }}>
  1181. 项目业务
  1182. </span>
  1183. {this.state.processStatus == 0 ? (
  1184. <Button
  1185. type="primary"
  1186. onClick={this.addDetailed}
  1187. style={{
  1188. float: "right",
  1189. marginRight: "50px",
  1190. marginBottom: "15px"
  1191. }}
  1192. >
  1193. 添加项目明细
  1194. </Button>
  1195. ) : (
  1196. ""
  1197. )}
  1198. </div>
  1199. <div className="patent-table">
  1200. <Spin spinning={this.state.loading}>
  1201. <Table
  1202. columns={this.state.columnsX}
  1203. dataSource={this.state.dataSourceX}
  1204. pagination={this.state.paginations}
  1205. onRowClick={this.tableRowClickX}
  1206. bordered
  1207. size="small"
  1208. />
  1209. </Spin>
  1210. </div>
  1211. <div style={{ marginTop: 10 }}>
  1212. <span style={{ marginLeft: 50, fontSize: "18px" }}>
  1213. 催款节点
  1214. </span>
  1215. <span
  1216. style={{
  1217. display: cuiDataList.length ? "none" : "inline-block",
  1218. marginLeft: 10,
  1219. color: "red"
  1220. }}
  1221. >
  1222. 金额总计(万元): {this.state.totalCui}
  1223. </span>
  1224. </div>
  1225. <div className="clearfix">
  1226. <Spin spinning={this.state.loading}>
  1227. <Form layout="horizontal" id="demand-form">
  1228. <Table
  1229. pagination={false}
  1230. bordered
  1231. size="small"
  1232. columns={
  1233. cuiDataList.length
  1234. ? this.state.ContactsLists
  1235. : this.state.ContactsListsNew
  1236. }
  1237. dataSource={
  1238. cuiDataList.length
  1239. ? this.state.contactList
  1240. : this.state.contactListNew
  1241. }
  1242. />
  1243. <Col
  1244. span={24}
  1245. offset={9}
  1246. style={{ marginTop: "15px" }}
  1247. ></Col>
  1248. </Form>
  1249. </Spin>
  1250. </div>
  1251. <div className="addSave" style={{ marginTop: "15px" }}>
  1252. <Button
  1253. className="cancel"
  1254. type="primary"
  1255. onClick={this.examOk}
  1256. style={{ marginLeft: "200px" }}
  1257. htmlType="submit"
  1258. >
  1259. 通过
  1260. </Button>
  1261. <Button
  1262. className="cancel"
  1263. type="primary"
  1264. onClick={this.examNo}
  1265. style={{ marginLeft: "50px" }}
  1266. htmlType="submit"
  1267. >
  1268. 驳回
  1269. </Button>
  1270. <Button
  1271. className="cancel"
  1272. type="ghost"
  1273. onClick={this.visitCancel}
  1274. style={{ marginLeft: "50px" }}
  1275. >
  1276. 取消
  1277. </Button>
  1278. </div>
  1279. </div>
  1280. </Spin>
  1281. </Form>
  1282. </Modal>
  1283. <Modal
  1284. maskClosable={false}
  1285. visible={this.state.addnextVisible}
  1286. onOk={this.nextCancel}
  1287. onCancel={this.nextCancel}
  1288. width="800px"
  1289. title={"项目任务详情"}
  1290. footer=""
  1291. className="admin-desc-content"
  1292. >
  1293. <Form layout="horizontal" id="demand-form">
  1294. <Spin spinning={this.state.loading}>
  1295. <div className="clearfix">
  1296. <FormItem
  1297. className="half-item"
  1298. {...formItemLayout}
  1299. label="项目名称"
  1300. >
  1301. <span>{this.state.commodityName}</span>
  1302. </FormItem>
  1303. <FormItem
  1304. className="half-item"
  1305. {...formItemLayout}
  1306. label="项目数量"
  1307. >
  1308. <span>{this.state.commodityQuantity}</span>
  1309. </FormItem>
  1310. <FormItem
  1311. className="half-item"
  1312. {...formItemLayout}
  1313. label="金额(万元)"
  1314. >
  1315. <span>{this.state.commodityPrice}</span>
  1316. </FormItem>
  1317. <FormItem
  1318. className="half-item"
  1319. {...formItemLayout}
  1320. label="主要项目"
  1321. >
  1322. <span>{getboutique(this.state.main)}</span>
  1323. </FormItem>
  1324. <div className="clearfix">
  1325. <FormItem
  1326. labelCol={{ span: 4 }}
  1327. wrapperCol={{ span: 16 }}
  1328. label="服务说明"
  1329. >
  1330. <span>{this.state.taskComment}</span>
  1331. </FormItem>
  1332. </div>
  1333. </div>
  1334. </Spin>
  1335. </Form>
  1336. </Modal>
  1337. <Modal
  1338. maskClosable={false}
  1339. visible={this.state.noVisible}
  1340. onOk={this.noCancel}
  1341. onCancel={this.noCancel}
  1342. width="400px"
  1343. title={"拒绝理由"}
  1344. footer=""
  1345. className="admin-desc-content"
  1346. >
  1347. <Form layout="horizontal" id="demand-form">
  1348. <Spin spinning={this.state.loading}>
  1349. <div className="clearfix">
  1350. <FormItem
  1351. labelCol={{ span: 4 }}
  1352. wrapperCol={{ span: 16 }}
  1353. label="拒绝理由"
  1354. >
  1355. <Input
  1356. type="textarea"
  1357. placeholder="请输入拒绝理由"
  1358. rows={4}
  1359. value={this.state.reason}
  1360. onChange={e => {
  1361. this.setState({ reason: e.target.value });
  1362. }}
  1363. />
  1364. </FormItem>
  1365. </div>
  1366. <div className="clearfix">
  1367. <Button
  1368. className="cancel"
  1369. type="primary"
  1370. onClick={this.examOks}
  1371. style={{ marginLeft: "50px" }}
  1372. htmlType="submit"
  1373. >
  1374. 确定
  1375. </Button>
  1376. <Button
  1377. className="cancel"
  1378. type="ghost"
  1379. onClick={this.noCancel}
  1380. style={{ marginLeft: "50px" }}
  1381. >
  1382. 取消
  1383. </Button>
  1384. </div>
  1385. </Spin>
  1386. </Form>
  1387. </Modal>
  1388. <Modal
  1389. visible={this.state.rizhivisible}
  1390. className="admin-desc-content"
  1391. width="800px"
  1392. maskClosable={false}
  1393. title="订单日志"
  1394. footer={null}
  1395. onCancel={this.closeOrderLog}
  1396. >
  1397. <div className="patent-table">
  1398. <Spin spinning={this.state.loading}>
  1399. <Table
  1400. columns={this.state.columnsrizhi}
  1401. dataSource={this.state.dataSourcerizhi}
  1402. pagination={false}
  1403. />
  1404. </Spin>
  1405. </div>
  1406. </Modal>
  1407. </div>
  1408. </div>
  1409. );
  1410. }
  1411. })
  1412. );
  1413. export default IntentionCustomer;