reject.jsx 89 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705
  1. import React from 'react';
  2. import { Icon, Button, AutoComplete,Input, Select, Spin, Popconfirm, Table, message,DatePicker, Upload, Form ,Modal,Col} from 'antd';
  3. import $ from 'jquery/src/ajax';
  4. import moment from 'moment';
  5. import {boutique ,tepi,jiedian} from '@/dataDic.js';
  6. import {
  7. getLiquidationStatus,
  8. getProcessStatus,
  9. splitUrl,
  10. getCuikuan,
  11. moneyVerify,
  12. ShowModal
  13. } from "@/tools.js";
  14. import './customer.less';
  15. import ShowModalDiv from "@/showModal.jsx"
  16. import OrderRiZi from "@/orderRiZi.jsx";
  17. import { cuiJieDian } from "@/dataDic.js";
  18. //图片组件
  19. const PicturesWall = React.createClass({
  20. getInitialState() {
  21. return {
  22. previewVisible: false,
  23. previewImage: '',
  24. fileList: [],
  25. }
  26. },
  27. handleCancel() {
  28. this.setState({
  29. previewVisible: false
  30. })
  31. },
  32. handlePreview(file) {
  33. this.setState({
  34. previewImage: file.url || file.thumbUrl,
  35. previewVisible: true,
  36. });
  37. },
  38. handleChange(info) {
  39. let fileList = info.fileList;
  40. this.setState({
  41. fileList
  42. });
  43. this.props.fileList(fileList);
  44. },
  45. componentWillReceiveProps(nextProps) {
  46. this.state.fileList = nextProps.pictureUrl;
  47. this.state.pojectApplicationUrl = undefined;
  48. },
  49. render() {
  50. const {
  51. previewVisible,
  52. previewImage,
  53. fileList
  54. } = this.state;
  55. const uploadButton = (
  56. <div>
  57. <Icon type="plus" />
  58. <div className="ant-upload-text">点击上传</div>
  59. </div>
  60. );
  61. return(
  62. <div style={{display:"inline-block"}}>
  63. <Upload
  64. action={globalConfig.context + "/api/admin/customer/uploadCustomerImg"}
  65. data={{ 'sign': '' }}
  66. listType="picture-card"
  67. fileList={fileList}
  68. onPreview={this.handlePreview}
  69. onChange={this.handleChange} >
  70. {fileList.length >= 18 ? null : uploadButton}
  71. </Upload>
  72. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  73. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  74. </Modal>
  75. </div>
  76. );
  77. }
  78. });
  79. const IntentionCustomer = Form.create()(
  80. React.createClass({
  81. loadData(pageNo) {
  82. this.setState({
  83. visitModul: false,
  84. loading: true,
  85. ispage: pageNo,
  86. modalVisible: false
  87. });
  88. $.ajax({
  89. method: "get",
  90. dataType: "json",
  91. crossDomain: false,
  92. url: globalConfig.context + "/api/admin/newOrder/orderNewList",
  93. data: {
  94. pageNo: pageNo || 1,
  95. pageSize: this.state.pagination.pageSize,
  96. specially: 2, //审核列表
  97. name: this.state.customerName, //名称
  98. orderNo: this.state.orderNoSearch, //订单编号
  99. starTime: this.state.releaseDate[0], //开始时间
  100. endTime: this.state.releaseDate[1] //结束时间
  101. },
  102. success: function(data) {
  103. ShowModal(this);
  104. let theArr = [];
  105. if (data.error.length || data.data.list == "") {
  106. if (data.error && data.error.length) {
  107. message.warning(data.error[0].message);
  108. }
  109. } else {
  110. for (let i = 0; i < data.data.list.length; i++) {
  111. let thisdata = data.data.list[i];
  112. theArr.push({
  113. key: i,
  114. id: thisdata.id, //用户ID
  115. orderNo: thisdata.orderNo, //订单编号
  116. totalAmount: thisdata.totalAmount + "", //签单金额
  117. processStatus: thisdata.processStatus, //流程状态
  118. liquidationStatus: thisdata.liquidationStatus, //结算状态
  119. approval: thisdata.approval, //特批状态
  120. signDate: thisdata.signDate, //签单时间
  121. userName: thisdata.userName, //客户名称
  122. salesmanName: thisdata.salesmanName, //营销员名称
  123. financeName: thisdata.financeName, //财务名称
  124. createDate: thisdata.createDate, //下单时间
  125. initiateName: thisdata.initiateName, //驳回人
  126. reason: thisdata.reason, //驳回信息
  127. backDate: thisdata.backDate, //驳回日期
  128. backId: thisdata.backId //驳回编号
  129. });
  130. }
  131. this.state.pagination.total = data.data.totalCount;
  132. this.state.pagination.current = data.data.pageNo;
  133. }
  134. if (data.data && data.data.list && !data.data.list.length) {
  135. this.state.pagination.total = 0;
  136. }
  137. this.setState({
  138. dataSource: theArr,
  139. pageNo: pageNo,
  140. pagination: this.state.pagination,
  141. selectedRowKeys: []
  142. });
  143. }.bind(this)
  144. }).always(
  145. function() {
  146. this.setState({
  147. loading: false
  148. });
  149. }.bind(this)
  150. );
  151. },
  152. getInitialState() {
  153. return {
  154. page: 1,
  155. releaseDate: [],
  156. selectedRowKeys: [],
  157. orgCodeUrl: [],
  158. customerArr: [],
  159. pagination: {
  160. defaultCurrent: 1,
  161. defaultPageSize: 10,
  162. showQuickJumper: true,
  163. pageSize: 10,
  164. onChange: function(page) {
  165. this.loadData(page);
  166. }.bind(this),
  167. showTotal: function(total) {
  168. return "共" + total + "条数据";
  169. }
  170. },
  171. columns: [
  172. {
  173. title: "驳回编号",
  174. dataIndex: "backId",
  175. key: "backId"
  176. },
  177. {
  178. title: "驳回日期",
  179. dataIndex: "backDate",
  180. key: "backDate"
  181. },
  182. {
  183. title: "下单时间",
  184. dataIndex: "createDate",
  185. key: "createDate"
  186. },
  187. {
  188. title: "订单编号",
  189. dataIndex: "orderNo",
  190. key: "orderNo"
  191. },
  192. {
  193. title: "客户名称",
  194. dataIndex: "userName",
  195. key: "userName",
  196. render: text => {
  197. return text && text.length > 9 ? text.substr(0, 9) + "..." : text;
  198. }
  199. },
  200. {
  201. title: "驳回人",
  202. dataIndex: "initiateName",
  203. key: "initiateName"
  204. },
  205. {
  206. title: "驳回原因",
  207. dataIndex: "reason",
  208. key: "reason",
  209. render: text => {
  210. return text && text.length > 24
  211. ? text.substr(0, 24) + "..."
  212. : text;
  213. }
  214. }
  215. ],
  216. columnsrizhi: [
  217. {
  218. title: "流程",
  219. dataIndex: "processName",
  220. key: "processName"
  221. },
  222. {
  223. title: "操作人",
  224. dataIndex: "adminName",
  225. key: "adminName"
  226. },
  227. {
  228. title: "时间",
  229. dataIndex: "createDate",
  230. key: "createDate"
  231. }
  232. ],
  233. data: [],
  234. dataSource: [],
  235. columnsX: [
  236. {
  237. title: "业务项目名称",
  238. dataIndex: "commodityName",
  239. key: "commodityName"
  240. },
  241. {
  242. title: "项目类别",
  243. dataIndex: "cname",
  244. key: "cname"
  245. },
  246. {
  247. title: "项目数量",
  248. dataIndex: "commodityQuantity",
  249. key: "commodityQuantity"
  250. },
  251. {
  252. title: "金额(万元)",
  253. dataIndex: "commodityPrice",
  254. key: "commodityPrice"
  255. },
  256. {
  257. title: "负责人",
  258. dataIndex: "contacts",
  259. key: "contacts"
  260. },
  261. {
  262. title: "负责人电话",
  263. dataIndex: "contactsMobile",
  264. key: "contactsMobile"
  265. },
  266. {
  267. title: "主要项目",
  268. dataIndex: "main",
  269. key: "main",
  270. render: text => {
  271. return text ? "是" : "否";
  272. }
  273. },
  274. {
  275. title: "项目说明",
  276. dataIndex: "taskComment",
  277. key: "taskComment",
  278. render: text => {
  279. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  280. }
  281. },
  282. {
  283. title: "操作",
  284. dataIndex: "ABC",
  285. key: "ABC",
  286. render: (text, record) => {
  287. return (
  288. <div>
  289. {this.state.processStatus == 0 ? (
  290. <Popconfirm
  291. title="是否删除?"
  292. onConfirm={() => {
  293. this.delectRow(record);
  294. }}
  295. okText="是"
  296. cancelText="否"
  297. >
  298. <Button
  299. onClick={e => {
  300. e.stopPropagation();
  301. }}
  302. type="danger"
  303. >
  304. 删除
  305. </Button>
  306. </Popconfirm>
  307. ) : (
  308. ""
  309. )}
  310. </div>
  311. );
  312. }
  313. }
  314. ],
  315. dataSourceX: [],
  316. ContactsListsNew: [
  317. {
  318. title: "项目名称",
  319. dataIndex: "commodityName",
  320. key: "commodityName",
  321. render: (text, record, index) => {
  322. let dataArr = this.state.dataSourceX || [];
  323. if (text) {
  324. return <span>{text}</span>;
  325. }
  326. return (
  327. <Select
  328. placeholder="请选择名称"
  329. style={{ width: "150px" }}
  330. disabled={
  331. this.state.getLoad && record.sortName ? true : false
  332. }
  333. onChange={e => {
  334. record.sortName = e;
  335. dataArr.forEach(item => {
  336. if (item.commodityName == record.sortName) {
  337. record.cname = item.cname;
  338. record.tid = item.id;
  339. record.isSave = true;
  340. record.sort = item.sort;
  341. console.log(record);
  342. cuiJieDian.forEach(item => {
  343. if (item.value == record.sort) {
  344. record.arr = item.children;
  345. let yearFlag = true;
  346. if (record.sort == 6) {
  347. yearFlag = false;
  348. }
  349. this.setState({
  350. getLoad: true,
  351. yearFlag
  352. });
  353. }
  354. });
  355. }
  356. });
  357. console.log(e);
  358. }}
  359. >
  360. {dataArr.map(item => {
  361. return (
  362. <Select.Option key={item.id} value={item.commodityName}>
  363. {item.commodityName}
  364. </Select.Option>
  365. );
  366. })}
  367. </Select>
  368. );
  369. }
  370. },
  371. {
  372. title: "项目分类",
  373. dataIndex: "projectType",
  374. key: "projectType",
  375. render: (text, record) => {
  376. if (text) {
  377. let arr = this.state.dataSourceX || [];
  378. let str = "";
  379. for (let i = 0; i < arr.length; i++) {
  380. if (this.state.dataSourceX[i].sort == text) {
  381. str = this.state.dataSourceX[i].cname;
  382. return <span>{str}</span>;
  383. }
  384. }
  385. }
  386. if (this.state.getLoad) {
  387. return (
  388. <Select
  389. style={{ width: "150px" }}
  390. placeholder="请选择分类"
  391. value={record.cname}
  392. >
  393. <Select.Option key={record.sort} value={record.cname}>
  394. {record.cname}
  395. </Select.Option>
  396. </Select>
  397. );
  398. } else {
  399. return (
  400. <Select style={{ width: "150px" }} placeholder="请选择分类">
  401. <Select.Option key={record.sort} value={record.cname}>
  402. {record.cname}
  403. </Select.Option>
  404. </Select>
  405. );
  406. }
  407. }
  408. },
  409. {
  410. title: "催款科目",
  411. dataIndex: "dunTypeName",
  412. key: "dunTypeName",
  413. render: (text, record) => {
  414. if (text) {
  415. return <span>{text}</span>;
  416. }
  417. if (this.state.getLoad) {
  418. let arr = record.arr || [];
  419. console.log("arrrr", arr);
  420. return (
  421. <Select
  422. style={{ width: "150px" }}
  423. placeholder="请选择分类"
  424. onChange={e => {
  425. record.dunType = e;
  426. if (e != 1) {
  427. this.setState({
  428. timeFlag: true
  429. });
  430. } else {
  431. this.setState({
  432. timeFlag: false
  433. });
  434. }
  435. if (e == 1 && record.sort == 6) {
  436. this.setState({
  437. yearFlag: true
  438. });
  439. } else if (e != 1 && record.sort == 6) {
  440. this.setState({
  441. yearFlag: false
  442. });
  443. }
  444. if (record.sort == 3 && e == 3) {
  445. this.setState({
  446. boFlag: true
  447. });
  448. } else {
  449. this.setState({
  450. boFlag: false
  451. });
  452. }
  453. console.log(e);
  454. }}
  455. >
  456. {arr.map(item => {
  457. record;
  458. return (
  459. <Select.Option key={item.value} value={item.value}>
  460. {item.key}
  461. </Select.Option>
  462. );
  463. })}
  464. </Select>
  465. );
  466. } else {
  467. return (
  468. <Select style={{ width: "150px" }} placeholder="请选择分类">
  469. <Select.Option
  470. key={0}
  471. value={"请选择上一项"}
  472. ></Select.Option>
  473. </Select>
  474. );
  475. }
  476. }
  477. },
  478. {
  479. title: "首付时间(特批需选择时间)",
  480. dataIndex: "waitDay",
  481. key: "waitDay",
  482. render: (text, record) => {
  483. if (record.dunTypeName) {
  484. if (text == 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. return (
  1836. <div className="user-content">
  1837. <ShowModalDiv ShowModal={this.state.showModal} />
  1838. <div className="content-title">
  1839. <span>订单审核</span>
  1840. </div>
  1841. <div className="user-search">
  1842. <Input
  1843. placeholder="客户名称"
  1844. style={{ width: "150px", marginBottom: "10px" }}
  1845. value={this.state.customerName}
  1846. onChange={e => {
  1847. this.setState({ customerName: e.target.value });
  1848. }}
  1849. />
  1850. <Input
  1851. placeholder="订单编号"
  1852. style={{ width: "150px" }}
  1853. value={this.state.orderNoSearch}
  1854. onChange={e => {
  1855. this.setState({ orderNoSearch: e.target.value });
  1856. }}
  1857. />
  1858. <span style={{ marginRight: "10px" }}>下单时间 :</span>
  1859. <RangePicker
  1860. value={[
  1861. this.state.releaseDate[0]
  1862. ? moment(this.state.releaseDate[0])
  1863. : null,
  1864. this.state.releaseDate[1]
  1865. ? moment(this.state.releaseDate[1])
  1866. : null
  1867. ]}
  1868. onChange={(data, dataString) => {
  1869. this.setState({ releaseDate: dataString });
  1870. }}
  1871. />
  1872. <Button
  1873. type="primary"
  1874. onClick={this.search}
  1875. style={{ marginLeft: "10px" }}
  1876. >
  1877. 搜索
  1878. </Button>
  1879. <Button onClick={this.resets}>重置</Button>
  1880. <div className="patent-table">
  1881. <Spin spinning={this.state.loading}>
  1882. <Table
  1883. columns={this.state.columns}
  1884. dataSource={this.state.dataSource}
  1885. rowSelection={rowSelection}
  1886. pagination={this.state.pagination}
  1887. onRowClick={this.tableRowClick}
  1888. bordered
  1889. size="small"
  1890. />
  1891. </Spin>
  1892. </div>
  1893. <Modal
  1894. className="customeDetails"
  1895. footer=""
  1896. title="订单详情"
  1897. width="900px"
  1898. visible={this.state.visible}
  1899. onOk={this.visitOk}
  1900. onCancel={this.visitCancel}
  1901. >
  1902. <Form
  1903. layout="horizontal"
  1904. onSubmit={this.handleSubmit}
  1905. id="demand-form"
  1906. style={{ paddingBottom: "40px" }}
  1907. >
  1908. <Spin spinning={this.state.loading}>
  1909. <div className="clearfix">
  1910. <FormItem
  1911. className="half-item"
  1912. {...formItemLayout}
  1913. label="订单编号"
  1914. >
  1915. <span>{this.state.orderNo}</span>
  1916. </FormItem>
  1917. <FormItem
  1918. className="half-item"
  1919. {...formItemLayout}
  1920. label="合同编号"
  1921. >
  1922. <span>{this.state.contractNo}</span>
  1923. </FormItem>
  1924. <FormItem
  1925. className="half-item"
  1926. {...formItemLayout}
  1927. label="客户名称"
  1928. >
  1929. <span>{this.state.userName}</span>
  1930. </FormItem>
  1931. <FormItem
  1932. className="half-item"
  1933. {...formItemLayout}
  1934. label="流程状态"
  1935. >
  1936. <span>{getProcessStatus(this.state.processStatus)}</span>
  1937. </FormItem>
  1938. <FormItem
  1939. className="half-item"
  1940. {...formItemLayout}
  1941. label="结算状态"
  1942. >
  1943. <span>
  1944. {getLiquidationStatus(this.state.liquidationStatus)}
  1945. </span>
  1946. </FormItem>
  1947. <FormItem
  1948. className="half-item"
  1949. {...formItemLayout}
  1950. label="已收款项(万元)"
  1951. >
  1952. <span>{this.state.settlementAmount}</span>
  1953. </FormItem>
  1954. <FormItem
  1955. className="half-item"
  1956. {...formItemLayout}
  1957. label="企业联系人"
  1958. >
  1959. <Input
  1960. placeholder="请输入联系人"
  1961. ref="signTotalAmount"
  1962. value={this.state.contacts}
  1963. onChange={e => {
  1964. this.setState({ contacts: e.target.value });
  1965. }}
  1966. style={{ width: "240px" }}
  1967. />
  1968. </FormItem>
  1969. <FormItem
  1970. className="half-item"
  1971. {...formItemLayout}
  1972. label="联系人电话"
  1973. >
  1974. <Input
  1975. placeholder="请输入联系人电话"
  1976. ref="signTotalAmount"
  1977. value={this.state.contactMobile}
  1978. onChange={e => {
  1979. this.setState({ contactMobile: e.target.value });
  1980. }}
  1981. style={{ width: "240px" }}
  1982. />
  1983. </FormItem>
  1984. <FormItem
  1985. className="half-item"
  1986. {...formItemLayout}
  1987. label="企业法人"
  1988. >
  1989. <Input
  1990. placeholder="请输入法人"
  1991. ref="signTotalAmount"
  1992. value={this.state.legalPerson}
  1993. onChange={e => {
  1994. this.setState({ legalPerson: e.target.value });
  1995. }}
  1996. style={{ width: "240px" }}
  1997. />
  1998. </FormItem>
  1999. <FormItem
  2000. className="half-item"
  2001. {...formItemLayout}
  2002. label="法人电话"
  2003. >
  2004. <Input
  2005. placeholder="请输入法人电话"
  2006. ref="signTotalAmount"
  2007. value={this.state.legalPersonTel}
  2008. onChange={e => {
  2009. this.setState({ legalPersonTel: e.target.value });
  2010. }}
  2011. style={{ width: "240px" }}
  2012. />
  2013. </FormItem>
  2014. <FormItem
  2015. className="half-item"
  2016. {...formItemLayout}
  2017. label="签单金额(万元)"
  2018. >
  2019. <Input
  2020. placeholder="签单金额"
  2021. ref="signTotalAmount"
  2022. value={this.state.totalAmount}
  2023. onChange={e => {
  2024. this.setState({ totalAmount: e.target.value });
  2025. }}
  2026. style={{ width: "240px" }}
  2027. />
  2028. <span className="mandatory">*</span>
  2029. </FormItem>
  2030. <FormItem
  2031. className="half-item"
  2032. {...formItemLayout}
  2033. label="首付金额(万元)"
  2034. >
  2035. <Input
  2036. placeholder="请输入实签首款金额"
  2037. ref="signFirstPayment"
  2038. value={this.state.firstAmount}
  2039. onChange={e => {
  2040. this.setState({ firstAmount: e.target.value });
  2041. }}
  2042. style={{ width: "240px" }}
  2043. />
  2044. <span className="mandatory">*</span>
  2045. </FormItem>
  2046. <FormItem
  2047. className="half-item"
  2048. {...formItemLayout}
  2049. label="特批立项"
  2050. >
  2051. <Select
  2052. placeholder="请选择客户所属类型"
  2053. style={{ width: "240px" }}
  2054. value={this.state.approval}
  2055. onChange={e => {
  2056. this.setState({ approval: e });
  2057. }}
  2058. >
  2059. {/* {tepi.map(function(item) {
  2060. return (
  2061. <Select.Option key={item.value}>
  2062. {item.key}
  2063. </Select.Option>
  2064. );
  2065. })} */}
  2066. <Select.Option key={0}>非特批</Select.Option>
  2067. <Select.Option key={1}>特批</Select.Option>
  2068. </Select>
  2069. </FormItem>
  2070. <FormItem
  2071. className="half-item"
  2072. {...formItemLayout}
  2073. label="合同签订时间"
  2074. >
  2075. <DatePicker
  2076. style={{
  2077. marginTop: "2px",
  2078. width: "240px",
  2079. height: "32px"
  2080. }}
  2081. showTime
  2082. format="YYYY-MM-DD"
  2083. onOk={() => {}}
  2084. value={
  2085. this.state.signDate
  2086. ? moment(this.state.signDate)
  2087. : null
  2088. }
  2089. onChange={(data, dataString) => {
  2090. this.setState({ signDate: dataString });
  2091. }}
  2092. />
  2093. </FormItem>
  2094. <FormItem
  2095. className="half-item"
  2096. {...formItemLayout}
  2097. label="订单部门"
  2098. >
  2099. <Select
  2100. placeholder="请输入订单部门"
  2101. style={{ width: 240 }}
  2102. value={this.state.organizationSearch}
  2103. onChange={e => {
  2104. this.setState({ organizationSearch: e });
  2105. }}
  2106. >
  2107. {departmentArr.map(function(item) {
  2108. return (
  2109. <Select.Option key={item.id}>
  2110. {item.name}
  2111. </Select.Option>
  2112. );
  2113. })}
  2114. </Select>
  2115. </FormItem>
  2116. <FormItem
  2117. className="half-item"
  2118. {...formItemLayout}
  2119. label="是否外包"
  2120. >
  2121. {this.state.outsource}
  2122. </FormItem>
  2123. <div className="clearfix">
  2124. <FormItem
  2125. labelCol={{ span: 4 }}
  2126. wrapperCol={{ span: 18 }}
  2127. label={
  2128. <span>
  2129. <strong style={{ color: "#f00" }}>*</strong>
  2130. 合同扫描件
  2131. </span>
  2132. }
  2133. >
  2134. <PicturesWall
  2135. fileList={this.getOrgCodeUrl}
  2136. pictureUrl={this.state.orgCodeUrl}
  2137. />
  2138. <p>图片建议:要清晰。</p>
  2139. <Button
  2140. style={{
  2141. float: "right",
  2142. marginRight: "140px",
  2143. marginTop: "20px"
  2144. }}
  2145. onClick={this.getOrderLog}
  2146. >
  2147. 查看订单 日志
  2148. </Button>
  2149. </FormItem>
  2150. </div>
  2151. <div className="clearfix">
  2152. <FormItem
  2153. labelCol={{ span: 4 }}
  2154. wrapperCol={{ span: 16 }}
  2155. label="订单留言"
  2156. >
  2157. <Input
  2158. type="textarea"
  2159. placeholder="请输入订单留言"
  2160. rows={4}
  2161. value={this.state.orderRemarks}
  2162. onChange={e => {
  2163. this.setState({ orderRemarks: e.target.value });
  2164. }}
  2165. />
  2166. </FormItem>
  2167. </div>
  2168. <div className="clearfix">
  2169. <FormItem
  2170. className="half-item"
  2171. {...formItemLayout}
  2172. label="订单负责人"
  2173. >
  2174. <span>{this.state.salesmanName}</span>
  2175. </FormItem>
  2176. <FormItem
  2177. className="half-item"
  2178. {...formItemLayout}
  2179. label="订单负责人电话"
  2180. >
  2181. <span>{this.state.salesmanMobile}</span>
  2182. </FormItem>
  2183. </div>
  2184. <div className="clearfix">
  2185. <FormItem
  2186. className="half-item"
  2187. {...formItemLayout}
  2188. label="当前财务负责人"
  2189. >
  2190. <span>{this.state.nowFinance}</span>
  2191. </FormItem>
  2192. <FormItem
  2193. className="half-item"
  2194. {...formItemLayout}
  2195. label="当前财务负责人电话"
  2196. >
  2197. <span>{this.state.nowFinanceMobile}</span>
  2198. </FormItem>
  2199. </div>
  2200. <div className="clearfix">
  2201. <FormItem
  2202. className="half-item"
  2203. {...formItemLayout}
  2204. style={{ opacity: ".5" }}
  2205. label="原订单负责人"
  2206. >
  2207. <span>{this.state.oldSalesmanName}</span>
  2208. </FormItem>
  2209. <FormItem
  2210. className="half-item"
  2211. {...formItemLayout}
  2212. style={{ opacity: ".5" }}
  2213. label="原订单负责人电话"
  2214. >
  2215. <span>{this.state.oldSalesmanMobile}</span>
  2216. </FormItem>
  2217. </div>
  2218. <div className="clearfix">
  2219. <FormItem
  2220. className="half-item"
  2221. style={{ opacity: ".5" }}
  2222. {...formItemLayout}
  2223. label="实际财务操作人"
  2224. >
  2225. <span>{this.state.financeName}</span>
  2226. </FormItem>
  2227. <FormItem
  2228. className="half-item"
  2229. {...formItemLayout}
  2230. style={{ opacity: ".5" }}
  2231. label="实际财务操作人电话"
  2232. >
  2233. <span>{this.state.financeMobile}</span>
  2234. </FormItem>
  2235. </div>
  2236. <div className="clearfix">
  2237. <FormItem
  2238. className="half-item"
  2239. {...formItemLayout}
  2240. label="驳回人"
  2241. >
  2242. <span>{this.state.initiateName}</span>
  2243. </FormItem>
  2244. <FormItem
  2245. className="half-item"
  2246. {...formItemLayout}
  2247. label="驳回时间"
  2248. >
  2249. <span>{this.state.backDate}</span>
  2250. </FormItem>
  2251. </div>
  2252. <div className="clearfix">
  2253. <FormItem
  2254. labelCol={{ span: 4 }}
  2255. wrapperCol={{ span: 16 }}
  2256. label="驳回原因"
  2257. >
  2258. <span>{this.state.reason}</span>
  2259. </FormItem>
  2260. </div>
  2261. <div>
  2262. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  2263. 项目业务
  2264. </span>
  2265. <Button
  2266. type="primary"
  2267. onClick={this.addDetailed}
  2268. style={{
  2269. float: "right",
  2270. marginRight: "50px",
  2271. marginBottom: "15px"
  2272. }}
  2273. >
  2274. 添加项目明细
  2275. </Button>
  2276. </div>
  2277. <div className="patent-table">
  2278. <Spin spinning={this.state.loading}>
  2279. <Table
  2280. columns={this.state.columnsX}
  2281. dataSource={this.state.dataSourceX}
  2282. pagination={this.state.paginations}
  2283. onRowClick={this.tableRowClickX}
  2284. bordered
  2285. size="small"
  2286. />
  2287. </Spin>
  2288. </div>
  2289. <div
  2290. style={{ display: cuiDataList.length ? "block" : "none" }}
  2291. >
  2292. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  2293. 旧催款节点
  2294. </span>
  2295. <Button
  2296. type="primary"
  2297. // onClick={this.addcontact}
  2298. disabled
  2299. onClick={e => {
  2300. cuiDataList.length
  2301. ? this.addcontact()
  2302. : this.addcontactNew();
  2303. }}
  2304. style={{
  2305. float: "right",
  2306. marginRight: "50px",
  2307. marginBottom: "15px"
  2308. }}
  2309. >
  2310. 添加催款节点
  2311. </Button>
  2312. </div>
  2313. <div
  2314. className="clearfix"
  2315. style={{ display: cuiDataList.length ? "block" : "none" }}
  2316. >
  2317. <Spin spinning={this.state.loading}>
  2318. <Form layout="horizontal" id="demand-form">
  2319. <Table
  2320. pagination={false}
  2321. columns={this.state.ContactsLists}
  2322. dataSource={this.state.contactList}
  2323. bordered
  2324. size="small"
  2325. scroll={{ x: "max-content", y: 0 }}
  2326. />
  2327. <Col
  2328. span={24}
  2329. offset={9}
  2330. style={{ marginTop: "15px" }}
  2331. ></Col>
  2332. </Form>
  2333. </Spin>
  2334. </div>
  2335. <div>
  2336. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  2337. 新催款节点
  2338. </span>
  2339. <span
  2340. style={{
  2341. display: cuiDataList.length ? "none" : "inline-block",
  2342. marginLeft: 10,
  2343. color: "red"
  2344. }}
  2345. >
  2346. 金额总计(万元): {this.state.totalCui}
  2347. </span>
  2348. <Button
  2349. type="primary"
  2350. disabled={
  2351. cuiDataList.length || this.state.addFlag
  2352. ? true
  2353. : false
  2354. }
  2355. // onClick={this.addcontact}
  2356. onClick={e => {
  2357. this.setState({ addFlag: true });
  2358. this.addcontactNew();
  2359. }}
  2360. style={{
  2361. float: "right",
  2362. marginRight: "50px",
  2363. marginBottom: "15px"
  2364. }}
  2365. >
  2366. 添加催款节点
  2367. </Button>
  2368. </div>
  2369. <div className="clearfix">
  2370. <Spin spinning={this.state.loading}>
  2371. <Form layout="horizontal" id="demand-form">
  2372. <Table
  2373. pagination={false}
  2374. columns={this.state.ContactsListsNew}
  2375. dataSource={this.state.contactListNew}
  2376. scroll={{ x: "max-content", y: 0 }}
  2377. bordered
  2378. size="small"
  2379. />
  2380. <Col
  2381. span={24}
  2382. offset={9}
  2383. style={{ marginTop: "15px" }}
  2384. ></Col>
  2385. </Form>
  2386. </Spin>
  2387. </div>
  2388. <div className="addSave" style={{ marginTop: "15px" }}>
  2389. <Button
  2390. className="cancel"
  2391. type="primary"
  2392. onClick={this.examOk}
  2393. style={{ marginLeft: "200px" }}
  2394. htmlType="submit"
  2395. >
  2396. 重新提交
  2397. </Button>
  2398. <Button
  2399. className="cancel"
  2400. type="primary"
  2401. onClick={this.examOks}
  2402. style={{ marginLeft: "50px" }}
  2403. htmlType="submit"
  2404. >
  2405. 订单作废
  2406. </Button>
  2407. <Button
  2408. className="cancel"
  2409. type="ghost"
  2410. onClick={this.visitCancel}
  2411. style={{ marginLeft: "50px" }}
  2412. >
  2413. 取消
  2414. </Button>
  2415. </div>
  2416. </div>
  2417. </Spin>
  2418. </Form>
  2419. </Modal>
  2420. <Modal
  2421. maskClosable={false}
  2422. visible={this.state.addnextVisible}
  2423. onOk={this.nextCancel}
  2424. onCancel={this.nextCancel}
  2425. width="800px"
  2426. title={this.state.addState ? "添加项目任务" : "项目任务详情"}
  2427. footer=""
  2428. className="admin-desc-content"
  2429. >
  2430. <Form
  2431. layout="horizontal"
  2432. onSubmit={this.nextSubmit}
  2433. id="demand-form"
  2434. >
  2435. <Spin spinning={this.state.loading}>
  2436. {this.state.addState ? (
  2437. <div className="clearfix">
  2438. <FormItem
  2439. className="half-item"
  2440. {...formItemLayout}
  2441. label="服务名称"
  2442. >
  2443. <AutoComplete
  2444. className="certain-category-search"
  2445. dropdownClassName="certain-category-search-dropdown"
  2446. dropdownMatchSelectWidth={false}
  2447. dropdownStyle={{ width: 200 }}
  2448. style={{ width: "200px" }}
  2449. dataSource={options}
  2450. placeholder="输入服务名称"
  2451. value={this.state.commodityName}
  2452. onChange={this.httpChange}
  2453. filterOption={true}
  2454. onSelect={this.selectAuto}
  2455. >
  2456. <Input />
  2457. </AutoComplete>
  2458. <span className="mandatory">*</span>
  2459. </FormItem>
  2460. <FormItem
  2461. className="half-item"
  2462. {...formItemLayout}
  2463. label="服务数量"
  2464. >
  2465. <Input
  2466. placeholder="请输入服务数量"
  2467. value={this.state.commodityQuantity}
  2468. style={{ width: "200px" }}
  2469. onChange={e => {
  2470. this.setState({
  2471. commodityQuantity: e.target.value
  2472. });
  2473. }}
  2474. ref="commodityQuantity"
  2475. />
  2476. <span className="mandatory">*</span>
  2477. </FormItem>
  2478. <FormItem
  2479. className="half-item"
  2480. {...formItemLayout}
  2481. label="实签价格(万元)"
  2482. >
  2483. <Input
  2484. placeholder="请输入实签价格"
  2485. value={this.state.commodityPrice}
  2486. style={{ width: "200px" }}
  2487. onChange={e => {
  2488. this.setState({ commodityPrice: e.target.value });
  2489. }}
  2490. ref="commodityPrice"
  2491. />
  2492. <span className="mandatory">*</span>
  2493. </FormItem>
  2494. <FormItem
  2495. className="half-item"
  2496. {...formItemLayout}
  2497. label="主要业务"
  2498. >
  2499. <Select
  2500. placeholder="选择是否为主要业务"
  2501. style={{ width: "200px" }}
  2502. value={this.state.main}
  2503. onChange={e => {
  2504. this.setState({ main: e });
  2505. }}
  2506. >
  2507. {boutique.map(function(item) {
  2508. return (
  2509. <Select.Option key={item.value}>
  2510. {item.key}
  2511. </Select.Option>
  2512. );
  2513. })}
  2514. </Select>
  2515. <span className="mandatory">*</span>
  2516. </FormItem>
  2517. <div className="clearfix">
  2518. <FormItem
  2519. labelCol={{ span: 4 }}
  2520. wrapperCol={{ span: 16 }}
  2521. label="服务说明"
  2522. >
  2523. <Input
  2524. type="textarea"
  2525. placeholder="请输入服务说明"
  2526. value={this.state.taskComment}
  2527. onChange={e => {
  2528. this.setState({ taskComment: e.target.value });
  2529. }}
  2530. />
  2531. </FormItem>
  2532. </div>
  2533. <FormItem
  2534. wrapperCol={{ span: 12, offset: 4 }}
  2535. className="half-middle"
  2536. >
  2537. <Button
  2538. className="submitSave"
  2539. type="primary"
  2540. htmlType="submit"
  2541. >
  2542. 保存
  2543. </Button>
  2544. <Button
  2545. className="submitSave"
  2546. type="ghost"
  2547. onClick={this.nextCancel}
  2548. >
  2549. 取消
  2550. </Button>
  2551. </FormItem>
  2552. </div>
  2553. ) : (
  2554. <div className="clearfix">
  2555. <FormItem
  2556. className="half-item"
  2557. {...formItemLayout}
  2558. label="项目名称"
  2559. >
  2560. <span>{this.state.commodityName}</span>
  2561. </FormItem>
  2562. <FormItem
  2563. className="half-item"
  2564. {...formItemLayout}
  2565. label="项目数量"
  2566. >
  2567. <Input
  2568. placeholder="请输入数量"
  2569. value={this.state.commodityQuantity}
  2570. style={{ width: "200px" }}
  2571. onChange={e => {
  2572. this.setState({
  2573. commodityQuantity: e.target.value
  2574. });
  2575. }}
  2576. />
  2577. <span className="mandatory">*</span>
  2578. </FormItem>
  2579. <FormItem
  2580. className="half-item"
  2581. {...formItemLayout}
  2582. label="金额(万元)"
  2583. >
  2584. <Input
  2585. placeholder="请输入签单金额"
  2586. value={this.state.commodityPrice}
  2587. style={{ width: "200px" }}
  2588. onChange={e => {
  2589. this.setState({ commodityPrice: e.target.value });
  2590. }}
  2591. />
  2592. <span className="mandatory">*</span>
  2593. </FormItem>
  2594. <FormItem
  2595. className="half-item"
  2596. {...formItemLayout}
  2597. label="主要项目"
  2598. >
  2599. <Select
  2600. placeholder="选择是否为主要业务"
  2601. style={{ width: "200px" }}
  2602. value={this.state.main}
  2603. onChange={e => {
  2604. this.setState({ main: e });
  2605. }}
  2606. >
  2607. {boutique.map(function(item) {
  2608. return (
  2609. <Select.Option key={item.value}>
  2610. {item.key}
  2611. </Select.Option>
  2612. );
  2613. })}
  2614. </Select>
  2615. <span className="mandatory">*</span>
  2616. </FormItem>
  2617. <div className="clearfix">
  2618. <FormItem
  2619. labelCol={{ span: 4 }}
  2620. wrapperCol={{ span: 16 }}
  2621. label="服务说明"
  2622. >
  2623. <Input
  2624. type="textarea"
  2625. placeholder="请输入服务说明"
  2626. value={this.state.taskComment}
  2627. onChange={e => {
  2628. this.setState({ taskComment: e.target.value });
  2629. }}
  2630. />
  2631. </FormItem>
  2632. </div>
  2633. <FormItem
  2634. wrapperCol={{ span: 12, offset: 4 }}
  2635. className="half-middle"
  2636. >
  2637. <Button
  2638. className="submitSave"
  2639. type="primary"
  2640. onClick={this.tabRowSave}
  2641. >
  2642. 保存
  2643. </Button>
  2644. <Button
  2645. className="submitSave"
  2646. type="ghost"
  2647. onClick={this.nextCancel}
  2648. >
  2649. 取消
  2650. </Button>
  2651. </FormItem>
  2652. </div>
  2653. )}
  2654. </Spin>
  2655. </Form>
  2656. </Modal>
  2657. {/* <Modal
  2658. visible={this.state.rizhivisible}
  2659. className="admin-desc-content"
  2660. width="800px"
  2661. maskClosable={false}
  2662. title="订单日志"
  2663. footer={null}
  2664. onCancel={this.closeOrderLog}
  2665. >
  2666. <div className="patent-table">
  2667. <Spin spinning={this.state.loading}>
  2668. <Table
  2669. columns={this.state.columnsrizhi}
  2670. dataSource={this.state.dataSourcerizhi}
  2671. pagination={false}
  2672. />
  2673. </Spin>
  2674. </div>
  2675. </Modal> */}
  2676. <OrderRiZi
  2677. dataSourcerizhi={this.state.dataSourcerizhi}
  2678. closeOrderLog={this.closeOrderLog}
  2679. visible={this.state.rizhivisible}
  2680. loading={this.state.loading}
  2681. />
  2682. </div>
  2683. </div>
  2684. );
  2685. }
  2686. })
  2687. );
  2688. export default IntentionCustomer;