approveds.jsx 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422
  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. 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. });
  779. this.loadData();
  780. this.resets();
  781. this.setState({
  782. flagE: false
  783. });
  784. }
  785. }.bind(this)
  786. }).always(
  787. function() {
  788. this.setState({
  789. loading: false
  790. });
  791. }.bind(this)
  792. );
  793. },
  794. //点击拒绝
  795. examNo() {
  796. this.setState({
  797. noVisible: true
  798. });
  799. },
  800. //关闭输入理由框
  801. noCancel() {
  802. this.setState({
  803. noVisible: false
  804. });
  805. },
  806. //搜索
  807. search() {
  808. this.setState({
  809. //signBillVisible:false
  810. });
  811. this.loadData();
  812. },
  813. //重置
  814. reset() {
  815. this.setState({
  816. signBillVisible: false
  817. });
  818. this.state.orderNo = "";
  819. this.state.customerName = "";
  820. this.state.departmenttSearch = undefined;
  821. this.state.releaseDate[0] = undefined;
  822. this.state.releaseDate[1] = undefined;
  823. this.state.approval = undefined;
  824. this.loadData();
  825. },
  826. resets() {
  827. this.state.orderNo = "";
  828. this.state.customerName = "";
  829. this.state.departmenttSearch = undefined;
  830. this.state.releaseDate[0] = undefined;
  831. this.state.releaseDate[1] = undefined;
  832. },
  833. getOrgCodeUrl(e) {
  834. this.setState({ orgCodeUrl: e });
  835. },
  836. //关闭详情
  837. visitCancel() {
  838. this.setState({
  839. visible: false
  840. });
  841. this.resets();
  842. },
  843. visitOk() {
  844. this.setState({
  845. visible: false
  846. });
  847. this.resets();
  848. },
  849. //部门
  850. departmentList() {
  851. this.setState({
  852. loading: true
  853. });
  854. $.ajax({
  855. method: "get",
  856. dataType: "json",
  857. crossDomain: false,
  858. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  859. data: {},
  860. success: function(data) {
  861. let thedata = data.data;
  862. let theArr = [];
  863. if (!thedata) {
  864. if (data.error && data.error.length) {
  865. message.warning(data.error[0].message);
  866. }
  867. thedata = {};
  868. } else {
  869. thedata.map(function(item, index) {
  870. theArr.push({
  871. key: index,
  872. name: item.name,
  873. id: item.id
  874. });
  875. });
  876. }
  877. this.setState({
  878. departmentArr: theArr
  879. });
  880. }.bind(this)
  881. }).always(
  882. function() {
  883. this.setState({
  884. loading: false
  885. });
  886. }.bind(this)
  887. );
  888. },
  889. render() {
  890. const formItemLayout = {
  891. labelCol: { span: 8 },
  892. wrapperCol: { span: 14 }
  893. };
  894. const FormItem = Form.Item;
  895. const { RangePicker } = DatePicker;
  896. const cuiDataList = this.state.contactList || [];
  897. const rowSelection = {
  898. selectedRowKeys: this.state.selectedRowKeys,
  899. onChange: (selectedRowKeys, selectedRows) => {
  900. this.setState({
  901. modalVisible: false,
  902. selectedRows: selectedRows.slice(-1),
  903. selectedRowKeys: selectedRowKeys.slice(-1)
  904. });
  905. },
  906. onSelect: recordt => {
  907. this.setState({
  908. modalVisible: false,
  909. recordt: recordt.id
  910. });
  911. }
  912. };
  913. let departmentArr = this.state.departmentArr || [];
  914. return (
  915. <div className="user-content">
  916. <ShowModalDiv ShowModal={this.state.showModal} />
  917. <div className="content-title">
  918. <span>特批订单审核</span>
  919. </div>
  920. <div className="user-search">
  921. <Input
  922. placeholder="客户名称"
  923. style={{ width: "150px", marginBottom: "10px" }}
  924. value={this.state.customerName}
  925. onChange={e => {
  926. this.setState({ customerName: e.target.value });
  927. }}
  928. />
  929. <Input
  930. placeholder="订单编号"
  931. style={{ width: "150px" }}
  932. value={this.state.orderNo}
  933. onChange={e => {
  934. this.setState({ orderNo: e.target.value });
  935. }}
  936. />
  937. <Select
  938. placeholder="选择部门"
  939. style={{ width: 150, marginRight: "10px" }}
  940. value={this.state.departmenttSearch}
  941. onChange={e => {
  942. this.setState({ departmenttSearch: e });
  943. }}
  944. >
  945. {departmentArr.map(function(item) {
  946. return <Select.Option key={item.id}>{item.name}</Select.Option>;
  947. })}
  948. </Select>
  949. <span style={{ marginRight: "10px" }}>下单时间 :</span>
  950. <RangePicker
  951. value={[
  952. this.state.releaseDate[0]
  953. ? moment(this.state.releaseDate[0])
  954. : null,
  955. this.state.releaseDate[1]
  956. ? moment(this.state.releaseDate[1])
  957. : null
  958. ]}
  959. onChange={(data, dataString) => {
  960. this.setState({ releaseDate: dataString });
  961. }}
  962. />
  963. <Button
  964. type="primary"
  965. onClick={this.search}
  966. style={{ marginLeft: "10px" }}
  967. >
  968. 搜索
  969. </Button>
  970. <Button onClick={this.reset}>重置</Button>
  971. <div className="patent-table">
  972. <Spin spinning={this.state.loading}>
  973. <Table
  974. columns={this.state.columns}
  975. dataSource={this.state.dataSource}
  976. rowSelection={rowSelection}
  977. pagination={this.state.pagination}
  978. onRowClick={this.tableRowClick}
  979. bordered
  980. size="small"
  981. />
  982. </Spin>
  983. </div>
  984. <Modal
  985. className="customeDetails"
  986. footer=""
  987. title="订单详情"
  988. width="900px"
  989. visible={this.state.visible}
  990. onOk={this.visitOk}
  991. onCancel={this.visitCancel}
  992. >
  993. <Form
  994. layout="horizontal"
  995. onSubmit={this.handleSubmit}
  996. id="demand-form"
  997. style={{ paddingBottom: "40px" }}
  998. >
  999. <Spin spinning={this.state.loading}>
  1000. <div className="clearfix">
  1001. <FormItem
  1002. className="half-item"
  1003. {...formItemLayout}
  1004. label="订单编号"
  1005. >
  1006. <span>{this.state.orderNo}</span>
  1007. </FormItem>
  1008. <FormItem
  1009. className="half-item"
  1010. {...formItemLayout}
  1011. label="合同编号"
  1012. >
  1013. <span>{this.state.contractNo}</span>
  1014. </FormItem>
  1015. <FormItem
  1016. className="half-item"
  1017. {...formItemLayout}
  1018. label="客户名称"
  1019. >
  1020. <span>{this.state.userName}</span>
  1021. </FormItem>
  1022. <FormItem
  1023. className="half-item"
  1024. {...formItemLayout}
  1025. label="合同签订时间"
  1026. >
  1027. <span>{this.state.signDate}</span>
  1028. </FormItem>
  1029. <FormItem
  1030. className="half-item"
  1031. {...formItemLayout}
  1032. label="流程状态"
  1033. >
  1034. <span>{getProcessStatus(this.state.processStatus)}</span>
  1035. </FormItem>
  1036. <FormItem
  1037. className="half-item"
  1038. {...formItemLayout}
  1039. label="结算状态"
  1040. >
  1041. <span>
  1042. {getLiquidationStatus(this.state.liquidationStatus)}
  1043. </span>
  1044. </FormItem>
  1045. <FormItem
  1046. className="half-item"
  1047. {...formItemLayout}
  1048. label="企业联系人"
  1049. >
  1050. <span>{this.state.contacts}</span>
  1051. </FormItem>
  1052. <FormItem
  1053. className="half-item"
  1054. {...formItemLayout}
  1055. label="联系人电话"
  1056. >
  1057. <span>{this.state.contactMobile}</span>
  1058. </FormItem>
  1059. <FormItem
  1060. className="half-item"
  1061. {...formItemLayout}
  1062. label="企业法人"
  1063. >
  1064. <span>{this.state.legalPerson}</span>
  1065. </FormItem>
  1066. <FormItem
  1067. className="half-item"
  1068. {...formItemLayout}
  1069. label="法人电话"
  1070. >
  1071. <span>{this.state.legalPersonTel}</span>
  1072. </FormItem>
  1073. <FormItem
  1074. className="half-item"
  1075. {...formItemLayout}
  1076. label="签单金额(万元)"
  1077. >
  1078. <span>{this.state.totalAmount}</span>
  1079. </FormItem>
  1080. <FormItem
  1081. className="half-item"
  1082. {...formItemLayout}
  1083. label="首付金额(万元)"
  1084. >
  1085. <span>{this.state.firstAmount}</span>
  1086. </FormItem>
  1087. <FormItem
  1088. className="half-item"
  1089. {...formItemLayout}
  1090. label="特批立项"
  1091. >
  1092. <span>{getApprovedState(this.state.approval)}</span>
  1093. </FormItem>
  1094. <FormItem
  1095. className="half-item"
  1096. {...formItemLayout}
  1097. label="已收款项(万元)"
  1098. >
  1099. <span>{this.state.settlementAmount}</span>
  1100. </FormItem>
  1101. <FormItem
  1102. className="half-item"
  1103. {...formItemLayout}
  1104. label="是否外包"
  1105. >
  1106. <span>{this.state.outsource}</span>
  1107. </FormItem>
  1108. <div className="clearfix">
  1109. <FormItem
  1110. labelCol={{ span: 4 }}
  1111. wrapperCol={{ span: 16 }}
  1112. label="订单留言"
  1113. >
  1114. <span>{this.state.orderRemarks}</span>
  1115. </FormItem>
  1116. </div>
  1117. <div className="clearfix">
  1118. <FormItem
  1119. labelCol={{ span: 4 }}
  1120. wrapperCol={{ span: 18 }}
  1121. label={
  1122. <span>
  1123. <strong style={{ color: "#f00" }}>*</strong>
  1124. 合同扫描件
  1125. </span>
  1126. }
  1127. >
  1128. <PicturesWall
  1129. fileList={this.getOrgCodeUrl}
  1130. pictureUrl={this.state.orgCodeUrl}
  1131. />
  1132. <p>图片建议:要清晰。</p>
  1133. <Button
  1134. style={{
  1135. float: "right",
  1136. marginRight: "140px",
  1137. marginTop: "20px"
  1138. }}
  1139. onClick={this.getOrderLog}
  1140. >
  1141. 查看订单 日志
  1142. </Button>
  1143. </FormItem>
  1144. </div>
  1145. <div className="clearfix">
  1146. <FormItem
  1147. className="half-item"
  1148. {...formItemLayout}
  1149. label="订单负责人"
  1150. >
  1151. <span>{this.state.salesmanName}</span>
  1152. </FormItem>
  1153. <FormItem
  1154. className="half-item"
  1155. {...formItemLayout}
  1156. label="订单负责人电话"
  1157. >
  1158. <span>{this.state.salesmanMobile}</span>
  1159. </FormItem>
  1160. </div>
  1161. <div className="clearfix">
  1162. <FormItem
  1163. className="half-item"
  1164. {...formItemLayout}
  1165. label="财务负责人"
  1166. >
  1167. <span>{this.state.financeName}</span>
  1168. </FormItem>
  1169. <FormItem
  1170. className="half-item"
  1171. {...formItemLayout}
  1172. label="财务负责人电话"
  1173. >
  1174. <span>{this.state.financeMobile}</span>
  1175. </FormItem>
  1176. </div>
  1177. <div>
  1178. <span style={{ marginLeft: 20, fontSize: "18px" }}>
  1179. 催款节点
  1180. </span>
  1181. <span
  1182. style={{
  1183. display: cuiDataList.length ? "none" : "inline-block",
  1184. marginLeft: 10,
  1185. color: "red"
  1186. }}
  1187. >
  1188. 金额总计(万元): {this.state.totalCui}
  1189. </span>
  1190. </div>
  1191. <div className="clearfix">
  1192. <Spin spinning={this.state.loading}>
  1193. <Form layout="horizontal" id="demand-form">
  1194. <Table
  1195. pagination={false}
  1196. bordered
  1197. size="small"
  1198. columns={
  1199. cuiDataList.length
  1200. ? this.state.ContactsLists
  1201. : this.state.ContactsListsNew
  1202. }
  1203. dataSource={
  1204. cuiDataList.length
  1205. ? this.state.contactList
  1206. : this.state.contactListNew
  1207. }
  1208. />
  1209. <Col
  1210. span={24}
  1211. offset={9}
  1212. style={{ marginTop: "15px" }}
  1213. ></Col>
  1214. </Form>
  1215. </Spin>
  1216. </div>
  1217. <div>
  1218. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  1219. 项目业务
  1220. </span>
  1221. {this.state.processStatus == 0 ? (
  1222. <Button
  1223. type="primary"
  1224. onClick={this.addDetailed}
  1225. style={{
  1226. float: "right",
  1227. marginRight: "50px",
  1228. marginBottom: "15px"
  1229. }}
  1230. >
  1231. 添加项目明细
  1232. </Button>
  1233. ) : (
  1234. ""
  1235. )}
  1236. </div>
  1237. <div className="patent-table">
  1238. <Spin spinning={this.state.loading}>
  1239. <Table
  1240. columns={this.state.columnsX}
  1241. dataSource={this.state.dataSourceX}
  1242. pagination={this.state.paginations}
  1243. onRowClick={this.tableRowClickX}
  1244. />
  1245. </Spin>
  1246. </div>
  1247. <div className="addSave" style={{ marginTop: "15px" }}>
  1248. <Button
  1249. className="cancel"
  1250. type="primary"
  1251. onClick={this.examOk}
  1252. style={{ marginLeft: "200px" }}
  1253. htmlType="submit"
  1254. >
  1255. 通过
  1256. </Button>
  1257. <Button
  1258. className="cancel"
  1259. type="primary"
  1260. onClick={this.examNo}
  1261. style={{ marginLeft: "50px" }}
  1262. htmlType="submit"
  1263. >
  1264. 驳回
  1265. </Button>
  1266. <Button
  1267. className="cancel"
  1268. type="ghost"
  1269. onClick={this.visitCancel}
  1270. style={{ marginLeft: "50px" }}
  1271. >
  1272. 取消
  1273. </Button>
  1274. </div>
  1275. </div>
  1276. </Spin>
  1277. </Form>
  1278. </Modal>
  1279. <Modal
  1280. maskClosable={false}
  1281. visible={this.state.addnextVisible}
  1282. onOk={this.nextCancel}
  1283. onCancel={this.nextCancel}
  1284. width="800px"
  1285. title={"项目任务详情"}
  1286. footer=""
  1287. className="admin-desc-content"
  1288. >
  1289. <Form layout="horizontal" id="demand-form">
  1290. <Spin spinning={this.state.loading}>
  1291. <div className="clearfix">
  1292. <FormItem
  1293. className="half-item"
  1294. {...formItemLayout}
  1295. label="项目名称"
  1296. >
  1297. <span>{this.state.commodityName}</span>
  1298. </FormItem>
  1299. <FormItem
  1300. className="half-item"
  1301. {...formItemLayout}
  1302. label="项目数量"
  1303. >
  1304. <span>{this.state.commodityQuantity}</span>
  1305. </FormItem>
  1306. <FormItem
  1307. className="half-item"
  1308. {...formItemLayout}
  1309. label="金额(万元)"
  1310. >
  1311. <span>{this.state.commodityPrice}</span>
  1312. </FormItem>
  1313. <FormItem
  1314. className="half-item"
  1315. {...formItemLayout}
  1316. label="主要项目"
  1317. >
  1318. <span>{getboutique(this.state.main)}</span>
  1319. </FormItem>
  1320. <div className="clearfix">
  1321. <FormItem
  1322. labelCol={{ span: 4 }}
  1323. wrapperCol={{ span: 16 }}
  1324. label="服务说明"
  1325. >
  1326. <span>{this.state.taskComment}</span>
  1327. </FormItem>
  1328. </div>
  1329. </div>
  1330. </Spin>
  1331. </Form>
  1332. </Modal>
  1333. <Modal
  1334. maskClosable={false}
  1335. visible={this.state.noVisible}
  1336. onOk={this.noCancel}
  1337. onCancel={this.noCancel}
  1338. width="400px"
  1339. title={"拒绝理由"}
  1340. footer=""
  1341. className="admin-desc-content"
  1342. >
  1343. <Form layout="horizontal" id="demand-form">
  1344. <Spin spinning={this.state.loading}>
  1345. <div className="clearfix">
  1346. <FormItem
  1347. labelCol={{ span: 4 }}
  1348. wrapperCol={{ span: 16 }}
  1349. label="拒绝理由"
  1350. >
  1351. <Input
  1352. type="textarea"
  1353. placeholder="请输入拒绝理由"
  1354. rows={4}
  1355. value={this.state.reason}
  1356. onChange={e => {
  1357. this.setState({ reason: e.target.value });
  1358. }}
  1359. />
  1360. </FormItem>
  1361. </div>
  1362. <div className="clearfix">
  1363. <Button
  1364. className="cancel"
  1365. type="primary"
  1366. onClick={this.examOks}
  1367. style={{ marginLeft: "50px" }}
  1368. htmlType="submit"
  1369. >
  1370. 确定
  1371. </Button>
  1372. <Button
  1373. className="cancel"
  1374. type="ghost"
  1375. onClick={this.noCancel}
  1376. style={{ marginLeft: "50px" }}
  1377. >
  1378. 取消
  1379. </Button>
  1380. </div>
  1381. </Spin>
  1382. </Form>
  1383. </Modal>
  1384. <Modal
  1385. visible={this.state.rizhivisible}
  1386. className="admin-desc-content"
  1387. width="800px"
  1388. maskClosable={false}
  1389. title="订单日志"
  1390. footer={null}
  1391. onCancel={this.closeOrderLog}
  1392. >
  1393. <div className="patent-table">
  1394. <Spin spinning={this.state.loading}>
  1395. <Table
  1396. columns={this.state.columnsrizhi}
  1397. dataSource={this.state.dataSourcerizhi}
  1398. pagination={false}
  1399. />
  1400. </Spin>
  1401. </div>
  1402. </Modal>
  1403. </div>
  1404. </div>
  1405. );
  1406. }
  1407. })
  1408. );
  1409. export default IntentionCustomer;