addorders.js 97 KB

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