reject.jsx 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680
  1. import React from 'react';
  2. import { Icon, Button, AutoComplete,Input, Select, Spin, Popconfirm, Table, message,DatePicker, Upload, Form ,Modal,Col} from 'antd';
  3. import $ from 'jquery/src/ajax';
  4. import moment from 'moment';
  5. import {boutique ,tepi,jiedian} from '@/dataDic.js';
  6. import {
  7. getLiquidationStatus,
  8. getProcessStatus,
  9. splitUrl,
  10. getCuikuan,
  11. moneyVerify,
  12. ShowModal
  13. } from "@/tools.js";
  14. import './customer.less';
  15. import ShowModalDiv from "@/showModal.jsx"
  16. import OrderRiZi from "@/orderRiZi.jsx";
  17. import { cuiJieDian } from "@/dataDic.js";
  18. //图片组件
  19. const PicturesWall = React.createClass({
  20. getInitialState() {
  21. return {
  22. previewVisible: false,
  23. previewImage: '',
  24. fileList: [],
  25. }
  26. },
  27. handleCancel() {
  28. this.setState({
  29. previewVisible: false
  30. })
  31. },
  32. handlePreview(file) {
  33. this.setState({
  34. previewImage: file.url || file.thumbUrl,
  35. previewVisible: true,
  36. });
  37. },
  38. handleChange(info) {
  39. let fileList = info.fileList;
  40. this.setState({
  41. fileList
  42. });
  43. this.props.fileList(fileList);
  44. },
  45. componentWillReceiveProps(nextProps) {
  46. this.state.fileList = nextProps.pictureUrl;
  47. this.state.pojectApplicationUrl = undefined;
  48. },
  49. render() {
  50. const {
  51. previewVisible,
  52. previewImage,
  53. fileList
  54. } = this.state;
  55. const uploadButton = (
  56. <div>
  57. <Icon type="plus" />
  58. <div className="ant-upload-text">点击上传</div>
  59. </div>
  60. );
  61. return(
  62. <div style={{display:"inline-block"}}>
  63. <Upload
  64. action={globalConfig.context + "/api/admin/customer/uploadCustomerImg"}
  65. data={{ 'sign': '' }}
  66. listType="picture-card"
  67. fileList={fileList}
  68. onPreview={this.handlePreview}
  69. onChange={this.handleChange} >
  70. {fileList.length >= 18 ? null : uploadButton}
  71. </Upload>
  72. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  73. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  74. </Modal>
  75. </div>
  76. );
  77. }
  78. });
  79. const IntentionCustomer = Form.create()(
  80. React.createClass({
  81. loadData(pageNo) {
  82. this.setState({
  83. visitModul: false,
  84. loading: true,
  85. ispage: pageNo,
  86. modalVisible: false
  87. });
  88. $.ajax({
  89. method: "get",
  90. dataType: "json",
  91. crossDomain: false,
  92. url: globalConfig.context + "/api/admin/newOrder/orderNewList",
  93. data: {
  94. pageNo: pageNo || 1,
  95. pageSize: this.state.pagination.pageSize,
  96. specially: 2, //审核列表
  97. name: this.state.customerName, //名称
  98. orderNo: this.state.orderNoSearch, //订单编号
  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. initiateName: thisdata.initiateName, //驳回人
  126. reason: thisdata.reason, //驳回信息
  127. backDate: thisdata.backDate, //驳回日期
  128. backId: thisdata.backId //驳回编号
  129. });
  130. }
  131. this.state.pagination.total = data.data.totalCount;
  132. this.state.pagination.current = data.data.pageNo;
  133. }
  134. if (data.data && data.data.list && !data.data.list.length) {
  135. this.state.pagination.total = 0;
  136. }
  137. this.setState({
  138. dataSource: theArr,
  139. pageNo: pageNo,
  140. pagination: this.state.pagination,
  141. selectedRowKeys: []
  142. });
  143. }.bind(this)
  144. }).always(
  145. function() {
  146. this.setState({
  147. loading: false
  148. });
  149. }.bind(this)
  150. );
  151. },
  152. getInitialState() {
  153. return {
  154. page: 1,
  155. releaseDate: [],
  156. selectedRowKeys: [],
  157. orgCodeUrl: [],
  158. customerArr: [],
  159. pagination: {
  160. defaultCurrent: 1,
  161. defaultPageSize: 10,
  162. showQuickJumper: true,
  163. pageSize: 10,
  164. onChange: function(page) {
  165. this.loadData(page);
  166. }.bind(this),
  167. showTotal: function(total) {
  168. return "共" + total + "条数据";
  169. }
  170. },
  171. columns: [
  172. {
  173. title: "驳回编号",
  174. dataIndex: "backId",
  175. key: "backId"
  176. },
  177. {
  178. title: "驳回日期",
  179. dataIndex: "backDate",
  180. key: "backDate"
  181. },
  182. {
  183. title: "下单时间",
  184. dataIndex: "createDate",
  185. key: "createDate"
  186. },
  187. {
  188. title: "订单编号",
  189. dataIndex: "orderNo",
  190. key: "orderNo"
  191. },
  192. {
  193. title: "客户名称",
  194. dataIndex: "userName",
  195. key: "userName",
  196. render: text => {
  197. return text && text.length > 9 ? text.substr(0, 9) + "..." : text;
  198. }
  199. },
  200. {
  201. title: "驳回人",
  202. dataIndex: "initiateName",
  203. key: "initiateName"
  204. },
  205. {
  206. title: "驳回原因",
  207. dataIndex: "reason",
  208. key: "reason",
  209. render: text => {
  210. return text && text.length > 24
  211. ? text.substr(0, 24) + "..."
  212. : text;
  213. }
  214. }
  215. ],
  216. columnsrizhi: [
  217. {
  218. title: "流程",
  219. dataIndex: "processName",
  220. key: "processName"
  221. },
  222. {
  223. title: "操作人",
  224. dataIndex: "adminName",
  225. key: "adminName"
  226. },
  227. {
  228. title: "时间",
  229. dataIndex: "createDate",
  230. key: "createDate"
  231. }
  232. ],
  233. data: [],
  234. dataSource: [],
  235. columnsX: [
  236. {
  237. title: "业务项目名称",
  238. dataIndex: "commodityName",
  239. key: "commodityName"
  240. },
  241. {
  242. title: "项目类别",
  243. dataIndex: "cname",
  244. key: "cname"
  245. },
  246. {
  247. title: "项目数量",
  248. dataIndex: "commodityQuantity",
  249. key: "commodityQuantity"
  250. },
  251. {
  252. title: "金额(万元)",
  253. dataIndex: "commodityPrice",
  254. key: "commodityPrice"
  255. },
  256. {
  257. title: "负责人",
  258. dataIndex: "contacts",
  259. key: "contacts"
  260. },
  261. {
  262. title: "负责人电话",
  263. dataIndex: "contactsMobile",
  264. key: "contactsMobile"
  265. },
  266. {
  267. title: "主要项目",
  268. dataIndex: "main",
  269. key: "main",
  270. render: text => {
  271. return text ? "是" : "否";
  272. }
  273. },
  274. {
  275. title: "项目说明",
  276. dataIndex: "taskComment",
  277. key: "taskComment",
  278. render: text => {
  279. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  280. }
  281. },
  282. {
  283. title: "操作",
  284. dataIndex: "ABC",
  285. key: "ABC",
  286. render: (text, record) => {
  287. return (
  288. <div>
  289. {this.state.processStatus == 0 ? (
  290. <Popconfirm
  291. title="是否删除?"
  292. onConfirm={() => {
  293. this.delectRow(record);
  294. }}
  295. okText="是"
  296. cancelText="否"
  297. >
  298. <Button
  299. onClick={e => {
  300. e.stopPropagation();
  301. }}
  302. type="danger"
  303. >
  304. 删除
  305. </Button>
  306. </Popconfirm>
  307. ) : (
  308. ""
  309. )}
  310. </div>
  311. );
  312. }
  313. }
  314. ],
  315. dataSourceX: [],
  316. ContactsListsNew: [
  317. {
  318. title: "项目名称",
  319. dataIndex: "commodityName",
  320. key: "commodityName",
  321. render: (text, record, index) => {
  322. let dataArr = this.state.dataSourceX || [];
  323. if (text) {
  324. return <span>{text}</span>;
  325. }
  326. return (
  327. <Select
  328. placeholder="请选择名称"
  329. style={{ width: "150px" }}
  330. disabled={
  331. this.state.getLoad && record.sortName ? true : false
  332. }
  333. onChange={e => {
  334. record.sortName = e;
  335. dataArr.forEach(item => {
  336. if (item.commodityName == record.sortName) {
  337. record.cname = item.cname;
  338. record.tid = item.id;
  339. record.isSave = true;
  340. record.sort = item.sort;
  341. console.log(record);
  342. cuiJieDian.forEach(item => {
  343. if (item.value == record.sort) {
  344. record.arr = item.children;
  345. let yearFlag = true;
  346. if (record.sort == 6) {
  347. yearFlag = false;
  348. }
  349. this.setState({
  350. getLoad: true,
  351. yearFlag
  352. });
  353. }
  354. });
  355. }
  356. });
  357. console.log(e);
  358. }}
  359. >
  360. {dataArr.map(item => {
  361. return (
  362. <Select.Option key={item.id} value={item.commodityName}>
  363. {item.commodityName}
  364. </Select.Option>
  365. );
  366. })}
  367. </Select>
  368. );
  369. }
  370. },
  371. {
  372. title: "项目分类",
  373. dataIndex: "projectType",
  374. key: "projectType",
  375. render: (text, record) => {
  376. if (text) {
  377. let arr = this.state.dataSourceX || [];
  378. let str = "";
  379. for (let i = 0; i < arr.length; i++) {
  380. if (this.state.dataSourceX[i].sort == text) {
  381. str = this.state.dataSourceX[i].cname;
  382. return <span>{str}</span>;
  383. }
  384. }
  385. }
  386. if (this.state.getLoad) {
  387. return (
  388. <Select
  389. style={{ width: "150px" }}
  390. placeholder="请选择分类"
  391. value={record.cname}
  392. >
  393. <Select.Option key={record.sort} value={record.cname}>
  394. {record.cname}
  395. </Select.Option>
  396. </Select>
  397. );
  398. } else {
  399. return (
  400. <Select style={{ width: "150px" }} placeholder="请选择分类">
  401. <Select.Option key={record.sort} value={record.cname}>
  402. {record.cname}
  403. </Select.Option>
  404. </Select>
  405. );
  406. }
  407. }
  408. },
  409. {
  410. title: "催款科目",
  411. dataIndex: "dunTypeName",
  412. key: "dunTypeName",
  413. render: (text, record) => {
  414. if (text) {
  415. return <span>{text}</span>;
  416. }
  417. if (this.state.getLoad) {
  418. let arr = record.arr || [];
  419. console.log("arrrr", arr);
  420. return (
  421. <Select
  422. style={{ width: "150px" }}
  423. placeholder="请选择分类"
  424. onChange={e => {
  425. record.dunType = e;
  426. if (e != 1) {
  427. this.setState({
  428. timeFlag: true
  429. });
  430. } else {
  431. this.setState({
  432. timeFlag: false
  433. });
  434. }
  435. if (e == 1 && record.sort == 6) {
  436. this.setState({
  437. yearFlag: true
  438. });
  439. } else if (e != 1 && record.sort == 6) {
  440. this.setState({
  441. yearFlag: false
  442. });
  443. }
  444. if (record.sort == 3 && e == 3) {
  445. this.setState({
  446. boFlag: true
  447. });
  448. } else {
  449. this.setState({
  450. boFlag: false
  451. });
  452. }
  453. console.log(e);
  454. }}
  455. >
  456. {arr.map(item => {
  457. record;
  458. return (
  459. <Select.Option key={item.value} value={item.value}>
  460. {item.key}
  461. </Select.Option>
  462. );
  463. })}
  464. </Select>
  465. );
  466. } else {
  467. return (
  468. <Select style={{ width: "150px" }} placeholder="请选择分类">
  469. <Select.Option
  470. key={0}
  471. value={"请选择上一项"}
  472. ></Select.Option>
  473. </Select>
  474. );
  475. }
  476. }
  477. },
  478. {
  479. title: "首付时间(特批需选择时间)",
  480. dataIndex: "waitDay",
  481. key: "waitDay",
  482. render: (text, record) => {
  483. if (record.dunTypeName) {
  484. if (!text) {
  485. var str = "";
  486. } else {
  487. var str = text + "天";
  488. }
  489. return <span>{str}</span>;
  490. }
  491. return (
  492. <Select
  493. placeholder="请选择时间"
  494. style={{ width: "150px" }}
  495. disabled={
  496. this.state.approval != 0 && !this.state.timeFlag
  497. ? false
  498. : true
  499. }
  500. onChange={e => {
  501. console.log("ee", e);
  502. record.waitDay = e;
  503. console.log("time", record);
  504. }}
  505. >
  506. <Select.Option key={0}>当天</Select.Option>
  507. <Select.Option key={3}>3天</Select.Option>
  508. <Select.Option key={5}>5天</Select.Option>
  509. <Select.Option key={7}>7天</Select.Option>
  510. <Select.Option key={15}>15天</Select.Option>
  511. </Select>
  512. );
  513. }
  514. },
  515. {
  516. title: "金额(万元)",
  517. dataIndex: "money",
  518. key: "money",
  519. render: (text, record) => {
  520. if (record.dunTypeName) {
  521. if (record.appropriationRatio && !record.money) {
  522. return <span>{record.appropriationRatio}(拨款比例)</span>;
  523. } else if (record.appropriationRatio && record.money) {
  524. return (
  525. <span>
  526. {text}(比例:{record.appropriationRatio})
  527. </span>
  528. );
  529. } else {
  530. return <span>{text}</span>;
  531. }
  532. }
  533. if (this.state.boFlag) {
  534. return (
  535. <div>
  536. <div style={{ width: 70, float: "left", marginRight: 5 }}>
  537. <Select
  538. placeholder="选择"
  539. defaultValue={"金额"}
  540. onChange={e => {
  541. record.boStatus = e;
  542. }}
  543. >
  544. <Select.Option key={true}>比例</Select.Option>
  545. <Select.Option key={false}>金额</Select.Option>
  546. </Select>
  547. </div>
  548. <div style={{ float: "right" }}>
  549. <Input
  550. value={record.money}
  551. placeholder="请输入金额(必填项)"
  552. key={record.id}
  553. required="required"
  554. onChange={e => {
  555. record.money = e.target.value;
  556. this.setState({
  557. contactList: this.state.contactList
  558. });
  559. }}
  560. style={{ width: "120px" }}
  561. />
  562. </div>
  563. </div>
  564. );
  565. } else {
  566. return (
  567. <div>
  568. <Input
  569. value={record.money}
  570. placeholder="请输入金额(必填项)"
  571. key={record.id}
  572. required="required"
  573. onChange={e => {
  574. record.money = e.target.value;
  575. this.setState({ contactList: this.state.contactList });
  576. }}
  577. style={{ width: "120px" }}
  578. />
  579. </div>
  580. );
  581. }
  582. }
  583. },
  584. {
  585. title: "服务年限",
  586. dataIndex: "startDate",
  587. key: "startDate",
  588. render: (text, record) => {
  589. if (record.dunTypeName) {
  590. return <span>{text}</span>;
  591. }
  592. return (
  593. <Select
  594. placeholder="请选择年限"
  595. style={{ width: "150px" }}
  596. disabled={this.state.yearFlag ? true : false}
  597. onChange={e => {
  598. console.log("ee", e);
  599. record.effectiveCount = e;
  600. console.log("year", record);
  601. }}
  602. >
  603. {/* <Select.Option key={null}>无</Select.Option> */}
  604. <Select.Option key={1}>一年</Select.Option>
  605. <Select.Option key={3}>两年</Select.Option>
  606. <Select.Option key={5}>三年</Select.Option>
  607. <Select.Option key={7}>四年</Select.Option>
  608. <Select.Option key={9}>五年</Select.Option>
  609. </Select>
  610. );
  611. }
  612. },
  613. {
  614. title: "催款状态",
  615. dataIndex: "status",
  616. key: "status",
  617. render: text => {
  618. return <span>{text == 1 ? "已启动" : "未启动"}</span>;
  619. }
  620. },
  621. {
  622. title: "操作",
  623. dataIndex: "dels",
  624. key: "dels",
  625. render: (text, record, index) => {
  626. return (
  627. <div>
  628. {this.state.processStatus == 0 ? (
  629. <Popconfirm
  630. title="是否删除?"
  631. onConfirm={() => {
  632. this.confirmDeletNew(record);
  633. }}
  634. okText="删除"
  635. cancelText="不删除"
  636. >
  637. <Button
  638. style={{
  639. marginRight: "10px",
  640. color: "#ffffff",
  641. background: "#f00",
  642. border: "none"
  643. }}
  644. >
  645. 删除
  646. </Button>
  647. </Popconfirm>
  648. ) : (
  649. ""
  650. )}
  651. {record.isSave ? (
  652. <Button
  653. type="primary"
  654. onClick={e => {
  655. this.contactSaveNew(record);
  656. this.setState({
  657. addFlag: false
  658. });
  659. }}
  660. >
  661. 保存
  662. </Button>
  663. ) : (
  664. ""
  665. )}
  666. </div>
  667. );
  668. }
  669. }
  670. ],
  671. ContactsLists: [
  672. {
  673. title: "催款科目",
  674. dataIndex: "dunSubject",
  675. key: "dunSubject",
  676. render: (text, record) => {
  677. return (
  678. <Select
  679. placeholder="请选择催款科目"
  680. value={record.dunSubject}
  681. disabled
  682. style={{ width: "150px" }}
  683. onChange={e => {
  684. record.dunSubject = e;
  685. this.setState({ contactList: this.state.contactList });
  686. }}
  687. >
  688. {jiedian.map(function(item) {
  689. return (
  690. <Select.Option key={item.value}>{item.key}</Select.Option>
  691. );
  692. })}
  693. </Select>
  694. );
  695. }
  696. },
  697. {
  698. title: "金额(万元)",
  699. dataIndex: "money",
  700. key: "money",
  701. render: (text, record) => {
  702. return (
  703. <Input
  704. value={record.money}
  705. disabled
  706. placeholder="请输入金额(必填项)"
  707. key={record.id}
  708. required="required"
  709. onChange={e => {
  710. record.money = e.target.value;
  711. this.setState({ contactList: this.state.contactList });
  712. }}
  713. style={{ width: "120px" }}
  714. />
  715. );
  716. }
  717. },
  718. {
  719. title: "催款状态",
  720. dataIndex: "dunStatus",
  721. key: "dunStatus",
  722. render: text => {
  723. return getCuikuan(text);
  724. }
  725. },
  726. {
  727. title: "操作",
  728. dataIndex: "dels",
  729. key: "dels",
  730. render: (text, record) => {
  731. return (
  732. <div>
  733. {
  734. <Popconfirm
  735. title="是否删除?"
  736. onConfirm={() => {
  737. this.confirmDelet(record.key);
  738. }}
  739. okText="删除"
  740. cancelText="不删除"
  741. >
  742. <Button
  743. style={{
  744. marginRight: "10px",
  745. color: "#ffffff",
  746. background: "#f00",
  747. border: "none"
  748. }}
  749. >
  750. 删除
  751. </Button>
  752. </Popconfirm>
  753. }
  754. {record.id ? (
  755. ""
  756. ) : (
  757. <Button type="primary" onClick={this.contactSave} disabled>
  758. 保存
  759. </Button>
  760. )}
  761. </div>
  762. );
  763. }
  764. }
  765. ]
  766. };
  767. },
  768. //删除
  769. delectRow(record) {
  770. this.setState({
  771. loading: true
  772. });
  773. $.ajax({
  774. method: "post",
  775. dataType: "json",
  776. crossDomain: false,
  777. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  778. data: {
  779. id: record.id
  780. }
  781. }).done(
  782. function(data) {
  783. if (!data.error.length) {
  784. message.success("删除成功!");
  785. this.setState({
  786. loading: false
  787. });
  788. this.xiangmu(this.state.orderNo);
  789. this.loadData();
  790. } else {
  791. message.warning(data.error[0].message);
  792. }
  793. }.bind(this)
  794. );
  795. },
  796. //页面加载函数
  797. componentWillMount() {
  798. this.loadData();
  799. },
  800. //整行点击
  801. tableRowClick(record) {
  802. this.setState({
  803. visible: true
  804. });
  805. this.xiangqing(record.orderNo);
  806. this.xiangmu(record.orderNo);
  807. this.jiedian(record.orderNo);
  808. this.jiedianNew(record.orderNo);
  809. this.departmentList();
  810. },
  811. //点击打卡项目详情
  812. tableRowClickX(record) {
  813. this.setState({
  814. jid: record.id, //项目ID
  815. kid: record.commodityId, //商品ID
  816. commodityName: record.commodityName, //金额
  817. commodityPrice: record.commodityPrice, //金额
  818. commodityQuantity: record.commodityQuantity, //数量
  819. taskComment: record.taskComment, //备注
  820. main: record.main.toString(), //是否为主要
  821. addnextVisible: true,
  822. addState: 0
  823. });
  824. },
  825. //项目详情关闭
  826. nextCancel() {
  827. this.setState({
  828. addnextVisible: false
  829. });
  830. },
  831. //订单详情
  832. xiangqing(orderNos) {
  833. $.ajax({
  834. method: "get",
  835. dataType: "json",
  836. crossDomain: false,
  837. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  838. data: {
  839. orderNo: orderNos
  840. },
  841. success: function(data) {
  842. if (data.error.length || data.data.list == "") {
  843. if (data.error && data.error.length) {
  844. message.warning(data.error[0].message);
  845. }
  846. } else {
  847. let thisdata = data.data;
  848. if (thisdata.approval == 2) {
  849. thisdata.approval = "特批通过";
  850. } else if (thisdata.approval == 3) {
  851. thisdata.approval = "特批驳回";
  852. }
  853. this.setState({
  854. id: thisdata.id,
  855. kehuId: thisdata.buyerId,
  856. orderNo: thisdata.orderNo, //订单编号
  857. contractNo: thisdata.contractNo, //合同编号
  858. userName: thisdata.userName, //客户名称
  859. signDate: thisdata.signDate, //签单时间
  860. processStatus: thisdata.processStatus, //流程状态
  861. liquidationStatus: thisdata.liquidationStatus, //结算状态
  862. contacts: thisdata.contacts, //企业联系人
  863. contactMobile: thisdata.contactMobile, //联系人电话
  864. legalPerson: thisdata.legalPerson, //法人
  865. legalPersonTel: thisdata.legalPersonTel, //法人电话
  866. firstAmount: thisdata.firstAmount + "", //签单金额
  867. totalAmount: thisdata.totalAmount + "", //首付金额
  868. settlementAmount: thisdata.settlementAmount, //已收款项
  869. orderRemarks: thisdata.orderRemarks, //订单留言
  870. orgCodeUrl: thisdata.contractPictureUrl
  871. ? splitUrl(
  872. thisdata.contractPictureUrl,
  873. ",",
  874. globalConfig.avatarHost + "/upload"
  875. )
  876. : [], //图片地址
  877. salesmanName: thisdata.salesmanName, //营销员名称
  878. salesmanMobile: thisdata.salesmanMobile, //营销员电话
  879. oldSalesmanName: thisdata.oldSalesmanName, //营销员名称
  880. oldSalesmanMobile: thisdata.oldSalesmanMobile, //营销员电话
  881. financeName: thisdata.financeName, //财务名称
  882. financeMobile: thisdata.financeMobile, //财务电话
  883. nowFinance: thisdata.nowFinance, //财务名称
  884. nowFinanceMobile: thisdata.nowFinanceMobile, //财务电话
  885. initiateName: thisdata.initiateName, //驳回人
  886. backDate: thisdata.backDate, //驳回时间
  887. reason: thisdata.reason, //驳回原因
  888. approval: thisdata.approval.toString(), //特批状态
  889. organizationSearch: thisdata.orderDep,
  890. //approval:thisdata.approval==0?thisdata.approval.toString():thisdata.approval,//特批状态
  891. outsource: thisdata.outsource == 0 ? "否" : "是"
  892. });
  893. }
  894. }.bind(this)
  895. }).always(
  896. function() {
  897. this.setState({
  898. loading: false
  899. });
  900. }.bind(this)
  901. );
  902. },
  903. //项目列表
  904. xiangmu(orderNos) {
  905. $.ajax({
  906. method: "get",
  907. dataType: "json",
  908. crossDomain: false,
  909. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  910. data: {
  911. orderNo: orderNos
  912. },
  913. success: function(data) {
  914. let theArr = [];
  915. if (data.error.length || data.data.list == "") {
  916. if (data.error && data.error.length) {
  917. message.warning(data.error[0].message);
  918. }
  919. } else {
  920. for (let i = 0; i < data.data.length; i++) {
  921. let thisdata = data.data[i];
  922. theArr.push({
  923. key: i,
  924. id: thisdata.id,
  925. orderNo: thisdata.orderNo, //订单编号
  926. commodityId: thisdata.commodityId, //项目ID
  927. commodityName: thisdata.commodityName, //项目名称
  928. cname: thisdata.cname, //项目类别
  929. commodityPrice: thisdata.commodityPrice, //项目价格
  930. commodityQuantity: thisdata.commodityQuantity, //项目数量
  931. main: thisdata.main, //是否为主要任务
  932. taskComment: thisdata.taskComment, //任务说明
  933. contacts: thisdata.contacts, //联系人
  934. contactsMobile: thisdata.contactsMobile, //联系人电话
  935. sort: thisdata.cSort
  936. });
  937. }
  938. }
  939. this.setState({
  940. dataSourceX: theArr,
  941. paginations: false
  942. });
  943. }.bind(this)
  944. }).always(
  945. function() {
  946. this.setState({
  947. loading: false
  948. });
  949. }.bind(this)
  950. );
  951. },
  952. //节点列表
  953. jiedian(orderNos) {
  954. $.ajax({
  955. method: "get",
  956. dataType: "json",
  957. crossDomain: false,
  958. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  959. data: {
  960. orderNo: orderNos
  961. },
  962. success: function(data) {
  963. let theArr = [];
  964. let thisData = [];
  965. if (data.error.length || data.data.list == "") {
  966. if (data.error && data.error.length) {
  967. message.warning(data.error[0].message);
  968. }
  969. } else {
  970. for (let i = 0; i < data.data.length; i++) {
  971. thisData = data.data[i];
  972. theArr.push({
  973. key: i,
  974. dunSubject: thisData.dunSubject
  975. ? thisData.dunSubject.toString()
  976. : "", //催款科目
  977. id: thisData.id, //节点Id
  978. money: thisData.money, //催款金额
  979. dunStatus: thisData.dunStatus, //催款状态
  980. orderNo: thisData.orderNo
  981. });
  982. }
  983. this.setState({
  984. contactList: theArr
  985. });
  986. }
  987. }.bind(this)
  988. }).always(
  989. function() {
  990. this.setState({
  991. loading: false
  992. });
  993. }.bind(this)
  994. );
  995. },
  996. //查看催款节点
  997. jiedianNew(orderNos) {
  998. $.ajax({
  999. method: "get",
  1000. dataType: "json",
  1001. crossDomain: false,
  1002. url:
  1003. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  1004. data: {
  1005. orderNo: orderNos
  1006. },
  1007. success: function(data) {
  1008. let theArr = [];
  1009. let thisData = [];
  1010. if (!thisData) {
  1011. if (data.error && data.error.length) {
  1012. message.warning(data.error[0].message);
  1013. }
  1014. thisData = {};
  1015. } else {
  1016. let arr = data.data || [];
  1017. for (let i = 0; i < arr.length; i++) {
  1018. thisData = arr[i];
  1019. theArr.push({
  1020. key: i,
  1021. dunSubject: thisData.dunSubject
  1022. ? thisData.dunSubject.toString()
  1023. : "", //催款科目
  1024. id: thisData.id, //节点Id
  1025. money: thisData.money, //催款金额
  1026. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  1027. commodityName: thisData.commodityName,
  1028. projectType: thisData.projectType,
  1029. dunTypeName: thisData.dunTypeName,
  1030. status: thisData.status,
  1031. waitDay: thisData.waitDay,
  1032. effectiveCount: thisData.effectiveCount,
  1033. startDate: thisData.startDate,
  1034. dunType: thisData.dunType,
  1035. appropriationRatio: thisData.appropriationRatio
  1036. });
  1037. }
  1038. this.setState({
  1039. contactListNew: theArr
  1040. });
  1041. }
  1042. }.bind(this)
  1043. }).always(
  1044. function() {
  1045. this.setState({
  1046. loading: false
  1047. });
  1048. }.bind(this)
  1049. );
  1050. },
  1051. //催款节点保存
  1052. contactSave() {
  1053. for (let i = 0; i < this.state.contactList.length; i++) {
  1054. if (moneyVerify(this.state.contactList[i].money)) {
  1055. return;
  1056. }
  1057. }
  1058. this.setState({
  1059. loading: true
  1060. });
  1061. $.ajax({
  1062. url: globalConfig.context + "/api/admin/newOrder/createOrderDun",
  1063. method: "post",
  1064. data: {
  1065. orderNo: this.state.orderNo,
  1066. orderDun: JSON.stringify(this.state.contactList)
  1067. }
  1068. }).done(
  1069. function(data) {
  1070. this.setState({
  1071. loading: false
  1072. });
  1073. if (!data.error.length) {
  1074. message.success("保存成功!");
  1075. this.jiedian(this.state.orderNo);
  1076. } else {
  1077. message.warning(data.error[0].message);
  1078. }
  1079. }.bind(this)
  1080. );
  1081. },
  1082. //催款节点保存
  1083. contactSaveNew(record) {
  1084. if (!this.state.yearFlag) {
  1085. if (!record.effectiveCount) {
  1086. message.warning("请选择服务年限");
  1087. return;
  1088. }
  1089. } else {
  1090. record.effectiveCount = "";
  1091. }
  1092. if (record.money == "") {
  1093. message.warning("请填写金额");
  1094. return;
  1095. }
  1096. if (record.boStatus) {
  1097. if (
  1098. typeof +record.money == "number" &&
  1099. +record.money >= 0 &&
  1100. +record.money <= 1
  1101. ) {
  1102. record.appropriationRatio = record.money;
  1103. } else {
  1104. message.warning("金额比例填写错误,比例范围0~1");
  1105. return;
  1106. }
  1107. }
  1108. if (!record.dunType) {
  1109. message.warning("请选择对应科目");
  1110. return;
  1111. }
  1112. if (record.dunType != 1) {
  1113. record.waitDay = "";
  1114. }
  1115. this.setState({
  1116. loading: true
  1117. });
  1118. if (record.boStatus) {
  1119. $.ajax({
  1120. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1121. method: "post",
  1122. data: {
  1123. orderNo: record.orderNo,
  1124. tid: record.tid,
  1125. projectType: record.sort,
  1126. dunType: record.dunType,
  1127. appropriationRatio: record.appropriationRatio,
  1128. waitDay: record.waitDay,
  1129. effectiveCount: record.effectiveCount
  1130. }
  1131. }).done(
  1132. function(data) {
  1133. this.setState({
  1134. loading: false
  1135. });
  1136. if (!data.error.length) {
  1137. message.success("保存成功!");
  1138. this.setState({
  1139. cuiFlag: false,
  1140. boFlag: false
  1141. });
  1142. this.jiedianNew(record.orderNo);
  1143. } else {
  1144. message.warning(data.error[0].message);
  1145. }
  1146. }.bind(this)
  1147. );
  1148. } else {
  1149. $.ajax({
  1150. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1151. method: "post",
  1152. data: {
  1153. orderNo: record.orderNo,
  1154. tid: record.tid,
  1155. projectType: record.sort,
  1156. dunType: record.dunType,
  1157. money: record.money,
  1158. waitDay: record.waitDay,
  1159. effectiveCount: record.effectiveCount
  1160. }
  1161. }).done(
  1162. function(data) {
  1163. this.setState({
  1164. loading: false
  1165. });
  1166. if (!data.error.length) {
  1167. message.success("保存成功!");
  1168. this.setState({
  1169. cuiFlag: false,
  1170. boFlag: false
  1171. });
  1172. this.jiedianNew(record.orderNo);
  1173. } else {
  1174. message.warning(data.error[0].message);
  1175. }
  1176. }.bind(this)
  1177. );
  1178. }
  1179. },
  1180. //点击新增催款节点
  1181. addcontact() {
  1182. this.state.contactList.push({
  1183. key: this.state.contactList.length,
  1184. money: "",
  1185. dunSubject: undefined,
  1186. orderNo: this.state.orderNo,
  1187. dunTarget: this.state.kehuId
  1188. });
  1189. this.setState({
  1190. contactList: this.state.contactList
  1191. });
  1192. },
  1193. //点击新增催款节点
  1194. addcontactNew() {
  1195. this.state.contactListNew.push({
  1196. key: this.state.contactListNew.length,
  1197. money: "",
  1198. dunSubject: undefined,
  1199. orderNo: this.state.orderNo,
  1200. dunTarget: this.state.kehuId
  1201. });
  1202. this.setState({
  1203. contactListNew: this.state.contactListNew,
  1204. cuiFlag: true
  1205. });
  1206. },
  1207. //删除收款节点
  1208. confirmDelet(index) {
  1209. this.state.contactList.splice(index, 1);
  1210. this.setState({
  1211. contactList: this.state.contactList
  1212. });
  1213. this.contactSave();
  1214. },
  1215. //删除收款节点
  1216. confirmDeletNew(index) {
  1217. if (index.id) {
  1218. this.state.contactListNew.splice(index.key, 1);
  1219. this.setState({
  1220. contactListNew: this.state.contactListNew,
  1221. cuiFlag: false,
  1222. addFlag: false,
  1223. boFlag: false
  1224. });
  1225. $.ajax({
  1226. url: globalConfig.context + "/api/admin/newOrderDun/deleteDun",
  1227. method: "post",
  1228. data: {
  1229. id: index.id
  1230. }
  1231. }).done(
  1232. function(data) {
  1233. this.setState({
  1234. loading: false
  1235. });
  1236. if (!data.error.length) {
  1237. message.success("删除成功!");
  1238. this.setState({
  1239. cuiFlag: false
  1240. });
  1241. this.jiedianNew(this.state.orderNo);
  1242. } else {
  1243. message.warning(data.error[0].message);
  1244. }
  1245. }.bind(this)
  1246. );
  1247. } else {
  1248. this.state.contactListNew.splice(index.key, 1);
  1249. this.setState({
  1250. contactListNew: this.state.contactListNew,
  1251. cuiFlag: false,
  1252. addFlag: false,
  1253. boFlag: false
  1254. });
  1255. }
  1256. },
  1257. //重新提交
  1258. examOk() {
  1259. if (this.state.flag) return;
  1260. this.setState({
  1261. flag: true
  1262. });
  1263. let theorgCodeUrl = [];
  1264. if (this.state.orgCodeUrl.length) {
  1265. let picArr = [];
  1266. this.state.orgCodeUrl.map(function(item) {
  1267. if (
  1268. item.response &&
  1269. item.response.data &&
  1270. item.response.data.length
  1271. ) {
  1272. picArr.push(item.response.data);
  1273. }
  1274. });
  1275. theorgCodeUrl = picArr.join(",");
  1276. }
  1277. if (moneyVerify(this.state.totalAmount)) {
  1278. this.setState({
  1279. flag: false
  1280. });
  1281. return;
  1282. }
  1283. if (moneyVerify(this.state.firstAmount)) {
  1284. this.setState({
  1285. flag: false
  1286. });
  1287. return;
  1288. }
  1289. if (!this.state.totalAmount) {
  1290. message.warning("签单金额不能为空");
  1291. this.refs.signFirstPayment.focus();
  1292. this.setState({
  1293. flag: false
  1294. });
  1295. return false;
  1296. }
  1297. if (!this.state.firstAmount) {
  1298. message.warning("首付金额不能为空");
  1299. this.refs.signFirstPayment.focus();
  1300. this.setState({
  1301. flag: false
  1302. });
  1303. return false;
  1304. }
  1305. if (!theorgCodeUrl) {
  1306. message.warning("企业负责人不能为空");
  1307. this.refs.signFirstPayment.focus();
  1308. this.setState({
  1309. flag: false
  1310. });
  1311. return false;
  1312. }
  1313. if (
  1314. this.state.approval == "特批通过" ||
  1315. this.state.approval == "特批驳回"
  1316. ) {
  1317. message.warning("特批状态不正确,请重新填写");
  1318. this.setState({
  1319. flag: false
  1320. });
  1321. return false;
  1322. }
  1323. const arr = this.state.contactListNew || [];
  1324. for (let i = 0; i < arr.length; i++) {
  1325. if (arr[i].dunType == 1 && arr[i].waitDay && this.state.approval == 0) {
  1326. message.warning(
  1327. "非特批存在填写催款节点首付时间的情况,请删除后重新填写保存"
  1328. );
  1329. this.setState({
  1330. flag: false
  1331. });
  1332. return false;
  1333. } else if (
  1334. arr[i].dunType == 1 &&
  1335. !arr[i].waitDay &&
  1336. this.state.approval == 1
  1337. ) {
  1338. message.warning(
  1339. "特批存在首付催款节点未填写时间的情况,请删除后重新填写保存"
  1340. );
  1341. this.setState({
  1342. flag: false
  1343. });
  1344. return false;
  1345. }
  1346. if (!this.state.contactListNew[i].id) {
  1347. message.warning("请保存催款节点");
  1348. this.setState({
  1349. flag: false
  1350. });
  1351. return false;
  1352. }
  1353. }
  1354. $.ajax({
  1355. method: "post",
  1356. dataType: "json",
  1357. crossDomain: false,
  1358. url: globalConfig.context + "/api/admin/newOrder/updateServiceOrderNew",
  1359. data: {
  1360. orderNo: this.state.orderNo, //订单编号
  1361. totalAmount: this.state.totalAmount, //总金额
  1362. firstAmount: this.state.firstAmount, //首付
  1363. isSubmit: 1, //保存草稿还是提交
  1364. signDate: this.state.signDate, //签单日期
  1365. contacts: this.state.contacts, //企业负责人
  1366. contactMobile: this.state.contactMobile, //负责人联系方式
  1367. legalPerson: this.state.legalPerson, //企业法人
  1368. legalPersonTel: this.state.legalPersonTel, //企业法人联系电话
  1369. approval: this.state.approval, //特批状态
  1370. contractNo: this.state.contractNo, //合同编号
  1371. orderRemarks: this.state.orderRemarks, //订单备注
  1372. contractPictureUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  1373. orderDep: this.state.organizationSearch
  1374. },
  1375. success: function(data) {
  1376. if (data.error.length || data.data.list == "") {
  1377. if (data.error && data.error.length) {
  1378. message.warning(data.error[0].message);
  1379. this.setState({
  1380. flag: false
  1381. });
  1382. }
  1383. } else {
  1384. message.success("该订单已重新提交~");
  1385. this.setState({
  1386. visible: false,
  1387. flag: false
  1388. });
  1389. this.resets();
  1390. this.loadData();
  1391. }
  1392. }.bind(this)
  1393. }).always(
  1394. function() {
  1395. this.setState({
  1396. loading: false
  1397. });
  1398. }.bind(this)
  1399. );
  1400. },
  1401. //重新提交
  1402. examOks() {
  1403. if (this.state.flag) return;
  1404. this.setState({
  1405. flag: true
  1406. });
  1407. $.ajax({
  1408. method: "post",
  1409. dataType: "json",
  1410. crossDomain: false,
  1411. url: globalConfig.context + "/api/admin/newOrder/deleteOrderNew",
  1412. data: {
  1413. orderNo: this.state.orderNo //订单编号
  1414. },
  1415. success: function(data) {
  1416. if (data.error.length || data.data.list == "") {
  1417. if (data.error && data.error.length) {
  1418. message.warning(data.error[0].message);
  1419. }
  1420. } else {
  1421. message.success("该订单已作废~");
  1422. this.setState({
  1423. visible: false,
  1424. flag: false
  1425. });
  1426. this.resets();
  1427. this.loadData();
  1428. }
  1429. }.bind(this)
  1430. }).always(
  1431. function() {
  1432. this.setState({
  1433. loading: false
  1434. });
  1435. }.bind(this)
  1436. );
  1437. },
  1438. departmentList() {
  1439. this.setState({
  1440. loading: true
  1441. });
  1442. $.ajax({
  1443. method: "get",
  1444. dataType: "json",
  1445. crossDomain: false,
  1446. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  1447. data: {},
  1448. success: function(data) {
  1449. let thedata = data.data;
  1450. let theArr = [];
  1451. if (!thedata) {
  1452. if (data.error && data.error.length) {
  1453. message.warning(data.error[0].message);
  1454. }
  1455. thedata = {};
  1456. } else {
  1457. thedata.map(function(item, index) {
  1458. theArr.push({
  1459. key: index,
  1460. name: item.name,
  1461. id: item.id,
  1462. depNo: item.depNo
  1463. });
  1464. });
  1465. }
  1466. this.setState({
  1467. departmentArr: theArr
  1468. });
  1469. console.log(this.state.departmentArr);
  1470. }.bind(this)
  1471. }).always(
  1472. function() {
  1473. this.setState({
  1474. loading: false
  1475. });
  1476. }.bind(this)
  1477. );
  1478. },
  1479. //新建项目明细保存
  1480. nextSubmit(e) {
  1481. e.preventDefault();
  1482. if (this.state.gid == undefined || !this.state.gid) {
  1483. message.warning("服务名称不匹配!");
  1484. return false;
  1485. }
  1486. if (moneyVerify(this.state.commodityPrice)) {
  1487. return;
  1488. }
  1489. if (!this.state.commodityPrice) {
  1490. message.warning("请输入金额!");
  1491. this.refs.commodityPrice.focus();
  1492. return false;
  1493. }
  1494. if (!this.state.commodityQuantity) {
  1495. message.warning("请输入商品数量!");
  1496. this.refs.commodityQuantity.focus();
  1497. return false;
  1498. }
  1499. if (!this.state.main) {
  1500. message.warning("请选择是否为主要项目!");
  1501. this.refs.commodityQuantity.focus();
  1502. return false;
  1503. }
  1504. this.setState({
  1505. loading: true
  1506. });
  1507. let api = this.state.addState
  1508. ? "/api/admin/newOrder/addOrderTask"
  1509. : "/api/bianji";
  1510. $.ajax({
  1511. method: "POST",
  1512. dataType: "json",
  1513. crossDomain: false,
  1514. url: globalConfig.context + api,
  1515. data: {
  1516. commodityId: this.state.gid, //商品ID
  1517. orderNo: this.state.orderNo, //订单编号
  1518. commodityName: this.state.commodityName, //商品名称
  1519. commodityQuantity: this.state.commodityQuantity, //商品数量
  1520. commodityPrice: this.state.commodityPrice, //签单总价
  1521. taskComment: this.state.taskComment, //服务说明
  1522. main: this.state.main //是否为主要项目
  1523. }
  1524. }).done(
  1525. function(data) {
  1526. this.setState({
  1527. loading: false
  1528. });
  1529. if (!data.error.length) {
  1530. message.success("保存成功!");
  1531. this.nextCancel();
  1532. this.xiangmu(this.state.orderNo);
  1533. } else {
  1534. message.warning(data.error[0].message);
  1535. }
  1536. }.bind(this)
  1537. );
  1538. },
  1539. rizhi() {
  1540. console.log(this.state.orderNo);
  1541. this.setState({
  1542. loading: true
  1543. });
  1544. $.ajax({
  1545. method: "get",
  1546. dataType: "json",
  1547. crossDomain: false,
  1548. url: "/api/admin/newOrder/selectOrderLog",
  1549. data: {
  1550. orderNo: this.state.orderNo
  1551. },
  1552. success: function(data) {
  1553. let theArr = [];
  1554. let thisData = data.data;
  1555. if (!thisData.length) {
  1556. if (data.error && data.error.length) {
  1557. message.warning(data.error[0].message);
  1558. }
  1559. thisData = {};
  1560. } else {
  1561. for (let i = 0; i < data.data.length; i++) {
  1562. let thisdata = data.data[i];
  1563. theArr.push({
  1564. processName: thisdata.processName,
  1565. adminName: thisdata.adminName,
  1566. createDate: thisdata.createDate
  1567. });
  1568. }
  1569. }
  1570. this.setState({
  1571. dataSourcerizhi: theArr
  1572. });
  1573. }.bind(this)
  1574. }).always(
  1575. function() {
  1576. this.setState({
  1577. loading: false
  1578. });
  1579. }.bind(this)
  1580. );
  1581. },
  1582. //查看订单日志
  1583. getOrderLog() {
  1584. this.setState({
  1585. rizhivisible: true
  1586. });
  1587. this.rizhi();
  1588. },
  1589. closeOrderLog() {
  1590. this.setState({
  1591. rizhivisible: false
  1592. });
  1593. },
  1594. //点击签单
  1595. handleCancels() {
  1596. this.setState({
  1597. isSubmit: 1
  1598. });
  1599. },
  1600. //点击签单
  1601. handleCancelq() {
  1602. this.setState({
  1603. isSubmit: 0
  1604. });
  1605. },
  1606. resets() {
  1607. this.state.orderNo = "";
  1608. this.state.customerName = "";
  1609. this.state.releaseDate[0] = undefined;
  1610. this.state.releaseDate[1] = undefined;
  1611. this.loadData();
  1612. },
  1613. //点击添加项目明细
  1614. addDetailed() {
  1615. this.setState({
  1616. gid: "",
  1617. customerArr: [],
  1618. commodityName: "",
  1619. commodityQuantity: "",
  1620. commodityId: "",
  1621. taskComment: "",
  1622. main: undefined,
  1623. commodityPrice: "",
  1624. addState: 1,
  1625. addnextVisible: true
  1626. });
  1627. },
  1628. //修改项目详情
  1629. tabRowSave(e) {
  1630. e.preventDefault();
  1631. if (!this.state.commodityPrice) {
  1632. message.warning("金额不能为空!");
  1633. return false;
  1634. }
  1635. if (!this.state.commodityQuantity) {
  1636. message.warning("数量不能为空!");
  1637. return false;
  1638. }
  1639. if (!this.state.main) {
  1640. message.warning("请选择是否为主要项目!");
  1641. this.refs.commodityQuantity.focus();
  1642. return false;
  1643. }
  1644. $.ajax({
  1645. method: "POST",
  1646. dataType: "json",
  1647. crossDomain: false,
  1648. url: globalConfig.context + "/api/admin/newOrder/updateOrderTask",
  1649. data: {
  1650. id: this.state.jid, //项目ID
  1651. commodityId: this.state.kid, //商品ID
  1652. orderNo: this.state.orderNo, //订单编号
  1653. main: this.state.main, //是否为主要
  1654. commodityPrice: this.state.commodityPrice, //金额
  1655. commodityQuantity: this.state.commodityQuantity, //数量
  1656. taskComment: this.state.taskComment //备注
  1657. }
  1658. }).done(
  1659. function(data) {
  1660. this.setState({
  1661. loading: false
  1662. });
  1663. if (!data.error.length) {
  1664. message.success("保存成功!");
  1665. this.nextCancel();
  1666. this.xiangmu(this.state.orderNo);
  1667. //this.loaduser(this.props.datauser);
  1668. this.loadData();
  1669. } else {
  1670. message.warning(data.error[0].message);
  1671. }
  1672. }.bind(this)
  1673. );
  1674. },
  1675. //搜索
  1676. search() {
  1677. this.setState({
  1678. //signBillVisible:false
  1679. });
  1680. this.loadData();
  1681. },
  1682. getOrgCodeUrl(e) {
  1683. this.setState({ orgCodeUrl: e });
  1684. },
  1685. //关闭详情
  1686. visitCancel() {
  1687. this.setState({
  1688. visible: false,
  1689. cuiFlag: false,
  1690. addFlag: false,
  1691. boFlag: false
  1692. });
  1693. this.resets();
  1694. },
  1695. visitOk() {
  1696. this.setState({
  1697. visible: false
  1698. });
  1699. this.resets();
  1700. },
  1701. //客户
  1702. selectAutoCUT(value) {
  1703. let autoIds;
  1704. let fwList = this.state.customerArr;
  1705. fwList.map(function(item) {
  1706. if (value == item.name) {
  1707. autoIds = item.id;
  1708. }
  1709. });
  1710. this.setState({
  1711. customerName: value,
  1712. autoId: autoIds
  1713. });
  1714. },
  1715. //加载(自动补全)
  1716. supervisor(e, state) {
  1717. //客户名称与服务名称自动补全
  1718. let api = state
  1719. ? "/api/admin/customer/getCustomerByName"
  1720. : "/api/admin/order/getBusinessProjectByName";
  1721. $.ajax({
  1722. method: "get",
  1723. dataType: "json",
  1724. crossDomain: false,
  1725. url: globalConfig.context + api,
  1726. data: state
  1727. ? {
  1728. name: e,
  1729. type: this.state.customType
  1730. }
  1731. : {
  1732. businessName: e
  1733. },
  1734. success: function(data) {
  1735. let thedata = data.data;
  1736. if (!thedata) {
  1737. if (data.error && data.error.length) {
  1738. message.warning(data.error[0].message);
  1739. }
  1740. thedata = {};
  1741. }
  1742. this.setState({
  1743. states: state,
  1744. customerArr: thedata
  1745. });
  1746. }.bind(this)
  1747. }).always(
  1748. function() {
  1749. this.setState({
  1750. loading: false
  1751. });
  1752. }.bind(this)
  1753. );
  1754. },
  1755. //上级主管输入框失去焦点是判断客户是否存在
  1756. selectAuto(value) {
  1757. let kid = [];
  1758. let fwList = this.state.customerArr;
  1759. fwList.map(function(item) {
  1760. if (value == item.bname) {
  1761. kid = item;
  1762. }
  1763. });
  1764. this.setState({
  1765. commodityName: value,
  1766. gid: kid.id,
  1767. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  1768. commodityFirstPayment:
  1769. kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
  1770. });
  1771. },
  1772. //服务值改变时请求客户名称
  1773. httpChange(e) {
  1774. this.state.gid = "";
  1775. if (e.length >= 1) {
  1776. this.supervisor(e, false);
  1777. }
  1778. this.setState({
  1779. commodityName: e
  1780. });
  1781. },
  1782. render() {
  1783. const formItemLayout = {
  1784. labelCol: { span: 8 },
  1785. wrapperCol: { span: 14 }
  1786. };
  1787. const FormItem = Form.Item;
  1788. const { RangePicker } = DatePicker;
  1789. const rowSelection = {
  1790. selectedRowKeys: this.state.selectedRowKeys,
  1791. onChange: (selectedRowKeys, selectedRows) => {
  1792. this.setState({
  1793. modalVisible: false,
  1794. selectedRows: selectedRows.slice(-1),
  1795. selectedRowKeys: selectedRowKeys.slice(-1)
  1796. });
  1797. },
  1798. onSelect: recordt => {
  1799. this.setState({
  1800. modalVisible: false,
  1801. recordt: recordt.id
  1802. });
  1803. }
  1804. };
  1805. const cuiDataList = this.state.contactList || [];
  1806. const dataSources = this.state.customerArr || [];
  1807. let departmentArr = this.state.departmentArr || [];
  1808. const options = this.state.states
  1809. ? dataSources.map(group => (
  1810. <Select.Option key={group.id} value={group.name}>
  1811. {group.name}
  1812. </Select.Option>
  1813. ))
  1814. : dataSources.map((group, index) => (
  1815. <Select.Option key={index} value={group.bname}>
  1816. {group.bname}
  1817. </Select.Option>
  1818. ));
  1819. return (
  1820. <div className="user-content">
  1821. <ShowModalDiv ShowModal={this.state.showModal} />
  1822. <div className="content-title">
  1823. <span>订单审核</span>
  1824. </div>
  1825. <div className="user-search">
  1826. <Input
  1827. placeholder="客户名称"
  1828. style={{ width: "150px", marginBottom: "10px" }}
  1829. value={this.state.customerName}
  1830. onChange={e => {
  1831. this.setState({ customerName: e.target.value });
  1832. }}
  1833. />
  1834. <Input
  1835. placeholder="订单编号"
  1836. style={{ width: "150px" }}
  1837. value={this.state.orderNoSearch}
  1838. onChange={e => {
  1839. this.setState({ orderNoSearch: e.target.value });
  1840. }}
  1841. />
  1842. <span style={{ marginRight: "10px" }}>下单时间 :</span>
  1843. <RangePicker
  1844. value={[
  1845. this.state.releaseDate[0]
  1846. ? moment(this.state.releaseDate[0])
  1847. : null,
  1848. this.state.releaseDate[1]
  1849. ? moment(this.state.releaseDate[1])
  1850. : null
  1851. ]}
  1852. onChange={(data, dataString) => {
  1853. this.setState({ releaseDate: dataString });
  1854. }}
  1855. />
  1856. <Button
  1857. type="primary"
  1858. onClick={this.search}
  1859. style={{ marginLeft: "10px" }}
  1860. >
  1861. 搜索
  1862. </Button>
  1863. <Button onClick={this.resets}>重置</Button>
  1864. <div className="patent-table">
  1865. <Spin spinning={this.state.loading}>
  1866. <Table
  1867. columns={this.state.columns}
  1868. dataSource={this.state.dataSource}
  1869. rowSelection={rowSelection}
  1870. pagination={this.state.pagination}
  1871. onRowClick={this.tableRowClick}
  1872. bordered
  1873. size="small"
  1874. />
  1875. </Spin>
  1876. </div>
  1877. <Modal
  1878. className="customeDetails"
  1879. footer=""
  1880. title="订单详情"
  1881. width="900px"
  1882. visible={this.state.visible}
  1883. onOk={this.visitOk}
  1884. onCancel={this.visitCancel}
  1885. >
  1886. <Form
  1887. layout="horizontal"
  1888. onSubmit={this.handleSubmit}
  1889. id="demand-form"
  1890. style={{ paddingBottom: "40px" }}
  1891. >
  1892. <Spin spinning={this.state.loading}>
  1893. <div className="clearfix">
  1894. <FormItem
  1895. className="half-item"
  1896. {...formItemLayout}
  1897. label="订单编号"
  1898. >
  1899. <span>{this.state.orderNo}</span>
  1900. </FormItem>
  1901. <FormItem
  1902. className="half-item"
  1903. {...formItemLayout}
  1904. label="合同编号"
  1905. >
  1906. <span>{this.state.contractNo}</span>
  1907. </FormItem>
  1908. <FormItem
  1909. className="half-item"
  1910. {...formItemLayout}
  1911. label="客户名称"
  1912. >
  1913. <span>{this.state.userName}</span>
  1914. </FormItem>
  1915. <FormItem
  1916. className="half-item"
  1917. {...formItemLayout}
  1918. label="流程状态"
  1919. >
  1920. <span>{getProcessStatus(this.state.processStatus)}</span>
  1921. </FormItem>
  1922. <FormItem
  1923. className="half-item"
  1924. {...formItemLayout}
  1925. label="结算状态"
  1926. >
  1927. <span>
  1928. {getLiquidationStatus(this.state.liquidationStatus)}
  1929. </span>
  1930. </FormItem>
  1931. <FormItem
  1932. className="half-item"
  1933. {...formItemLayout}
  1934. label="已收款项(万元)"
  1935. >
  1936. <span>{this.state.settlementAmount}</span>
  1937. </FormItem>
  1938. <FormItem
  1939. className="half-item"
  1940. {...formItemLayout}
  1941. label="企业联系人"
  1942. >
  1943. <Input
  1944. placeholder="请输入联系人"
  1945. ref="signTotalAmount"
  1946. value={this.state.contacts}
  1947. onChange={e => {
  1948. this.setState({ contacts: e.target.value });
  1949. }}
  1950. style={{ width: "240px" }}
  1951. />
  1952. </FormItem>
  1953. <FormItem
  1954. className="half-item"
  1955. {...formItemLayout}
  1956. label="联系人电话"
  1957. >
  1958. <Input
  1959. placeholder="请输入联系人电话"
  1960. ref="signTotalAmount"
  1961. value={this.state.contactMobile}
  1962. onChange={e => {
  1963. this.setState({ contactMobile: e.target.value });
  1964. }}
  1965. style={{ width: "240px" }}
  1966. />
  1967. </FormItem>
  1968. <FormItem
  1969. className="half-item"
  1970. {...formItemLayout}
  1971. label="企业法人"
  1972. >
  1973. <Input
  1974. placeholder="请输入法人"
  1975. ref="signTotalAmount"
  1976. value={this.state.legalPerson}
  1977. onChange={e => {
  1978. this.setState({ legalPerson: e.target.value });
  1979. }}
  1980. style={{ width: "240px" }}
  1981. />
  1982. </FormItem>
  1983. <FormItem
  1984. className="half-item"
  1985. {...formItemLayout}
  1986. label="法人电话"
  1987. >
  1988. <Input
  1989. placeholder="请输入法人电话"
  1990. ref="signTotalAmount"
  1991. value={this.state.legalPersonTel}
  1992. onChange={e => {
  1993. this.setState({ legalPersonTel: e.target.value });
  1994. }}
  1995. style={{ width: "240px" }}
  1996. />
  1997. </FormItem>
  1998. <FormItem
  1999. className="half-item"
  2000. {...formItemLayout}
  2001. label="签单金额(万元)"
  2002. >
  2003. <Input
  2004. placeholder="签单金额"
  2005. ref="signTotalAmount"
  2006. value={this.state.totalAmount}
  2007. onChange={e => {
  2008. this.setState({ totalAmount: e.target.value });
  2009. }}
  2010. style={{ width: "240px" }}
  2011. />
  2012. <span className="mandatory">*</span>
  2013. </FormItem>
  2014. <FormItem
  2015. className="half-item"
  2016. {...formItemLayout}
  2017. label="首付金额(万元)"
  2018. >
  2019. <Input
  2020. placeholder="请输入实签首款金额"
  2021. ref="signFirstPayment"
  2022. value={this.state.firstAmount}
  2023. onChange={e => {
  2024. this.setState({ firstAmount: e.target.value });
  2025. }}
  2026. style={{ width: "240px" }}
  2027. />
  2028. <span className="mandatory">*</span>
  2029. </FormItem>
  2030. <FormItem
  2031. className="half-item"
  2032. {...formItemLayout}
  2033. label="特批立项"
  2034. >
  2035. <Select
  2036. placeholder="请选择客户所属类型"
  2037. style={{ width: "240px" }}
  2038. value={this.state.approval}
  2039. onChange={e => {
  2040. this.setState({ approval: e });
  2041. }}
  2042. >
  2043. {/* {tepi.map(function(item) {
  2044. return (
  2045. <Select.Option key={item.value}>
  2046. {item.key}
  2047. </Select.Option>
  2048. );
  2049. })} */}
  2050. <Select.Option key={0}>非特批</Select.Option>
  2051. <Select.Option key={1}>特批</Select.Option>
  2052. </Select>
  2053. </FormItem>
  2054. <FormItem
  2055. className="half-item"
  2056. {...formItemLayout}
  2057. label="合同签订时间"
  2058. >
  2059. <DatePicker
  2060. style={{
  2061. marginTop: "2px",
  2062. width: "240px",
  2063. height: "32px"
  2064. }}
  2065. showTime
  2066. format="YYYY-MM-DD"
  2067. onOk={() => {}}
  2068. value={
  2069. this.state.signDate
  2070. ? moment(this.state.signDate)
  2071. : null
  2072. }
  2073. onChange={(data, dataString) => {
  2074. this.setState({ signDate: dataString });
  2075. }}
  2076. />
  2077. </FormItem>
  2078. <FormItem
  2079. className="half-item"
  2080. {...formItemLayout}
  2081. label="订单部门"
  2082. >
  2083. <Select
  2084. placeholder="请输入订单部门"
  2085. style={{ width: 240 }}
  2086. value={this.state.organizationSearch}
  2087. onChange={e => {
  2088. this.setState({ organizationSearch: e });
  2089. }}
  2090. >
  2091. {departmentArr.map(function(item) {
  2092. return (
  2093. <Select.Option key={item.id}>
  2094. {item.name}
  2095. </Select.Option>
  2096. );
  2097. })}
  2098. </Select>
  2099. </FormItem>
  2100. <FormItem
  2101. className="half-item"
  2102. {...formItemLayout}
  2103. label="是否外包"
  2104. >
  2105. {this.state.outsource}
  2106. </FormItem>
  2107. <div className="clearfix">
  2108. <FormItem
  2109. labelCol={{ span: 4 }}
  2110. wrapperCol={{ span: 18 }}
  2111. label={
  2112. <span>
  2113. <strong style={{ color: "#f00" }}>*</strong>
  2114. 合同扫描件
  2115. </span>
  2116. }
  2117. >
  2118. <PicturesWall
  2119. fileList={this.getOrgCodeUrl}
  2120. pictureUrl={this.state.orgCodeUrl}
  2121. />
  2122. <p>图片建议:要清晰。</p>
  2123. <Button
  2124. style={{
  2125. float: "right",
  2126. marginRight: "140px",
  2127. marginTop: "20px"
  2128. }}
  2129. onClick={this.getOrderLog}
  2130. >
  2131. 查看订单 日志
  2132. </Button>
  2133. </FormItem>
  2134. </div>
  2135. <div className="clearfix">
  2136. <FormItem
  2137. labelCol={{ span: 4 }}
  2138. wrapperCol={{ span: 16 }}
  2139. label="订单留言"
  2140. >
  2141. <Input
  2142. type="textarea"
  2143. placeholder="请输入订单留言"
  2144. rows={4}
  2145. value={this.state.orderRemarks}
  2146. onChange={e => {
  2147. this.setState({ orderRemarks: e.target.value });
  2148. }}
  2149. />
  2150. </FormItem>
  2151. </div>
  2152. <div className="clearfix">
  2153. <FormItem
  2154. className="half-item"
  2155. {...formItemLayout}
  2156. label="订单负责人"
  2157. >
  2158. <span>{this.state.salesmanName}</span>
  2159. </FormItem>
  2160. <FormItem
  2161. className="half-item"
  2162. {...formItemLayout}
  2163. label="订单负责人电话"
  2164. >
  2165. <span>{this.state.salesmanMobile}</span>
  2166. </FormItem>
  2167. </div>
  2168. <div className="clearfix">
  2169. <FormItem
  2170. className="half-item"
  2171. {...formItemLayout}
  2172. label="当前财务负责人"
  2173. >
  2174. <span>{this.state.nowFinance}</span>
  2175. </FormItem>
  2176. <FormItem
  2177. className="half-item"
  2178. {...formItemLayout}
  2179. label="当前财务负责人电话"
  2180. >
  2181. <span>{this.state.nowFinanceMobile}</span>
  2182. </FormItem>
  2183. </div>
  2184. <div className="clearfix">
  2185. <FormItem
  2186. className="half-item"
  2187. {...formItemLayout}
  2188. style={{ opacity: ".5" }}
  2189. label="原订单负责人"
  2190. >
  2191. <span>{this.state.oldSalesmanName}</span>
  2192. </FormItem>
  2193. <FormItem
  2194. className="half-item"
  2195. {...formItemLayout}
  2196. style={{ opacity: ".5" }}
  2197. label="原订单负责人电话"
  2198. >
  2199. <span>{this.state.oldSalesmanMobile}</span>
  2200. </FormItem>
  2201. </div>
  2202. <div className="clearfix">
  2203. <FormItem
  2204. className="half-item"
  2205. style={{ opacity: ".5" }}
  2206. {...formItemLayout}
  2207. label="实际财务操作人"
  2208. >
  2209. <span>{this.state.financeName}</span>
  2210. </FormItem>
  2211. <FormItem
  2212. className="half-item"
  2213. {...formItemLayout}
  2214. style={{ opacity: ".5" }}
  2215. label="实际财务操作人电话"
  2216. >
  2217. <span>{this.state.financeMobile}</span>
  2218. </FormItem>
  2219. </div>
  2220. <div className="clearfix">
  2221. <FormItem
  2222. className="half-item"
  2223. {...formItemLayout}
  2224. label="驳回人"
  2225. >
  2226. <span>{this.state.initiateName}</span>
  2227. </FormItem>
  2228. <FormItem
  2229. className="half-item"
  2230. {...formItemLayout}
  2231. label="驳回时间"
  2232. >
  2233. <span>{this.state.backDate}</span>
  2234. </FormItem>
  2235. </div>
  2236. <div className="clearfix">
  2237. <FormItem
  2238. labelCol={{ span: 4 }}
  2239. wrapperCol={{ span: 16 }}
  2240. label="驳回原因"
  2241. >
  2242. <span>{this.state.reason}</span>
  2243. </FormItem>
  2244. </div>
  2245. <div>
  2246. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  2247. 项目业务
  2248. </span>
  2249. <Button
  2250. type="primary"
  2251. onClick={this.addDetailed}
  2252. style={{
  2253. float: "right",
  2254. marginRight: "50px",
  2255. marginBottom: "15px"
  2256. }}
  2257. >
  2258. 添加项目明细
  2259. </Button>
  2260. </div>
  2261. <div className="patent-table">
  2262. <Spin spinning={this.state.loading}>
  2263. <Table
  2264. columns={this.state.columnsX}
  2265. dataSource={this.state.dataSourceX}
  2266. pagination={this.state.paginations}
  2267. onRowClick={this.tableRowClickX}
  2268. bordered
  2269. size="small"
  2270. />
  2271. </Spin>
  2272. </div>
  2273. <div
  2274. style={{ display: cuiDataList.length ? "block" : "none" }}
  2275. >
  2276. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  2277. 旧催款节点
  2278. </span>
  2279. <Button
  2280. type="primary"
  2281. // onClick={this.addcontact}
  2282. disabled
  2283. onClick={e => {
  2284. cuiDataList.length
  2285. ? this.addcontact()
  2286. : this.addcontactNew();
  2287. }}
  2288. style={{
  2289. float: "right",
  2290. marginRight: "50px",
  2291. marginBottom: "15px"
  2292. }}
  2293. >
  2294. 添加催款节点
  2295. </Button>
  2296. </div>
  2297. <div
  2298. className="clearfix"
  2299. style={{ display: cuiDataList.length ? "block" : "none" }}
  2300. >
  2301. <Spin spinning={this.state.loading}>
  2302. <Form layout="horizontal" id="demand-form">
  2303. <Table
  2304. pagination={false}
  2305. columns={this.state.ContactsLists}
  2306. dataSource={this.state.contactList}
  2307. bordered
  2308. size="small"
  2309. scroll={{ x: "max-content", y: 0 }}
  2310. />
  2311. <Col
  2312. span={24}
  2313. offset={9}
  2314. style={{ marginTop: "15px" }}
  2315. ></Col>
  2316. </Form>
  2317. </Spin>
  2318. </div>
  2319. <div>
  2320. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  2321. 新催款节点
  2322. </span>
  2323. <Button
  2324. type="primary"
  2325. disabled={
  2326. cuiDataList.length || this.state.addFlag
  2327. ? true
  2328. : false
  2329. }
  2330. // onClick={this.addcontact}
  2331. onClick={e => {
  2332. this.setState({ addFlag: true });
  2333. this.addcontactNew();
  2334. }}
  2335. style={{
  2336. float: "right",
  2337. marginRight: "50px",
  2338. marginBottom: "15px"
  2339. }}
  2340. >
  2341. 添加催款节点
  2342. </Button>
  2343. </div>
  2344. <div className="clearfix">
  2345. <Spin spinning={this.state.loading}>
  2346. <Form layout="horizontal" id="demand-form">
  2347. <Table
  2348. pagination={false}
  2349. columns={this.state.ContactsListsNew}
  2350. dataSource={this.state.contactListNew}
  2351. scroll={{ x: "max-content", y: 0 }}
  2352. bordered
  2353. size="small"
  2354. />
  2355. <Col
  2356. span={24}
  2357. offset={9}
  2358. style={{ marginTop: "15px" }}
  2359. ></Col>
  2360. </Form>
  2361. </Spin>
  2362. </div>
  2363. <div className="addSave" style={{ marginTop: "15px" }}>
  2364. <Button
  2365. className="cancel"
  2366. type="primary"
  2367. onClick={this.examOk}
  2368. style={{ marginLeft: "200px" }}
  2369. htmlType="submit"
  2370. >
  2371. 重新提交
  2372. </Button>
  2373. <Button
  2374. className="cancel"
  2375. type="primary"
  2376. onClick={this.examOks}
  2377. style={{ marginLeft: "50px" }}
  2378. htmlType="submit"
  2379. >
  2380. 订单作废
  2381. </Button>
  2382. <Button
  2383. className="cancel"
  2384. type="ghost"
  2385. onClick={this.visitCancel}
  2386. style={{ marginLeft: "50px" }}
  2387. >
  2388. 取消
  2389. </Button>
  2390. </div>
  2391. </div>
  2392. </Spin>
  2393. </Form>
  2394. </Modal>
  2395. <Modal
  2396. maskClosable={false}
  2397. visible={this.state.addnextVisible}
  2398. onOk={this.nextCancel}
  2399. onCancel={this.nextCancel}
  2400. width="800px"
  2401. title={this.state.addState ? "添加项目任务" : "项目任务详情"}
  2402. footer=""
  2403. className="admin-desc-content"
  2404. >
  2405. <Form
  2406. layout="horizontal"
  2407. onSubmit={this.nextSubmit}
  2408. id="demand-form"
  2409. >
  2410. <Spin spinning={this.state.loading}>
  2411. {this.state.addState ? (
  2412. <div className="clearfix">
  2413. <FormItem
  2414. className="half-item"
  2415. {...formItemLayout}
  2416. label="服务名称"
  2417. >
  2418. <AutoComplete
  2419. className="certain-category-search"
  2420. dropdownClassName="certain-category-search-dropdown"
  2421. dropdownMatchSelectWidth={false}
  2422. dropdownStyle={{ width: 200 }}
  2423. style={{ width: "200px" }}
  2424. dataSource={options}
  2425. placeholder="输入服务名称"
  2426. value={this.state.commodityName}
  2427. onChange={this.httpChange}
  2428. filterOption={true}
  2429. onSelect={this.selectAuto}
  2430. >
  2431. <Input />
  2432. </AutoComplete>
  2433. <span className="mandatory">*</span>
  2434. </FormItem>
  2435. <FormItem
  2436. className="half-item"
  2437. {...formItemLayout}
  2438. label="服务数量"
  2439. >
  2440. <Input
  2441. placeholder="请输入服务数量"
  2442. value={this.state.commodityQuantity}
  2443. style={{ width: "200px" }}
  2444. onChange={e => {
  2445. this.setState({
  2446. commodityQuantity: e.target.value
  2447. });
  2448. }}
  2449. ref="commodityQuantity"
  2450. />
  2451. <span className="mandatory">*</span>
  2452. </FormItem>
  2453. <FormItem
  2454. className="half-item"
  2455. {...formItemLayout}
  2456. label="实签价格(万元)"
  2457. >
  2458. <Input
  2459. placeholder="请输入实签价格"
  2460. value={this.state.commodityPrice}
  2461. style={{ width: "200px" }}
  2462. onChange={e => {
  2463. this.setState({ commodityPrice: e.target.value });
  2464. }}
  2465. ref="commodityPrice"
  2466. />
  2467. <span className="mandatory">*</span>
  2468. </FormItem>
  2469. <FormItem
  2470. className="half-item"
  2471. {...formItemLayout}
  2472. label="主要业务"
  2473. >
  2474. <Select
  2475. placeholder="选择是否为主要业务"
  2476. style={{ width: "200px" }}
  2477. value={this.state.main}
  2478. onChange={e => {
  2479. this.setState({ main: e });
  2480. }}
  2481. >
  2482. {boutique.map(function(item) {
  2483. return (
  2484. <Select.Option key={item.value}>
  2485. {item.key}
  2486. </Select.Option>
  2487. );
  2488. })}
  2489. </Select>
  2490. <span className="mandatory">*</span>
  2491. </FormItem>
  2492. <div className="clearfix">
  2493. <FormItem
  2494. labelCol={{ span: 4 }}
  2495. wrapperCol={{ span: 16 }}
  2496. label="服务说明"
  2497. >
  2498. <Input
  2499. type="textarea"
  2500. placeholder="请输入服务说明"
  2501. value={this.state.taskComment}
  2502. onChange={e => {
  2503. this.setState({ taskComment: e.target.value });
  2504. }}
  2505. />
  2506. </FormItem>
  2507. </div>
  2508. <FormItem
  2509. wrapperCol={{ span: 12, offset: 4 }}
  2510. className="half-middle"
  2511. >
  2512. <Button
  2513. className="submitSave"
  2514. type="primary"
  2515. htmlType="submit"
  2516. >
  2517. 保存
  2518. </Button>
  2519. <Button
  2520. className="submitSave"
  2521. type="ghost"
  2522. onClick={this.nextCancel}
  2523. >
  2524. 取消
  2525. </Button>
  2526. </FormItem>
  2527. </div>
  2528. ) : (
  2529. <div className="clearfix">
  2530. <FormItem
  2531. className="half-item"
  2532. {...formItemLayout}
  2533. label="项目名称"
  2534. >
  2535. <span>{this.state.commodityName}</span>
  2536. </FormItem>
  2537. <FormItem
  2538. className="half-item"
  2539. {...formItemLayout}
  2540. label="项目数量"
  2541. >
  2542. <Input
  2543. placeholder="请输入数量"
  2544. value={this.state.commodityQuantity}
  2545. style={{ width: "200px" }}
  2546. onChange={e => {
  2547. this.setState({
  2548. commodityQuantity: e.target.value
  2549. });
  2550. }}
  2551. />
  2552. <span className="mandatory">*</span>
  2553. </FormItem>
  2554. <FormItem
  2555. className="half-item"
  2556. {...formItemLayout}
  2557. label="金额(万元)"
  2558. >
  2559. <Input
  2560. placeholder="请输入签单金额"
  2561. value={this.state.commodityPrice}
  2562. style={{ width: "200px" }}
  2563. onChange={e => {
  2564. this.setState({ commodityPrice: e.target.value });
  2565. }}
  2566. />
  2567. <span className="mandatory">*</span>
  2568. </FormItem>
  2569. <FormItem
  2570. className="half-item"
  2571. {...formItemLayout}
  2572. label="主要项目"
  2573. >
  2574. <Select
  2575. placeholder="选择是否为主要业务"
  2576. style={{ width: "200px" }}
  2577. value={this.state.main}
  2578. onChange={e => {
  2579. this.setState({ main: e });
  2580. }}
  2581. >
  2582. {boutique.map(function(item) {
  2583. return (
  2584. <Select.Option key={item.value}>
  2585. {item.key}
  2586. </Select.Option>
  2587. );
  2588. })}
  2589. </Select>
  2590. <span className="mandatory">*</span>
  2591. </FormItem>
  2592. <div className="clearfix">
  2593. <FormItem
  2594. labelCol={{ span: 4 }}
  2595. wrapperCol={{ span: 16 }}
  2596. label="服务说明"
  2597. >
  2598. <Input
  2599. type="textarea"
  2600. placeholder="请输入服务说明"
  2601. value={this.state.taskComment}
  2602. onChange={e => {
  2603. this.setState({ taskComment: e.target.value });
  2604. }}
  2605. />
  2606. </FormItem>
  2607. </div>
  2608. <FormItem
  2609. wrapperCol={{ span: 12, offset: 4 }}
  2610. className="half-middle"
  2611. >
  2612. <Button
  2613. className="submitSave"
  2614. type="primary"
  2615. onClick={this.tabRowSave}
  2616. >
  2617. 保存
  2618. </Button>
  2619. <Button
  2620. className="submitSave"
  2621. type="ghost"
  2622. onClick={this.nextCancel}
  2623. >
  2624. 取消
  2625. </Button>
  2626. </FormItem>
  2627. </div>
  2628. )}
  2629. </Spin>
  2630. </Form>
  2631. </Modal>
  2632. {/* <Modal
  2633. visible={this.state.rizhivisible}
  2634. className="admin-desc-content"
  2635. width="800px"
  2636. maskClosable={false}
  2637. title="订单日志"
  2638. footer={null}
  2639. onCancel={this.closeOrderLog}
  2640. >
  2641. <div className="patent-table">
  2642. <Spin spinning={this.state.loading}>
  2643. <Table
  2644. columns={this.state.columnsrizhi}
  2645. dataSource={this.state.dataSourcerizhi}
  2646. pagination={false}
  2647. />
  2648. </Spin>
  2649. </div>
  2650. </Modal> */}
  2651. <OrderRiZi
  2652. dataSourcerizhi={this.state.dataSourcerizhi}
  2653. closeOrderLog={this.closeOrderLog}
  2654. visible={this.state.rizhivisible}
  2655. loading={this.state.loading}
  2656. />
  2657. </div>
  2658. </div>
  2659. );
  2660. }
  2661. })
  2662. );
  2663. export default IntentionCustomer;