addorders.js 96 KB

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