reject.jsx 91 KB

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