reject.jsx 100 KB

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