addorders.js 107 KB

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