addorders.js 94 KB

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