reject.jsx 90 KB

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