addService.jsx 176 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959
  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. Tabs
  17. } from "antd";
  18. import $ from "jquery/src/ajax";
  19. import "../userMangagement.less";
  20. import "../billing.less";
  21. import moment from "moment";
  22. import Picture from "@/manageCenter/publicComponent/picture";
  23. import OrderRiZi from "@/orderRiZi.jsx";
  24. import {
  25. orderTypes,
  26. customerType,
  27. jiedian,
  28. tepi,
  29. boutique,
  30. } from "../../../dataDic.js";
  31. import {
  32. splitUrl,
  33. getProcessStatus,
  34. getLiquidationStatus,
  35. getboutique,
  36. getApprovedState,
  37. getjiedian,
  38. getCuikuan,
  39. getProjectStatus,
  40. moneyVerify
  41. } from "../../../tools.js";
  42. import {cuiJieDian} from "@/dataDic.js"
  43. import PicturesWall from "./changeComponent/picturesWall.js";
  44. import { changeType, getChangeType } from "./changeComponent/changeDetailYxgly";
  45. // const Options = Select.Option;
  46. const Option = AutoComplete.Option;
  47. const confirm = Modal.confirm;
  48. const NewService = Form.create()(
  49. React.createClass({
  50. //查看项目列表
  51. loadData(record) {
  52. this.state.data = [];
  53. this.setState({
  54. loading: true
  55. });
  56. $.ajax({
  57. method: "get",
  58. dataType: "json",
  59. crossDomain: false,
  60. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  61. data: {
  62. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  63. },
  64. success: function(data) {
  65. let theArr = [];
  66. if (!data.data) {
  67. if (data.error && data.error.length) {
  68. message.warning(data.error[0].message);
  69. }
  70. } else {
  71. for (let i = 0; i < data.data.length; i++) {
  72. let thisdata = data.data[i];
  73. theArr.push({
  74. key: i,
  75. id: thisdata.id,
  76. orderNo: thisdata.orderNo, //订单编号
  77. commodityId: thisdata.commodityId, //项目ID
  78. commodityName: thisdata.commodityName, //项目名称
  79. cname: thisdata.cname, //项目类别
  80. commodityPrice: thisdata.commodityPrice, //项目价格
  81. commodityQuantity: thisdata.commodityQuantity, //项目数量
  82. main: thisdata.main, //是否为主要任务
  83. taskComment: thisdata.taskComment, //任务说明
  84. contacts: thisdata.contacts, //联系人
  85. contactsMobile: thisdata.contactsMobile, //联系人电话
  86. projectStatus: thisdata.projectStatus, //项目状态
  87. sort: thisdata.cSort
  88. });
  89. }
  90. }
  91. this.departmentList();
  92. this.setState({
  93. dataSource: theArr,
  94. pagination: false,
  95. // 禁用变更类型
  96. changeFlag: false
  97. });
  98. }.bind(this)
  99. }).always(
  100. function() {
  101. this.setState({
  102. loading: false
  103. });
  104. }.bind(this)
  105. );
  106. },
  107. //收款节点
  108. loadDatas(record) {
  109. this.state.data = [];
  110. this.setState({
  111. loading: true
  112. });
  113. $.ajax({
  114. method: "get",
  115. dataType: "json",
  116. crossDomain: false,
  117. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  118. data: {
  119. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  120. },
  121. success: function(data) {
  122. let theArr = [];
  123. if (!data.data) {
  124. if (data.error && data.error.length) {
  125. message.warning(data.error[0].message);
  126. }
  127. } else {
  128. for (let i = 0; i < data.data.length; i++) {
  129. let thisdata = data.data[i];
  130. theArr.push({
  131. key: i,
  132. id: thisdata.id
  133. });
  134. }
  135. }
  136. this.setState({
  137. dataSource: theArr,
  138. pagination: false
  139. });
  140. }.bind(this)
  141. }).always(
  142. function() {
  143. this.setState({
  144. loading: false
  145. });
  146. }.bind(this)
  147. );
  148. },
  149. getInitialState() {
  150. return {
  151. isCaoGao: false,
  152. cuiFlag: false,
  153. startRemarks: "",
  154. remarksC: "",
  155. loading: false,
  156. visible: false,
  157. status: 4,
  158. orgCodeUrl: [],
  159. voucherUrl: [],
  160. customerArr: [],
  161. // 禁用变更类型转换
  162. changeFlag: false,
  163. // 合同额禁用
  164. hetongFlag: true,
  165. // 项目及催款禁用
  166. listFlag: true,
  167. mark: false,
  168. activeKey: "1",
  169. typeChange: [],
  170. bussStats: false,
  171. checkedKeys: [],
  172. lookflowList: [],
  173. contractUrl: [],
  174. applicationUrl: [],
  175. changeAmount: "0",
  176. active: {
  177. applySign: false
  178. },
  179. lookState: false,
  180. signBillVisible: false,
  181. commod: "",
  182. columns: [
  183. {
  184. title: "业务项目名称",
  185. dataIndex: "commodityName",
  186. key: "commodityName"
  187. },
  188. {
  189. title: "项目类别",
  190. dataIndex: "cname",
  191. key: "cname"
  192. },
  193. {
  194. title: "项目数量",
  195. dataIndex: "commodityQuantity",
  196. key: "commodityQuantity"
  197. },
  198. {
  199. title: "金额(万元)",
  200. dataIndex: "commodityPrice",
  201. key: "commodityPrice"
  202. },
  203. {
  204. title: "负责人",
  205. dataIndex: "contacts",
  206. key: "contacts"
  207. },
  208. {
  209. title: "负责人电话",
  210. dataIndex: "contactsMobile",
  211. key: "contactsMobile"
  212. },
  213. {
  214. title: "项目状态",
  215. dataIndex: "projectStatus",
  216. key: "projectStatus",
  217. render: text => {
  218. return getProjectStatus(text);
  219. }
  220. },
  221. {
  222. title: "主要项目",
  223. dataIndex: "main",
  224. key: "main",
  225. render: text => {
  226. return text ? "是" : "否";
  227. }
  228. },
  229. {
  230. title: "项目说明",
  231. dataIndex: "taskComment",
  232. key: "taskComment",
  233. render: text => {
  234. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  235. }
  236. },
  237. {
  238. title: "操作",
  239. dataIndex: "ABC",
  240. key: "ABC",
  241. render: (text, record) => {
  242. return (
  243. <div>
  244. {this.state.processStatus == 0 ? (
  245. <Button
  246. onClick={e => {
  247. e.stopPropagation();
  248. this.showConfirm(this.delectRow, record);
  249. }}
  250. >
  251. 删除
  252. </Button>
  253. ) : (
  254. ""
  255. )}
  256. </div>
  257. );
  258. }
  259. }
  260. ],
  261. proColumns: [
  262. {
  263. title: "业务项目名称",
  264. dataIndex: "commodityName",
  265. key: "commodityName"
  266. },
  267. {
  268. title: "项目类别",
  269. dataIndex: "cname",
  270. key: "cname"
  271. },
  272. {
  273. title: "项目数量",
  274. dataIndex: "commodityQuantity",
  275. key: "commodityQuantity"
  276. },
  277. {
  278. title: "金额(万元)",
  279. dataIndex: "commodityPrice",
  280. key: "commodityPrice"
  281. },
  282. {
  283. title: "主要项目",
  284. dataIndex: "main",
  285. key: "main",
  286. render: text => {
  287. return text ? "是" : "否";
  288. }
  289. },
  290. {
  291. title: "项目说明",
  292. dataIndex: "taskComment",
  293. key: "taskComment",
  294. render: text => {
  295. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  296. }
  297. },
  298. {
  299. title: "操作",
  300. dataIndex: "ABC",
  301. key: "ABC",
  302. render: (text, record) => {
  303. return (
  304. <div>
  305. <Button
  306. onClick={e => {
  307. e.stopPropagation();
  308. this.showConfirm(this.changeDeletePro, record);
  309. }}
  310. disabled={this.state.listFlag}
  311. >
  312. 删除
  313. </Button>
  314. </div>
  315. );
  316. }
  317. }
  318. ],
  319. columnsrizhi: [
  320. {
  321. title: "流程",
  322. dataIndex: "processName",
  323. key: "processName"
  324. },
  325. {
  326. title: "操作人",
  327. dataIndex: "adminName",
  328. key: "adminName"
  329. },
  330. {
  331. title: "时间",
  332. dataIndex: "createDate",
  333. key: "createDate"
  334. }
  335. ],
  336. contactList: [],
  337. loading: false,
  338. ContactsLists: [
  339. {
  340. title: "催款科目",
  341. dataIndex: "dunSubject",
  342. key: "dunSubject",
  343. render: (text, record) => {
  344. return (
  345. <Select
  346. placeholder="请选择催款科目"
  347. value={record.dunSubject}
  348. style={{ width: "150px" }}
  349. disabled
  350. onChange={e => {
  351. record.dunSubject = e;
  352. this.setState({ contactList: this.state.contactList });
  353. }}
  354. >
  355. {jiedian.map(function(item) {
  356. return (
  357. <Select.Option key={item.value}>{item.key}</Select.Option>
  358. );
  359. })}
  360. </Select>
  361. );
  362. }
  363. },
  364. {
  365. title: "金额(万元)",
  366. dataIndex: "money",
  367. key: "money",
  368. render: (text, record) => {
  369. return (
  370. <Input
  371. value={record.money}
  372. placeholder="请输入金额(必填项)"
  373. disabled
  374. key={record.id}
  375. required="required"
  376. onChange={e => {
  377. record.money = e.target.value;
  378. this.setState({ contactList: this.state.contactList });
  379. }}
  380. style={{ width: "120px" }}
  381. />
  382. );
  383. }
  384. },
  385. {
  386. title: "催款状态",
  387. dataIndex: "dunStatus",
  388. key: "dunStatus",
  389. render: text => {
  390. return getCuikuan(text);
  391. }
  392. },
  393. {
  394. title: "操作",
  395. dataIndex: "dels",
  396. key: "dels",
  397. render: (text, record) => {
  398. return (
  399. <div>
  400. {
  401. <Popconfirm
  402. title="是否删除?"
  403. onConfirm={() => {
  404. this.confirmDelet(record.key);
  405. }}
  406. okText="删除"
  407. cancelText="不删除"
  408. >
  409. <Button
  410. style={{
  411. marginRight: "10px",
  412. color: "#ffffff",
  413. background: "#f00",
  414. border: "none",
  415. display:
  416. this.state.processStatus == 0 ? "block" : "none"
  417. }}
  418. >
  419. 删除
  420. </Button>
  421. </Popconfirm>
  422. }
  423. {record.id ? (
  424. ""
  425. ) : (
  426. <Button type="primary" onClick={this.contactSave}>
  427. 保存
  428. </Button>
  429. )}
  430. </div>
  431. );
  432. }
  433. }
  434. ],
  435. ContactsListsNew: [
  436. {
  437. title: "项目名称",
  438. dataIndex: "commodityName",
  439. key: "commodityName",
  440. render: (text, record, index) => {
  441. let dataArr = this.state.dataSource || [];
  442. if (text) {
  443. return <span>{text}</span>;
  444. }
  445. return (
  446. <Select
  447. placeholder="请选择名称"
  448. style={{ width: "150px" }}
  449. disabled={
  450. this.state.getLoad && record.sortName ? true : false
  451. }
  452. onChange={e => {
  453. record.sortName = e;
  454. dataArr.forEach(item => {
  455. if (item.commodityName == record.sortName) {
  456. record.cname = item.cname;
  457. record.tid = item.id;
  458. record.isSave = true;
  459. record.sort = item.sort;
  460. cuiJieDian.forEach(item => {
  461. if (item.value == record.sort) {
  462. record.arr = item.children;
  463. let yearFlag = true;
  464. if (record.sort == 6) {
  465. yearFlag = false;
  466. }
  467. this.setState({
  468. getLoad: true,
  469. yearFlag
  470. });
  471. }
  472. });
  473. }
  474. });
  475. }}
  476. >
  477. {dataArr.map(item => {
  478. return (
  479. <Select.Option key={item.id} value={item.commodityName}>
  480. {item.commodityName}
  481. </Select.Option>
  482. );
  483. })}
  484. </Select>
  485. );
  486. }
  487. },
  488. {
  489. title: "项目分类",
  490. dataIndex: "projectType",
  491. key: "projectType",
  492. render: (text, record) => {
  493. if (text) {
  494. let arr = this.state.dataSource || [];
  495. let str = "";
  496. for (let i = 0; i < arr.length; i++) {
  497. if (this.state.dataSource[i].sort == text) {
  498. str = this.state.dataSource[i].cname;
  499. return <span>{str}</span>;
  500. }
  501. }
  502. }
  503. if (this.state.getLoad) {
  504. return (
  505. <Select
  506. style={{ width: "150px" }}
  507. placeholder="请选择分类"
  508. value={record.cname}
  509. >
  510. <Select.Option key={record.sort} value={record.cname}>
  511. {record.cname}
  512. </Select.Option>
  513. </Select>
  514. );
  515. } else {
  516. return (
  517. <Select style={{ width: "150px" }} placeholder="请选择分类">
  518. <Select.Option key={record.sort} value={record.cname}>
  519. {record.cname}
  520. </Select.Option>
  521. </Select>
  522. );
  523. }
  524. }
  525. },
  526. {
  527. title: "催款科目",
  528. dataIndex: "dunTypeName",
  529. key: "dunTypeName",
  530. render: (text, record) => {
  531. if (text) {
  532. return <span>{text}</span>;
  533. }
  534. if (this.state.getLoad) {
  535. let arr = record.arr || [];
  536. return (
  537. <Select
  538. style={{ width: "150px" }}
  539. placeholder="请选择分类"
  540. onChange={e => {
  541. record.dunType = e;
  542. if (e != 1) {
  543. this.setState({
  544. timeFlag: true
  545. });
  546. } else {
  547. this.setState({
  548. timeFlag: false
  549. });
  550. }
  551. if (e == 1 && record.sort == 6) {
  552. this.setState({
  553. yearFlag: true
  554. });
  555. } else if (e != 1 && record.sort == 6) {
  556. this.setState({
  557. yearFlag: false
  558. });
  559. }
  560. if (record.sort == 3 && e == 3) {
  561. this.setState({
  562. boFlag: true
  563. });
  564. } else {
  565. this.setState({
  566. boFlag: false
  567. });
  568. }
  569. }}
  570. >
  571. {arr.map(item => {
  572. record;
  573. return (
  574. <Select.Option key={item.value} value={item.value}>
  575. {item.key}
  576. </Select.Option>
  577. );
  578. })}
  579. </Select>
  580. );
  581. } else {
  582. return (
  583. <Select style={{ width: "150px" }} placeholder="请选择分类">
  584. <Select.Option
  585. key={0}
  586. value={"请选择上一项"}
  587. ></Select.Option>
  588. </Select>
  589. );
  590. }
  591. }
  592. },
  593. {
  594. title: "首付时间(特批需选择时间)",
  595. dataIndex: "waitDay",
  596. key: "waitDay",
  597. render: (text, record) => {
  598. if (record.dunTypeName) {
  599. if (text == 0) {
  600. var str = "当天";
  601. } else if (!text) {
  602. var str = "";
  603. } else {
  604. var str = text + "天";
  605. }
  606. return <span>{str}</span>;
  607. }
  608. return (
  609. <Select
  610. placeholder="请选择时间"
  611. style={{ width: "150px" }}
  612. disabled={
  613. this.state.approval != 0 && !this.state.timeFlag
  614. ? false
  615. : true
  616. }
  617. onChange={e => {
  618. record.waitDay = e;
  619. }}
  620. >
  621. <Select.Option key={0}>当天</Select.Option>
  622. <Select.Option key={3}>3天</Select.Option>
  623. <Select.Option key={5}>5天</Select.Option>
  624. <Select.Option key={7}>7天</Select.Option>
  625. <Select.Option key={15}>15天</Select.Option>
  626. </Select>
  627. );
  628. }
  629. },
  630. {
  631. title: "金额(万元)",
  632. dataIndex: "money",
  633. key: "money",
  634. render: (text, record) => {
  635. if (record.dunTypeName) {
  636. if (record.appropriationRatio && !record.money) {
  637. return <span>{record.appropriationRatio}(拨款比例)</span>;
  638. } else if (record.appropriationRatio && record.money) {
  639. return (
  640. <span>
  641. {text}(比例:{record.appropriationRatio})
  642. </span>
  643. );
  644. } else {
  645. return <span>{text}</span>;
  646. }
  647. }
  648. if (this.state.boFlag) {
  649. return (
  650. <div>
  651. <div style={{ width: 70, float: "left", marginRight: 5 }}>
  652. <Select
  653. placeholder="选择"
  654. defaultValue={"金额"}
  655. onChange={e => {
  656. record.boStatus = e;
  657. }}
  658. >
  659. <Select.Option key={true}>比例</Select.Option>
  660. <Select.Option key={false}>金额</Select.Option>
  661. </Select>
  662. </div>
  663. <div style={{ float: "right" }}>
  664. <Input
  665. value={record.money}
  666. placeholder="请根据左侧类型填写"
  667. key={record.id}
  668. required="required"
  669. onChange={e => {
  670. record.money = e.target.value;
  671. this.setState({
  672. contactList: this.state.contactList
  673. });
  674. }}
  675. style={{ width: "120px" }}
  676. />
  677. </div>
  678. </div>
  679. );
  680. } else {
  681. return (
  682. <div>
  683. <Input
  684. value={record.money}
  685. placeholder="请输入金额(必填项)"
  686. key={record.id}
  687. required="required"
  688. onChange={e => {
  689. record.money = e.target.value;
  690. this.setState({ contactList: this.state.contactList });
  691. }}
  692. style={{ width: "120px" }}
  693. />
  694. </div>
  695. );
  696. }
  697. }
  698. },
  699. {
  700. title: "服务年限",
  701. dataIndex: "startDate",
  702. key: "startDate",
  703. render: (text, record) => {
  704. if (record.dunTypeName) {
  705. return <span>{text}</span>;
  706. }
  707. return (
  708. <Select
  709. placeholder="请选择年限"
  710. style={{ width: "150px" }}
  711. disabled={this.state.yearFlag ? true : false}
  712. onChange={e => {
  713. record.effectiveCount = e;
  714. }}
  715. >
  716. {/* <Select.Option key={null}>无</Select.Option> */}
  717. <Select.Option key={1}>一年</Select.Option>
  718. <Select.Option key={3}>两年</Select.Option>
  719. <Select.Option key={5}>三年</Select.Option>
  720. <Select.Option key={7}>四年</Select.Option>
  721. <Select.Option key={9}>五年</Select.Option>
  722. </Select>
  723. );
  724. }
  725. },
  726. {
  727. title: "催款状态",
  728. dataIndex: "status",
  729. key: "status",
  730. render: text => {
  731. return <span>{text == 1 ? "已启动" : "未启动"}</span>;
  732. }
  733. },
  734. {
  735. title: "操作",
  736. dataIndex: "dels",
  737. key: "dels",
  738. render: (text, record, index) => {
  739. return (
  740. <div>
  741. {this.state.processStatus == 0 ? (
  742. <Popconfirm
  743. title="是否删除?"
  744. onConfirm={() => {
  745. this.confirmDeletNew(record);
  746. }}
  747. okText="删除"
  748. cancelText="不删除"
  749. >
  750. <Button
  751. style={{
  752. marginRight: "10px",
  753. color: "#ffffff",
  754. background: "#f00",
  755. border: "none"
  756. }}
  757. >
  758. 删除
  759. </Button>
  760. </Popconfirm>
  761. ) : (
  762. ""
  763. )}
  764. {record.isSave ? (
  765. <Button
  766. type="primary"
  767. onClick={e => {
  768. this.contactSaveNew(record);
  769. }}
  770. >
  771. 保存
  772. </Button>
  773. ) : (
  774. ""
  775. )}
  776. </div>
  777. );
  778. }
  779. }
  780. ],
  781. changeCuiList: [
  782. {
  783. title: "项目名称",
  784. dataIndex: "commodityName",
  785. key: "commodityName",
  786. render: (text, record, index) => {
  787. let dataArr = this.state.proDataSource || [];
  788. if (text) {
  789. return <span>{text}</span>;
  790. }
  791. return (
  792. <Select
  793. placeholder="请选择名称"
  794. style={{ width: "150px" }}
  795. disabled={
  796. this.state.getLoad && record.sortName ? true : false
  797. }
  798. onChange={e => {
  799. record.sortName = e;
  800. dataArr.forEach(item => {
  801. if (item.commodityName == record.sortName) {
  802. record.cname = item.cname;
  803. record.tid = item.id;
  804. record.isSave = true;
  805. record.sort = item.cSort;
  806. cuiJieDian.forEach(item => {
  807. if (item.value == record.sort) {
  808. record.arr = item.children;
  809. let yearFlag = true;
  810. if (record.sort == 6) {
  811. yearFlag = false;
  812. }
  813. this.setState({
  814. getLoad: true,
  815. yearFlag
  816. });
  817. }
  818. });
  819. }
  820. });
  821. }}
  822. >
  823. {dataArr.map(item => {
  824. return (
  825. <Select.Option key={item.id} value={item.commodityName}>
  826. {item.commodityName}
  827. </Select.Option>
  828. );
  829. })}
  830. </Select>
  831. );
  832. }
  833. },
  834. {
  835. title: "项目分类",
  836. dataIndex: "projectType",
  837. key: "projectType",
  838. render: (text, record) => {
  839. if (text) {
  840. let arr = this.state.proDataSource || [];
  841. let str = "";
  842. for (let i = 0; i < arr.length; i++) {
  843. if (this.state.proDataSource[i].cSort == text) {
  844. str = this.state.proDataSource[i].cname;
  845. return <span>{str}</span>;
  846. }
  847. }
  848. }
  849. if (this.state.getLoad) {
  850. return (
  851. <Select
  852. style={{ width: "150px" }}
  853. placeholder="请选择分类"
  854. value={record.cname}
  855. >
  856. <Select.Option key={record.sort} value={record.cname}>
  857. {record.cname}
  858. </Select.Option>
  859. </Select>
  860. );
  861. } else {
  862. return (
  863. <Select style={{ width: "150px" }} placeholder="请选择分类">
  864. <Select.Option key={record.sort} value={record.cname}>
  865. {record.cname}
  866. </Select.Option>
  867. </Select>
  868. );
  869. }
  870. }
  871. },
  872. {
  873. title: "催款科目",
  874. dataIndex: "dunTypeName",
  875. key: "dunTypeName",
  876. render: (text, record) => {
  877. if (text) {
  878. return <span>{text}</span>;
  879. }
  880. if (this.state.getLoad) {
  881. let arr = record.arr || [];
  882. return (
  883. <Select
  884. style={{ width: "150px" }}
  885. placeholder="请选择分类"
  886. onChange={e => {
  887. record.dunType = e;
  888. if (e != 1) {
  889. this.setState({
  890. timeFlag: true
  891. });
  892. } else {
  893. this.setState({
  894. timeFlag: false
  895. });
  896. }
  897. if (e == 1 && record.sort == 6) {
  898. this.setState({
  899. yearFlag: true
  900. });
  901. } else if (e != 1 && record.sort == 6) {
  902. this.setState({
  903. yearFlag: false
  904. });
  905. }
  906. if (record.sort == 3 && e == 3) {
  907. this.setState({
  908. boFlag: true
  909. });
  910. } else {
  911. this.setState({
  912. boFlag: false
  913. });
  914. }
  915. }}
  916. >
  917. {arr.map(item => {
  918. record;
  919. return (
  920. <Select.Option key={item.value} value={item.value}>
  921. {item.key}
  922. </Select.Option>
  923. );
  924. })}
  925. </Select>
  926. );
  927. } else {
  928. return (
  929. <Select style={{ width: "150px" }} placeholder="请选择分类">
  930. <Select.Option
  931. key={0}
  932. value={"请选择上一项"}
  933. ></Select.Option>
  934. </Select>
  935. );
  936. }
  937. }
  938. },
  939. {
  940. title: "首付时间(特批需选择时间)",
  941. dataIndex: "waitDay",
  942. key: "waitDay",
  943. render: (text, record) => {
  944. if (record.dunTypeName) {
  945. if (text == 0) {
  946. var str = "当天";
  947. } else if (!text) {
  948. var str = "";
  949. } else {
  950. var str = text + "天";
  951. }
  952. return <span>{str}</span>;
  953. }
  954. return (
  955. <Select
  956. placeholder="请选择时间"
  957. style={{ width: "150px" }}
  958. disabled={
  959. this.state.approval != 0 && !this.state.timeFlag
  960. ? false
  961. : true
  962. }
  963. onChange={e => {
  964. record.waitDay = e;
  965. }}
  966. >
  967. <Select.Option key={0}>当天</Select.Option>
  968. <Select.Option key={3}>3天</Select.Option>
  969. <Select.Option key={5}>5天</Select.Option>
  970. <Select.Option key={7}>7天</Select.Option>
  971. <Select.Option key={15}>15天</Select.Option>
  972. </Select>
  973. );
  974. }
  975. },
  976. {
  977. title: "金额(万元)",
  978. dataIndex: "money",
  979. key: "money",
  980. render: (text, record) => {
  981. if (record.dunTypeName) {
  982. if (record.appropriationRatio && !record.money) {
  983. return <span>{record.appropriationRatio}(拨款比例)</span>;
  984. } else if (record.appropriationRatio && record.money) {
  985. return (
  986. <span>
  987. {text}(比例:{record.appropriationRatio})
  988. </span>
  989. );
  990. } else {
  991. return <span>{text}</span>;
  992. }
  993. }
  994. if (this.state.boFlag) {
  995. return (
  996. <div>
  997. <div style={{ width: 70, float: "left", marginRight: 5 }}>
  998. <Select
  999. placeholder="选择"
  1000. defaultValue={"金额"}
  1001. onChange={e => {
  1002. record.boStatus = e;
  1003. }}
  1004. >
  1005. <Select.Option key={true}>比例</Select.Option>
  1006. <Select.Option key={false}>金额</Select.Option>
  1007. </Select>
  1008. </div>
  1009. <div style={{ float: "right" }}>
  1010. <Input
  1011. value={record.money}
  1012. placeholder="请根据左侧类型填写"
  1013. key={record.id}
  1014. required="required"
  1015. onChange={e => {
  1016. record.money = e.target.value;
  1017. this.setState({
  1018. contactList: this.state.contactList
  1019. });
  1020. }}
  1021. style={{ width: "120px" }}
  1022. />
  1023. </div>
  1024. </div>
  1025. );
  1026. } else {
  1027. return (
  1028. <div>
  1029. <Input
  1030. value={record.money}
  1031. placeholder="请输入金额(必填项)"
  1032. key={record.id}
  1033. required="required"
  1034. onChange={e => {
  1035. record.money = e.target.value;
  1036. this.setState({ contactList: this.state.contactList });
  1037. }}
  1038. style={{ width: "120px" }}
  1039. />
  1040. </div>
  1041. );
  1042. }
  1043. }
  1044. },
  1045. {
  1046. title: "服务年限",
  1047. dataIndex: "startDate",
  1048. key: "startDate",
  1049. render: (text, record) => {
  1050. if (record.dunTypeName) {
  1051. return <span>{text}</span>;
  1052. }
  1053. return (
  1054. <Select
  1055. placeholder="请选择年限"
  1056. style={{ width: "150px" }}
  1057. disabled={this.state.yearFlag ? true : false}
  1058. onChange={e => {
  1059. record.effectiveCount = e;
  1060. }}
  1061. >
  1062. {/* <Select.Option key={null}>无</Select.Option> */}
  1063. <Select.Option key={1}>一年</Select.Option>
  1064. <Select.Option key={3}>两年</Select.Option>
  1065. <Select.Option key={5}>三年</Select.Option>
  1066. <Select.Option key={7}>四年</Select.Option>
  1067. <Select.Option key={9}>五年</Select.Option>
  1068. </Select>
  1069. );
  1070. }
  1071. },
  1072. {
  1073. title: "催款状态",
  1074. dataIndex: "status",
  1075. key: "status",
  1076. render: text => {
  1077. return <span>{text == 1 ? "已启动" : "未启动"}</span>;
  1078. }
  1079. },
  1080. {
  1081. title: "操作",
  1082. dataIndex: "dels",
  1083. key: "dels",
  1084. render: (text, record, index) => {
  1085. return (
  1086. <div>
  1087. <Popconfirm
  1088. title="是否删除?"
  1089. onConfirm={() => {
  1090. this.changeDeleteCui(record);
  1091. }}
  1092. okText="删除"
  1093. cancelText="不删除"
  1094. >
  1095. <Button
  1096. disabled={this.state.listCuiFlag}
  1097. style={{
  1098. marginRight: "10px",
  1099. }}
  1100. >
  1101. 删除
  1102. </Button>
  1103. </Popconfirm>
  1104. {record.isSave ? (
  1105. <Button
  1106. type="primary"
  1107. onClick={e => {
  1108. this.changeSaveCui(record);
  1109. }}
  1110. >
  1111. 保存
  1112. </Button>
  1113. ) : (
  1114. ""
  1115. )}
  1116. </div>
  1117. );
  1118. }
  1119. }
  1120. ]
  1121. };
  1122. },
  1123. departmentList() {
  1124. this.setState({
  1125. loading: true
  1126. });
  1127. $.ajax({
  1128. method: "get",
  1129. dataType: "json",
  1130. crossDomain: false,
  1131. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  1132. data: {},
  1133. success: function(data) {
  1134. let thedata = data.data;
  1135. let theArr = [];
  1136. if (!thedata) {
  1137. if (data.error && data.error.length) {
  1138. message.warning(data.error[0].message);
  1139. }
  1140. thedata = {};
  1141. } else {
  1142. thedata.map(function(item, index) {
  1143. theArr.push({
  1144. key: index,
  1145. name: item.name,
  1146. id: item.id,
  1147. depNo: item.depNo
  1148. });
  1149. });
  1150. }
  1151. this.setState({
  1152. departmentArr: theArr
  1153. });
  1154. }.bind(this)
  1155. }).always(
  1156. function() {
  1157. this.setState({
  1158. loading: false
  1159. });
  1160. }.bind(this)
  1161. );
  1162. },
  1163. //新建订单、编辑订单保存
  1164. handleSubmit(e) {
  1165. e.preventDefault();
  1166. let theorgCodeUrl = [];
  1167. if (this.state.orgCodeUrl.length) {
  1168. let picArr = [];
  1169. this.state.orgCodeUrl.map(function(item) {
  1170. if (
  1171. item.response &&
  1172. item.response.data &&
  1173. item.response.data.length
  1174. ) {
  1175. picArr.push(item.response.data);
  1176. }
  1177. });
  1178. theorgCodeUrl = picArr.join(",");
  1179. }
  1180. if (this.props.userDetaile) {
  1181. if (this.state.totalAmount === "") {
  1182. message.warning("签单金额不能为空");
  1183. this.refs.signFirstPayment.focus();
  1184. return false;
  1185. }
  1186. if (this.state.firstAmount === "") {
  1187. message.warning("首付金额不能为空");
  1188. this.refs.signFirstPayment.focus();
  1189. return false;
  1190. }
  1191. if (moneyVerify(this.state.firstAmount)) {
  1192. return;
  1193. }
  1194. if (moneyVerify(this.state.totalAmount)) {
  1195. return;
  1196. }
  1197. if (!theorgCodeUrl) {
  1198. message.warning("图片过大,上传失败");
  1199. this.refs.signFirstPayment.focus();
  1200. return false;
  1201. }
  1202. if (!this.state.signDate) {
  1203. message.warning("签单日期不能为空");
  1204. this.refs.signFirstPayment.focus();
  1205. return false;
  1206. }
  1207. if (!this.state.orderRemarks) {
  1208. message.warning("订单留言不能为空");
  1209. this.refs.signFirstPayment.focus();
  1210. return false;
  1211. }
  1212. } else {
  1213. }
  1214. const arr = this.state.contactListNew || [];
  1215. for (let i = 0; i < arr.length; i++) {
  1216. if (
  1217. arr[i].dunType == 1 &&
  1218. arr[i].waitDay != null &&
  1219. this.state.approval == 0
  1220. ) {
  1221. message.warning(
  1222. "非特批存在填写催款节点首付时间的情况,请删除后重新填写保存"
  1223. );
  1224. return false;
  1225. } else if (
  1226. arr[i].dunType == 1 &&
  1227. arr[i].waitDay == null &&
  1228. this.state.approval == 1
  1229. ) {
  1230. message.warning(
  1231. "特批存在首付催款节点未填写时间的情况,请删除后重新填写保存"
  1232. );
  1233. return false;
  1234. }
  1235. if (!this.state.contactListNew[i].id && this.props.userDetaile) {
  1236. message.warning("请保存催款节点");
  1237. return false;
  1238. }
  1239. }
  1240. this.setState({
  1241. loading: true
  1242. });
  1243. let api = this.props.userDetaile
  1244. ? "/api/admin/newOrder/updateServiceOrderNew"
  1245. : "/api/admin/newOrder/createOrder";
  1246. $.ajax({
  1247. method: "POST",
  1248. dataType: "json",
  1249. crossDomain: false,
  1250. url: globalConfig.context + api,
  1251. data: !this.props.userDetaile
  1252. ? {
  1253. uid: this.state.autoId,
  1254. orderType: this.state.orderType
  1255. }
  1256. : {
  1257. orderNo: this.state.orderNo, //订单编号
  1258. totalAmount: this.state.totalAmount, //总金额
  1259. firstAmount: this.state.firstAmount, //首付
  1260. isSubmit: this.state.isSubmit, //保存草稿还是提交
  1261. signDate: this.state.signDate, //签单日期
  1262. contacts: this.state.contacts, //企业负责人
  1263. contactMobile: this.state.contactMobile, //负责人联系方式
  1264. legalPerson: this.state.legalPerson, //企业法人
  1265. legalPersonTel: this.state.legalPersonTel, //企业法人联系电话
  1266. approval: this.state.approval, //特批状态
  1267. orderRemarks: this.state.orderRemarks, //订单备注
  1268. contractPictureUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  1269. orderDep: this.state.organizationSearch
  1270. }
  1271. }).done(
  1272. function(data) {
  1273. this.setState({
  1274. loading: false
  1275. });
  1276. if (!data.error.length) {
  1277. message.success("保存成功!");
  1278. this.handleOk();
  1279. if (this.state.autoId) {
  1280. this.loadData();
  1281. }
  1282. } else {
  1283. message.warning(data.error[0].message);
  1284. }
  1285. }.bind(this)
  1286. );
  1287. },
  1288. //订单详情修改
  1289. xiangqingClick(e) {
  1290. e.preventDefault();
  1291. this.setState({
  1292. loading: true
  1293. });
  1294. if (this.state.approval == 2 || this.state.approval == 3) {
  1295. message.warning("特批状态不正确");
  1296. this.setState({
  1297. loading: false
  1298. });
  1299. return;
  1300. }
  1301. $.ajax({
  1302. url: globalConfig.context + "/api/admin/newOrder/updateServiceOrderNew",
  1303. method: "post",
  1304. data: {
  1305. orderNo: this.state.orderNo, //订单编号
  1306. totalAmount: this.state.totalAmount, //总金额
  1307. firstAmount: this.state.firstAmount, //首付
  1308. isSubmit: this.state.isSubmit, //保存草稿还是提交
  1309. signDate: this.state.selTime, //签单日期
  1310. contacts: this.state.contacts, //企业负责人
  1311. contactMobile: this.state.contactMobile, //负责人联系方式
  1312. legalPerson: this.state.legalPerson, //企业法人
  1313. legalPersonTel: this.state.legalPersonTel, //企业法人联系电话
  1314. approval: this.state.approval, //特批状态
  1315. orderRemarks: this.state.orderRemarks //订单备注
  1316. }
  1317. }).done(
  1318. function(data) {
  1319. this.setState({
  1320. loading: false
  1321. });
  1322. if (!data.error.length) {
  1323. message.success("保存成功!");
  1324. this.loaduser();
  1325. } else {
  1326. message.warning(data.error[0].message);
  1327. }
  1328. }.bind(this)
  1329. );
  1330. },
  1331. //查看基本详情基本信息
  1332. loaduser(record) {
  1333. this.state.orderList = [];
  1334. $.ajax({
  1335. method: "get",
  1336. dataType: "json",
  1337. crossDomain: false,
  1338. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  1339. data: {
  1340. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  1341. },
  1342. success: function(data) {
  1343. let thisData = data.data;
  1344. if (!thisData) {
  1345. if (data.error && data.error.length) {
  1346. message.warning(data.error[0].message);
  1347. }
  1348. thisData = {};
  1349. }
  1350. if (thisData.approval == 2) {
  1351. thisData.approval = "特批通过";
  1352. } else if (thisData.approval == 3) {
  1353. thisData.approval = "特批驳回";
  1354. }
  1355. this.setState({
  1356. id: thisData.id,
  1357. kehuId: thisData.buyerId,
  1358. orderNo: thisData.orderNo, //订单编号
  1359. orderType: thisData.orderType, //订单类型
  1360. firstAmount: thisData.firstAmount, //首付金额
  1361. totalAmount: thisData.totalAmount, //总金额
  1362. settlementAmount: thisData.settlementAmount, //结算金额
  1363. liquidationStatus: thisData.liquidationStatus, //清算状态
  1364. processStatus: thisData.processStatus, //流程状态
  1365. approval: thisData.approval.toString(), //特批状态
  1366. orderRemarks: thisData.orderRemarks, //订单备注
  1367. contractNo: thisData.contractNo, //合同编号
  1368. contacts: thisData.contacts, //联系人
  1369. contactMobile: thisData.contactMobile, //联系人电话
  1370. legalPerson: thisData.legalPerson, //法人
  1371. legalPersonTel: thisData.legalPersonTel, //法人电话
  1372. contractNo: thisData.contractNo, //合同编号
  1373. orgCodeUrl: thisData.contractPictureUrl
  1374. ? splitUrl(
  1375. thisData.contractPictureUrl,
  1376. ",",
  1377. globalConfig.avatarHost + "/upload"
  1378. )
  1379. : [], //图片地址
  1380. signDate: thisData.signDate, //签单时间
  1381. userName: thisData.userName, //客户名称
  1382. salesmanName: thisData.salesmanName, //营销员名称
  1383. salesmanMobile: thisData.salesmanMobile, //营销员电话
  1384. oldSalesmanName: thisData.oldSalesmanName, //营销员名称
  1385. oldSalesmanMobile: thisData.oldSalesmanMobile, //营销员电话
  1386. financeName: thisData.financeName, //财务名称
  1387. financeMobile: thisData.financeMobile, //财务电话
  1388. nowFinanceMobile: thisData.nowFinanceMobile,
  1389. nowFinance: thisData.nowFinance,
  1390. contractNo: thisData.contractNo, //合同编号
  1391. approval:
  1392. thisData.approval == 0
  1393. ? thisData.approval.toString()
  1394. : thisData.approval,
  1395. organizationSearch: thisData.orderDep,
  1396. depName: thisData.depName,
  1397. status: thisData.status,
  1398. outsource: thisData.outsource
  1399. });
  1400. // console.log("kkkk",this.state.processStatus);
  1401. }.bind(this)
  1402. }).always(
  1403. function() {
  1404. this.setState({
  1405. loading: false
  1406. });
  1407. }.bind(this)
  1408. );
  1409. },
  1410. // //查看催款节点
  1411. // loaduserss(record) {
  1412. // this.state.orderList = [];
  1413. // this.setState({
  1414. // orderNoss: record ? record.orderNo : this.props.datauser.orderNo
  1415. // });
  1416. // $.ajax({
  1417. // method: "get",
  1418. // dataType: "json",
  1419. // crossDomain: false,
  1420. // url: globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  1421. // data: {
  1422. // orderNo: record ? record.orderNo : this.props.datauser.orderNo
  1423. // },
  1424. // success: function(data) {
  1425. // let theArr = [];
  1426. // let thisData = [];
  1427. // if (!thisData) {
  1428. // if (data.error && data.error.length) {
  1429. // message.warning(data.error[0].message);
  1430. // }
  1431. // thisData = {};
  1432. // } else {
  1433. // for (let i = 0; i < data.data.length; i++) {
  1434. // thisData = data.data[i];
  1435. // theArr.push({
  1436. // key: i,
  1437. // dunSubject: thisData.dunSubject
  1438. // ? thisData.dunSubject.toString()
  1439. // : "", //催款科目
  1440. // id: thisData.id, //节点Id
  1441. // money: thisData.money, //催款金额
  1442. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  1443. // commodityName: thisData.commodityName,
  1444. // projectType: thisData.projectType,
  1445. // dunTypeName: thisData.dunTypeName,
  1446. // status: thisData.status,
  1447. // waitDay: thisData.waitDay,
  1448. // effectiveCount: thisData.effectiveCount,
  1449. // startDate: thisData.startDate
  1450. // });
  1451. // }
  1452. // this.setState({
  1453. // contactList: theArr
  1454. // });
  1455. // }
  1456. // }.bind(this)
  1457. // }).always(
  1458. // function() {
  1459. // this.setState({
  1460. // loading: false
  1461. // });
  1462. // }.bind(this)
  1463. // );
  1464. // },
  1465. // //催款节点保存
  1466. // contactSave(record) {
  1467. // if(!this.state.yearFlag) {
  1468. // if(!record.effectiveCount) {
  1469. // message.warning("请选择服务年限")
  1470. // return
  1471. // }
  1472. // }else {
  1473. // record.effectiveCount = ""
  1474. // }
  1475. // if(record.money == "" ) {
  1476. // message.warning("请填写金额")
  1477. // return
  1478. // }
  1479. // if(!record.dunType) {
  1480. // message.warning("请选择对应科目")
  1481. // return
  1482. // }
  1483. // // if (this.state.contactList) {
  1484. // // let cuiData = this.state.contactList;
  1485. // // for (var a = 0; a < cuiData.length; a++) {
  1486. // // if (cuiData[a].money == "") {
  1487. // // message.warning("催款金额不能为空");
  1488. // // this.refs.signFirstPayment.focus();
  1489. // // return false;
  1490. // // } else if (!cuiData[a].dunSubject) {
  1491. // // message.warning("催款科目不能为空");
  1492. // // this.refs.signFirstPayment.focus();
  1493. // // return false;
  1494. // // }
  1495. // // if (moneyVerify(cuiData[a].money)) {
  1496. // // return;
  1497. // // }
  1498. // // }
  1499. // // }
  1500. // this.setState({
  1501. // loading: true
  1502. // });
  1503. // $.ajax({
  1504. // url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1505. // method: "post",
  1506. // data: {
  1507. // orderNo: record.orderNo,
  1508. // tid: record.tid,
  1509. // projectType: record.sort,
  1510. // dunType: record.dunType,
  1511. // money: record.money,
  1512. // waitDay: record.waitDay,
  1513. // effectiveCount: record.effectiveCount
  1514. // }
  1515. // }).done(
  1516. // function(data) {
  1517. // this.setState({
  1518. // loading: false
  1519. // });
  1520. // if (!data.error.length) {
  1521. // message.success("保存成功!");
  1522. // this.setState({
  1523. // cuiFlag: false
  1524. // });
  1525. // this.jiedian();
  1526. // } else {
  1527. // message.warning(data.error[0].message);
  1528. // }
  1529. // }.bind(this)
  1530. // );
  1531. // },
  1532. // //点击新增催款节点
  1533. // addcontact() {
  1534. // this.state.contactList.push({
  1535. // key: this.state.contactList.length,
  1536. // money: "",
  1537. // dunSubject: undefined,
  1538. // orderNo: this.state.orderNoss,
  1539. // dunTarget: this.state.kehuId
  1540. // });
  1541. // this.setState({
  1542. // contactList: this.state.contactList,
  1543. // cuiFlag: true
  1544. // });
  1545. // },
  1546. // //删除收款节点
  1547. // confirmDelet(index) {
  1548. // if (index.id) {
  1549. // this.state.contactList.splice(index.key, 1);
  1550. // this.setState({
  1551. // contactList: this.state.contactList,
  1552. // cuiFlag: false
  1553. // });
  1554. // $.ajax({
  1555. // url: globalConfig.context + "/api/admin/newOrderDun/deleteDun",
  1556. // method: "post",
  1557. // data: {
  1558. // id: index.id,
  1559. // }
  1560. // }).done(
  1561. // function(data) {
  1562. // this.setState({
  1563. // loading: false
  1564. // });
  1565. // if (!data.error.length) {
  1566. // message.success("删除成功!");
  1567. // this.setState({
  1568. // cuiFlag: false
  1569. // });
  1570. // this.jiedian();
  1571. // } else {
  1572. // message.warning(data.error[0].message);
  1573. // }
  1574. // }.bind(this)
  1575. // );
  1576. // } else {
  1577. // this.state.contactList.splice(index.key, 1);
  1578. // this.setState({
  1579. // contactList: this.state.contactList,
  1580. // cuiFlag: false
  1581. // });
  1582. // }
  1583. // },
  1584. //节点列表
  1585. jiedian(orderNos) {
  1586. $.ajax({
  1587. method: "get",
  1588. dataType: "json",
  1589. crossDomain: false,
  1590. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  1591. data: {
  1592. orderNo: orderNos
  1593. },
  1594. success: function(data) {
  1595. let theArr = [];
  1596. let thisData = [];
  1597. if (data.error.length || data.data.list == "") {
  1598. if (data.error && data.error.length) {
  1599. message.warning(data.error[0].message);
  1600. }
  1601. } else {
  1602. for (let i = 0; i < data.data.length; i++) {
  1603. thisData = data.data[i];
  1604. theArr.push({
  1605. key: i,
  1606. dunSubject: thisData.dunSubject
  1607. ? thisData.dunSubject.toString()
  1608. : "", //催款科目
  1609. id: thisData.id, //节点Id
  1610. money: thisData.money, //催款金额
  1611. dunStatus: thisData.dunStatus, //催款状态
  1612. orderNo: thisData.orderNo
  1613. });
  1614. }
  1615. this.setState({
  1616. contactList: theArr
  1617. });
  1618. }
  1619. }.bind(this)
  1620. }).always(
  1621. function() {
  1622. this.setState({
  1623. loading: false
  1624. });
  1625. }.bind(this)
  1626. );
  1627. },
  1628. //查看催款节点
  1629. jiedianNew(orderNos) {
  1630. $.ajax({
  1631. method: "get",
  1632. dataType: "json",
  1633. crossDomain: false,
  1634. url:
  1635. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  1636. data: {
  1637. orderNo: orderNos
  1638. },
  1639. success: function(data) {
  1640. if (data.error && data.error.length) {
  1641. message.warning(data.error[0].message);
  1642. } else {
  1643. let theArr = [];
  1644. let thisData = [];
  1645. let arr = data.data || [];
  1646. let totalCui = 0;
  1647. for (let i = 0; i < arr.length; i++) {
  1648. thisData = arr[i];
  1649. totalCui += +thisData.money;
  1650. theArr.push({
  1651. key: i,
  1652. dunSubject: thisData.dunSubject
  1653. ? thisData.dunSubject.toString()
  1654. : "", //催款科目
  1655. id: thisData.id, //节点Id
  1656. money: thisData.money, //催款金额
  1657. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  1658. commodityName: thisData.commodityName,
  1659. projectType: thisData.projectType,
  1660. dunTypeName: thisData.dunTypeName,
  1661. status: thisData.status,
  1662. waitDay: thisData.waitDay,
  1663. effectiveCount: thisData.effectiveCount,
  1664. startDate: thisData.startDate,
  1665. dunType: thisData.dunType,
  1666. appropriationRatio: thisData.appropriationRatio
  1667. });
  1668. }
  1669. if (!totalCui) {
  1670. totalCui = 0;
  1671. }
  1672. totalCui = (Math.round(totalCui * 10000) / 10000).toFixed(4);
  1673. this.setState({
  1674. contactListNew: theArr,
  1675. totalCui
  1676. });
  1677. }
  1678. }.bind(this)
  1679. }).always(
  1680. function() {
  1681. this.setState({
  1682. loading: false
  1683. });
  1684. }.bind(this)
  1685. );
  1686. },
  1687. //催款节点保存
  1688. contactSave(record) {
  1689. for (let i = 0; i < this.state.contactList.length; i++) {
  1690. if (moneyVerify(this.state.contactList[i].money)) {
  1691. return;
  1692. }
  1693. }
  1694. this.setState({
  1695. loading: true
  1696. });
  1697. $.ajax({
  1698. url: globalConfig.context + "/api/admin/newOrder/createOrderDun",
  1699. method: "post",
  1700. data: {
  1701. orderNo: this.state.orderNo,
  1702. orderDun: JSON.stringify(this.state.contactList)
  1703. }
  1704. }).done(
  1705. function(data) {
  1706. this.setState({
  1707. loading: false
  1708. });
  1709. if (!data.error.length) {
  1710. message.success("保存成功!");
  1711. this.jiedian(record.orderNo);
  1712. } else {
  1713. message.warning(data.error[0].message);
  1714. }
  1715. }.bind(this)
  1716. );
  1717. },
  1718. //催款节点保存
  1719. contactSaveNew(record) {
  1720. if (record.boStatus == "false") {
  1721. record.boStatus = false;
  1722. } else if (record.boStatus == "true") {
  1723. record.boStatus = true;
  1724. }
  1725. if (!this.state.yearFlag) {
  1726. if (!record.effectiveCount) {
  1727. message.warning("请选择服务年限");
  1728. return;
  1729. }
  1730. } else {
  1731. record.effectiveCount = "";
  1732. }
  1733. if (record.money == "") {
  1734. message.warning("请填写金额");
  1735. return;
  1736. }
  1737. if (record.boStatus) {
  1738. if (
  1739. typeof +record.money == "number" &&
  1740. +record.money >= 0 &&
  1741. +record.money <= 1
  1742. ) {
  1743. record.appropriationRatio = record.money;
  1744. } else {
  1745. message.warning("金额比例填写错误,比例范围0~1");
  1746. return;
  1747. }
  1748. }
  1749. if (!record.dunType) {
  1750. message.warning("请选择对应科目");
  1751. return;
  1752. }
  1753. if (record.dunType != 1) {
  1754. record.waitDay = "";
  1755. }
  1756. this.setState({
  1757. loading: true
  1758. });
  1759. if (record.boStatus) {
  1760. $.ajax({
  1761. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1762. method: "post",
  1763. data: {
  1764. orderNo: record.orderNo,
  1765. tid: record.tid,
  1766. projectType: record.sort,
  1767. dunType: record.dunType,
  1768. appropriationRatio: record.appropriationRatio,
  1769. waitDay: record.waitDay,
  1770. effectiveCount: record.effectiveCount
  1771. }
  1772. }).done(
  1773. function(data) {
  1774. this.setState({
  1775. loading: false
  1776. });
  1777. if (!data.error.length) {
  1778. message.success("保存成功!");
  1779. this.setState({
  1780. cuiFlag: false,
  1781. boFlag: false,
  1782. addFlag: false
  1783. });
  1784. this.jiedianNew(record.orderNo);
  1785. } else {
  1786. message.warning(data.error[0].message);
  1787. }
  1788. }.bind(this)
  1789. );
  1790. } else {
  1791. $.ajax({
  1792. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1793. method: "post",
  1794. data: {
  1795. orderNo: record.orderNo,
  1796. tid: record.tid,
  1797. projectType: record.sort,
  1798. dunType: record.dunType,
  1799. money: record.money,
  1800. waitDay: record.waitDay,
  1801. effectiveCount: record.effectiveCount
  1802. }
  1803. }).done(
  1804. function(data) {
  1805. this.setState({
  1806. loading: false
  1807. });
  1808. if (!data.error.length) {
  1809. message.success("保存成功!");
  1810. this.setState({
  1811. cuiFlag: false,
  1812. boFlag: false,
  1813. addFlag: false
  1814. });
  1815. this.jiedianNew(record.orderNo);
  1816. } else {
  1817. message.warning(data.error[0].message);
  1818. }
  1819. }.bind(this)
  1820. );
  1821. }
  1822. },
  1823. //点击新增催款节点
  1824. addcontact() {
  1825. this.state.contactList.push({
  1826. key: this.state.contactList.length,
  1827. money: "",
  1828. dunSubject: undefined,
  1829. orderNo: this.state.orderNo,
  1830. dunTarget: this.state.kehuId
  1831. });
  1832. this.setState({
  1833. contactList: this.state.contactList
  1834. });
  1835. },
  1836. //点击新增催款节点
  1837. addcontactNew() {
  1838. this.state.contactListNew.push({
  1839. key: this.state.contactListNew.length,
  1840. money: "",
  1841. dunSubject: undefined,
  1842. orderNo: this.state.orderNo,
  1843. dunTarget: this.state.kehuId
  1844. });
  1845. this.setState({
  1846. contactListNew: this.state.contactListNew,
  1847. cuiFlag: true
  1848. });
  1849. },
  1850. //删除收款节点
  1851. confirmDelet(index) {
  1852. this.state.contactList.splice(index, 1);
  1853. this.setState({
  1854. contactList: this.state.contactList
  1855. });
  1856. this.contactSave();
  1857. },
  1858. //删除收款节点
  1859. confirmDeletNew(index) {
  1860. if (index.id) {
  1861. this.state.contactListNew.splice(index.id, 1);
  1862. this.setState({
  1863. contactListNew: this.state.contactListNew,
  1864. cuiFlag: false,
  1865. addFlag: false,
  1866. boFlag: false
  1867. });
  1868. $.ajax({
  1869. url: globalConfig.context + "/api/admin/newOrderDun/deleteDun",
  1870. method: "post",
  1871. data: {
  1872. id: index.id
  1873. }
  1874. }).done(
  1875. function(data) {
  1876. this.setState({
  1877. loading: false
  1878. });
  1879. if (!data.error.length) {
  1880. message.success("删除成功!");
  1881. this.setState({
  1882. cuiFlag: false
  1883. });
  1884. this.jiedianNew(this.state.orderNo);
  1885. } else {
  1886. message.warning(data.error[0].message);
  1887. }
  1888. }.bind(this)
  1889. );
  1890. } else {
  1891. this.state.contactListNew.splice(index.key, 1);
  1892. this.setState({
  1893. contactListNew: this.state.contactListNew,
  1894. cuiFlag: false,
  1895. addFlag: false,
  1896. boFlag: false
  1897. });
  1898. }
  1899. },
  1900. handleOk() {
  1901. this.setState({
  1902. visible: false,
  1903. mark: false
  1904. });
  1905. this.props.closeDesc(false, true);
  1906. },
  1907. handleCancel() {
  1908. if (this.state.orderType == undefined) {
  1909. return false;
  1910. }
  1911. if (!this.state.autoId) {
  1912. return false;
  1913. }
  1914. this.setState({
  1915. visible: false,
  1916. mark: false
  1917. });
  1918. this.props.closeDesc(false);
  1919. },
  1920. handleCancelclose() {
  1921. this.setState(
  1922. {
  1923. visible: false,
  1924. mark: false,
  1925. cuiFlag: false,
  1926. addFlag: false,
  1927. boFlag: false
  1928. },
  1929. () => {
  1930. this.setState({
  1931. activeKey: "1"
  1932. });
  1933. }
  1934. );
  1935. this.props.closeDesc(false);
  1936. this.reset();
  1937. },
  1938. //点击签单
  1939. handleCancels() {
  1940. this.setState({
  1941. isSubmit: 1
  1942. });
  1943. },
  1944. //点击签单
  1945. handleCancelq() {
  1946. this.setState({
  1947. isSubmit: 0
  1948. });
  1949. },
  1950. //删除
  1951. delectRow(record) {
  1952. this.setState({
  1953. loading: true
  1954. });
  1955. $.ajax({
  1956. method: "post",
  1957. dataType: "json",
  1958. crossDomain: false,
  1959. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  1960. data: {
  1961. id: record.id
  1962. }
  1963. }).done(
  1964. function(data) {
  1965. if (!data.error.length) {
  1966. message.success("删除成功!");
  1967. this.setState({
  1968. loading: false
  1969. });
  1970. this.jiedian(this.state.orderNo);
  1971. this.jiedianNew(this.state.orderNo);
  1972. this.loaduser();
  1973. this.loadData();
  1974. } else {
  1975. message.warning(data.error[0].message);
  1976. }
  1977. }.bind(this)
  1978. );
  1979. },
  1980. nextCancel() {
  1981. this.setState({
  1982. addnextVisible: false,
  1983. changeVisible: false
  1984. });
  1985. },
  1986. rizhi() {
  1987. this.setState({
  1988. loading: true
  1989. });
  1990. $.ajax({
  1991. method: "get",
  1992. dataType: "json",
  1993. crossDomain: false,
  1994. url: "/api/admin/newOrder/selectOrderLog",
  1995. data: {
  1996. orderNo: this.props.datauser.orderNo
  1997. },
  1998. success: function(data) {
  1999. let theArr = [];
  2000. let thisData = data.data;
  2001. if (!thisData.length) {
  2002. if (data.error && data.error.length) {
  2003. message.warning(data.error[0].message);
  2004. }
  2005. thisData = {};
  2006. } else {
  2007. for (let i = 0; i < data.data.length; i++) {
  2008. let thisdata = data.data[i];
  2009. theArr.push({
  2010. processName: thisdata.processName,
  2011. adminName: thisdata.adminName,
  2012. createDate: thisdata.createDate,
  2013. remarks: thisdata.remarks
  2014. });
  2015. }
  2016. }
  2017. this.setState({
  2018. dataSourcerizhi: theArr
  2019. });
  2020. }.bind(this)
  2021. }).always(
  2022. function() {
  2023. this.setState({
  2024. loading: false
  2025. });
  2026. }.bind(this)
  2027. );
  2028. },
  2029. //查看订单日志
  2030. getOrderLog() {
  2031. this.setState({
  2032. rizhivisible: true
  2033. });
  2034. this.rizhi();
  2035. },
  2036. closeOrderLog() {
  2037. this.setState({
  2038. rizhivisible: false
  2039. });
  2040. },
  2041. callback(key) {
  2042. this.setState({
  2043. activeKey: key
  2044. });
  2045. if (key === "1") {
  2046. this.jiedian(this.props.datauser.orderNo);
  2047. this.jiedianNew(this.props.datauser.orderNo);
  2048. }
  2049. if (key === "2") {
  2050. let url = window.location.href.substring(7);
  2051. $.ajax({
  2052. method: "get",
  2053. dataType: "json",
  2054. crossDomain: false,
  2055. url:
  2056. globalConfig.context + "/api/admin/orderChange/orderChangeDetails",
  2057. data: {
  2058. orderNo: this.props.datauser.orderNo
  2059. },
  2060. success: function(data) {
  2061. // console.log(data.data);
  2062. if (data.data && data.data.length) {
  2063. let thisdata = data.data[data.data.length - 1];
  2064. if (thisdata.status === 0 || thisdata.processState == 0) {
  2065. this.setState({
  2066. changeId: thisdata.id,
  2067. typeChange: thisdata.type,
  2068. totalAmount: thisdata.totalAmount,
  2069. settlementAmount: thisdata.settlementAmount,
  2070. changeAmount: thisdata.changeAmount,
  2071. remarksC: thisdata.remarks,
  2072. startRemarks: thisdata.zxsRemarks,
  2073. isCaoGao: true,
  2074. changeFlag: true,
  2075. voucherUrl: thisdata.voucherUrl
  2076. ? splitUrl(
  2077. thisdata.voucherUrl,
  2078. ",",
  2079. globalConfig.avatarHost + "/upload",
  2080. url
  2081. )
  2082. : []
  2083. });
  2084. this.proList();
  2085. this.cuiList();
  2086. let e = thisdata.type;
  2087. if (e == 1) {
  2088. this.setState({
  2089. hetongFlag: false,
  2090. listFlag: false,
  2091. listCuiFlag: false,
  2092. tuiKuanFlag: false
  2093. });
  2094. } else if (e == 2) {
  2095. this.setState({
  2096. hetongFlag: true,
  2097. listFlag: false,
  2098. listCuiFlag: false,
  2099. tuiKuanFlag: true
  2100. });
  2101. } else if (e == 3) {
  2102. this.setState({
  2103. listFlag: true,
  2104. hetongFlag: false,
  2105. listCuiFlag: false,
  2106. tuiKuanFlag: false
  2107. });
  2108. } else if (e == 4) {
  2109. this.setState({
  2110. listFlag: false,
  2111. listCuiFlag: false,
  2112. hetongFlag: false,
  2113. tuiKuanFlag: true
  2114. });
  2115. } else if (e == 5) {
  2116. this.setState({
  2117. listFlag: false,
  2118. listCuiFlag: false,
  2119. hetongFlag: true,
  2120. tuiKuanFlag: true
  2121. });
  2122. } else {
  2123. this.setState({
  2124. listFlag: true,
  2125. hetongFlag: true,
  2126. listCuiFlag: true,
  2127. tuiKuanFlag: false
  2128. });
  2129. }
  2130. } else {
  2131. this.setState({
  2132. listFlag: false,
  2133. hetongFlag: false,
  2134. listCuiFlag: false,
  2135. tuiKuanFlag: false
  2136. });
  2137. }
  2138. } else {
  2139. this.setState({
  2140. isCaoGao: false
  2141. });
  2142. }
  2143. }.bind(this)
  2144. });
  2145. }
  2146. },
  2147. cuiList() {
  2148. $.ajax({
  2149. method: "get",
  2150. dataType: "json",
  2151. crossDomain: false,
  2152. url: globalConfig.context + "/api/admin/orderChange/selectChangeDun",
  2153. data: {
  2154. id: this.state.changeId
  2155. },
  2156. success: function(data) {
  2157. if (data.data && data.data.length) {
  2158. console.log(data);
  2159. this.setState({
  2160. cuiDataSource: data.data
  2161. });
  2162. }
  2163. }.bind(this)
  2164. });
  2165. },
  2166. proList() {
  2167. $.ajax({
  2168. method: "get",
  2169. dataType: "json",
  2170. crossDomain: false,
  2171. url: globalConfig.context + "/api/admin/orderChange/selectChangeTask",
  2172. data: {
  2173. id: this.state.changeId
  2174. },
  2175. success: function(data) {
  2176. // console.log(data.data);
  2177. if (data.data && data.data.length) {
  2178. console.log(data);
  2179. this.setState({
  2180. proDataSource: data.data
  2181. });
  2182. }
  2183. }.bind(this)
  2184. });
  2185. },
  2186. getOrgCodeUrl(e) {
  2187. this.setState({ orgCodeUrl: e });
  2188. },
  2189. getVoucherUrl(e) {
  2190. this.setState({ voucherUrl: e });
  2191. },
  2192. //加载(自动补全)
  2193. supervisor(e, state) {
  2194. //客户名称与服务名称自动补全
  2195. let api = state
  2196. ? "/api/admin/customer/getCustomerByName"
  2197. : "/api/admin/order/getBusinessProjectByName";
  2198. $.ajax({
  2199. method: "get",
  2200. dataType: "json",
  2201. crossDomain: false,
  2202. url: globalConfig.context + api,
  2203. data: state
  2204. ? {
  2205. name: e,
  2206. type: this.state.customType
  2207. }
  2208. : {
  2209. businessName: e
  2210. },
  2211. success: function(data) {
  2212. let thedata = data.data;
  2213. if (!thedata) {
  2214. if (data.error && data.error.length) {
  2215. message.warning(data.error[0].message);
  2216. }
  2217. thedata = {};
  2218. }
  2219. this.setState({
  2220. states: state,
  2221. customerArr: thedata
  2222. });
  2223. }.bind(this)
  2224. }).always(
  2225. function() {
  2226. this.setState({
  2227. loading: false
  2228. });
  2229. }.bind(this)
  2230. );
  2231. },
  2232. supervisorCui(e) {
  2233. //客户名称与服务名称自动补全
  2234. let api = "/api/admin/order/getBusinessProjectByName";
  2235. $.ajax({
  2236. method: "get",
  2237. dataType: "json",
  2238. crossDomain: false,
  2239. url: globalConfig.context + api,
  2240. data: {
  2241. businessName: e
  2242. },
  2243. success: function(data) {
  2244. let thedata = data.data;
  2245. if (!thedata) {
  2246. if (data.error && data.error.length) {
  2247. message.warning(data.error[0].message);
  2248. }
  2249. thedata = {};
  2250. }
  2251. this.setState({
  2252. customerCuiArr: thedata
  2253. });
  2254. }.bind(this)
  2255. }).always(
  2256. function() {
  2257. this.setState({
  2258. loading: false
  2259. });
  2260. }.bind(this)
  2261. );
  2262. },
  2263. //上级主管输入框失去焦点是判断客户是否存在
  2264. selectAuto(value) {
  2265. let kid = [];
  2266. let fwList = this.state.customerArr;
  2267. fwList.map(function(item) {
  2268. if (value == item.bname) {
  2269. kid = item;
  2270. }
  2271. });
  2272. this.setState({
  2273. commodityName: value,
  2274. gid: kid.id,
  2275. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  2276. commodityFirstPayment:
  2277. kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
  2278. });
  2279. },
  2280. selectAutoCui(value) {
  2281. let kid = [];
  2282. let fwList = this.state.customerCuiArr;
  2283. fwList.map(function(item) {
  2284. if (value == item.bname) {
  2285. kid = item;
  2286. }
  2287. });
  2288. this.setState({
  2289. commodityNameCui: value,
  2290. cid: kid.id,
  2291. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  2292. commodityFirstPayment:
  2293. kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
  2294. });
  2295. },
  2296. //客户
  2297. selectAutoCUT(value) {
  2298. let autoIds;
  2299. let fwList = this.state.customerArr;
  2300. fwList.map(function(item) {
  2301. if (value == item.name) {
  2302. autoIds = item.id;
  2303. }
  2304. });
  2305. this.setState({
  2306. customerName: value,
  2307. autoId: autoIds
  2308. });
  2309. },
  2310. //服务值改变时请求客户名称
  2311. httpChange(e) {
  2312. this.state.gid = "";
  2313. if (e.length >= 1) {
  2314. this.supervisor(e, false);
  2315. }
  2316. this.setState({
  2317. commodityName: e
  2318. });
  2319. },
  2320. httpChangeCui(e) {
  2321. if (e.length >= 1) {
  2322. this.supervisorCui(e, false);
  2323. }
  2324. this.setState({
  2325. commodityNameCui: e
  2326. });
  2327. },
  2328. //客户名称自动补全
  2329. customerChange(e) {
  2330. if (this.state.customType) {
  2331. this.state.autoId = "";
  2332. if (e.length >= 2) {
  2333. this.supervisor(e, true);
  2334. }
  2335. this.setState({
  2336. customerName: e
  2337. });
  2338. } else {
  2339. this.setState({
  2340. customerName: ""
  2341. });
  2342. message.warning("客户所属类型必须指定");
  2343. }
  2344. },
  2345. //点击添加项目明细
  2346. addDetailed() {
  2347. this.setState({
  2348. gid: "",
  2349. customerArr: [],
  2350. commodityName: "",
  2351. commodityQuantity: "",
  2352. commodityId: "",
  2353. taskComment: "",
  2354. main: undefined,
  2355. commodityPrice: "",
  2356. addState: 1,
  2357. addnextVisible: true
  2358. });
  2359. },
  2360. //新建项目明细保存
  2361. nextSubmit(e) {
  2362. e.preventDefault();
  2363. if (this.state.gid == undefined || !this.state.gid) {
  2364. message.warning("服务名称不匹配!");
  2365. return false;
  2366. }
  2367. if (!this.state.commodityPrice) {
  2368. message.warning("请输入金额!");
  2369. this.refs.commodityPrice.focus();
  2370. return false;
  2371. }
  2372. let reg = /^([0]|[1-9][0-9]*)$/;
  2373. if (
  2374. !this.state.commodityQuantity ||
  2375. !reg.test(this.state.commodityQuantity)
  2376. ) {
  2377. message.warning("请输入正确商品数量!");
  2378. this.refs.commodityQuantity.focus();
  2379. return false;
  2380. }
  2381. if (!this.state.main) {
  2382. message.warning("请选择是否为主要项目!");
  2383. this.refs.commodityQuantity.focus();
  2384. return false;
  2385. }
  2386. this.setState({
  2387. loading: true
  2388. });
  2389. let api = this.state.addState
  2390. ? "/api/admin/newOrder/addOrderTask"
  2391. : "/api/bianji";
  2392. $.ajax({
  2393. method: "POST",
  2394. dataType: "json",
  2395. crossDomain: false,
  2396. url: globalConfig.context + api,
  2397. data: {
  2398. commodityId: this.state.gid, //商品ID
  2399. orderNo: this.props.datauser.orderNo, //订单编号
  2400. commodityName: this.state.commodityName, //商品名称
  2401. commodityQuantity: this.state.commodityQuantity, //商品数量
  2402. commodityPrice: this.state.commodityPrice, //签单总价
  2403. taskComment: this.state.taskComment, //服务说明
  2404. main: this.state.main //是否为主要项目
  2405. }
  2406. }).done(
  2407. function(data) {
  2408. this.setState({
  2409. loading: false
  2410. });
  2411. if (!data.error.length) {
  2412. message.success("保存成功!");
  2413. this.nextCancel();
  2414. //this.loaduser(this.props.datauser);
  2415. this.loadData();
  2416. } else {
  2417. message.warning(data.error[0].message);
  2418. }
  2419. }.bind(this)
  2420. );
  2421. },
  2422. //点击打卡项目详情
  2423. tableRowClick(record) {
  2424. this.setState({
  2425. jid: record.id, //项目ID
  2426. kid: record.commodityId, //商品ID
  2427. commodityName: record.commodityName, //金额
  2428. commodityPrice: record.commodityPrice, //金额
  2429. commodityQuantity: record.commodityQuantity, //数量
  2430. taskComment: record.taskComment, //备注
  2431. main: record.main.toString(), //是否为主要
  2432. addnextVisible: true,
  2433. addState: 0
  2434. });
  2435. },
  2436. //修改项目详情
  2437. tabRowSave(e) {
  2438. e.preventDefault();
  2439. if (!this.state.commodityPrice) {
  2440. message.warning("金额不能为空!");
  2441. return false;
  2442. }
  2443. let reg = /^([0]|[1-9][0-9]*)$/;
  2444. if (
  2445. !this.state.commodityQuantity ||
  2446. !reg.test(this.state.commodityQuantity)
  2447. ) {
  2448. message.warning("请输入正确商品数量!");
  2449. return false;
  2450. }
  2451. if (!this.state.main) {
  2452. message.warning("请选择是否为主要项目!");
  2453. this.refs.commodityQuantity.focus();
  2454. return false;
  2455. }
  2456. $.ajax({
  2457. method: "POST",
  2458. dataType: "json",
  2459. crossDomain: false,
  2460. url: globalConfig.context + "/api/admin/newOrder/updateOrderTask",
  2461. data: {
  2462. id: this.state.jid, //项目ID
  2463. commodityId: this.state.kid, //商品ID
  2464. orderNo: this.props.datauser.orderNo, //订单编号
  2465. main: this.state.main, //是否为主要
  2466. commodityPrice: this.state.commodityPrice, //金额
  2467. commodityQuantity: this.state.commodityQuantity, //数量
  2468. taskComment: this.state.taskComment //备注
  2469. }
  2470. }).done(
  2471. function(data) {
  2472. this.setState({
  2473. loading: false
  2474. });
  2475. if (!data.error.length) {
  2476. message.success("保存成功!");
  2477. this.nextCancel();
  2478. //this.loaduser(this.props.datauser);
  2479. this.loadData();
  2480. } else {
  2481. message.warning(data.error[0].message);
  2482. }
  2483. }.bind(this)
  2484. );
  2485. },
  2486. //签单时间选择
  2487. selTime(e, index) {
  2488. this.setState({
  2489. entryTime: e,
  2490. signDate: e,
  2491. selTime: index
  2492. });
  2493. },
  2494. //退单操作
  2495. //点击退单
  2496. tuikuan() {
  2497. this.setState({
  2498. lookVisible: true,
  2499. contractUrl: [],
  2500. applicationUrl: [],
  2501. reason: ""
  2502. });
  2503. },
  2504. //关闭退单
  2505. noCancel() {
  2506. this.setState({
  2507. lookVisible: false
  2508. });
  2509. },
  2510. //点击确认退单
  2511. tuidanOk() {
  2512. let contractUrls = [];
  2513. let applicationUrls = [];
  2514. if (this.state.contractUrl.length) {
  2515. let picArr = [];
  2516. this.state.contractUrl.map(function(item) {
  2517. if (
  2518. item.response &&
  2519. item.response.data &&
  2520. item.response.data.length
  2521. ) {
  2522. picArr.push(item.response.data);
  2523. }
  2524. });
  2525. contractUrls = picArr.join(",");
  2526. }
  2527. if (this.state.applicationUrl.length) {
  2528. let picArr = [];
  2529. this.state.applicationUrl.map(function(item) {
  2530. if (
  2531. item.response &&
  2532. item.response.data &&
  2533. item.response.data.length
  2534. ) {
  2535. picArr.push(item.response.data);
  2536. }
  2537. });
  2538. applicationUrls = picArr.join(",");
  2539. }
  2540. $.ajax({
  2541. method: "POST",
  2542. dataType: "json",
  2543. crossDomain: false,
  2544. url: globalConfig.context + "/api/admin/newOrder/addOrderRefund",
  2545. data: {
  2546. orderNo: this.state.orderNo, //订单编号
  2547. contractUrl: contractUrls.length ? contractUrls : "", //终止合同
  2548. applicationUrl: applicationUrls.length ? applicationUrls : "", //退单申请表
  2549. reason: this.state.reason //退单原因
  2550. }
  2551. }).done(
  2552. function(data) {
  2553. this.setState({
  2554. loading: false
  2555. });
  2556. if (!data.error.length) {
  2557. message.success("退单成功!");
  2558. this.noCancel();
  2559. this.handleCancelclose();
  2560. } else {
  2561. message.warning(data.error[0].message);
  2562. }
  2563. }.bind(this)
  2564. );
  2565. },
  2566. //开单选择订单类型骚操作
  2567. orderTypeFn(e) {
  2568. if (e == 0) {
  2569. this.setState({
  2570. bussStats: true,
  2571. orderType: e
  2572. });
  2573. this.category();
  2574. } else {
  2575. this.setState({
  2576. contractType: undefined,
  2577. bussStats: false,
  2578. orderType: e
  2579. });
  2580. }
  2581. },
  2582. //品类数据获取
  2583. category() {
  2584. $.ajax({
  2585. method: "get",
  2586. dataType: "json",
  2587. crossDomain: false,
  2588. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  2589. data: {},
  2590. success: function(data) {
  2591. let thedata = data.data;
  2592. let theArr = [];
  2593. if (!thedata) {
  2594. if (data.error && data.error.length) {
  2595. message.warning(data.error[0].message);
  2596. }
  2597. thedata = {};
  2598. } else {
  2599. thedata.map(function(item, index) {
  2600. theArr.push({
  2601. key: index,
  2602. name: item.cname,
  2603. id: item.id
  2604. });
  2605. });
  2606. }
  2607. this.setState({
  2608. contractType: undefined,
  2609. categoryArr: theArr
  2610. });
  2611. }.bind(this)
  2612. });
  2613. },
  2614. //变更申请
  2615. changeApply() {
  2616. if (this.state.processStatus <= 4) {
  2617. message.warning("当前订单流程不能发起变更!");
  2618. return false;
  2619. }
  2620. if (this.state.changeAmount == "") {
  2621. message.warning("申请退款金额不能为空!");
  2622. // console.log(this.state.changeAmount);
  2623. return false;
  2624. }
  2625. if (this.state.remarksC.trim() == "") {
  2626. message.warning("请正确填写变更原因");
  2627. return false;
  2628. }
  2629. if (this.state.startRemarks.trim() == "") {
  2630. message.warning("请正确填写备注信息");
  2631. return false;
  2632. }
  2633. let theorgCodeUrl = [];
  2634. if (this.state.voucherUrl.length) {
  2635. let picArr = [];
  2636. this.state.voucherUrl.map(function(item) {
  2637. if (
  2638. item.response &&
  2639. item.response.data &&
  2640. item.response.data.length
  2641. ) {
  2642. picArr.push(item.response.data);
  2643. }
  2644. });
  2645. theorgCodeUrl = picArr.join(",");
  2646. }
  2647. this.setState({
  2648. loading: true
  2649. })
  2650. $.ajax({
  2651. method: "post",
  2652. dataType: "json",
  2653. crossDomain: false,
  2654. url: globalConfig.context + "/api/admin/orderChange/addOrderChange",
  2655. data: {
  2656. orderNo: this.state.orderNo, //订单编号
  2657. processState: 0,
  2658. status: 0,
  2659. startRemarks: this.state.startRemarks,
  2660. remarks: this.state.remarksC,
  2661. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  2662. totalAmount: this.state.totalAmount,
  2663. settlementAmount: this.state.settlementAmount,
  2664. changeAmount: this.state.changeAmount,
  2665. applicant: this.state.salesmanName,
  2666. depName: this.state.depName,
  2667. type: this.state.typeChange
  2668. }
  2669. }).done(
  2670. function(data) {
  2671. this.setState({
  2672. loading: false
  2673. });
  2674. if (!data.error.length) {
  2675. message.success("发起变更草稿");
  2676. this.setState({
  2677. isCaoGao: true,
  2678. loading: false,
  2679. });
  2680. this.noCancel();
  2681. this.handleCancelclose();
  2682. // this.handleCancelclose();
  2683. this.callback();
  2684. } else {
  2685. message.warning(data.error[0].message);
  2686. }
  2687. }.bind(this)
  2688. );
  2689. },
  2690. reset() {
  2691. this.setState({
  2692. startRemarks: "",
  2693. remarksC: "",
  2694. voucherUrl: [],
  2695. totalAmount: undefined,
  2696. settlementAmount: undefined,
  2697. changeAmount: "0",
  2698. applicant: undefined,
  2699. depNameChange: undefined,
  2700. typeChange: []
  2701. });
  2702. },
  2703. componentWillReceiveProps(nextProps) {
  2704. //props改变时触发
  2705. this.state.visible = nextProps.showDesc;
  2706. this.state.signBillVisible = nextProps.signBillVisible;
  2707. if (this.state.signBillVisible) {
  2708. this.loaduser(nextProps.uid);
  2709. }
  2710. if (nextProps.userDetaile && nextProps.showDesc) {
  2711. this.loaduser(nextProps.datauser);
  2712. this.jiedian(nextProps.datauser.orderNo);
  2713. this.jiedianNew(nextProps.datauser.orderNo);
  2714. this.loadData(nextProps.datauser);
  2715. } else {
  2716. this.setState({
  2717. orderType: undefined,
  2718. customerName: "",
  2719. autoId: "",
  2720. customerArr: [],
  2721. contractType: undefined,
  2722. bussStats: false,
  2723. customType: undefined
  2724. });
  2725. }
  2726. },
  2727. showConfirm(fn, record) {
  2728. confirm({
  2729. title: "确定删除此项目吗?",
  2730. content: (
  2731. <span style={{ color: "red" }}>
  2732. 删除后会将该项目下的所有催款节点自动清除!!!
  2733. </span>
  2734. ),
  2735. onOk() {
  2736. fn(record);
  2737. },
  2738. onCancel() {}
  2739. });
  2740. },
  2741. changeAddPro() {
  2742. this.setState({
  2743. changeVisible: true,
  2744. gid: "",
  2745. customerArr: [],
  2746. commodityName: "",
  2747. commodityQuantity: "",
  2748. commodityId: "",
  2749. taskComment: "",
  2750. main: undefined,
  2751. commodityPrice: ""
  2752. });
  2753. },
  2754. changeProSubmit() {
  2755. if (this.state.gid == undefined || !this.state.gid) {
  2756. message.warning("服务名称不匹配!");
  2757. return false;
  2758. }
  2759. if (!this.state.commodityPrice) {
  2760. message.warning("请输入金额!");
  2761. this.refs.commodityPrice.focus();
  2762. return false;
  2763. }
  2764. let reg = /^([0]|[1-9][0-9]*)$/;
  2765. if (
  2766. !this.state.commodityQuantity ||
  2767. !reg.test(this.state.commodityQuantity)
  2768. ) {
  2769. message.warning("请输入正确商品数量!");
  2770. this.refs.commodityQuantity.focus();
  2771. return false;
  2772. }
  2773. if (!this.state.main) {
  2774. message.warning("请选择是否为主要项目!");
  2775. this.refs.commodityQuantity.focus();
  2776. return false;
  2777. }
  2778. this.setState({
  2779. loading: true
  2780. });
  2781. $.ajax({
  2782. method: "post",
  2783. dataType: "json",
  2784. crossDomain: false,
  2785. url: globalConfig.context + "/api/admin/orderChange/addChangeTask",
  2786. data: {
  2787. commodityId: this.state.gid, //商品ID
  2788. orderNo: this.props.datauser.orderNo, //订单编号
  2789. commodityName: this.state.commodityName, //商品名称
  2790. commodityQuantity: this.state.commodityQuantity, //商品数量
  2791. commodityPrice: this.state.commodityPrice, //签单总价
  2792. taskComment: this.state.taskComment, //服务说明
  2793. main: this.state.main, //是否为主要项目
  2794. cid: this.state.changeId //变更ID
  2795. },
  2796. success: function(data) {
  2797. let theArr = [];
  2798. if (data.error && data.error.length) {
  2799. message.warning(data.error[0].message);
  2800. } else {
  2801. message.success("保存成功");
  2802. this.nextCancel();
  2803. this.proList();
  2804. }
  2805. }.bind(this)
  2806. }).always(
  2807. function() {
  2808. this.setState({
  2809. loading: false
  2810. });
  2811. }.bind(this)
  2812. );
  2813. },
  2814. changeDeletePro(record) {
  2815. this.setState({
  2816. loading: true
  2817. });
  2818. $.ajax({
  2819. method: "post",
  2820. dataType: "json",
  2821. crossDomain: false,
  2822. url: globalConfig.context + "/api/admin/orderChange/deleteChangeTask",
  2823. data: {
  2824. id: record.id
  2825. },
  2826. success: function(data) {
  2827. let theArr = [];
  2828. if (data.error && data.error.length) {
  2829. message.warning(data.error[0].message);
  2830. } else {
  2831. message.success("删除成功");
  2832. this.proList();
  2833. }
  2834. }.bind(this)
  2835. }).always(
  2836. function() {
  2837. this.setState({
  2838. loading: false
  2839. });
  2840. }.bind(this)
  2841. );
  2842. },
  2843. //点击新增变更催款节点
  2844. changeAddCui() {
  2845. this.state.cuiDataSource.push({
  2846. key: this.state.cuiDataSource.length,
  2847. money: "",
  2848. dunSubject: undefined,
  2849. orderNo: this.state.orderNo,
  2850. dunTarget: this.state.kehuId
  2851. });
  2852. this.setState({
  2853. cuiDataSource: this.state.cuiDataSource,
  2854. cuiFlag: true
  2855. });
  2856. },
  2857. //删除变更收款节点
  2858. changeDeleteCui(index) {
  2859. if (index.id) {
  2860. this.state.cuiDataSource.splice(index.id, 1);
  2861. this.setState({
  2862. contactListNew: this.state.cuiDataSource,
  2863. cuiFlag: false,
  2864. addFlag: false,
  2865. boFlag: false
  2866. });
  2867. $.ajax({
  2868. url: globalConfig.context + "/api/admin/orderChange/deleteChangeDun",
  2869. method: "post",
  2870. data: {
  2871. id: index.id
  2872. }
  2873. }).done(
  2874. function(data) {
  2875. this.setState({
  2876. loading: false
  2877. });
  2878. if (!data.error.length) {
  2879. message.success("删除成功!");
  2880. this.setState({
  2881. cuiFlag: false
  2882. });
  2883. this.cuiList(this.state.orderNo);
  2884. } else {
  2885. message.warning(data.error[0].message);
  2886. }
  2887. }.bind(this)
  2888. );
  2889. } else {
  2890. this.state.cuiDataSource.splice(index.key, 1);
  2891. this.setState({
  2892. cuiDataSource: this.state.cuiDataSource,
  2893. cuiFlag: false,
  2894. addFlag: false,
  2895. boFlag: false
  2896. });
  2897. }
  2898. },
  2899. changeSaveCui(record) {
  2900. if (record.boStatus == "false") {
  2901. record.boStatus = false;
  2902. } else if (record.boStatus == "true") {
  2903. record.boStatus = true;
  2904. }
  2905. if (!this.state.yearFlag) {
  2906. if (!record.effectiveCount) {
  2907. message.warning("请选择服务年限");
  2908. return;
  2909. }
  2910. } else {
  2911. record.effectiveCount = "";
  2912. }
  2913. if (record.money == "") {
  2914. message.warning("请填写金额");
  2915. return;
  2916. }
  2917. if (record.boStatus) {
  2918. if (
  2919. typeof +record.money == "number" &&
  2920. +record.money >= 0 &&
  2921. +record.money <= 1
  2922. ) {
  2923. record.appropriationRatio = record.money;
  2924. } else {
  2925. message.warning("金额比例填写错误,比例范围0~1");
  2926. return;
  2927. }
  2928. }
  2929. if (!record.dunType) {
  2930. message.warning("请选择对应科目");
  2931. return;
  2932. }
  2933. if (record.dunType != 1) {
  2934. record.waitDay = "";
  2935. }
  2936. this.setState({
  2937. loading: true
  2938. });
  2939. if (record.boStatus) {
  2940. $.ajax({
  2941. url: globalConfig.context + "/api/admin/orderChange/addChangeDun",
  2942. method: "post",
  2943. data: {
  2944. orderNo: record.orderNo,
  2945. tid: record.tid,
  2946. projectType: record.sort,
  2947. dunType: record.dunType,
  2948. appropriationRatio: record.appropriationRatio,
  2949. waitDay: record.waitDay,
  2950. effectiveCount: record.effectiveCount,
  2951. cid: this.state.changeId //变更ID
  2952. }
  2953. }).done(
  2954. function(data) {
  2955. this.setState({
  2956. loading: false
  2957. });
  2958. if (!data.error.length) {
  2959. message.success("保存成功!");
  2960. this.setState({
  2961. cuiFlag: false,
  2962. boFlag: false,
  2963. addFlag: false
  2964. });
  2965. this.cuiList(record.orderNo);
  2966. } else {
  2967. message.warning(data.error[0].message);
  2968. }
  2969. }.bind(this)
  2970. );
  2971. } else {
  2972. $.ajax({
  2973. url: globalConfig.context + "/api/admin/orderChange/addChangeDun",
  2974. method: "post",
  2975. data: {
  2976. orderNo: record.orderNo,
  2977. tid: record.tid,
  2978. projectType: record.sort,
  2979. dunType: record.dunType,
  2980. money: record.money,
  2981. waitDay: record.waitDay,
  2982. effectiveCount: record.effectiveCount,
  2983. cid: this.state.changeId //变更ID
  2984. }
  2985. }).done(
  2986. function(data) {
  2987. this.setState({
  2988. loading: false
  2989. });
  2990. if (!data.error.length) {
  2991. message.success("保存成功!");
  2992. this.setState({
  2993. cuiFlag: false,
  2994. boFlag: false,
  2995. addFlag: false
  2996. });
  2997. this.cuiList(record.orderNo);
  2998. } else {
  2999. message.warning(data.error[0].message);
  3000. }
  3001. }.bind(this)
  3002. );
  3003. }
  3004. },
  3005. submitChange() {
  3006. if (this.state.processStatus <= 4) {
  3007. message.warning("当前订单流程不能发起变更!");
  3008. return false;
  3009. }
  3010. if (this.state.changeAmount == "") {
  3011. message.warning("申请退款金额不能为空!");
  3012. // console.log(this.state.changeAmount);
  3013. return false;
  3014. }
  3015. if (this.state.remarksC.trim() == "") {
  3016. message.warning("请正确填写变更原因");
  3017. return false;
  3018. }
  3019. if (this.state.startRemarks.trim() == "") {
  3020. message.warning("请正确填写备注信息");
  3021. return false;
  3022. }
  3023. let theorgCodeUrl = [];
  3024. if (this.state.voucherUrl.length) {
  3025. let picArr = [];
  3026. this.state.voucherUrl.map(function(item) {
  3027. if (
  3028. item.response &&
  3029. item.response.data &&
  3030. item.response.data.length
  3031. ) {
  3032. picArr.push(item.response.data);
  3033. }
  3034. });
  3035. theorgCodeUrl = picArr.join(",");
  3036. }
  3037. this.setState({
  3038. loading: true
  3039. })
  3040. $.ajax({
  3041. url: globalConfig.context + "/api/admin/orderChange/updateOrderChange",
  3042. method: "post",
  3043. data: {
  3044. id: this.state.changeId,
  3045. changeType: 0,
  3046. orderNo: this.state.orderNo, //订单编号
  3047. processState: 0,
  3048. startRemarks: this.state.startRemarks,
  3049. remarks: this.state.remarksC,
  3050. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  3051. totalAmount: this.state.totalAmount,
  3052. settlementAmount: this.state.settlementAmount,
  3053. changeAmount: this.state.changeAmount,
  3054. applicant: this.state.salesmanName,
  3055. depName: this.state.depName,
  3056. type: this.state.typeChange
  3057. }
  3058. }).done(
  3059. function(data) {
  3060. if (!data.error.length) {
  3061. this.setState({
  3062. loading: false
  3063. });
  3064. message.success("发起变更成功");
  3065. this.handleCancelclose();
  3066. } else {
  3067. message.warning(data.error[0].message);
  3068. }
  3069. }.bind(this)
  3070. );
  3071. },
  3072. render() {
  3073. const FormItem = Form.Item;
  3074. const { TabPane } = Tabs;
  3075. const { TextArea } = Input;
  3076. const formItemLayout = {
  3077. labelCol: { span: 8 },
  3078. wrapperCol: { span: 14 }
  3079. };
  3080. const contractData = this.state.contractData;
  3081. const formItemList = [
  3082. {
  3083. label: "企业联系人",
  3084. content: <span>{this.state.contacts}</span>
  3085. },
  3086. {
  3087. label: "联系人电话",
  3088. content: <span>{this.state.contactMobile}</span>
  3089. },
  3090. {
  3091. label: "企业法人",
  3092. content: <span>{this.state.legalPerson}</span>
  3093. },
  3094. {
  3095. label: "法人电话",
  3096. content: <span>{this.state.legalPersonTel}</span>
  3097. }
  3098. // {
  3099. // label: "签单金额(万元)",
  3100. // content: <span>{this.state.totalAmount}</span>
  3101. // },
  3102. // {
  3103. // label: "首付金额(万元)",
  3104. // content: <span>{this.state.firstAmount}</span>
  3105. // },
  3106. // {
  3107. // label: "特批立项",
  3108. // content: <span>{getApprovedState(this.state.approval)}</span>
  3109. // },
  3110. // {
  3111. // label: "合同签订时间",
  3112. // content: <span>{this.state.signDate}</span>
  3113. // },
  3114. // {
  3115. // label: "订单部门",
  3116. // content: <span>{this.state.depName}</span>
  3117. // }
  3118. ];
  3119. const dataSources = this.state.customerArr || [];
  3120. const cuiDataList = this.state.contactList || [];
  3121. let departmentArr = this.state.departmentArr || [];
  3122. const options = this.state.states
  3123. ? dataSources.map(group => (
  3124. <Select.Option key={group.id} value={group.name}>
  3125. {group.name}
  3126. </Select.Option>
  3127. ))
  3128. : dataSources.map((group, index) => (
  3129. <Select.Option key={index} value={group.bname}>
  3130. {group.bname}
  3131. </Select.Option>
  3132. ));
  3133. return (
  3134. <div>
  3135. <Modal
  3136. maskClosable={false}
  3137. visible={this.state.visible}
  3138. onOk={this.handleOk}
  3139. onCancel={this.handleCancelclose}
  3140. width={!this.props.userDetaile ? "600px" : "900px"}
  3141. title={!this.props.userDetaile ? "创建订单" : ""}
  3142. footer=""
  3143. // width={1300}
  3144. className="admin-desc-content"
  3145. >
  3146. <Form
  3147. layout="horizontal"
  3148. onSubmit={this.handleSubmit}
  3149. // id="demand-form"
  3150. style={{ paddingBottom: "40px" }}
  3151. >
  3152. <Spin spinning={this.state.loading}>
  3153. <div className="clearfix">
  3154. {!this.props.userDetaile ? (
  3155. <div className="clearfix">
  3156. <div className="clearfix">
  3157. <FormItem {...formItemLayout} label="订单类型">
  3158. <Select
  3159. placeholder="请选择订单类型"
  3160. style={{ width: "200px" }}
  3161. value={this.state.orderType}
  3162. onChange={e => {
  3163. this.setState({ orderType: e });
  3164. }}
  3165. >
  3166. {orderTypes.map(function(item) {
  3167. return (
  3168. <Select.Option key={item.value}>
  3169. {item.key}
  3170. </Select.Option>
  3171. );
  3172. })}
  3173. </Select>
  3174. <span className="mandatory">*</span>
  3175. </FormItem>
  3176. </div>
  3177. <FormItem {...formItemLayout} label="客户所属类型">
  3178. <Select
  3179. placeholder="请选择客户所属类型"
  3180. style={{ width: "200px" }}
  3181. value={this.state.customType}
  3182. onChange={e => {
  3183. this.setState({ customType: e });
  3184. }}
  3185. >
  3186. {customerType.map(function(item) {
  3187. return (
  3188. <Select.Option key={item.value}>
  3189. {item.key}
  3190. </Select.Option>
  3191. );
  3192. })}
  3193. </Select>
  3194. </FormItem>
  3195. <div className="clearfix">
  3196. <FormItem {...formItemLayout} label="客户名称">
  3197. <AutoComplete
  3198. className="certain-category-search"
  3199. dropdownClassName="certain-category-search-dropdown"
  3200. dropdownMatchSelectWidth={false}
  3201. dropdownStyle={{ width: 200 }}
  3202. size="large"
  3203. style={{ width: "200px" }}
  3204. dataSource={options}
  3205. placeholder="输入名称"
  3206. value={this.state.customerName}
  3207. onChange={this.customerChange}
  3208. filterOption={true}
  3209. onSelect={this.selectAutoCUT}
  3210. >
  3211. <Input />
  3212. </AutoComplete>
  3213. <span className="mandatory">*</span>
  3214. </FormItem>
  3215. </div>
  3216. <div className="addSave" style={{ marginTop: "15px" }}>
  3217. <Button
  3218. className="cancel"
  3219. type="primary"
  3220. onClick={this.handleCancel}
  3221. style={{ marginLeft: "150px" }}
  3222. htmlType="submit"
  3223. >
  3224. 开单
  3225. </Button>
  3226. <Button
  3227. className="cancel"
  3228. type="ghost"
  3229. onClick={this.handleCancelclose}
  3230. style={{ marginLeft: "50px" }}
  3231. >
  3232. 取消
  3233. </Button>
  3234. </div>
  3235. </div>
  3236. ) : (
  3237. <Tabs
  3238. onChange={this.callback}
  3239. activeKey={this.state.activeKey}
  3240. >
  3241. <TabPane tab={"编辑订单"} key="1">
  3242. <div className="clearfix">
  3243. <div className="clearfix">
  3244. <FormItem
  3245. className="half-item"
  3246. {...formItemLayout}
  3247. label="合同编号"
  3248. >
  3249. {<span>{this.state.contractNo}</span>}
  3250. </FormItem>
  3251. <FormItem
  3252. className="half-item"
  3253. {...formItemLayout}
  3254. label="订单编号"
  3255. >
  3256. <span>{this.state.orderNo}</span>
  3257. </FormItem>
  3258. <FormItem
  3259. className="half-item"
  3260. {...formItemLayout}
  3261. label="流程状态"
  3262. >
  3263. <span>
  3264. {getProcessStatus(this.state.processStatus)}
  3265. </span>
  3266. </FormItem>
  3267. <FormItem
  3268. className="half-item"
  3269. {...formItemLayout}
  3270. label="结算状态"
  3271. >
  3272. <span>
  3273. {getLiquidationStatus(
  3274. this.state.liquidationStatus
  3275. )}
  3276. </span>
  3277. </FormItem>
  3278. {this.state.processStatus === 0 ? (
  3279. <div className="clearfix">
  3280. <FormItem
  3281. className="half-item"
  3282. {...formItemLayout}
  3283. label="特批立项"
  3284. >
  3285. <Select
  3286. placeholder="请选择客户所属类型"
  3287. style={{ width: "240px" }}
  3288. value={getApprovedState(
  3289. this.state.approval
  3290. )}
  3291. onChange={e => {
  3292. this.setState({ approval: e });
  3293. }}
  3294. >
  3295. {/* {tepi.map(function(item) {
  3296. // if(item.key == "特批通过" || item.key == "特批驳回")
  3297. return (
  3298. <Select.Option key={item.value}>
  3299. {item.key}
  3300. </Select.Option>
  3301. );
  3302. })} */}
  3303. <Select.Option key={0}>
  3304. 非特批
  3305. </Select.Option>
  3306. <Select.Option key={1}>特批</Select.Option>
  3307. </Select>
  3308. </FormItem>
  3309. <FormItem
  3310. className="half-item"
  3311. {...formItemLayout}
  3312. label="合同签订时间"
  3313. >
  3314. <DatePicker
  3315. style={{
  3316. marginTop: "2px",
  3317. // width: "240px",
  3318. height: "32px"
  3319. }}
  3320. showTime
  3321. format="YYYY-MM-DD"
  3322. onOk={() => {}}
  3323. value={
  3324. this.state.signDate
  3325. ? moment(this.state.signDate)
  3326. : null
  3327. }
  3328. onChange={(data, dataString) => {
  3329. this.setState({ signDate: dataString });
  3330. }}
  3331. />
  3332. <span
  3333. className="mandatory"
  3334. style={{ marginLeft: 20 }}
  3335. >
  3336. *
  3337. </span>
  3338. </FormItem>
  3339. <FormItem
  3340. className="half-item"
  3341. {...formItemLayout}
  3342. label="订单部门"
  3343. >
  3344. <Select
  3345. placeholder="请输入订单部门"
  3346. style={{ width: 240 }}
  3347. value={this.state.organizationSearch}
  3348. onChange={e => {
  3349. this.setState({ organizationSearch: e });
  3350. }}
  3351. >
  3352. {departmentArr.map(function(item) {
  3353. return (
  3354. <Select.Option key={item.id}>
  3355. {item.name}
  3356. </Select.Option>
  3357. );
  3358. })}
  3359. </Select>
  3360. </FormItem>
  3361. </div>
  3362. ) : (
  3363. <div className="clearfix">
  3364. <FormItem
  3365. className="half-item"
  3366. {...formItemLayout}
  3367. label="特批立项"
  3368. >
  3369. <span>
  3370. {getApprovedState(this.state.approval)}
  3371. </span>
  3372. </FormItem>
  3373. <FormItem
  3374. className="half-item"
  3375. {...formItemLayout}
  3376. label="合同签订时间"
  3377. >
  3378. <span>{this.state.signDate}</span>
  3379. </FormItem>
  3380. <FormItem
  3381. className="half-item"
  3382. {...formItemLayout}
  3383. label="订单部门"
  3384. >
  3385. <span>{this.state.depName}</span>
  3386. </FormItem>
  3387. <FormItem
  3388. className="half-item"
  3389. {...formItemLayout}
  3390. label="是否外包"
  3391. >
  3392. <span>
  3393. {this.state.outsource == 0 ? "否" : "是"}
  3394. </span>
  3395. </FormItem>
  3396. </div>
  3397. )}
  3398. </div>
  3399. <h3
  3400. style={{
  3401. marginLeft: 10,
  3402. fontWeight: 800,
  3403. marginBottom: 10
  3404. }}
  3405. >
  3406. 收款项目
  3407. </h3>
  3408. {this.state.processStatus === 0 ? (
  3409. <div className="clearfix">
  3410. <FormItem
  3411. className="half-item"
  3412. {...formItemLayout}
  3413. label="签单金额(万元)"
  3414. >
  3415. <Input
  3416. placeholder="签单金额"
  3417. ref="signTotalAmount"
  3418. value={this.state.totalAmount}
  3419. onChange={e => {
  3420. this.setState({
  3421. totalAmount: e.target.value
  3422. });
  3423. }}
  3424. style={{ width: "240px" }}
  3425. />
  3426. {/* <span className="mandatory">*</span> */}
  3427. </FormItem>
  3428. <FormItem
  3429. className="half-item"
  3430. {...formItemLayout}
  3431. label="首付金额(万元)"
  3432. >
  3433. <Input
  3434. placeholder="请输入实签首款金额"
  3435. ref="signFirstPayment"
  3436. value={this.state.firstAmount}
  3437. onChange={e => {
  3438. this.setState({
  3439. firstAmount: e.target.value
  3440. });
  3441. }}
  3442. style={{ width: "240px" }}
  3443. />
  3444. {/* <span className="mandatory">*</span> */}
  3445. </FormItem>
  3446. <FormItem
  3447. className="half-item"
  3448. {...formItemLayout}
  3449. label="已收款项"
  3450. >
  3451. <span>
  3452. {this.state.settlementAmount + "万元"}
  3453. </span>
  3454. {/* {this.state.settlementAmount ? (
  3455. <Button
  3456. type="primary"
  3457. onClick={this.tuikuan}
  3458. style={{
  3459. float: "right",
  3460. marginRight: "50px",
  3461. marginBottom: "15px"
  3462. }}
  3463. >
  3464. 退单
  3465. </Button>
  3466. ) : (
  3467. ""
  3468. )} */}
  3469. </FormItem>
  3470. </div>
  3471. ) : (
  3472. <div className="clearfix">
  3473. <FormItem
  3474. className="half-item"
  3475. {...formItemLayout}
  3476. label="签单金额(万元)"
  3477. >
  3478. <span>{this.state.totalAmount}</span>
  3479. </FormItem>
  3480. <FormItem
  3481. className="half-item"
  3482. {...formItemLayout}
  3483. label="首付金额(万元)"
  3484. >
  3485. <span>{this.state.firstAmount}</span>
  3486. </FormItem>
  3487. <FormItem
  3488. className="half-item"
  3489. {...formItemLayout}
  3490. label="已收款项"
  3491. >
  3492. <span>
  3493. {this.state.settlementAmount + "万元"}
  3494. </span>
  3495. {/* {this.state.settlementAmount ? (
  3496. <Button
  3497. type="primary"
  3498. onClick={this.tuikuan}
  3499. style={{
  3500. float: "right",
  3501. marginRight: "50px",
  3502. marginBottom: "15px"
  3503. }}
  3504. >
  3505. 退单
  3506. </Button>
  3507. ) : (
  3508. ""
  3509. )} */}
  3510. </FormItem>
  3511. </div>
  3512. )}
  3513. <h3
  3514. style={{
  3515. marginLeft: 10,
  3516. fontWeight: 800,
  3517. marginBottom: 10
  3518. }}
  3519. >
  3520. 联系信息
  3521. </h3>
  3522. {this.state.processStatus == 0 ? (
  3523. <div className="clearfix">
  3524. <div className="clearfix">
  3525. <FormItem
  3526. className="half-item"
  3527. {...formItemLayout}
  3528. label="客户名称"
  3529. >
  3530. <span>{this.state.userName}</span>
  3531. </FormItem>
  3532. </div>
  3533. <FormItem
  3534. className="half-item"
  3535. {...formItemLayout}
  3536. label="企业联系人"
  3537. >
  3538. <Input
  3539. placeholder="请输入联系人"
  3540. ref="signTotalAmount"
  3541. value={this.state.contacts}
  3542. onChange={e => {
  3543. this.setState({ contacts: e.target.value });
  3544. }}
  3545. style={{ width: "240px" }}
  3546. />
  3547. </FormItem>
  3548. <FormItem
  3549. className="half-item"
  3550. {...formItemLayout}
  3551. label="联系人电话"
  3552. >
  3553. <Input
  3554. placeholder="请输入联系人电话"
  3555. ref="signTotalAmount"
  3556. value={this.state.contactMobile}
  3557. onChange={e => {
  3558. this.setState({
  3559. contactMobile: e.target.value
  3560. });
  3561. }}
  3562. style={{ width: "240px" }}
  3563. />
  3564. </FormItem>
  3565. <FormItem
  3566. className="half-item"
  3567. {...formItemLayout}
  3568. label="企业法人"
  3569. >
  3570. <Input
  3571. placeholder="请输入法人"
  3572. ref="signTotalAmount"
  3573. value={this.state.legalPerson}
  3574. onChange={e => {
  3575. this.setState({
  3576. legalPerson: e.target.value
  3577. });
  3578. }}
  3579. style={{ width: "240px" }}
  3580. />
  3581. </FormItem>
  3582. <FormItem
  3583. className="half-item"
  3584. {...formItemLayout}
  3585. label="法人电话"
  3586. >
  3587. <Input
  3588. placeholder="请输入法人电话"
  3589. ref="signTotalAmount"
  3590. value={this.state.legalPersonTel}
  3591. onChange={e => {
  3592. this.setState({
  3593. legalPersonTel: e.target.value
  3594. });
  3595. }}
  3596. style={{ width: "240px" }}
  3597. />
  3598. </FormItem>
  3599. </div>
  3600. ) : (
  3601. <div className="clearfix">
  3602. {formItemList.map((data, index) => {
  3603. return (
  3604. <FormItem
  3605. className="half-item"
  3606. {...formItemLayout}
  3607. key={index}
  3608. label={data.label}
  3609. >
  3610. {data.content}
  3611. </FormItem>
  3612. );
  3613. })}
  3614. </div>
  3615. )}
  3616. <div className="clearfix">
  3617. {this.state.processStatus == 0 ? (
  3618. <FormItem
  3619. labelCol={{ span: 4 }}
  3620. wrapperCol={{ span: 18 }}
  3621. label={
  3622. <span>
  3623. <strong style={{ color: "#f00" }}>*</strong>
  3624. 合同扫描件
  3625. </span>
  3626. }
  3627. >
  3628. <PicturesWall
  3629. fileList={this.getOrgCodeUrl}
  3630. pictureUrl={this.state.orgCodeUrl}
  3631. url="/api/admin/order/uploadOrderImg"
  3632. sign=""
  3633. />
  3634. <p>图片建议:要清晰。</p>
  3635. <Button
  3636. style={{
  3637. float: "right",
  3638. marginRight: "140px",
  3639. marginTop: "20px"
  3640. }}
  3641. onClick={this.getOrderLog}
  3642. >
  3643. 查看订单日志
  3644. </Button>
  3645. </FormItem>
  3646. ) : (
  3647. <FormItem
  3648. labelCol={{ span: 4 }}
  3649. wrapperCol={{ span: 18 }}
  3650. label="合同扫描件"
  3651. >
  3652. <Upload
  3653. className="demandDetailShow-upload"
  3654. listType="picture-card"
  3655. fileList={this.state.orgCodeUrl}
  3656. onPreview={file => {
  3657. this.setState({
  3658. previewImage: file.url || file.thumbUrl,
  3659. previewVisible: true
  3660. });
  3661. }}
  3662. ></Upload>
  3663. <Modal
  3664. maskClosable={false}
  3665. footer={null}
  3666. visible={this.state.previewVisible}
  3667. onCancel={() => {
  3668. this.setState({ previewVisible: false });
  3669. }}
  3670. >
  3671. <img
  3672. alt=""
  3673. style={{ width: "100%" }}
  3674. src={this.state.previewImage || ""}
  3675. />
  3676. </Modal>
  3677. <Button
  3678. style={{
  3679. float: "right",
  3680. marginRight: "140px",
  3681. marginTop: "20px"
  3682. }}
  3683. onClick={this.getOrderLog}
  3684. >
  3685. 查看订单日志
  3686. </Button>
  3687. </FormItem>
  3688. )}
  3689. </div>
  3690. <div className="clearfix">
  3691. {this.state.processStatus == 0 ? (
  3692. <div className="clearfix">
  3693. <FormItem
  3694. labelCol={{ span: 4 }}
  3695. wrapperCol={{ span: 16 }}
  3696. label="订单留言"
  3697. >
  3698. <Input
  3699. type="textarea"
  3700. placeholder="请输入订单留言"
  3701. rows={4}
  3702. value={this.state.orderRemarks}
  3703. onChange={e => {
  3704. this.setState({
  3705. orderRemarks: e.target.value
  3706. });
  3707. }}
  3708. style={{ width: "95%" }}
  3709. />
  3710. <span className="mandatory">*</span>
  3711. </FormItem>
  3712. </div>
  3713. ) : (
  3714. <FormItem
  3715. labelCol={{ span: 4 }}
  3716. wrapperCol={{ span: 16 }}
  3717. label="订单留言"
  3718. >
  3719. <p
  3720. style={{ width: 500, wordWrap: "break-word" }}
  3721. >
  3722. {this.state.orderRemarks}
  3723. </p>
  3724. </FormItem>
  3725. )}
  3726. </div>
  3727. <div className="clearfix">
  3728. <FormItem
  3729. className="half-item"
  3730. {...formItemLayout}
  3731. label="订单负责人"
  3732. >
  3733. <span>{this.state.salesmanName}</span>
  3734. </FormItem>
  3735. <FormItem
  3736. className="half-item"
  3737. {...formItemLayout}
  3738. label="订单负责人电话"
  3739. >
  3740. <span>{this.state.salesmanMobile}</span>
  3741. </FormItem>
  3742. </div>
  3743. <div className="clearfix">
  3744. <FormItem
  3745. className="half-item"
  3746. {...formItemLayout}
  3747. label="当前财务负责人"
  3748. >
  3749. <span>{this.state.nowFinance}</span>
  3750. </FormItem>
  3751. <FormItem
  3752. className="half-item"
  3753. {...formItemLayout}
  3754. label="当前财务负责人电话"
  3755. >
  3756. <span>{this.state.nowFinanceMobile}</span>
  3757. </FormItem>
  3758. </div>
  3759. <div className="clearfix">
  3760. <FormItem
  3761. className="half-item"
  3762. {...formItemLayout}
  3763. style={{ opacity: ".5" }}
  3764. label="原订单负责人"
  3765. >
  3766. <span>{this.state.oldSalesmanName}</span>
  3767. </FormItem>
  3768. <FormItem
  3769. className="half-item"
  3770. {...formItemLayout}
  3771. style={{ opacity: ".5" }}
  3772. label="原订单负责人电话"
  3773. >
  3774. <span>{this.state.oldSalesmanMobile}</span>
  3775. </FormItem>
  3776. </div>
  3777. <div className="clearfix">
  3778. <FormItem
  3779. className="half-item"
  3780. style={{ opacity: ".5" }}
  3781. {...formItemLayout}
  3782. label="实际财务操作人"
  3783. >
  3784. <span>{this.state.financeName}</span>
  3785. </FormItem>
  3786. <FormItem
  3787. className="half-item"
  3788. {...formItemLayout}
  3789. style={{ opacity: ".5" }}
  3790. label="实际财务操作人电话"
  3791. >
  3792. <span>{this.state.financeMobile}</span>
  3793. </FormItem>
  3794. </div>
  3795. <div>
  3796. <span
  3797. style={{ marginLeft: "50px", fontSize: "20px" }}
  3798. >
  3799. 项目业务
  3800. </span>
  3801. {this.state.processStatus == 0 ? (
  3802. <Button
  3803. type="primary"
  3804. onClick={this.addDetailed}
  3805. style={{
  3806. float: "right",
  3807. marginRight: "50px",
  3808. marginBottom: "15px"
  3809. }}
  3810. >
  3811. 添加项目明细
  3812. </Button>
  3813. ) : (
  3814. ""
  3815. )}
  3816. </div>
  3817. <div
  3818. className="patent-table"
  3819. style={{ marginBottom: 10 }}
  3820. >
  3821. <Spin spinning={this.state.loading}>
  3822. <Table
  3823. columns={this.state.columns}
  3824. dataSource={this.state.dataSource}
  3825. pagination={this.state.pagination}
  3826. onRowClick={this.tableRowClick}
  3827. bordered
  3828. size="small"
  3829. />
  3830. </Spin>
  3831. </div>
  3832. <div
  3833. style={{
  3834. display: cuiDataList.length ? "block" : "none"
  3835. }}
  3836. >
  3837. <span
  3838. style={{ marginLeft: "50px", fontSize: "20px" }}
  3839. >
  3840. 旧催款节点
  3841. </span>
  3842. <Button
  3843. type="primary"
  3844. // onClick={this.addcontact}
  3845. disabled
  3846. onClick={e => {
  3847. cuiDataList.length
  3848. ? this.addcontact()
  3849. : this.addcontactNew();
  3850. }}
  3851. style={{
  3852. float: "right",
  3853. marginRight: "50px",
  3854. marginBottom: "15px",
  3855. display:
  3856. this.state.processStatus == 0
  3857. ? "block"
  3858. : "none"
  3859. }}
  3860. >
  3861. 添加催款节点
  3862. </Button>
  3863. </div>
  3864. <div
  3865. className="clearfix"
  3866. style={{
  3867. display: cuiDataList.length ? "block" : "none"
  3868. }}
  3869. >
  3870. <Spin spinning={this.state.loading}>
  3871. <Form layout="horizontal">
  3872. <Table
  3873. pagination={false}
  3874. columns={this.state.ContactsLists}
  3875. dataSource={this.state.contactList}
  3876. scroll={{ x: "max-content", y: 0 }}
  3877. bordered
  3878. size="small"
  3879. />
  3880. <Col
  3881. span={24}
  3882. offset={9}
  3883. style={{ marginTop: "15px" }}
  3884. ></Col>
  3885. </Form>
  3886. </Spin>
  3887. </div>
  3888. <div
  3889. style={{
  3890. display: cuiDataList.length ? "none" : "block"
  3891. }}
  3892. >
  3893. <span
  3894. style={{
  3895. marginLeft: "50px",
  3896. fontSize: "20px"
  3897. }}
  3898. >
  3899. 新催款节点
  3900. </span>
  3901. <span
  3902. style={{
  3903. display: "inline-block",
  3904. marginLeft: 10,
  3905. color: "red"
  3906. }}
  3907. >
  3908. 金额总计(万元): {this.state.totalCui}
  3909. </span>
  3910. <Button
  3911. type="primary"
  3912. disabled={this.state.addFlag ? true : false}
  3913. // onClick={this.addcontact}
  3914. onClick={e => {
  3915. this.setState({ addFlag: true });
  3916. this.addcontactNew();
  3917. }}
  3918. style={{
  3919. float: "right",
  3920. marginRight: "50px",
  3921. marginBottom: "15px",
  3922. display:
  3923. this.state.processStatus == 0
  3924. ? "block"
  3925. : "none"
  3926. }}
  3927. >
  3928. 添加催款节点
  3929. </Button>
  3930. </div>
  3931. <div
  3932. className="clearfix"
  3933. style={{
  3934. display: cuiDataList.length ? "none" : "block"
  3935. }}
  3936. >
  3937. <Spin spinning={this.state.loading}>
  3938. <Form layout="horizontal">
  3939. <Table
  3940. pagination={false}
  3941. columns={this.state.ContactsListsNew}
  3942. dataSource={this.state.contactListNew}
  3943. scroll={{ x: "max-content", y: 0 }}
  3944. bordered
  3945. size="small"
  3946. />
  3947. <Col
  3948. span={24}
  3949. offset={9}
  3950. style={{ marginTop: "15px" }}
  3951. ></Col>
  3952. </Form>
  3953. </Spin>
  3954. </div>
  3955. {this.state.processStatus == 0 ? (
  3956. <div
  3957. className="addSave"
  3958. style={{ marginTop: "15px" }}
  3959. >
  3960. <Button
  3961. className="cancel"
  3962. type="primary"
  3963. onClick={this.handleCancels}
  3964. style={{ marginLeft: "200px" }}
  3965. htmlType="submit"
  3966. >
  3967. 签单
  3968. </Button>
  3969. <Button
  3970. className="cancel"
  3971. type="primary"
  3972. onClick={this.handleCancelq}
  3973. style={{ marginLeft: "50px" }}
  3974. htmlType="submit"
  3975. >
  3976. 保存
  3977. </Button>
  3978. <Button
  3979. className="cancel"
  3980. type="ghost"
  3981. onClick={this.handleCancelclose}
  3982. style={{ marginLeft: "50px" }}
  3983. >
  3984. 取消
  3985. </Button>
  3986. </div>
  3987. ) : (
  3988. ""
  3989. )}
  3990. </div>
  3991. </TabPane>
  3992. <TabPane tab="合同变更发起" key="2">
  3993. {
  3994. <div>
  3995. <div className="clearfix">
  3996. <FormItem
  3997. className="half-item"
  3998. {...formItemLayout}
  3999. label="客户名称"
  4000. >
  4001. <span>{this.state.userName}</span>
  4002. </FormItem>
  4003. </div>
  4004. <div className="clearfix">
  4005. <FormItem
  4006. className="half-item"
  4007. {...formItemLayout}
  4008. label="合同编号"
  4009. >
  4010. <span>{this.state.contractNo}</span>
  4011. </FormItem>
  4012. </div>
  4013. <div className="clearfix">
  4014. <FormItem
  4015. className="half-item"
  4016. {...formItemLayout}
  4017. label="申请变更部门"
  4018. >
  4019. {/* {!this.state.mark ? ( */}
  4020. <span>{this.state.depName}</span>
  4021. {/* ) : (
  4022. <span>{contractData.depName}</span>
  4023. )} */}
  4024. </FormItem>
  4025. <FormItem
  4026. className="half-item"
  4027. {...formItemLayout}
  4028. label="申请人"
  4029. >
  4030. <span>{this.state.salesmanName}</span>
  4031. </FormItem>
  4032. </div>
  4033. <div className="clearfix">
  4034. <FormItem
  4035. labelCol={{ span: 4 }}
  4036. wrapperCol={{ span: 18 }}
  4037. label="变更类型"
  4038. >
  4039. {/* {!this.state.mark ? ( */}
  4040. <Select
  4041. placeholder="选择合同变更类型"
  4042. style={{ width: 200 }}
  4043. disabled={this.state.changeFlag}
  4044. value={this.state.typeChange}
  4045. onChange={e => {
  4046. this.setState({
  4047. typeChange: e,
  4048. changeFlag: true
  4049. });
  4050. if (e == 1) {
  4051. this.setState({
  4052. hetongFlag: false,
  4053. listFlag: false,
  4054. listCuiFlag: false,
  4055. tuiKuanFlag: false
  4056. });
  4057. } else if (e == 2) {
  4058. this.setState({
  4059. hetongFlag: true,
  4060. listFlag: false,
  4061. listCuiFlag: false,
  4062. tuiKuanFlag: true
  4063. });
  4064. } else if (e == 3) {
  4065. this.setState({
  4066. listFlag: true,
  4067. hetongFlag: false,
  4068. listCuiFlag: false,
  4069. tuiKuanFlag: false
  4070. });
  4071. } else if (e == 4) {
  4072. this.setState({
  4073. listFlag: false,
  4074. listCuiFlag: false,
  4075. hetongFlag: false,
  4076. tuiKuanFlag: true
  4077. });
  4078. } else if (e == 5) {
  4079. this.setState({
  4080. listFlag: false,
  4081. listCuiFlag: false,
  4082. hetongFlag: true,
  4083. tuiKuanFlag: true
  4084. });
  4085. } else {
  4086. this.setState({
  4087. listFlag: true,
  4088. hetongFlag: true,
  4089. listCuiFlag: true,
  4090. tuiKuanFlag: false
  4091. });
  4092. }
  4093. }}
  4094. value={this.state.typeChange}
  4095. >
  4096. <Option value={0}>退单退款</Option>
  4097. <Option value={1}>项目及金额变更</Option>
  4098. <Option value={2}>仅项目变更</Option>
  4099. <Option value={3}>仅金额变更</Option>
  4100. <Option value={4}>重报</Option>
  4101. <Option value={5}>赠送</Option>
  4102. </Select>
  4103. <Button
  4104. onClick={e => {
  4105. this.setState({
  4106. listFlag: false,
  4107. hetongFlag: false,
  4108. listCuiFlag: false,
  4109. tuiKuanFlag: false,
  4110. startRemarks: "",
  4111. remarksC: "",
  4112. voucherUrl: [],
  4113. totalAmount: "0",
  4114. changeAmount: "0",
  4115. applicant: undefined,
  4116. depNameChange: undefined,
  4117. typeChange: [],
  4118. changeFlag: false
  4119. });
  4120. }}
  4121. >
  4122. 重置
  4123. </Button>
  4124. </FormItem>
  4125. </div>
  4126. <div className="clearfix">
  4127. <FormItem
  4128. labelCol={{ span: 4 }}
  4129. wrapperCol={{ span: 18 }}
  4130. label="合同额(万元)"
  4131. >
  4132. {/* {!this.state.mark ? ( */}
  4133. <Input
  4134. placeholder="请输入合同额"
  4135. disabled={this.state.hetongFlag}
  4136. ref="signTotalAmount"
  4137. value={this.state.totalAmount}
  4138. onChange={e => {
  4139. this.setState({
  4140. totalAmount: e.target.value
  4141. });
  4142. }}
  4143. style={{ width: "240px" }}
  4144. />
  4145. {/* ) : (
  4146. <span>{contractData.totalAmount}</span>
  4147. )} */}
  4148. </FormItem>
  4149. <FormItem
  4150. labelCol={{ span: 4 }}
  4151. wrapperCol={{ span: 18 }}
  4152. label="已收款(万元)"
  4153. >
  4154. <span>{this.state.settlementAmount}</span>
  4155. </FormItem>
  4156. <FormItem
  4157. labelCol={{ span: 4 }}
  4158. wrapperCol={{ span: 18 }}
  4159. label="申请退款(万元)"
  4160. >
  4161. {/* {!this.state.mark ? ( */}
  4162. <Input
  4163. placeholder="请输入申请退款"
  4164. ref="signTotalAmount"
  4165. disabled={this.state.tuiKuanFlag}
  4166. value={this.state.changeAmount}
  4167. onChange={e => {
  4168. this.setState({
  4169. changeAmount: e.target.value
  4170. });
  4171. }}
  4172. style={{ width: "240px" }}
  4173. />
  4174. {/* ) : (
  4175. <span>{contractData.changeAmount}</span>
  4176. )} */}
  4177. </FormItem>
  4178. </div>
  4179. {/* 动态展示项目以及催款节点 */}
  4180. <div
  4181. style={{
  4182. display: this.state.isCaoGao ? "block" : "none"
  4183. }}
  4184. >
  4185. <div>
  4186. <span
  4187. style={{
  4188. marginLeft: "50px",
  4189. fontSize: "20px"
  4190. }}
  4191. >
  4192. 项目业务
  4193. </span>
  4194. <Button
  4195. type="primary"
  4196. onClick={this.changeAddPro}
  4197. disabled={this.state.listFlag}
  4198. style={{
  4199. float: "right",
  4200. marginRight: "50px",
  4201. marginBottom: "15px"
  4202. }}
  4203. >
  4204. 添加项目明细
  4205. </Button>
  4206. </div>
  4207. <div
  4208. className="patent-table"
  4209. style={{ marginBottom: 10 }}
  4210. >
  4211. <Spin spinning={this.state.loading}>
  4212. <Table
  4213. columns={this.state.proColumns}
  4214. dataSource={this.state.proDataSource}
  4215. pagination={this.state.pagination}
  4216. // onRowClick={this.tableRowClick}
  4217. bordered
  4218. size="small"
  4219. />
  4220. </Spin>
  4221. </div>
  4222. <div>
  4223. <span
  4224. style={{
  4225. marginLeft: "50px",
  4226. fontSize: "20px"
  4227. }}
  4228. >
  4229. 催款节点
  4230. </span>
  4231. {/* <span
  4232. style={{
  4233. display: "inline-block",
  4234. marginLeft: 10,
  4235. color: "red"
  4236. }}
  4237. >
  4238. 金额总计(万元): {this.state.totalCui}
  4239. </span> */}
  4240. <Button
  4241. type="primary"
  4242. onClick={e => {
  4243. this.changeAddCui();
  4244. }}
  4245. disabled={this.state.listCuiFlag}
  4246. style={{
  4247. float: "right",
  4248. marginRight: "50px",
  4249. marginBottom: "15px"
  4250. }}
  4251. >
  4252. 添加催款节点
  4253. </Button>
  4254. </div>
  4255. <div className="clearfix">
  4256. <Spin spinning={this.state.loading}>
  4257. <Form layout="horizontal">
  4258. <Table
  4259. pagination={false}
  4260. columns={this.state.changeCuiList}
  4261. dataSource={this.state.cuiDataSource}
  4262. scroll={{ x: "max-content", y: 0 }}
  4263. bordered
  4264. size="small"
  4265. />
  4266. <Col
  4267. span={24}
  4268. offset={9}
  4269. style={{ marginTop: "15px" }}
  4270. ></Col>
  4271. </Form>
  4272. </Spin>
  4273. </div>
  4274. </div>
  4275. <div className="clearfix">
  4276. <FormItem
  4277. style={{ height: "auto" }}
  4278. labelCol={{ span: 4 }}
  4279. wrapperCol={{ span: 18 }}
  4280. label="变更原因"
  4281. >
  4282. {/* {!this.state.mark ? ( */}
  4283. <TextArea
  4284. rows={4}
  4285. placeholder="请输入变更原因"
  4286. ref="signTotalAmount"
  4287. style={{ width: "95%" }}
  4288. value={this.state.remarksC}
  4289. onChange={e => {
  4290. this.setState({
  4291. remarksC: e.target.value
  4292. });
  4293. }}
  4294. />
  4295. {/* ) : (
  4296. <span>{contractData.remarks}</span>
  4297. )} */}
  4298. </FormItem>
  4299. </div>
  4300. <div className="clearfix">
  4301. <FormItem
  4302. style={{ height: "auto" }}
  4303. labelCol={{ span: 4 }}
  4304. wrapperCol={{ span: 18 }}
  4305. label="备注"
  4306. >
  4307. {/* {!this.state.mark ? ( */}
  4308. <TextArea
  4309. rows={4}
  4310. placeholder="请输入备注"
  4311. ref="signTotalAmount"
  4312. style={{ width: "95%" }}
  4313. value={this.state.startRemarks}
  4314. onChange={e => {
  4315. this.setState({
  4316. startRemarks: e.target.value
  4317. });
  4318. }}
  4319. />
  4320. {/* ) : (
  4321. <span>{contractData.startRemarks}</span>
  4322. )} */}
  4323. </FormItem>
  4324. </div>
  4325. {/* ---- */}
  4326. <div className="clearfix">
  4327. <FormItem
  4328. labelCol={{ span: 4 }}
  4329. wrapperCol={{ span: 18 }}
  4330. label="变更凭证"
  4331. >
  4332. {/* {!this.state.mark ? ( */}
  4333. <PicturesWall
  4334. fileList={this.getVoucherUrl}
  4335. pictureUrl={this.state.voucherUrl}
  4336. url="/api/admin/orderChange/uploadFile"
  4337. sign="order_change_file"
  4338. />
  4339. {/* ) : (
  4340. <div>
  4341. <Upload
  4342. className="demandDetailShow-upload"
  4343. listType="picture-card"
  4344. fileList={this.state.voucherUrl}
  4345. onPreview={file => {
  4346. this.setState({
  4347. previewImage:
  4348. file.url || file.thumbUrl,
  4349. previewVisible: true
  4350. });
  4351. }}
  4352. />
  4353. <Modal
  4354. maskClosable={false}
  4355. footer={null}
  4356. visible={this.state.previewVisible}
  4357. onCancel={() => {
  4358. this.setState({
  4359. previewVisible: false
  4360. });
  4361. }}
  4362. >
  4363. <img
  4364. alt=""
  4365. style={{ width: "100%" }}
  4366. src={this.state.previewImage || ""}
  4367. />
  4368. </Modal>
  4369. </div>
  4370. )} */}
  4371. <p>图片建议:要清晰。</p>
  4372. </FormItem>
  4373. </div>
  4374. {/* {!this.state.mark ? ( */}
  4375. <div className="clearfix">
  4376. <Button
  4377. type="primary"
  4378. style={{ float: "right", marginRight: 40 }}
  4379. // onClick={this.changeApply}
  4380. onClick={e => {
  4381. if (this.state.isCaoGao) {
  4382. this.submitChange()
  4383. } else {
  4384. this.changeApply();
  4385. }
  4386. }}
  4387. >
  4388. {this.state.isCaoGao ? "发起变更申请" : "确定"}
  4389. </Button>
  4390. </div>
  4391. {/* ) : (
  4392. ""
  4393. )} */}
  4394. </div>
  4395. }
  4396. </TabPane>
  4397. </Tabs>
  4398. )}
  4399. </div>
  4400. </Spin>
  4401. </Form>
  4402. </Modal>
  4403. <Modal
  4404. maskClosable={false}
  4405. visible={this.state.addnextVisible}
  4406. onOk={this.nextCancel}
  4407. onCancel={this.nextCancel}
  4408. width="800px"
  4409. title={this.state.addState ? "添加项目任务" : "项目任务详情"}
  4410. footer=""
  4411. className="admin-desc-content"
  4412. >
  4413. <Form
  4414. layout="horizontal"
  4415. onSubmit={this.nextSubmit}
  4416. // id="demand-form"
  4417. >
  4418. <Spin spinning={this.state.loading}>
  4419. {this.state.addState ? (
  4420. <div className="clearfix">
  4421. <FormItem
  4422. className="half-item"
  4423. {...formItemLayout}
  4424. label="服务名称"
  4425. >
  4426. <AutoComplete
  4427. className="certain-category-search"
  4428. dropdownClassName="certain-category-search-dropdown"
  4429. dropdownMatchSelectWidth={false}
  4430. dropdownStyle={{ width: 200 }}
  4431. style={{ width: "200px" }}
  4432. dataSource={options}
  4433. placeholder="输入服务名称"
  4434. value={this.state.commodityName}
  4435. onChange={this.httpChange}
  4436. filterOption={true}
  4437. onSelect={this.selectAuto}
  4438. >
  4439. <Input />
  4440. </AutoComplete>
  4441. <span className="mandatory">*</span>
  4442. </FormItem>
  4443. <FormItem
  4444. className="half-item"
  4445. {...formItemLayout}
  4446. label="服务数量"
  4447. >
  4448. <Input
  4449. placeholder="请输入服务数量"
  4450. value={this.state.commodityQuantity}
  4451. style={{ width: "200px" }}
  4452. onChange={e => {
  4453. this.setState({ commodityQuantity: e.target.value });
  4454. }}
  4455. ref="commodityQuantity"
  4456. />
  4457. <span className="mandatory">*</span>
  4458. </FormItem>
  4459. <FormItem
  4460. className="half-item"
  4461. {...formItemLayout}
  4462. label="实签价格(万元)"
  4463. >
  4464. <Input
  4465. placeholder="请输入实签价格"
  4466. value={this.state.commodityPrice}
  4467. style={{ width: "200px" }}
  4468. onChange={e => {
  4469. this.setState({ commodityPrice: e.target.value });
  4470. }}
  4471. ref="commodityPrice"
  4472. />
  4473. <span className="mandatory">*</span>
  4474. </FormItem>
  4475. <FormItem
  4476. className="half-item"
  4477. {...formItemLayout}
  4478. label="主要业务"
  4479. >
  4480. <Select
  4481. placeholder="选择是否为主要业务"
  4482. style={{ width: "200px" }}
  4483. value={this.state.main}
  4484. onChange={e => {
  4485. this.setState({ main: e });
  4486. }}
  4487. >
  4488. {boutique.map(function(item) {
  4489. return (
  4490. <Select.Option key={item.value}>
  4491. {item.key}
  4492. </Select.Option>
  4493. );
  4494. })}
  4495. </Select>
  4496. <span className="mandatory">*</span>
  4497. </FormItem>
  4498. <div className="clearfix">
  4499. <FormItem
  4500. labelCol={{ span: 4 }}
  4501. wrapperCol={{ span: 16 }}
  4502. label="服务说明"
  4503. >
  4504. <Input
  4505. type="textarea"
  4506. placeholder="请输入服务说明"
  4507. value={this.state.taskComment}
  4508. onChange={e => {
  4509. this.setState({ taskComment: e.target.value });
  4510. }}
  4511. />
  4512. </FormItem>
  4513. </div>
  4514. <FormItem
  4515. wrapperCol={{ span: 12, offset: 4 }}
  4516. className="half-middle"
  4517. >
  4518. <Button
  4519. className="submitSave"
  4520. type="primary"
  4521. htmlType="submit"
  4522. >
  4523. 保存
  4524. </Button>
  4525. <Button
  4526. className="submitSave"
  4527. type="ghost"
  4528. onClick={this.nextCancel}
  4529. >
  4530. 取消
  4531. </Button>
  4532. </FormItem>
  4533. </div>
  4534. ) : (
  4535. <div className="clearfix">
  4536. {this.state.processStatus == 0 ? (
  4537. <div className="clearfix">
  4538. <FormItem
  4539. className="half-item"
  4540. {...formItemLayout}
  4541. label="项目名称"
  4542. >
  4543. <span>{this.state.commodityName}</span>
  4544. </FormItem>
  4545. <FormItem
  4546. className="half-item"
  4547. {...formItemLayout}
  4548. label="项目数量"
  4549. >
  4550. <Input
  4551. placeholder="请输入数量"
  4552. value={this.state.commodityQuantity}
  4553. style={{ width: "200px" }}
  4554. onChange={e => {
  4555. this.setState({
  4556. commodityQuantity: e.target.value
  4557. });
  4558. }}
  4559. />
  4560. <span className="mandatory">*</span>
  4561. </FormItem>
  4562. <FormItem
  4563. className="half-item"
  4564. {...formItemLayout}
  4565. label="金额(万元)"
  4566. >
  4567. <Input
  4568. placeholder="请输入签单金额"
  4569. value={this.state.commodityPrice}
  4570. style={{ width: "200px" }}
  4571. onChange={e => {
  4572. this.setState({ commodityPrice: e.target.value });
  4573. }}
  4574. />
  4575. <span className="mandatory">*</span>
  4576. </FormItem>
  4577. <FormItem
  4578. className="half-item"
  4579. {...formItemLayout}
  4580. label="主要项目"
  4581. >
  4582. <Select
  4583. placeholder="选择是否为主要业务"
  4584. style={{ width: "200px" }}
  4585. value={this.state.main}
  4586. onChange={e => {
  4587. this.setState({ main: e });
  4588. }}
  4589. >
  4590. {boutique.map(function(item) {
  4591. return (
  4592. <Select.Option key={item.value}>
  4593. {item.key}
  4594. </Select.Option>
  4595. );
  4596. })}
  4597. </Select>
  4598. <span className="mandatory">*</span>
  4599. </FormItem>
  4600. <div className="clearfix">
  4601. <FormItem
  4602. labelCol={{ span: 4 }}
  4603. wrapperCol={{ span: 16 }}
  4604. label="服务说明"
  4605. >
  4606. <Input
  4607. type="textarea"
  4608. placeholder="请输入服务说明"
  4609. value={this.state.taskComment}
  4610. onChange={e => {
  4611. this.setState({ taskComment: e.target.value });
  4612. }}
  4613. />
  4614. </FormItem>
  4615. </div>
  4616. <FormItem
  4617. wrapperCol={{ span: 12, offset: 4 }}
  4618. className="half-middle"
  4619. >
  4620. <Button
  4621. className="submitSave"
  4622. type="primary"
  4623. onClick={this.tabRowSave}
  4624. >
  4625. 保存
  4626. </Button>
  4627. <Button
  4628. className="submitSave"
  4629. type="ghost"
  4630. onClick={this.nextCancel}
  4631. >
  4632. 取消
  4633. </Button>
  4634. </FormItem>
  4635. </div>
  4636. ) : (
  4637. <div className="clearfix">
  4638. <FormItem
  4639. className="half-item"
  4640. {...formItemLayout}
  4641. label="项目名称"
  4642. >
  4643. <span>{this.state.commodityName}</span>
  4644. </FormItem>
  4645. <FormItem
  4646. className="half-item"
  4647. {...formItemLayout}
  4648. label="项目数量"
  4649. >
  4650. <span>{this.state.commodityQuantity}</span>
  4651. </FormItem>
  4652. <FormItem
  4653. className="half-item"
  4654. {...formItemLayout}
  4655. label="金额(万元)"
  4656. >
  4657. <span>{this.state.commodityPrice}</span>
  4658. </FormItem>
  4659. <FormItem
  4660. className="half-item"
  4661. {...formItemLayout}
  4662. label="主要项目"
  4663. >
  4664. <span>{getboutique(this.state.main)}</span>
  4665. </FormItem>
  4666. <div className="clearfix">
  4667. <FormItem
  4668. labelCol={{ span: 4 }}
  4669. wrapperCol={{ span: 16 }}
  4670. label="服务说明"
  4671. >
  4672. <span>{this.state.taskComment}</span>
  4673. </FormItem>
  4674. </div>
  4675. </div>
  4676. )}
  4677. </div>
  4678. )}
  4679. </Spin>
  4680. </Form>
  4681. </Modal>
  4682. <Modal
  4683. maskClosable={false}
  4684. visible={this.state.changeVisible}
  4685. onOk={this.nextCancel}
  4686. onCancel={this.nextCancel}
  4687. width="800px"
  4688. title={"添加变更项目"}
  4689. footer=""
  4690. className="admin-desc-content"
  4691. >
  4692. <Form
  4693. layout="horizontal"
  4694. // id="demand-form"
  4695. >
  4696. <Spin spinning={this.state.loading}>
  4697. <div className="clearfix">
  4698. <FormItem
  4699. className="half-item"
  4700. {...formItemLayout}
  4701. label="服务名称"
  4702. >
  4703. <AutoComplete
  4704. className="certain-category-search"
  4705. dropdownClassName="certain-category-search-dropdown"
  4706. dropdownMatchSelectWidth={false}
  4707. dropdownStyle={{ width: 200 }}
  4708. style={{ width: "200px" }}
  4709. dataSource={options}
  4710. placeholder="输入服务名称"
  4711. value={this.state.commodityName}
  4712. onChange={this.httpChange}
  4713. filterOption={true}
  4714. onSelect={this.selectAuto}
  4715. >
  4716. <Input />
  4717. </AutoComplete>
  4718. <span className="mandatory">*</span>
  4719. </FormItem>
  4720. <FormItem
  4721. className="half-item"
  4722. {...formItemLayout}
  4723. label="服务数量"
  4724. >
  4725. <Input
  4726. placeholder="请输入服务数量"
  4727. value={this.state.commodityQuantity}
  4728. style={{ width: "200px" }}
  4729. onChange={e => {
  4730. this.setState({ commodityQuantity: e.target.value });
  4731. }}
  4732. ref="commodityQuantity"
  4733. />
  4734. <span className="mandatory">*</span>
  4735. </FormItem>
  4736. <FormItem
  4737. className="half-item"
  4738. {...formItemLayout}
  4739. label="实签价格(万元)"
  4740. >
  4741. <Input
  4742. placeholder="请输入实签价格"
  4743. value={this.state.commodityPrice}
  4744. style={{ width: "200px" }}
  4745. onChange={e => {
  4746. this.setState({ commodityPrice: e.target.value });
  4747. }}
  4748. ref="commodityPrice"
  4749. />
  4750. <span className="mandatory">*</span>
  4751. </FormItem>
  4752. <FormItem
  4753. className="half-item"
  4754. {...formItemLayout}
  4755. label="主要业务"
  4756. >
  4757. <Select
  4758. placeholder="选择是否为主要业务"
  4759. style={{ width: "200px" }}
  4760. value={this.state.main}
  4761. onChange={e => {
  4762. this.setState({ main: e });
  4763. }}
  4764. >
  4765. {boutique.map(function(item) {
  4766. return (
  4767. <Select.Option key={item.value}>
  4768. {item.key}
  4769. </Select.Option>
  4770. );
  4771. })}
  4772. </Select>
  4773. <span className="mandatory">*</span>
  4774. </FormItem>
  4775. <div className="clearfix">
  4776. <FormItem
  4777. labelCol={{ span: 4 }}
  4778. wrapperCol={{ span: 16 }}
  4779. label="服务说明"
  4780. >
  4781. <Input
  4782. type="textarea"
  4783. placeholder="请输入服务说明"
  4784. value={this.state.taskComment}
  4785. onChange={e => {
  4786. this.setState({ taskComment: e.target.value });
  4787. }}
  4788. />
  4789. </FormItem>
  4790. </div>
  4791. <FormItem
  4792. wrapperCol={{ span: 12, offset: 4 }}
  4793. className="half-middle"
  4794. >
  4795. <Button
  4796. className="submitSave"
  4797. type="primary"
  4798. onClick={this.changeProSubmit}
  4799. >
  4800. 保存
  4801. </Button>
  4802. <Button
  4803. className="submitSave"
  4804. type="ghost"
  4805. onClick={this.nextCancel}
  4806. >
  4807. 取消
  4808. </Button>
  4809. </FormItem>
  4810. </div>
  4811. </Spin>
  4812. </Form>
  4813. </Modal>
  4814. <Modal
  4815. maskClosable={false}
  4816. visible={this.state.lookVisible}
  4817. onOk={this.noCancel}
  4818. onCancel={this.noCancel}
  4819. width="800px"
  4820. title={"退单申请"}
  4821. footer=""
  4822. className="admin-desc-content"
  4823. >
  4824. <Form layout="horizontal">
  4825. <Spin spinning={this.state.loading}>
  4826. <div className="clearfix">
  4827. <FormItem
  4828. labelCol={{ span: 4 }}
  4829. wrapperCol={{ span: 16 }}
  4830. label="终止合同"
  4831. >
  4832. <Picture
  4833. fileList={e => {
  4834. this.setState({ contractUrl: e });
  4835. }}
  4836. pictureUrl={this.state.contractUrl}
  4837. visible={this.props.visible}
  4838. data={{
  4839. sign: "order_refund_file",
  4840. url: "/api/admin/newOrder/uploadRefundOrderFile",
  4841. number: 8
  4842. }}
  4843. />
  4844. </FormItem>
  4845. </div>
  4846. <div className="clearfix">
  4847. <FormItem
  4848. labelCol={{ span: 4 }}
  4849. wrapperCol={{ span: 16 }}
  4850. label="退单申请表"
  4851. >
  4852. <Picture
  4853. fileList={e => {
  4854. this.setState({ applicationUrl: e });
  4855. }}
  4856. pictureUrl={this.state.applicationUrl}
  4857. visible={this.props.visible}
  4858. data={{
  4859. sign: "order_refund_file",
  4860. url: "/api/admin/newOrder/uploadRefundOrderFile",
  4861. number: 8
  4862. }}
  4863. />
  4864. </FormItem>
  4865. </div>
  4866. <div className="clearfix">
  4867. <FormItem
  4868. labelCol={{ span: 4 }}
  4869. wrapperCol={{ span: 16 }}
  4870. label="退单理由"
  4871. >
  4872. <Input
  4873. type="textarea"
  4874. placeholder="请输入退单理由"
  4875. rows={4}
  4876. value={this.state.reason}
  4877. onChange={e => {
  4878. this.setState({ reason: e.target.value });
  4879. }}
  4880. />
  4881. </FormItem>
  4882. </div>
  4883. <div className="clearfix">
  4884. <Button
  4885. className="cancel"
  4886. type="primary"
  4887. onClick={this.tuidanOk}
  4888. style={{ marginLeft: "50px" }}
  4889. htmlType="submit"
  4890. >
  4891. 确定退单
  4892. </Button>
  4893. <Button
  4894. className="cancel"
  4895. type="ghost"
  4896. onClick={this.noCancel}
  4897. style={{ marginLeft: "50px" }}
  4898. >
  4899. 取消
  4900. </Button>
  4901. </div>
  4902. </Spin>
  4903. </Form>
  4904. </Modal>
  4905. {/* <Modal
  4906. visible={this.state.rizhivisible}
  4907. className="admin-desc-content"
  4908. width="800px"
  4909. maskClosable={false}
  4910. title="订单日志"
  4911. footer={null}
  4912. onCancel={this.closeOrderLog}
  4913. >
  4914. <div className="patent-table">
  4915. <Spin spinning={this.state.loading}>
  4916. <Table
  4917. columns={this.state.columnsrizhi}
  4918. dataSource={this.state.dataSourcerizhi}
  4919. pagination={false}
  4920. />
  4921. </Spin>
  4922. </div>
  4923. </Modal> */}
  4924. <OrderRiZi
  4925. dataSourcerizhi={this.state.dataSourcerizhi}
  4926. closeOrderLog={this.closeOrderLog}
  4927. visible={this.state.rizhivisible}
  4928. loading={this.state.loading}
  4929. />
  4930. </div>
  4931. );
  4932. }
  4933. })
  4934. );
  4935. export default Form.create()(NewService);