addorders.js 96 KB

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