addorders.js 93 KB

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