addService.jsx 183 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081
  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.ctid = 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. jiedian(orderNos) {
  1412. $.ajax({
  1413. method: "get",
  1414. dataType: "json",
  1415. crossDomain: false,
  1416. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  1417. data: {
  1418. orderNo: orderNos
  1419. },
  1420. success: function(data) {
  1421. let theArr = [];
  1422. let thisData = [];
  1423. if (data.error.length || data.data.list == "") {
  1424. if (data.error && data.error.length) {
  1425. message.warning(data.error[0].message);
  1426. }
  1427. } else {
  1428. for (let i = 0; i < data.data.length; i++) {
  1429. thisData = data.data[i];
  1430. theArr.push({
  1431. key: i,
  1432. dunSubject: thisData.dunSubject
  1433. ? thisData.dunSubject.toString()
  1434. : "", //催款科目
  1435. id: thisData.id, //节点Id
  1436. money: thisData.money, //催款金额
  1437. dunStatus: thisData.dunStatus, //催款状态
  1438. orderNo: thisData.orderNo
  1439. });
  1440. }
  1441. this.setState({
  1442. contactList: theArr
  1443. });
  1444. }
  1445. }.bind(this)
  1446. }).always(
  1447. function() {
  1448. this.setState({
  1449. loading: false
  1450. });
  1451. }.bind(this)
  1452. );
  1453. },
  1454. //查看催款节点
  1455. jiedianNew(orderNos) {
  1456. $.ajax({
  1457. method: "get",
  1458. dataType: "json",
  1459. crossDomain: false,
  1460. url:
  1461. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  1462. data: {
  1463. orderNo: orderNos
  1464. },
  1465. success: function(data) {
  1466. if (data.error && data.error.length) {
  1467. message.warning(data.error[0].message);
  1468. } else {
  1469. let theArr = [];
  1470. let thisData = [];
  1471. let arr = data.data || [];
  1472. let totalCui = 0;
  1473. for (let i = 0; i < arr.length; i++) {
  1474. thisData = arr[i];
  1475. totalCui += +thisData.money;
  1476. theArr.push({
  1477. key: i,
  1478. dunSubject: thisData.dunSubject
  1479. ? thisData.dunSubject.toString()
  1480. : "", //催款科目
  1481. id: thisData.id, //节点Id
  1482. money: thisData.money, //催款金额
  1483. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  1484. commodityName: thisData.commodityName,
  1485. projectType: thisData.projectType,
  1486. dunTypeName: thisData.dunTypeName,
  1487. status: thisData.status,
  1488. waitDay: thisData.waitDay,
  1489. effectiveCount: thisData.effectiveCount,
  1490. startDate: thisData.startDate,
  1491. dunType: thisData.dunType,
  1492. appropriationRatio: thisData.appropriationRatio
  1493. });
  1494. }
  1495. if (!totalCui) {
  1496. totalCui = 0;
  1497. }
  1498. totalCui = (Math.round(totalCui * 10000) / 10000).toFixed(4);
  1499. this.setState({
  1500. contactListNew: theArr,
  1501. totalCui
  1502. });
  1503. }
  1504. }.bind(this)
  1505. }).always(
  1506. function() {
  1507. this.setState({
  1508. loading: false
  1509. });
  1510. }.bind(this)
  1511. );
  1512. },
  1513. //催款节点保存
  1514. contactSave(record) {
  1515. for (let i = 0; i < this.state.contactList.length; i++) {
  1516. if (moneyVerify(this.state.contactList[i].money)) {
  1517. return;
  1518. }
  1519. }
  1520. this.setState({
  1521. loading: true
  1522. });
  1523. $.ajax({
  1524. url: globalConfig.context + "/api/admin/newOrder/createOrderDun",
  1525. method: "post",
  1526. data: {
  1527. orderNo: this.state.orderNo,
  1528. orderDun: JSON.stringify(this.state.contactList)
  1529. }
  1530. }).done(
  1531. function(data) {
  1532. this.setState({
  1533. loading: false
  1534. });
  1535. if (!data.error.length) {
  1536. message.success("保存成功!");
  1537. this.jiedian(record.orderNo);
  1538. } else {
  1539. message.warning(data.error[0].message);
  1540. }
  1541. }.bind(this)
  1542. );
  1543. },
  1544. //催款节点保存
  1545. contactSaveNew(record) {
  1546. if (record.boStatus == "false") {
  1547. record.boStatus = false;
  1548. } else if (record.boStatus == "true") {
  1549. record.boStatus = true;
  1550. }
  1551. if (!this.state.yearFlag) {
  1552. if (!record.effectiveCount) {
  1553. message.warning("请选择服务年限");
  1554. return;
  1555. }
  1556. } else {
  1557. record.effectiveCount = "";
  1558. }
  1559. if (record.money == "") {
  1560. message.warning("请填写金额");
  1561. return;
  1562. }
  1563. if (record.boStatus) {
  1564. if (
  1565. typeof +record.money == "number" &&
  1566. +record.money >= 0 &&
  1567. +record.money <= 1
  1568. ) {
  1569. record.appropriationRatio = record.money;
  1570. } else {
  1571. message.warning("金额比例填写错误,比例范围0~1");
  1572. return;
  1573. }
  1574. }
  1575. if (!record.dunType) {
  1576. message.warning("请选择对应科目");
  1577. return;
  1578. }
  1579. if (record.dunType != 1) {
  1580. record.waitDay = "";
  1581. }
  1582. this.setState({
  1583. loading: true
  1584. });
  1585. if (record.boStatus) {
  1586. $.ajax({
  1587. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1588. method: "post",
  1589. data: {
  1590. orderNo: record.orderNo,
  1591. tid: record.tid,
  1592. projectType: record.sort,
  1593. dunType: record.dunType,
  1594. appropriationRatio: record.appropriationRatio,
  1595. waitDay: record.waitDay,
  1596. effectiveCount: record.effectiveCount
  1597. }
  1598. }).done(
  1599. function(data) {
  1600. this.setState({
  1601. loading: false
  1602. });
  1603. if (!data.error.length) {
  1604. message.success("保存成功!");
  1605. this.setState({
  1606. cuiFlag: false,
  1607. boFlag: false,
  1608. addFlag: false
  1609. });
  1610. this.jiedianNew(record.orderNo);
  1611. } else {
  1612. message.warning(data.error[0].message);
  1613. }
  1614. }.bind(this)
  1615. );
  1616. } else {
  1617. $.ajax({
  1618. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1619. method: "post",
  1620. data: {
  1621. orderNo: record.orderNo,
  1622. tid: record.tid,
  1623. projectType: record.sort,
  1624. dunType: record.dunType,
  1625. money: record.money,
  1626. waitDay: record.waitDay,
  1627. effectiveCount: record.effectiveCount
  1628. }
  1629. }).done(
  1630. function(data) {
  1631. this.setState({
  1632. loading: false
  1633. });
  1634. if (!data.error.length) {
  1635. message.success("保存成功!");
  1636. this.setState({
  1637. cuiFlag: false,
  1638. boFlag: false,
  1639. addFlag: false
  1640. });
  1641. this.jiedianNew(record.orderNo);
  1642. } else {
  1643. message.warning(data.error[0].message);
  1644. }
  1645. }.bind(this)
  1646. );
  1647. }
  1648. },
  1649. //点击新增催款节点
  1650. addcontact() {
  1651. this.state.contactList.push({
  1652. key: this.state.contactList.length,
  1653. money: "",
  1654. dunSubject: undefined,
  1655. orderNo: this.state.orderNo,
  1656. dunTarget: this.state.kehuId
  1657. });
  1658. this.setState({
  1659. contactList: this.state.contactList
  1660. });
  1661. },
  1662. //点击新增催款节点
  1663. addcontactNew() {
  1664. this.state.contactListNew.push({
  1665. key: this.state.contactListNew.length,
  1666. money: "",
  1667. dunSubject: undefined,
  1668. orderNo: this.state.orderNo,
  1669. dunTarget: this.state.kehuId
  1670. });
  1671. this.setState({
  1672. contactListNew: this.state.contactListNew,
  1673. cuiFlag: true
  1674. });
  1675. },
  1676. //删除收款节点
  1677. confirmDelet(index) {
  1678. this.state.contactList.splice(index, 1);
  1679. this.setState({
  1680. contactList: this.state.contactList
  1681. });
  1682. this.contactSave();
  1683. },
  1684. //删除收款节点
  1685. confirmDeletNew(index) {
  1686. if (index.id) {
  1687. this.state.contactListNew.splice(index.id, 1);
  1688. this.setState({
  1689. contactListNew: this.state.contactListNew,
  1690. cuiFlag: false,
  1691. addFlag: false,
  1692. boFlag: false
  1693. });
  1694. $.ajax({
  1695. url: globalConfig.context + "/api/admin/newOrderDun/deleteDun",
  1696. method: "post",
  1697. data: {
  1698. id: index.id
  1699. }
  1700. }).done(
  1701. function(data) {
  1702. this.setState({
  1703. loading: false
  1704. });
  1705. if (!data.error.length) {
  1706. message.success("删除成功!");
  1707. this.setState({
  1708. cuiFlag: false
  1709. });
  1710. this.jiedianNew(this.state.orderNo);
  1711. } else {
  1712. message.warning(data.error[0].message);
  1713. }
  1714. }.bind(this)
  1715. );
  1716. } else {
  1717. this.state.contactListNew.splice(index.key, 1);
  1718. this.setState({
  1719. contactListNew: this.state.contactListNew,
  1720. cuiFlag: false,
  1721. addFlag: false,
  1722. boFlag: false
  1723. });
  1724. }
  1725. },
  1726. handleOk() {
  1727. this.setState({
  1728. visible: false,
  1729. mark: false
  1730. });
  1731. this.props.closeDesc(false, true);
  1732. },
  1733. handleCancel() {
  1734. if (this.state.orderType == undefined) {
  1735. return false;
  1736. }
  1737. if (!this.state.autoId) {
  1738. return false;
  1739. }
  1740. this.setState({
  1741. visible: false,
  1742. mark: false
  1743. });
  1744. this.props.closeDesc(false);
  1745. },
  1746. handleCancelclose() {
  1747. this.setState(
  1748. {
  1749. visible: false,
  1750. mark: false,
  1751. cuiFlag: false,
  1752. addFlag: false,
  1753. boFlag: false,
  1754. isJilu: false
  1755. },
  1756. () => {
  1757. this.setState({
  1758. activeKey: "1"
  1759. });
  1760. }
  1761. );
  1762. this.props.closeDesc(false);
  1763. this.reset();
  1764. },
  1765. //点击签单
  1766. handleCancels() {
  1767. this.setState({
  1768. isSubmit: 1
  1769. });
  1770. },
  1771. //点击签单
  1772. handleCancelq() {
  1773. this.setState({
  1774. isSubmit: 0
  1775. });
  1776. },
  1777. //删除
  1778. delectRow(record) {
  1779. this.setState({
  1780. loading: true
  1781. });
  1782. $.ajax({
  1783. method: "post",
  1784. dataType: "json",
  1785. crossDomain: false,
  1786. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  1787. data: {
  1788. id: record.id
  1789. }
  1790. }).done(
  1791. function(data) {
  1792. if (!data.error.length) {
  1793. message.success("删除成功!");
  1794. this.setState({
  1795. loading: false
  1796. });
  1797. this.jiedian(this.state.orderNo);
  1798. this.jiedianNew(this.state.orderNo);
  1799. this.loaduser();
  1800. this.loadData();
  1801. } else {
  1802. message.warning(data.error[0].message);
  1803. }
  1804. }.bind(this)
  1805. );
  1806. },
  1807. nextCancel() {
  1808. this.setState({
  1809. addnextVisible: false,
  1810. changeVisible: false
  1811. });
  1812. },
  1813. rizhi() {
  1814. this.setState({
  1815. loading: true
  1816. });
  1817. $.ajax({
  1818. method: "get",
  1819. dataType: "json",
  1820. crossDomain: false,
  1821. url: "/api/admin/newOrder/selectOrderLog",
  1822. data: {
  1823. orderNo: this.props.datauser.orderNo
  1824. },
  1825. success: function(data) {
  1826. let theArr = [];
  1827. let thisData = data.data;
  1828. if (!thisData.length) {
  1829. if (data.error && data.error.length) {
  1830. message.warning(data.error[0].message);
  1831. }
  1832. thisData = {};
  1833. } else {
  1834. for (let i = 0; i < data.data.length; i++) {
  1835. let thisdata = data.data[i];
  1836. theArr.push({
  1837. processName: thisdata.processName,
  1838. adminName: thisdata.adminName,
  1839. createDate: thisdata.createDate,
  1840. remarks: thisdata.remarks
  1841. });
  1842. }
  1843. }
  1844. this.setState({
  1845. dataSourcerizhi: theArr
  1846. });
  1847. }.bind(this)
  1848. }).always(
  1849. function() {
  1850. this.setState({
  1851. loading: false
  1852. });
  1853. }.bind(this)
  1854. );
  1855. },
  1856. //查看订单日志
  1857. getOrderLog() {
  1858. this.setState({
  1859. rizhivisible: true
  1860. });
  1861. this.rizhi();
  1862. },
  1863. closeOrderLog() {
  1864. this.setState({
  1865. rizhivisible: false
  1866. });
  1867. },
  1868. callback(key) {
  1869. this.setState({
  1870. activeKey: key
  1871. });
  1872. if (key === "1") {
  1873. this.jiedian(this.props.datauser.orderNo);
  1874. this.jiedianNew(this.props.datauser.orderNo);
  1875. // this.loaduser();
  1876. }
  1877. if (key === "3") {
  1878. this.getChangeData();
  1879. }
  1880. if (key === "2") {
  1881. let url = window.location.href.substring(7);
  1882. $.ajax({
  1883. method: "get",
  1884. dataType: "json",
  1885. crossDomain: false,
  1886. url:
  1887. globalConfig.context + "/api/admin/orderChange/orderChangeDetails",
  1888. data: {
  1889. orderNo: this.props.datauser.orderNo
  1890. },
  1891. success: function(data) {
  1892. // console.log(data.data);
  1893. if (data.data && data.data.length) {
  1894. let thisdata = data.data[data.data.length - 1];
  1895. if (thisdata.status === 0 || thisdata.processState == 0) {
  1896. this.setState({
  1897. changeId: thisdata.id,
  1898. typeChange: thisdata.type,
  1899. totalAmount: thisdata.totalAmount,
  1900. settlementAmount: thisdata.settlementAmount,
  1901. changeAmount: thisdata.changeAmount,
  1902. remarksC: thisdata.remarks,
  1903. startRemarks: thisdata.zxsRemarks,
  1904. isCaoGao: true,
  1905. changeFlag: true,
  1906. voucherUrl: thisdata.voucherUrl
  1907. ? splitUrl(
  1908. thisdata.voucherUrl,
  1909. ",",
  1910. globalConfig.avatarHost + "/upload",
  1911. url
  1912. )
  1913. : []
  1914. });
  1915. this.proList();
  1916. this.cuiList();
  1917. let e = thisdata.type;
  1918. if (e == 1) {
  1919. this.setState({
  1920. hetongFlag: false,
  1921. listFlag: false,
  1922. listCuiFlag: false,
  1923. tuiKuanFlag: false
  1924. });
  1925. } else if (e == 2) {
  1926. this.setState({
  1927. hetongFlag: true,
  1928. listFlag: false,
  1929. listCuiFlag: false,
  1930. tuiKuanFlag: true
  1931. });
  1932. } else if (e == 3) {
  1933. this.setState({
  1934. listFlag: true,
  1935. hetongFlag: false,
  1936. listCuiFlag: false,
  1937. tuiKuanFlag: false
  1938. });
  1939. } else if (e == 4) {
  1940. this.setState({
  1941. listFlag: false,
  1942. listCuiFlag: false,
  1943. hetongFlag: false,
  1944. tuiKuanFlag: true
  1945. });
  1946. } else if (e == 5) {
  1947. this.setState({
  1948. listFlag: false,
  1949. listCuiFlag: false,
  1950. hetongFlag: true,
  1951. tuiKuanFlag: true
  1952. });
  1953. } else {
  1954. this.setState({
  1955. listFlag: true,
  1956. hetongFlag: true,
  1957. listCuiFlag: true,
  1958. tuiKuanFlag: false
  1959. });
  1960. }
  1961. } else {
  1962. this.setState({
  1963. listFlag: false,
  1964. hetongFlag: false,
  1965. listCuiFlag: false,
  1966. tuiKuanFlag: false,
  1967. // 置空
  1968. changeId: undefined
  1969. });
  1970. }
  1971. } else {
  1972. this.setState({
  1973. isCaoGao: false
  1974. });
  1975. }
  1976. }.bind(this)
  1977. });
  1978. }
  1979. },
  1980. cuiList(id) {
  1981. $.ajax({
  1982. method: "get",
  1983. dataType: "json",
  1984. crossDomain: false,
  1985. url: globalConfig.context + "/api/admin/orderChange/selectChangeDun",
  1986. data: {
  1987. id: id || this.state.changeId
  1988. },
  1989. success: function(data) {
  1990. if (data.data && data.data.length) {
  1991. if(id) {
  1992. this.setState({
  1993. listCuiFlag: true
  1994. })
  1995. }
  1996. this.setState({
  1997. cuiDataSource: data.data
  1998. });
  1999. }
  2000. }.bind(this)
  2001. });
  2002. },
  2003. proList(id) {
  2004. $.ajax({
  2005. method: "get",
  2006. dataType: "json",
  2007. crossDomain: false,
  2008. url: globalConfig.context + "/api/admin/orderChange/selectChangeTask",
  2009. data: {
  2010. id: id || this.state.changeId
  2011. },
  2012. success: function(data) {
  2013. if (data.data && data.data.length) {
  2014. if(id) {
  2015. this.setState({
  2016. listFlag: true
  2017. })
  2018. }
  2019. this.setState({
  2020. proDataSource: data.data
  2021. });
  2022. }
  2023. }.bind(this)
  2024. });
  2025. },
  2026. getOrgCodeUrl(e) {
  2027. this.setState({ orgCodeUrl: e });
  2028. },
  2029. getVoucherUrl(e) {
  2030. this.setState({ voucherUrl: e });
  2031. },
  2032. //加载(自动补全)
  2033. supervisor(e, state) {
  2034. //客户名称与服务名称自动补全
  2035. let api = state
  2036. ? "/api/admin/customer/getCustomerByName"
  2037. : "/api/admin/order/getBusinessProjectByName";
  2038. $.ajax({
  2039. method: "get",
  2040. dataType: "json",
  2041. crossDomain: false,
  2042. url: globalConfig.context + api,
  2043. data: state
  2044. ? {
  2045. name: e,
  2046. type: this.state.customType
  2047. }
  2048. : {
  2049. businessName: e
  2050. },
  2051. success: function(data) {
  2052. let thedata = data.data;
  2053. if (!thedata) {
  2054. if (data.error && data.error.length) {
  2055. message.warning(data.error[0].message);
  2056. }
  2057. thedata = {};
  2058. }
  2059. this.setState({
  2060. states: state,
  2061. customerArr: thedata
  2062. });
  2063. }.bind(this)
  2064. }).always(
  2065. function() {
  2066. this.setState({
  2067. loading: false
  2068. });
  2069. }.bind(this)
  2070. );
  2071. },
  2072. supervisorCui(e) {
  2073. //客户名称与服务名称自动补全
  2074. let api = "/api/admin/order/getBusinessProjectByName";
  2075. $.ajax({
  2076. method: "get",
  2077. dataType: "json",
  2078. crossDomain: false,
  2079. url: globalConfig.context + api,
  2080. data: {
  2081. businessName: e
  2082. },
  2083. success: function(data) {
  2084. let thedata = data.data;
  2085. if (!thedata) {
  2086. if (data.error && data.error.length) {
  2087. message.warning(data.error[0].message);
  2088. }
  2089. thedata = {};
  2090. }
  2091. this.setState({
  2092. customerCuiArr: thedata
  2093. });
  2094. }.bind(this)
  2095. }).always(
  2096. function() {
  2097. this.setState({
  2098. loading: false
  2099. });
  2100. }.bind(this)
  2101. );
  2102. },
  2103. //上级主管输入框失去焦点是判断客户是否存在
  2104. selectAuto(value) {
  2105. let kid = [];
  2106. let fwList = this.state.customerArr;
  2107. fwList.map(function(item) {
  2108. if (value == item.bname) {
  2109. kid = item;
  2110. }
  2111. });
  2112. this.setState({
  2113. commodityName: value,
  2114. gid: kid.id,
  2115. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  2116. commodityFirstPayment:
  2117. kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
  2118. });
  2119. },
  2120. selectAutoCui(value) {
  2121. let kid = [];
  2122. let fwList = this.state.customerCuiArr;
  2123. fwList.map(function(item) {
  2124. if (value == item.bname) {
  2125. kid = item;
  2126. }
  2127. });
  2128. this.setState({
  2129. commodityNameCui: value,
  2130. cid: kid.id,
  2131. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  2132. commodityFirstPayment:
  2133. kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
  2134. });
  2135. },
  2136. //客户
  2137. selectAutoCUT(value) {
  2138. let autoIds;
  2139. let fwList = this.state.customerArr;
  2140. fwList.map(function(item) {
  2141. if (value == item.name) {
  2142. autoIds = item.id;
  2143. }
  2144. });
  2145. this.setState({
  2146. customerName: value,
  2147. autoId: autoIds
  2148. });
  2149. },
  2150. //服务值改变时请求客户名称
  2151. httpChange(e) {
  2152. this.state.gid = "";
  2153. if (e.length >= 1) {
  2154. this.supervisor(e, false);
  2155. }
  2156. this.setState({
  2157. commodityName: e
  2158. });
  2159. },
  2160. httpChangeCui(e) {
  2161. if (e.length >= 1) {
  2162. this.supervisorCui(e, false);
  2163. }
  2164. this.setState({
  2165. commodityNameCui: e
  2166. });
  2167. },
  2168. //客户名称自动补全
  2169. customerChange(e) {
  2170. if (this.state.customType) {
  2171. this.state.autoId = "";
  2172. if (e.length >= 2) {
  2173. this.supervisor(e, true);
  2174. }
  2175. this.setState({
  2176. customerName: e
  2177. });
  2178. } else {
  2179. this.setState({
  2180. customerName: ""
  2181. });
  2182. message.warning("客户所属类型必须指定");
  2183. }
  2184. },
  2185. //点击添加项目明细
  2186. addDetailed() {
  2187. this.setState({
  2188. gid: "",
  2189. customerArr: [],
  2190. commodityName: "",
  2191. commodityQuantity: "",
  2192. commodityId: "",
  2193. taskComment: "",
  2194. main: undefined,
  2195. commodityPrice: "",
  2196. addState: 1,
  2197. addnextVisible: true
  2198. });
  2199. },
  2200. //新建项目明细保存
  2201. nextSubmit(e) {
  2202. e.preventDefault();
  2203. if (this.state.gid == undefined || !this.state.gid) {
  2204. message.warning("服务名称不匹配!");
  2205. return false;
  2206. }
  2207. if (!this.state.commodityPrice) {
  2208. message.warning("请输入金额!");
  2209. this.refs.commodityPrice.focus();
  2210. return false;
  2211. }
  2212. let reg = /^([0]|[1-9][0-9]*)$/;
  2213. if (
  2214. !this.state.commodityQuantity ||
  2215. !reg.test(this.state.commodityQuantity)
  2216. ) {
  2217. message.warning("请输入正确商品数量!");
  2218. this.refs.commodityQuantity.focus();
  2219. return false;
  2220. }
  2221. if (!this.state.main) {
  2222. message.warning("请选择是否为主要项目!");
  2223. this.refs.commodityQuantity.focus();
  2224. return false;
  2225. }
  2226. this.setState({
  2227. loading: true
  2228. });
  2229. let api = this.state.addState
  2230. ? "/api/admin/newOrder/addOrderTask"
  2231. : "/api/bianji";
  2232. $.ajax({
  2233. method: "POST",
  2234. dataType: "json",
  2235. crossDomain: false,
  2236. url: globalConfig.context + api,
  2237. data: {
  2238. commodityId: this.state.gid, //商品ID
  2239. orderNo: this.props.datauser.orderNo, //订单编号
  2240. commodityName: this.state.commodityName, //商品名称
  2241. commodityQuantity: this.state.commodityQuantity, //商品数量
  2242. commodityPrice: this.state.commodityPrice, //签单总价
  2243. taskComment: this.state.taskComment, //服务说明
  2244. main: this.state.main //是否为主要项目
  2245. }
  2246. }).done(
  2247. function(data) {
  2248. this.setState({
  2249. loading: false
  2250. });
  2251. if (!data.error.length) {
  2252. message.success("保存成功!");
  2253. this.nextCancel();
  2254. //this.loaduser(this.props.datauser);
  2255. this.loadData();
  2256. } else {
  2257. message.warning(data.error[0].message);
  2258. }
  2259. }.bind(this)
  2260. );
  2261. },
  2262. //点击打卡项目详情
  2263. tableRowClick(record) {
  2264. this.setState({
  2265. jid: record.id, //项目ID
  2266. kid: record.commodityId, //商品ID
  2267. commodityName: record.commodityName, //金额
  2268. commodityPrice: record.commodityPrice, //金额
  2269. commodityQuantity: record.commodityQuantity, //数量
  2270. taskComment: record.taskComment, //备注
  2271. main: record.main.toString(), //是否为主要
  2272. addnextVisible: true,
  2273. addState: 0
  2274. });
  2275. },
  2276. //修改项目详情
  2277. tabRowSave(e) {
  2278. e.preventDefault();
  2279. if (!this.state.commodityPrice) {
  2280. message.warning("金额不能为空!");
  2281. return false;
  2282. }
  2283. let reg = /^([0]|[1-9][0-9]*)$/;
  2284. if (
  2285. !this.state.commodityQuantity ||
  2286. !reg.test(this.state.commodityQuantity)
  2287. ) {
  2288. message.warning("请输入正确商品数量!");
  2289. return false;
  2290. }
  2291. if (!this.state.main) {
  2292. message.warning("请选择是否为主要项目!");
  2293. this.refs.commodityQuantity.focus();
  2294. return false;
  2295. }
  2296. $.ajax({
  2297. method: "POST",
  2298. dataType: "json",
  2299. crossDomain: false,
  2300. url: globalConfig.context + "/api/admin/newOrder/updateOrderTask",
  2301. data: {
  2302. id: this.state.jid, //项目ID
  2303. commodityId: this.state.kid, //商品ID
  2304. orderNo: this.props.datauser.orderNo, //订单编号
  2305. main: this.state.main, //是否为主要
  2306. commodityPrice: this.state.commodityPrice, //金额
  2307. commodityQuantity: this.state.commodityQuantity, //数量
  2308. taskComment: this.state.taskComment //备注
  2309. }
  2310. }).done(
  2311. function(data) {
  2312. this.setState({
  2313. loading: false
  2314. });
  2315. if (!data.error.length) {
  2316. message.success("保存成功!");
  2317. this.nextCancel();
  2318. //this.loaduser(this.props.datauser);
  2319. this.loadData();
  2320. } else {
  2321. message.warning(data.error[0].message);
  2322. }
  2323. }.bind(this)
  2324. );
  2325. },
  2326. //签单时间选择
  2327. selTime(e, index) {
  2328. this.setState({
  2329. entryTime: e,
  2330. signDate: e,
  2331. selTime: index
  2332. });
  2333. },
  2334. //退单操作
  2335. //点击退单
  2336. tuikuan() {
  2337. this.setState({
  2338. lookVisible: true,
  2339. contractUrl: [],
  2340. applicationUrl: [],
  2341. reason: ""
  2342. });
  2343. },
  2344. //关闭退单
  2345. noCancel() {
  2346. this.setState({
  2347. lookVisible: false
  2348. });
  2349. },
  2350. //点击确认退单
  2351. tuidanOk() {
  2352. let contractUrls = [];
  2353. let applicationUrls = [];
  2354. if (this.state.contractUrl.length) {
  2355. let picArr = [];
  2356. this.state.contractUrl.map(function(item) {
  2357. if (
  2358. item.response &&
  2359. item.response.data &&
  2360. item.response.data.length
  2361. ) {
  2362. picArr.push(item.response.data);
  2363. }
  2364. });
  2365. contractUrls = picArr.join(",");
  2366. }
  2367. if (this.state.applicationUrl.length) {
  2368. let picArr = [];
  2369. this.state.applicationUrl.map(function(item) {
  2370. if (
  2371. item.response &&
  2372. item.response.data &&
  2373. item.response.data.length
  2374. ) {
  2375. picArr.push(item.response.data);
  2376. }
  2377. });
  2378. applicationUrls = picArr.join(",");
  2379. }
  2380. $.ajax({
  2381. method: "POST",
  2382. dataType: "json",
  2383. crossDomain: false,
  2384. url: globalConfig.context + "/api/admin/newOrder/addOrderRefund",
  2385. data: {
  2386. orderNo: this.state.orderNo, //订单编号
  2387. contractUrl: contractUrls.length ? contractUrls : "", //终止合同
  2388. applicationUrl: applicationUrls.length ? applicationUrls : "", //退单申请表
  2389. reason: this.state.reason //退单原因
  2390. }
  2391. }).done(
  2392. function(data) {
  2393. this.setState({
  2394. loading: false
  2395. });
  2396. if (!data.error.length) {
  2397. message.success("退单成功!");
  2398. this.noCancel();
  2399. this.handleCancelclose();
  2400. } else {
  2401. message.warning(data.error[0].message);
  2402. }
  2403. }.bind(this)
  2404. );
  2405. },
  2406. //开单选择订单类型骚操作
  2407. orderTypeFn(e) {
  2408. if (e == 0) {
  2409. this.setState({
  2410. bussStats: true,
  2411. orderType: e
  2412. });
  2413. this.category();
  2414. } else {
  2415. this.setState({
  2416. contractType: undefined,
  2417. bussStats: false,
  2418. orderType: e
  2419. });
  2420. }
  2421. },
  2422. //品类数据获取
  2423. category() {
  2424. $.ajax({
  2425. method: "get",
  2426. dataType: "json",
  2427. crossDomain: false,
  2428. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  2429. data: {},
  2430. success: function(data) {
  2431. let thedata = data.data;
  2432. let theArr = [];
  2433. if (!thedata) {
  2434. if (data.error && data.error.length) {
  2435. message.warning(data.error[0].message);
  2436. }
  2437. thedata = {};
  2438. } else {
  2439. thedata.map(function(item, index) {
  2440. theArr.push({
  2441. key: index,
  2442. name: item.cname,
  2443. id: item.id
  2444. });
  2445. });
  2446. }
  2447. this.setState({
  2448. contractType: undefined,
  2449. categoryArr: theArr
  2450. });
  2451. }.bind(this)
  2452. });
  2453. },
  2454. //变更申请
  2455. changeApply() {
  2456. if (this.state.processStatus <= 4) {
  2457. message.warning("当前订单流程不能发起变更!");
  2458. return false;
  2459. }
  2460. if (this.state.changeAmount == "") {
  2461. message.warning("申请退款金额不能为空!");
  2462. // console.log(this.state.changeAmount);
  2463. return false;
  2464. }
  2465. if (this.state.remarksC.trim() == "") {
  2466. message.warning("请正确填写变更原因");
  2467. return false;
  2468. }
  2469. if (this.state.startRemarks.trim() == "") {
  2470. message.warning("请正确填写备注信息");
  2471. return false;
  2472. }
  2473. let theorgCodeUrl = [];
  2474. if (this.state.voucherUrl.length) {
  2475. let picArr = [];
  2476. this.state.voucherUrl.map(function(item) {
  2477. if (
  2478. item.response &&
  2479. item.response.data &&
  2480. item.response.data.length
  2481. ) {
  2482. picArr.push(item.response.data);
  2483. }
  2484. });
  2485. theorgCodeUrl = picArr.join(",");
  2486. }
  2487. this.setState({
  2488. loading: true
  2489. });
  2490. if (this.state.typeChange == 0) {
  2491. $.ajax({
  2492. method: "post",
  2493. dataType: "json",
  2494. crossDomain: false,
  2495. url: globalConfig.context + "/api/admin/orderChange/addOrderChange",
  2496. data: {
  2497. orderNo: this.state.orderNo, //订单编号
  2498. processState: 1,
  2499. status: 1,
  2500. startRemarks: this.state.startRemarks,
  2501. remarks: this.state.remarksC,
  2502. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  2503. totalAmount: this.state.totalAmount,
  2504. settlementAmount: this.state.settlementAmount,
  2505. changeAmount: this.state.changeAmount,
  2506. applicant: this.state.salesmanName,
  2507. depName: this.state.depName,
  2508. type: this.state.typeChange
  2509. }
  2510. }).done(
  2511. function(data) {
  2512. this.setState({
  2513. loading: false
  2514. });
  2515. if (!data.error.length) {
  2516. message.success("发起变更成功");
  2517. this.handleCancelclose();
  2518. } else {
  2519. message.warning(data.error[0].message);
  2520. }
  2521. }.bind(this)
  2522. );
  2523. } else {
  2524. $.ajax({
  2525. method: "post",
  2526. dataType: "json",
  2527. crossDomain: false,
  2528. url: globalConfig.context + "/api/admin/orderChange/addOrderChange",
  2529. data: {
  2530. orderNo: this.state.orderNo, //订单编号
  2531. processState: 0,
  2532. status: 0,
  2533. startRemarks: this.state.startRemarks,
  2534. remarks: this.state.remarksC,
  2535. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  2536. totalAmount: this.state.totalAmount,
  2537. settlementAmount: this.state.settlementAmount,
  2538. changeAmount: this.state.changeAmount,
  2539. applicant: this.state.salesmanName,
  2540. depName: this.state.depName,
  2541. type: this.state.typeChange
  2542. }
  2543. }).done(
  2544. function(data) {
  2545. this.setState({
  2546. loading: false
  2547. });
  2548. if (!data.error.length) {
  2549. message.success("发起变更草稿");
  2550. this.setState({
  2551. isCaoGao: true,
  2552. loading: false,
  2553. },() => {
  2554. this.callback("2");
  2555. });
  2556. } else {
  2557. message.warning(data.error[0].message);
  2558. }
  2559. }.bind(this)
  2560. );
  2561. }
  2562. },
  2563. reset() {
  2564. this.setState({
  2565. startRemarks: "",
  2566. remarksC: "",
  2567. voucherUrl: [],
  2568. totalAmount: undefined,
  2569. settlementAmount: undefined,
  2570. changeAmount: "0",
  2571. applicant: undefined,
  2572. depNameChange: undefined,
  2573. typeChange: []
  2574. });
  2575. },
  2576. componentWillReceiveProps(nextProps) {
  2577. //props改变时触发
  2578. this.state.visible = nextProps.showDesc;
  2579. this.state.signBillVisible = nextProps.signBillVisible;
  2580. if (this.state.signBillVisible) {
  2581. this.loaduser(nextProps.uid);
  2582. }
  2583. if (nextProps.userDetaile && nextProps.showDesc) {
  2584. this.loaduser(nextProps.datauser);
  2585. this.jiedian(nextProps.datauser.orderNo);
  2586. this.jiedianNew(nextProps.datauser.orderNo);
  2587. this.loadData(nextProps.datauser);
  2588. this.getChangeData(nextProps.datauser);
  2589. } else {
  2590. this.setState({
  2591. orderType: undefined,
  2592. customerName: "",
  2593. autoId: "",
  2594. customerArr: [],
  2595. contractType: undefined,
  2596. bussStats: false,
  2597. customType: undefined
  2598. });
  2599. }
  2600. },
  2601. //查看变更记录
  2602. getChangeData(record) {
  2603. this.setState({
  2604. loading: true
  2605. });
  2606. $.ajax({
  2607. method: "get",
  2608. dataType: "json",
  2609. crossDomain: false,
  2610. url: globalConfig.context + "/api/admin/orderChange/orderChangeDetails",
  2611. data: {
  2612. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  2613. },
  2614. success: function(data) {
  2615. this.setState({
  2616. loading: false
  2617. });
  2618. let url = window.location.href.substring(7);
  2619. // console.log(data.data);
  2620. if (data.data && data.data.length) {
  2621. let thisdata = data.data[data.data.length - 1];
  2622. let obj = {
  2623. id: thisdata.id,
  2624. typeChange: thisdata.type,
  2625. totalAmount: thisdata.totalAmount,
  2626. settlementAmount: thisdata.settlementAmount,
  2627. changeAmount: thisdata.changeAmount,
  2628. remarksC: thisdata.remarks,
  2629. startRemarks: thisdata.zxsRemarks,
  2630. voucherUrl: thisdata.voucherUrl
  2631. ? splitUrl(
  2632. thisdata.voucherUrl,
  2633. ",",
  2634. globalConfig.avatarHost + "/upload",
  2635. url
  2636. )
  2637. : []
  2638. };
  2639. this.proList(thisdata.id);
  2640. this.cuiList(thisdata.id);
  2641. this.setState({
  2642. //判断是否有合同变更记录
  2643. isJilu: true,
  2644. detailChange: obj
  2645. });
  2646. }
  2647. }.bind(this)
  2648. });
  2649. },
  2650. showConfirm(fn, record) {
  2651. confirm({
  2652. title: "确定删除此项目吗?",
  2653. content: (
  2654. <span style={{ color: "red" }}>
  2655. 删除后会将该项目下的所有催款节点自动清除!!!
  2656. </span>
  2657. ),
  2658. onOk() {
  2659. fn(record);
  2660. },
  2661. onCancel() {}
  2662. });
  2663. },
  2664. changeAddPro() {
  2665. this.setState({
  2666. changeVisible: true,
  2667. gid: "",
  2668. customerArr: [],
  2669. commodityName: "",
  2670. commodityQuantity: "",
  2671. commodityId: "",
  2672. taskComment: "",
  2673. main: undefined,
  2674. commodityPrice: ""
  2675. });
  2676. },
  2677. changeProSubmit() {
  2678. if (this.state.gid == undefined || !this.state.gid) {
  2679. message.warning("服务名称不匹配!");
  2680. return false;
  2681. }
  2682. if (!this.state.commodityPrice) {
  2683. message.warning("请输入金额!");
  2684. this.refs.commodityPrice.focus();
  2685. return false;
  2686. }
  2687. let reg = /^([0]|[1-9][0-9]*)$/;
  2688. if (
  2689. !this.state.commodityQuantity ||
  2690. !reg.test(this.state.commodityQuantity)
  2691. ) {
  2692. message.warning("请输入正确商品数量!");
  2693. this.refs.commodityQuantity.focus();
  2694. return false;
  2695. }
  2696. if (!this.state.main) {
  2697. message.warning("请选择是否为主要项目!");
  2698. this.refs.commodityQuantity.focus();
  2699. return false;
  2700. }
  2701. this.setState({
  2702. loading: true
  2703. });
  2704. let type = 0;
  2705. if (this.state.typeChange == 4 || this.state.typeChange == 5) {
  2706. type = 1;
  2707. }
  2708. $.ajax({
  2709. method: "post",
  2710. dataType: "json",
  2711. crossDomain: false,
  2712. url: globalConfig.context + "/api/admin/orderChange/addChangeTask",
  2713. data: {
  2714. commodityId: this.state.gid, //商品ID
  2715. orderNo: this.props.datauser.orderNo, //订单编号
  2716. commodityName: this.state.commodityName, //商品名称
  2717. commodityQuantity: this.state.commodityQuantity, //商品数量
  2718. commodityPrice: this.state.commodityPrice, //签单总价
  2719. taskComment: this.state.taskComment, //服务说明
  2720. main: this.state.main, //是否为主要项目
  2721. cid: this.state.changeId, //变更ID
  2722. type
  2723. },
  2724. success: function(data) {
  2725. let theArr = [];
  2726. if (data.error && data.error.length) {
  2727. message.warning(data.error[0].message);
  2728. } else {
  2729. message.success("保存成功");
  2730. this.nextCancel();
  2731. this.proList();
  2732. }
  2733. }.bind(this)
  2734. }).always(
  2735. function() {
  2736. this.setState({
  2737. loading: false
  2738. });
  2739. }.bind(this)
  2740. );
  2741. },
  2742. changeDeletePro(record) {
  2743. this.setState({
  2744. loading: true
  2745. });
  2746. $.ajax({
  2747. method: "post",
  2748. dataType: "json",
  2749. crossDomain: false,
  2750. url: globalConfig.context + "/api/admin/orderChange/deleteChangeTask",
  2751. data: {
  2752. id: record.id
  2753. },
  2754. success: function(data) {
  2755. let theArr = [];
  2756. if (data.error && data.error.length) {
  2757. message.warning(data.error[0].message);
  2758. } else {
  2759. message.success("删除成功");
  2760. this.proList();
  2761. }
  2762. }.bind(this)
  2763. }).always(
  2764. function() {
  2765. this.setState({
  2766. loading: false
  2767. });
  2768. }.bind(this)
  2769. );
  2770. },
  2771. //点击新增变更催款节点
  2772. changeAddCui() {
  2773. this.state.cuiDataSource.push({
  2774. key: this.state.cuiDataSource.length,
  2775. money: "",
  2776. dunSubject: undefined,
  2777. orderNo: this.state.orderNo,
  2778. dunTarget: this.state.kehuId
  2779. });
  2780. this.setState({
  2781. cuiDataSource: this.state.cuiDataSource,
  2782. cuiFlag: true
  2783. });
  2784. },
  2785. //删除变更收款节点
  2786. changeDeleteCui(index) {
  2787. if (index.id) {
  2788. this.state.cuiDataSource.splice(index.id, 1);
  2789. this.setState({
  2790. contactListNew: this.state.cuiDataSource,
  2791. cuiFlag: false,
  2792. addFlag: false,
  2793. boFlag: false
  2794. });
  2795. $.ajax({
  2796. url: globalConfig.context + "/api/admin/orderChange/deleteChangeDun",
  2797. method: "post",
  2798. data: {
  2799. id: index.id
  2800. }
  2801. }).done(
  2802. function(data) {
  2803. this.setState({
  2804. loading: false
  2805. });
  2806. if (!data.error.length) {
  2807. message.success("删除成功!");
  2808. this.setState({
  2809. cuiFlag: false
  2810. });
  2811. this.cuiList(this.state.orderNo);
  2812. } else {
  2813. message.warning(data.error[0].message);
  2814. }
  2815. }.bind(this)
  2816. );
  2817. } else {
  2818. this.state.cuiDataSource.splice(index.key, 1);
  2819. this.setState({
  2820. cuiDataSource: this.state.cuiDataSource,
  2821. cuiFlag: false,
  2822. addFlag: false,
  2823. boFlag: false
  2824. });
  2825. }
  2826. },
  2827. changeSaveCui(record) {
  2828. if (record.boStatus == "false") {
  2829. record.boStatus = false;
  2830. } else if (record.boStatus == "true") {
  2831. record.boStatus = true;
  2832. }
  2833. if (!this.state.yearFlag) {
  2834. if (!record.effectiveCount) {
  2835. message.warning("请选择服务年限");
  2836. return;
  2837. }
  2838. } else {
  2839. record.effectiveCount = "";
  2840. }
  2841. if (record.money == "") {
  2842. message.warning("请填写金额");
  2843. return;
  2844. }
  2845. if (record.boStatus) {
  2846. if (
  2847. typeof +record.money == "number" &&
  2848. +record.money >= 0 &&
  2849. +record.money <= 1
  2850. ) {
  2851. record.appropriationRatio = record.money;
  2852. } else {
  2853. message.warning("金额比例填写错误,比例范围0~1");
  2854. return;
  2855. }
  2856. }
  2857. if (!record.dunType) {
  2858. message.warning("请选择对应科目");
  2859. return;
  2860. }
  2861. if (record.dunType != 1) {
  2862. record.waitDay = "";
  2863. }
  2864. this.setState({
  2865. loading: true
  2866. });
  2867. if (record.boStatus) {
  2868. $.ajax({
  2869. url: globalConfig.context + "/api/admin/orderChange/addChangeDun",
  2870. method: "post",
  2871. data: {
  2872. orderNo: record.orderNo,
  2873. ctid: record.ctid,
  2874. projectType: record.sort,
  2875. dunType: record.dunType,
  2876. appropriationRatio: record.appropriationRatio,
  2877. waitDay: record.waitDay,
  2878. effectiveCount: record.effectiveCount,
  2879. cid: this.state.changeId //变更ID
  2880. }
  2881. }).done(
  2882. function(data) {
  2883. this.setState({
  2884. loading: false
  2885. });
  2886. if (!data.error.length) {
  2887. message.success("保存成功!");
  2888. this.setState({
  2889. cuiFlag: false,
  2890. boFlag: false,
  2891. addFlag: false
  2892. });
  2893. this.cuiList(record.orderNo);
  2894. } else {
  2895. message.warning(data.error[0].message);
  2896. }
  2897. }.bind(this)
  2898. );
  2899. } else {
  2900. $.ajax({
  2901. url: globalConfig.context + "/api/admin/orderChange/addChangeDun",
  2902. method: "post",
  2903. data: {
  2904. orderNo: record.orderNo,
  2905. ctid: record.ctid,
  2906. projectType: record.sort,
  2907. dunType: record.dunType,
  2908. money: record.money,
  2909. waitDay: record.waitDay,
  2910. effectiveCount: record.effectiveCount,
  2911. cid: this.state.changeId //变更ID
  2912. }
  2913. }).done(
  2914. function(data) {
  2915. this.setState({
  2916. loading: false
  2917. });
  2918. if (!data.error.length) {
  2919. message.success("保存成功!");
  2920. this.setState({
  2921. cuiFlag: false,
  2922. boFlag: false,
  2923. addFlag: false
  2924. });
  2925. this.cuiList(record.orderNo);
  2926. } else {
  2927. message.warning(data.error[0].message);
  2928. }
  2929. }.bind(this)
  2930. );
  2931. }
  2932. },
  2933. submitChange() {
  2934. if (this.state.processStatus <= 4) {
  2935. message.warning("当前订单流程不能发起变更!");
  2936. return false;
  2937. }
  2938. if (this.state.changeAmount == "") {
  2939. message.warning("申请退款金额不能为空!");
  2940. // console.log(this.state.changeAmount);
  2941. return false;
  2942. }
  2943. if (this.state.remarksC.trim() == "") {
  2944. message.warning("请正确填写变更原因");
  2945. return false;
  2946. }
  2947. if (this.state.startRemarks.trim() == "") {
  2948. message.warning("请正确填写备注信息");
  2949. return false;
  2950. }
  2951. let theorgCodeUrl = [];
  2952. if (this.state.voucherUrl.length) {
  2953. let picArr = [];
  2954. this.state.voucherUrl.map(function(item) {
  2955. if (
  2956. item.response &&
  2957. item.response.data &&
  2958. item.response.data.length
  2959. ) {
  2960. picArr.push(item.response.data);
  2961. }
  2962. });
  2963. theorgCodeUrl = picArr.join(",");
  2964. }
  2965. this.setState({
  2966. loading: true
  2967. });
  2968. $.ajax({
  2969. url: globalConfig.context + "/api/admin/orderChange/updateOrderChange",
  2970. method: "post",
  2971. data: {
  2972. id: this.state.changeId,
  2973. changeType: 0,
  2974. orderNo: this.state.orderNo, //订单编号
  2975. processState: 0,
  2976. startRemarks: this.state.startRemarks,
  2977. remarks: this.state.remarksC,
  2978. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  2979. totalAmount: this.state.totalAmount,
  2980. settlementAmount: this.state.settlementAmount,
  2981. changeAmount: this.state.changeAmount,
  2982. applicant: this.state.salesmanName,
  2983. depName: this.state.depName,
  2984. type: this.state.typeChange
  2985. }
  2986. }).done(
  2987. function(data) {
  2988. if (!data.error.length) {
  2989. this.setState({
  2990. loading: false
  2991. });
  2992. message.success("发起变更成功");
  2993. this.handleCancelclose();
  2994. } else {
  2995. message.warning(data.error[0].message);
  2996. }
  2997. }.bind(this)
  2998. );
  2999. },
  3000. render() {
  3001. const FormItem = Form.Item;
  3002. const { TabPane } = Tabs;
  3003. const { TextArea } = Input;
  3004. const formItemLayout = {
  3005. labelCol: { span: 8 },
  3006. wrapperCol: { span: 14 }
  3007. };
  3008. const contractData = this.state.contractData;
  3009. const formItemList = [
  3010. {
  3011. label: "企业联系人",
  3012. content: <span>{this.state.contacts}</span>
  3013. },
  3014. {
  3015. label: "联系人电话",
  3016. content: <span>{this.state.contactMobile}</span>
  3017. },
  3018. {
  3019. label: "企业法人",
  3020. content: <span>{this.state.legalPerson}</span>
  3021. },
  3022. {
  3023. label: "法人电话",
  3024. content: <span>{this.state.legalPersonTel}</span>
  3025. }
  3026. // {
  3027. // label: "签单金额(万元)",
  3028. // content: <span>{this.state.totalAmount}</span>
  3029. // },
  3030. // {
  3031. // label: "首付金额(万元)",
  3032. // content: <span>{this.state.firstAmount}</span>
  3033. // },
  3034. // {
  3035. // label: "特批立项",
  3036. // content: <span>{getApprovedState(this.state.approval)}</span>
  3037. // },
  3038. // {
  3039. // label: "合同签订时间",
  3040. // content: <span>{this.state.signDate}</span>
  3041. // },
  3042. // {
  3043. // label: "订单部门",
  3044. // content: <span>{this.state.depName}</span>
  3045. // }
  3046. ];
  3047. const dataSources = this.state.customerArr || [];
  3048. const cuiDataList = this.state.contactList || [];
  3049. let departmentArr = this.state.departmentArr || [];
  3050. const options = this.state.states
  3051. ? dataSources.map(group => (
  3052. <Select.Option key={group.id} value={group.name}>
  3053. {group.name}
  3054. </Select.Option>
  3055. ))
  3056. : dataSources.map((group, index) => (
  3057. <Select.Option key={index} value={group.bname}>
  3058. {group.bname}
  3059. </Select.Option>
  3060. ));
  3061. return (
  3062. <div>
  3063. <Modal
  3064. maskClosable={false}
  3065. visible={this.state.visible}
  3066. onOk={this.handleOk}
  3067. onCancel={this.handleCancelclose}
  3068. width={!this.props.userDetaile ? "600px" : "900px"}
  3069. title={!this.props.userDetaile ? "创建订单" : ""}
  3070. footer=""
  3071. // width={1300}
  3072. className="admin-desc-content"
  3073. >
  3074. <Form
  3075. layout="horizontal"
  3076. onSubmit={this.handleSubmit}
  3077. // id="demand-form"
  3078. style={{ paddingBottom: "40px" }}
  3079. >
  3080. <Spin spinning={this.state.loading}>
  3081. <div className="clearfix">
  3082. {!this.props.userDetaile ? (
  3083. <div className="clearfix">
  3084. <div className="clearfix">
  3085. <FormItem {...formItemLayout} label="订单类型">
  3086. <Select
  3087. placeholder="请选择订单类型"
  3088. style={{ width: "200px" }}
  3089. value={this.state.orderType}
  3090. onChange={e => {
  3091. this.setState({ orderType: e });
  3092. }}
  3093. >
  3094. {orderTypes.map(function(item) {
  3095. return (
  3096. <Select.Option key={item.value}>
  3097. {item.key}
  3098. </Select.Option>
  3099. );
  3100. })}
  3101. </Select>
  3102. <span className="mandatory">*</span>
  3103. </FormItem>
  3104. </div>
  3105. <FormItem {...formItemLayout} label="客户所属类型">
  3106. <Select
  3107. placeholder="请选择客户所属类型"
  3108. style={{ width: "200px" }}
  3109. value={this.state.customType}
  3110. onChange={e => {
  3111. this.setState({ customType: e });
  3112. }}
  3113. >
  3114. {customerType.map(function(item) {
  3115. return (
  3116. <Select.Option key={item.value}>
  3117. {item.key}
  3118. </Select.Option>
  3119. );
  3120. })}
  3121. </Select>
  3122. </FormItem>
  3123. <div className="clearfix">
  3124. <FormItem {...formItemLayout} label="客户名称">
  3125. <AutoComplete
  3126. className="certain-category-search"
  3127. dropdownClassName="certain-category-search-dropdown"
  3128. dropdownMatchSelectWidth={false}
  3129. dropdownStyle={{ width: 200 }}
  3130. size="large"
  3131. style={{ width: "200px" }}
  3132. dataSource={options}
  3133. placeholder="输入名称"
  3134. value={this.state.customerName}
  3135. onChange={this.customerChange}
  3136. filterOption={true}
  3137. onSelect={this.selectAutoCUT}
  3138. >
  3139. <Input />
  3140. </AutoComplete>
  3141. <span className="mandatory">*</span>
  3142. </FormItem>
  3143. </div>
  3144. <div className="addSave" style={{ marginTop: "15px" }}>
  3145. <Button
  3146. className="cancel"
  3147. type="primary"
  3148. onClick={this.handleCancel}
  3149. style={{ marginLeft: "150px" }}
  3150. htmlType="submit"
  3151. >
  3152. 开单
  3153. </Button>
  3154. <Button
  3155. className="cancel"
  3156. type="ghost"
  3157. onClick={this.handleCancelclose}
  3158. style={{ marginLeft: "50px" }}
  3159. >
  3160. 取消
  3161. </Button>
  3162. </div>
  3163. </div>
  3164. ) : (
  3165. <Tabs
  3166. onChange={this.callback}
  3167. activeKey={this.state.activeKey}
  3168. >
  3169. <TabPane tab={"编辑订单"} key="1">
  3170. <div className="clearfix">
  3171. <div className="clearfix">
  3172. <FormItem
  3173. className="half-item"
  3174. {...formItemLayout}
  3175. label="合同编号"
  3176. >
  3177. {<span>{this.state.contractNo}</span>}
  3178. </FormItem>
  3179. <FormItem
  3180. className="half-item"
  3181. {...formItemLayout}
  3182. label="订单编号"
  3183. >
  3184. <span>{this.state.orderNo}</span>
  3185. </FormItem>
  3186. <FormItem
  3187. className="half-item"
  3188. {...formItemLayout}
  3189. label="流程状态"
  3190. >
  3191. <span>
  3192. {getProcessStatus(this.state.processStatus)}
  3193. </span>
  3194. </FormItem>
  3195. <FormItem
  3196. className="half-item"
  3197. {...formItemLayout}
  3198. label="结算状态"
  3199. >
  3200. <span>
  3201. {getLiquidationStatus(
  3202. this.state.liquidationStatus
  3203. )}
  3204. </span>
  3205. </FormItem>
  3206. {this.state.processStatus === 0 ? (
  3207. <div className="clearfix">
  3208. <FormItem
  3209. className="half-item"
  3210. {...formItemLayout}
  3211. label="特批立项"
  3212. >
  3213. <Select
  3214. placeholder="请选择客户所属类型"
  3215. style={{ width: "240px" }}
  3216. value={getApprovedState(
  3217. this.state.approval
  3218. )}
  3219. onChange={e => {
  3220. this.setState({ approval: e });
  3221. }}
  3222. >
  3223. {/* {tepi.map(function(item) {
  3224. // if(item.key == "特批通过" || item.key == "特批驳回")
  3225. return (
  3226. <Select.Option key={item.value}>
  3227. {item.key}
  3228. </Select.Option>
  3229. );
  3230. })} */}
  3231. <Select.Option key={0}>
  3232. 非特批
  3233. </Select.Option>
  3234. <Select.Option key={1}>特批</Select.Option>
  3235. </Select>
  3236. </FormItem>
  3237. <FormItem
  3238. className="half-item"
  3239. {...formItemLayout}
  3240. label="合同签订时间"
  3241. >
  3242. <DatePicker
  3243. style={{
  3244. marginTop: "2px",
  3245. // width: "240px",
  3246. height: "32px"
  3247. }}
  3248. showTime
  3249. format="YYYY-MM-DD"
  3250. onOk={() => {}}
  3251. value={
  3252. this.state.signDate
  3253. ? moment(this.state.signDate)
  3254. : null
  3255. }
  3256. onChange={(data, dataString) => {
  3257. this.setState({ signDate: dataString });
  3258. }}
  3259. />
  3260. <span
  3261. className="mandatory"
  3262. style={{ marginLeft: 20 }}
  3263. >
  3264. *
  3265. </span>
  3266. </FormItem>
  3267. <FormItem
  3268. className="half-item"
  3269. {...formItemLayout}
  3270. label="订单部门"
  3271. >
  3272. <Select
  3273. placeholder="请输入订单部门"
  3274. style={{ width: 240 }}
  3275. value={this.state.organizationSearch}
  3276. onChange={e => {
  3277. this.setState({ organizationSearch: e });
  3278. }}
  3279. >
  3280. {departmentArr.map(function(item) {
  3281. return (
  3282. <Select.Option key={item.id}>
  3283. {item.name}
  3284. </Select.Option>
  3285. );
  3286. })}
  3287. </Select>
  3288. </FormItem>
  3289. </div>
  3290. ) : (
  3291. <div className="clearfix">
  3292. <FormItem
  3293. className="half-item"
  3294. {...formItemLayout}
  3295. label="特批立项"
  3296. >
  3297. <span>
  3298. {getApprovedState(this.state.approval)}
  3299. </span>
  3300. </FormItem>
  3301. <FormItem
  3302. className="half-item"
  3303. {...formItemLayout}
  3304. label="合同签订时间"
  3305. >
  3306. <span>{this.state.signDate}</span>
  3307. </FormItem>
  3308. <FormItem
  3309. className="half-item"
  3310. {...formItemLayout}
  3311. label="订单部门"
  3312. >
  3313. <span>{this.state.depName}</span>
  3314. </FormItem>
  3315. <FormItem
  3316. className="half-item"
  3317. {...formItemLayout}
  3318. label="是否外包"
  3319. >
  3320. <span>
  3321. {this.state.outsource == 0 ? "否" : "是"}
  3322. </span>
  3323. </FormItem>
  3324. </div>
  3325. )}
  3326. </div>
  3327. <h3
  3328. style={{
  3329. marginLeft: 10,
  3330. fontWeight: 800,
  3331. marginBottom: 10
  3332. }}
  3333. >
  3334. 收款项目
  3335. </h3>
  3336. {this.state.processStatus === 0 ? (
  3337. <div className="clearfix">
  3338. <FormItem
  3339. className="half-item"
  3340. {...formItemLayout}
  3341. label="签单金额(万元)"
  3342. >
  3343. <Input
  3344. placeholder="签单金额"
  3345. ref="signTotalAmount"
  3346. value={this.state.totalAmount}
  3347. onChange={e => {
  3348. this.setState({
  3349. totalAmount: e.target.value
  3350. });
  3351. }}
  3352. style={{ width: "240px" }}
  3353. />
  3354. {/* <span className="mandatory">*</span> */}
  3355. </FormItem>
  3356. <FormItem
  3357. className="half-item"
  3358. {...formItemLayout}
  3359. label="首付金额(万元)"
  3360. >
  3361. <Input
  3362. placeholder="请输入实签首款金额"
  3363. ref="signFirstPayment"
  3364. value={this.state.firstAmount}
  3365. onChange={e => {
  3366. this.setState({
  3367. firstAmount: e.target.value
  3368. });
  3369. }}
  3370. style={{ width: "240px" }}
  3371. />
  3372. {/* <span className="mandatory">*</span> */}
  3373. </FormItem>
  3374. <FormItem
  3375. className="half-item"
  3376. {...formItemLayout}
  3377. label="已收款项"
  3378. >
  3379. <span>
  3380. {this.state.settlementAmount + "万元"}
  3381. </span>
  3382. {/* {this.state.settlementAmount ? (
  3383. <Button
  3384. type="primary"
  3385. onClick={this.tuikuan}
  3386. style={{
  3387. float: "right",
  3388. marginRight: "50px",
  3389. marginBottom: "15px"
  3390. }}
  3391. >
  3392. 退单
  3393. </Button>
  3394. ) : (
  3395. ""
  3396. )} */}
  3397. </FormItem>
  3398. </div>
  3399. ) : (
  3400. <div className="clearfix">
  3401. <FormItem
  3402. className="half-item"
  3403. {...formItemLayout}
  3404. label="签单金额(万元)"
  3405. >
  3406. <span>{this.state.totalAmount}</span>
  3407. </FormItem>
  3408. <FormItem
  3409. className="half-item"
  3410. {...formItemLayout}
  3411. label="首付金额(万元)"
  3412. >
  3413. <span>{this.state.firstAmount}</span>
  3414. </FormItem>
  3415. <FormItem
  3416. className="half-item"
  3417. {...formItemLayout}
  3418. label="已收款项"
  3419. >
  3420. <span>
  3421. {this.state.settlementAmount + "万元"}
  3422. </span>
  3423. {/* {this.state.settlementAmount ? (
  3424. <Button
  3425. type="primary"
  3426. onClick={this.tuikuan}
  3427. style={{
  3428. float: "right",
  3429. marginRight: "50px",
  3430. marginBottom: "15px"
  3431. }}
  3432. >
  3433. 退单
  3434. </Button>
  3435. ) : (
  3436. ""
  3437. )} */}
  3438. </FormItem>
  3439. </div>
  3440. )}
  3441. <h3
  3442. style={{
  3443. marginLeft: 10,
  3444. fontWeight: 800,
  3445. marginBottom: 10
  3446. }}
  3447. >
  3448. 联系信息
  3449. </h3>
  3450. {this.state.processStatus == 0 ? (
  3451. <div className="clearfix">
  3452. <div className="clearfix">
  3453. <FormItem
  3454. className="half-item"
  3455. {...formItemLayout}
  3456. label="客户名称"
  3457. >
  3458. <span>{this.state.userName}</span>
  3459. </FormItem>
  3460. </div>
  3461. <FormItem
  3462. className="half-item"
  3463. {...formItemLayout}
  3464. label="企业联系人"
  3465. >
  3466. <Input
  3467. placeholder="请输入联系人"
  3468. ref="signTotalAmount"
  3469. value={this.state.contacts}
  3470. onChange={e => {
  3471. this.setState({ contacts: e.target.value });
  3472. }}
  3473. style={{ width: "240px" }}
  3474. />
  3475. </FormItem>
  3476. <FormItem
  3477. className="half-item"
  3478. {...formItemLayout}
  3479. label="联系人电话"
  3480. >
  3481. <Input
  3482. placeholder="请输入联系人电话"
  3483. ref="signTotalAmount"
  3484. value={this.state.contactMobile}
  3485. onChange={e => {
  3486. this.setState({
  3487. contactMobile: e.target.value
  3488. });
  3489. }}
  3490. style={{ width: "240px" }}
  3491. />
  3492. </FormItem>
  3493. <FormItem
  3494. className="half-item"
  3495. {...formItemLayout}
  3496. label="企业法人"
  3497. >
  3498. <Input
  3499. placeholder="请输入法人"
  3500. ref="signTotalAmount"
  3501. value={this.state.legalPerson}
  3502. onChange={e => {
  3503. this.setState({
  3504. legalPerson: e.target.value
  3505. });
  3506. }}
  3507. style={{ width: "240px" }}
  3508. />
  3509. </FormItem>
  3510. <FormItem
  3511. className="half-item"
  3512. {...formItemLayout}
  3513. label="法人电话"
  3514. >
  3515. <Input
  3516. placeholder="请输入法人电话"
  3517. ref="signTotalAmount"
  3518. value={this.state.legalPersonTel}
  3519. onChange={e => {
  3520. this.setState({
  3521. legalPersonTel: e.target.value
  3522. });
  3523. }}
  3524. style={{ width: "240px" }}
  3525. />
  3526. </FormItem>
  3527. </div>
  3528. ) : (
  3529. <div className="clearfix">
  3530. {formItemList.map((data, index) => {
  3531. return (
  3532. <FormItem
  3533. className="half-item"
  3534. {...formItemLayout}
  3535. key={index}
  3536. label={data.label}
  3537. >
  3538. {data.content}
  3539. </FormItem>
  3540. );
  3541. })}
  3542. </div>
  3543. )}
  3544. <div className="clearfix">
  3545. {this.state.processStatus == 0 ? (
  3546. <FormItem
  3547. labelCol={{ span: 4 }}
  3548. wrapperCol={{ span: 18 }}
  3549. label={
  3550. <span>
  3551. <strong style={{ color: "#f00" }}>*</strong>
  3552. 合同扫描件
  3553. </span>
  3554. }
  3555. >
  3556. <PicturesWall
  3557. fileList={this.getOrgCodeUrl}
  3558. pictureUrl={this.state.orgCodeUrl}
  3559. url="/api/admin/order/uploadOrderImg"
  3560. sign=""
  3561. />
  3562. <p>图片建议:要清晰。</p>
  3563. <Button
  3564. style={{
  3565. float: "right",
  3566. marginRight: "140px",
  3567. marginTop: "20px"
  3568. }}
  3569. onClick={this.getOrderLog}
  3570. >
  3571. 查看订单日志
  3572. </Button>
  3573. </FormItem>
  3574. ) : (
  3575. <FormItem
  3576. labelCol={{ span: 4 }}
  3577. wrapperCol={{ span: 18 }}
  3578. label="合同扫描件"
  3579. >
  3580. <Upload
  3581. className="demandDetailShow-upload"
  3582. listType="picture-card"
  3583. fileList={this.state.orgCodeUrl}
  3584. onPreview={file => {
  3585. this.setState({
  3586. previewImage: file.url || file.thumbUrl,
  3587. previewVisible: true
  3588. });
  3589. }}
  3590. ></Upload>
  3591. <Modal
  3592. maskClosable={false}
  3593. footer={null}
  3594. visible={this.state.previewVisible}
  3595. onCancel={() => {
  3596. this.setState({ previewVisible: false });
  3597. }}
  3598. >
  3599. <img
  3600. alt=""
  3601. style={{ width: "100%" }}
  3602. src={this.state.previewImage || ""}
  3603. />
  3604. </Modal>
  3605. <Button
  3606. style={{
  3607. float: "right",
  3608. marginRight: "140px",
  3609. marginTop: "20px"
  3610. }}
  3611. onClick={this.getOrderLog}
  3612. >
  3613. 查看订单日志
  3614. </Button>
  3615. </FormItem>
  3616. )}
  3617. </div>
  3618. <div className="clearfix">
  3619. {this.state.processStatus == 0 ? (
  3620. <div className="clearfix">
  3621. <FormItem
  3622. labelCol={{ span: 4 }}
  3623. wrapperCol={{ span: 16 }}
  3624. label="订单留言"
  3625. >
  3626. <Input
  3627. type="textarea"
  3628. placeholder="请输入订单留言"
  3629. rows={4}
  3630. value={this.state.orderRemarks}
  3631. onChange={e => {
  3632. this.setState({
  3633. orderRemarks: e.target.value
  3634. });
  3635. }}
  3636. style={{ width: "95%" }}
  3637. />
  3638. <span className="mandatory">*</span>
  3639. </FormItem>
  3640. </div>
  3641. ) : (
  3642. <FormItem
  3643. labelCol={{ span: 4 }}
  3644. wrapperCol={{ span: 16 }}
  3645. label="订单留言"
  3646. >
  3647. <p
  3648. style={{ width: 500, wordWrap: "break-word" }}
  3649. >
  3650. {this.state.orderRemarks}
  3651. </p>
  3652. </FormItem>
  3653. )}
  3654. </div>
  3655. <div className="clearfix">
  3656. <FormItem
  3657. className="half-item"
  3658. {...formItemLayout}
  3659. label="订单负责人"
  3660. >
  3661. <span>{this.state.salesmanName}</span>
  3662. </FormItem>
  3663. <FormItem
  3664. className="half-item"
  3665. {...formItemLayout}
  3666. label="订单负责人电话"
  3667. >
  3668. <span>{this.state.salesmanMobile}</span>
  3669. </FormItem>
  3670. </div>
  3671. <div className="clearfix">
  3672. <FormItem
  3673. className="half-item"
  3674. {...formItemLayout}
  3675. label="当前财务负责人"
  3676. >
  3677. <span>{this.state.nowFinance}</span>
  3678. </FormItem>
  3679. <FormItem
  3680. className="half-item"
  3681. {...formItemLayout}
  3682. label="当前财务负责人电话"
  3683. >
  3684. <span>{this.state.nowFinanceMobile}</span>
  3685. </FormItem>
  3686. </div>
  3687. <div className="clearfix">
  3688. <FormItem
  3689. className="half-item"
  3690. {...formItemLayout}
  3691. style={{ opacity: ".5" }}
  3692. label="原订单负责人"
  3693. >
  3694. <span>{this.state.oldSalesmanName}</span>
  3695. </FormItem>
  3696. <FormItem
  3697. className="half-item"
  3698. {...formItemLayout}
  3699. style={{ opacity: ".5" }}
  3700. label="原订单负责人电话"
  3701. >
  3702. <span>{this.state.oldSalesmanMobile}</span>
  3703. </FormItem>
  3704. </div>
  3705. <div className="clearfix">
  3706. <FormItem
  3707. className="half-item"
  3708. style={{ opacity: ".5" }}
  3709. {...formItemLayout}
  3710. label="实际财务操作人"
  3711. >
  3712. <span>{this.state.financeName}</span>
  3713. </FormItem>
  3714. <FormItem
  3715. className="half-item"
  3716. {...formItemLayout}
  3717. style={{ opacity: ".5" }}
  3718. label="实际财务操作人电话"
  3719. >
  3720. <span>{this.state.financeMobile}</span>
  3721. </FormItem>
  3722. </div>
  3723. <div>
  3724. <span
  3725. style={{ marginLeft: "50px", fontSize: "20px" }}
  3726. >
  3727. 项目业务
  3728. </span>
  3729. {this.state.processStatus == 0 ? (
  3730. <Button
  3731. type="primary"
  3732. onClick={this.addDetailed}
  3733. style={{
  3734. float: "right",
  3735. marginRight: "50px",
  3736. marginBottom: "15px"
  3737. }}
  3738. >
  3739. 添加项目明细
  3740. </Button>
  3741. ) : (
  3742. ""
  3743. )}
  3744. </div>
  3745. <div
  3746. className="patent-table"
  3747. style={{ marginBottom: 10 }}
  3748. >
  3749. <Spin spinning={this.state.loading}>
  3750. <Table
  3751. columns={this.state.columns}
  3752. dataSource={this.state.dataSource}
  3753. pagination={this.state.pagination}
  3754. onRowClick={this.tableRowClick}
  3755. bordered
  3756. size="small"
  3757. />
  3758. </Spin>
  3759. </div>
  3760. <div
  3761. style={{
  3762. display: cuiDataList.length ? "block" : "none"
  3763. }}
  3764. >
  3765. <span
  3766. style={{ marginLeft: "50px", fontSize: "20px" }}
  3767. >
  3768. 旧催款节点
  3769. </span>
  3770. <Button
  3771. type="primary"
  3772. // onClick={this.addcontact}
  3773. disabled
  3774. onClick={e => {
  3775. cuiDataList.length
  3776. ? this.addcontact()
  3777. : this.addcontactNew();
  3778. }}
  3779. style={{
  3780. float: "right",
  3781. marginRight: "50px",
  3782. marginBottom: "15px",
  3783. display:
  3784. this.state.processStatus == 0
  3785. ? "block"
  3786. : "none"
  3787. }}
  3788. >
  3789. 添加催款节点
  3790. </Button>
  3791. </div>
  3792. <div
  3793. className="clearfix"
  3794. style={{
  3795. display: cuiDataList.length ? "block" : "none"
  3796. }}
  3797. >
  3798. <Spin spinning={this.state.loading}>
  3799. <Form layout="horizontal">
  3800. <Table
  3801. pagination={false}
  3802. columns={this.state.ContactsLists}
  3803. dataSource={this.state.contactList}
  3804. scroll={{ x: "max-content", y: 0 }}
  3805. bordered
  3806. size="small"
  3807. />
  3808. <Col
  3809. span={24}
  3810. offset={9}
  3811. style={{ marginTop: "15px" }}
  3812. ></Col>
  3813. </Form>
  3814. </Spin>
  3815. </div>
  3816. <div
  3817. style={{
  3818. display: cuiDataList.length ? "none" : "block"
  3819. }}
  3820. >
  3821. <span
  3822. style={{
  3823. marginLeft: "50px",
  3824. fontSize: "20px"
  3825. }}
  3826. >
  3827. 新催款节点
  3828. </span>
  3829. <span
  3830. style={{
  3831. display: "inline-block",
  3832. marginLeft: 10,
  3833. color: "red"
  3834. }}
  3835. >
  3836. 金额总计(万元): {this.state.totalCui}
  3837. </span>
  3838. <Button
  3839. type="primary"
  3840. disabled={this.state.addFlag ? true : false}
  3841. // onClick={this.addcontact}
  3842. onClick={e => {
  3843. this.setState({ addFlag: true });
  3844. this.addcontactNew();
  3845. }}
  3846. style={{
  3847. float: "right",
  3848. marginRight: "50px",
  3849. marginBottom: "15px",
  3850. display:
  3851. this.state.processStatus == 0
  3852. ? "block"
  3853. : "none"
  3854. }}
  3855. >
  3856. 添加催款节点
  3857. </Button>
  3858. </div>
  3859. <div
  3860. className="clearfix"
  3861. style={{
  3862. display: cuiDataList.length ? "none" : "block"
  3863. }}
  3864. >
  3865. <Spin spinning={this.state.loading}>
  3866. <Form layout="horizontal">
  3867. <Table
  3868. pagination={false}
  3869. columns={this.state.ContactsListsNew}
  3870. dataSource={this.state.contactListNew}
  3871. scroll={{ x: "max-content", y: 0 }}
  3872. bordered
  3873. size="small"
  3874. />
  3875. <Col
  3876. span={24}
  3877. offset={9}
  3878. style={{ marginTop: "15px" }}
  3879. ></Col>
  3880. </Form>
  3881. </Spin>
  3882. </div>
  3883. {this.state.processStatus == 0 ? (
  3884. <div
  3885. className="addSave"
  3886. style={{ marginTop: "15px" }}
  3887. >
  3888. <Button
  3889. className="cancel"
  3890. type="primary"
  3891. onClick={this.handleCancels}
  3892. style={{ marginLeft: "200px" }}
  3893. htmlType="submit"
  3894. >
  3895. 签单
  3896. </Button>
  3897. <Button
  3898. className="cancel"
  3899. type="primary"
  3900. onClick={this.handleCancelq}
  3901. style={{ marginLeft: "50px" }}
  3902. htmlType="submit"
  3903. >
  3904. 保存
  3905. </Button>
  3906. <Button
  3907. className="cancel"
  3908. type="ghost"
  3909. onClick={this.handleCancelclose}
  3910. style={{ marginLeft: "50px" }}
  3911. >
  3912. 取消
  3913. </Button>
  3914. </div>
  3915. ) : (
  3916. ""
  3917. )}
  3918. </div>
  3919. </TabPane>
  3920. <TabPane tab="合同变更发起" key="2">
  3921. {
  3922. <div>
  3923. <div className="clearfix">
  3924. <FormItem
  3925. className="half-item"
  3926. {...formItemLayout}
  3927. label="客户名称"
  3928. >
  3929. <span>{this.state.userName}</span>
  3930. </FormItem>
  3931. </div>
  3932. <div className="clearfix">
  3933. <FormItem
  3934. className="half-item"
  3935. {...formItemLayout}
  3936. label="合同编号"
  3937. >
  3938. <span>{this.state.contractNo}</span>
  3939. </FormItem>
  3940. </div>
  3941. <div className="clearfix">
  3942. <FormItem
  3943. className="half-item"
  3944. {...formItemLayout}
  3945. label="申请变更部门"
  3946. >
  3947. {/* {!this.state.mark ? ( */}
  3948. <span>{this.state.depName}</span>
  3949. {/* ) : (
  3950. <span>{contractData.depName}</span>
  3951. )} */}
  3952. </FormItem>
  3953. <FormItem
  3954. className="half-item"
  3955. {...formItemLayout}
  3956. label="申请人"
  3957. >
  3958. <span>{this.state.salesmanName}</span>
  3959. </FormItem>
  3960. </div>
  3961. <div className="clearfix">
  3962. <FormItem
  3963. labelCol={{ span: 4 }}
  3964. wrapperCol={{ span: 18 }}
  3965. label="变更类型"
  3966. >
  3967. {/* {!this.state.mark ? ( */}
  3968. <Select
  3969. placeholder="选择合同变更类型"
  3970. style={{ width: 200 }}
  3971. disabled={this.state.changeFlag}
  3972. value={this.state.typeChange}
  3973. onChange={e => {
  3974. this.setState({
  3975. typeChange: e,
  3976. changeFlag: true
  3977. });
  3978. if (e == 1) {
  3979. this.setState({
  3980. hetongFlag: false,
  3981. listFlag: false,
  3982. listCuiFlag: false,
  3983. tuiKuanFlag: false
  3984. });
  3985. } else if (e == 2) {
  3986. this.setState({
  3987. hetongFlag: true,
  3988. listFlag: false,
  3989. listCuiFlag: false,
  3990. tuiKuanFlag: true
  3991. });
  3992. } else if (e == 3) {
  3993. this.setState({
  3994. listFlag: true,
  3995. hetongFlag: false,
  3996. listCuiFlag: false,
  3997. tuiKuanFlag: false
  3998. });
  3999. } else if (e == 4) {
  4000. this.setState({
  4001. listFlag: false,
  4002. listCuiFlag: false,
  4003. hetongFlag: false,
  4004. tuiKuanFlag: true
  4005. });
  4006. } else if (e == 5) {
  4007. this.setState({
  4008. listFlag: false,
  4009. listCuiFlag: false,
  4010. hetongFlag: true,
  4011. tuiKuanFlag: true
  4012. });
  4013. } else {
  4014. this.setState({
  4015. listFlag: true,
  4016. hetongFlag: true,
  4017. listCuiFlag: true,
  4018. tuiKuanFlag: false
  4019. });
  4020. }
  4021. }}
  4022. value={this.state.typeChange}
  4023. >
  4024. <Option value={0}>退单退款</Option>
  4025. <Option value={1}>项目及金额变更</Option>
  4026. <Option value={2}>仅项目变更</Option>
  4027. <Option value={3}>仅金额变更</Option>
  4028. <Option value={4}>重报</Option>
  4029. <Option value={5}>赠送</Option>
  4030. </Select>
  4031. <Button
  4032. onClick={e => {
  4033. this.setState({
  4034. listFlag: false,
  4035. hetongFlag: false,
  4036. listCuiFlag: false,
  4037. tuiKuanFlag: false,
  4038. startRemarks: "",
  4039. remarksC: "",
  4040. voucherUrl: [],
  4041. changeAmount: "0",
  4042. applicant: undefined,
  4043. depNameChange: undefined,
  4044. typeChange: [],
  4045. changeFlag: false
  4046. });
  4047. }}
  4048. >
  4049. 重置
  4050. </Button>
  4051. </FormItem>
  4052. </div>
  4053. <div className="clearfix">
  4054. <FormItem
  4055. labelCol={{ span: 4 }}
  4056. wrapperCol={{ span: 18 }}
  4057. label="合同额(万元)"
  4058. >
  4059. {/* {!this.state.mark ? ( */}
  4060. <Input
  4061. placeholder="请输入合同额"
  4062. disabled={this.state.hetongFlag}
  4063. ref="signTotalAmount"
  4064. value={this.state.totalAmount}
  4065. onChange={e => {
  4066. this.setState({
  4067. totalAmount: e.target.value
  4068. });
  4069. }}
  4070. style={{ width: "240px" }}
  4071. />
  4072. {/* ) : (
  4073. <span>{contractData.totalAmount}</span>
  4074. )} */}
  4075. </FormItem>
  4076. <FormItem
  4077. labelCol={{ span: 4 }}
  4078. wrapperCol={{ span: 18 }}
  4079. label="已收款(万元)"
  4080. >
  4081. <span>{this.state.settlementAmount}</span>
  4082. </FormItem>
  4083. <FormItem
  4084. labelCol={{ span: 4 }}
  4085. wrapperCol={{ span: 18 }}
  4086. label="申请退款(万元)"
  4087. >
  4088. {/* {!this.state.mark ? ( */}
  4089. <Input
  4090. placeholder="请输入申请退款"
  4091. ref="signTotalAmount"
  4092. disabled={this.state.tuiKuanFlag}
  4093. value={this.state.changeAmount}
  4094. onChange={e => {
  4095. this.setState({
  4096. changeAmount: e.target.value
  4097. });
  4098. }}
  4099. style={{ width: "240px" }}
  4100. />
  4101. {/* ) : (
  4102. <span>{contractData.changeAmount}</span>
  4103. )} */}
  4104. </FormItem>
  4105. </div>
  4106. {/* 动态展示项目以及催款节点 */}
  4107. <div
  4108. style={{
  4109. display: this.state.isCaoGao ? "block" : "none"
  4110. }}
  4111. >
  4112. <div>
  4113. <span
  4114. style={{
  4115. marginLeft: "50px",
  4116. fontSize: "20px"
  4117. }}
  4118. >
  4119. 项目业务
  4120. </span>
  4121. <Button
  4122. type="primary"
  4123. onClick={this.changeAddPro}
  4124. disabled={this.state.listFlag}
  4125. style={{
  4126. float: "right",
  4127. marginRight: "50px",
  4128. marginBottom: "15px"
  4129. }}
  4130. >
  4131. 添加项目明细
  4132. </Button>
  4133. </div>
  4134. <div
  4135. className="patent-table"
  4136. style={{ marginBottom: 10 }}
  4137. >
  4138. <Spin spinning={this.state.loading}>
  4139. <Table
  4140. columns={this.state.proColumns}
  4141. dataSource={this.state.proDataSource}
  4142. pagination={this.state.pagination}
  4143. // onRowClick={this.tableRowClick}
  4144. bordered
  4145. size="small"
  4146. />
  4147. </Spin>
  4148. </div>
  4149. <div>
  4150. <span
  4151. style={{
  4152. marginLeft: "50px",
  4153. fontSize: "20px"
  4154. }}
  4155. >
  4156. 催款节点
  4157. </span>
  4158. {/* <span
  4159. style={{
  4160. display: "inline-block",
  4161. marginLeft: 10,
  4162. color: "red"
  4163. }}
  4164. >
  4165. 金额总计(万元): {this.state.totalCui}
  4166. </span> */}
  4167. <Button
  4168. type="primary"
  4169. onClick={e => {
  4170. this.changeAddCui();
  4171. }}
  4172. disabled={this.state.listCuiFlag}
  4173. style={{
  4174. float: "right",
  4175. marginRight: "50px",
  4176. marginBottom: "15px"
  4177. }}
  4178. >
  4179. 添加催款节点
  4180. </Button>
  4181. </div>
  4182. <div className="clearfix">
  4183. <Spin spinning={this.state.loading}>
  4184. <Form layout="horizontal">
  4185. <Table
  4186. pagination={false}
  4187. columns={this.state.changeCuiList}
  4188. dataSource={this.state.cuiDataSource}
  4189. scroll={{ x: "max-content", y: 0 }}
  4190. bordered
  4191. size="small"
  4192. />
  4193. <Col
  4194. span={24}
  4195. offset={9}
  4196. style={{ marginTop: "15px" }}
  4197. ></Col>
  4198. </Form>
  4199. </Spin>
  4200. </div>
  4201. </div>
  4202. <div className="clearfix">
  4203. <FormItem
  4204. style={{ height: "auto" }}
  4205. labelCol={{ span: 4 }}
  4206. wrapperCol={{ span: 18 }}
  4207. label="变更原因"
  4208. >
  4209. {/* {!this.state.mark ? ( */}
  4210. <TextArea
  4211. rows={4}
  4212. placeholder="请输入变更原因"
  4213. ref="signTotalAmount"
  4214. style={{ width: "95%" }}
  4215. value={this.state.remarksC}
  4216. onChange={e => {
  4217. this.setState({
  4218. remarksC: e.target.value
  4219. });
  4220. }}
  4221. />
  4222. {/* ) : (
  4223. <span>{contractData.remarks}</span>
  4224. )} */}
  4225. </FormItem>
  4226. </div>
  4227. <div className="clearfix">
  4228. <FormItem
  4229. style={{ height: "auto" }}
  4230. labelCol={{ span: 4 }}
  4231. wrapperCol={{ span: 18 }}
  4232. label="备注"
  4233. >
  4234. {/* {!this.state.mark ? ( */}
  4235. <TextArea
  4236. rows={4}
  4237. placeholder="请输入备注"
  4238. ref="signTotalAmount"
  4239. style={{ width: "95%" }}
  4240. value={this.state.startRemarks}
  4241. onChange={e => {
  4242. this.setState({
  4243. startRemarks: e.target.value
  4244. });
  4245. }}
  4246. />
  4247. {/* ) : (
  4248. <span>{contractData.startRemarks}</span>
  4249. )} */}
  4250. </FormItem>
  4251. </div>
  4252. {/* ---- */}
  4253. <div className="clearfix">
  4254. <FormItem
  4255. labelCol={{ span: 4 }}
  4256. wrapperCol={{ span: 18 }}
  4257. label="变更凭证"
  4258. >
  4259. {/* {!this.state.mark ? ( */}
  4260. <PicturesWall
  4261. fileList={this.getVoucherUrl}
  4262. pictureUrl={this.state.voucherUrl}
  4263. url="/api/admin/orderChange/uploadFile"
  4264. sign="order_change_file"
  4265. />
  4266. {/* ) : (
  4267. <div>
  4268. <Upload
  4269. className="demandDetailShow-upload"
  4270. listType="picture-card"
  4271. fileList={this.state.voucherUrl}
  4272. onPreview={file => {
  4273. this.setState({
  4274. previewImage:
  4275. file.url || file.thumbUrl,
  4276. previewVisible: true
  4277. });
  4278. }}
  4279. />
  4280. <Modal
  4281. maskClosable={false}
  4282. footer={null}
  4283. visible={this.state.previewVisible}
  4284. onCancel={() => {
  4285. this.setState({
  4286. previewVisible: false
  4287. });
  4288. }}
  4289. >
  4290. <img
  4291. alt=""
  4292. style={{ width: "100%" }}
  4293. src={this.state.previewImage || ""}
  4294. />
  4295. </Modal>
  4296. </div>
  4297. )} */}
  4298. <p>图片建议:要清晰。</p>
  4299. </FormItem>
  4300. </div>
  4301. {/* {!this.state.mark ? ( */}
  4302. <div className="clearfix">
  4303. <Button
  4304. type="primary"
  4305. style={{ float: "right", marginRight: 40 }}
  4306. // onClick={this.changeApply}
  4307. onClick={e => {
  4308. if (this.state.isCaoGao) {
  4309. this.submitChange();
  4310. } else {
  4311. this.changeApply();
  4312. }
  4313. }}
  4314. >
  4315. {this.state.isCaoGao
  4316. ? "发起变更申请"
  4317. : this.state.typeChange == 0
  4318. ? "发起变更申请"
  4319. : "下一步"}
  4320. </Button>
  4321. </div>
  4322. {/* ) : (
  4323. ""
  4324. )} */}
  4325. </div>
  4326. }
  4327. </TabPane>
  4328. {this.state.isJilu ? (
  4329. <TabPane tab={"最近变更记录"} key="3">
  4330. <div>
  4331. <div className="clearfix">
  4332. <FormItem
  4333. className="half-item"
  4334. {...formItemLayout}
  4335. label="客户名称"
  4336. >
  4337. <span>{this.state.userName}</span>
  4338. </FormItem>
  4339. </div>
  4340. <div className="clearfix">
  4341. <FormItem
  4342. className="half-item"
  4343. {...formItemLayout}
  4344. label="合同编号"
  4345. >
  4346. <span>{this.state.contractNo}</span>
  4347. </FormItem>
  4348. </div>
  4349. <div className="clearfix">
  4350. <FormItem
  4351. className="half-item"
  4352. {...formItemLayout}
  4353. label="申请变更部门"
  4354. >
  4355. <span>{this.state.depName}</span>
  4356. </FormItem>
  4357. <FormItem
  4358. className="half-item"
  4359. {...formItemLayout}
  4360. label="申请人"
  4361. >
  4362. <span>{this.state.salesmanName}</span>
  4363. </FormItem>
  4364. </div>
  4365. <div className="clearfix">
  4366. <FormItem
  4367. labelCol={{ span: 4 }}
  4368. wrapperCol={{ span: 18 }}
  4369. label="变更类型"
  4370. >
  4371. <span>
  4372. {getChangeType(
  4373. this.state.detailChange.typeChange
  4374. )}
  4375. </span>
  4376. </FormItem>
  4377. </div>
  4378. <div className="clearfix">
  4379. <FormItem
  4380. labelCol={{ span: 4 }}
  4381. wrapperCol={{ span: 18 }}
  4382. label="合同额(万元)"
  4383. >
  4384. <span>
  4385. {this.state.detailChange.totalAmount}
  4386. </span>
  4387. </FormItem>
  4388. <FormItem
  4389. labelCol={{ span: 4 }}
  4390. wrapperCol={{ span: 18 }}
  4391. label="已收款(万元)"
  4392. >
  4393. <span>
  4394. {this.state.detailChange.settlementAmount}
  4395. </span>
  4396. </FormItem>
  4397. <FormItem
  4398. labelCol={{ span: 4 }}
  4399. wrapperCol={{ span: 18 }}
  4400. label="申请退款(万元)"
  4401. >
  4402. <span>
  4403. {this.state.detailChange.changeAmount}
  4404. </span>
  4405. </FormItem>
  4406. </div>
  4407. {/* 动态展示项目以及催款节点 */}
  4408. <div>
  4409. <div>
  4410. <span
  4411. style={{
  4412. marginLeft: "50px",
  4413. fontSize: "20px"
  4414. }}
  4415. >
  4416. 项目业务
  4417. </span>
  4418. </div>
  4419. <div
  4420. className="patent-table"
  4421. style={{ marginBottom: 10 }}
  4422. >
  4423. <Spin spinning={this.state.loading}>
  4424. <Table
  4425. columns={this.state.proColumns}
  4426. dataSource={this.state.proDataSource}
  4427. pagination={this.state.pagination}
  4428. // onRowClick={this.tableRowClick}
  4429. bordered
  4430. size="small"
  4431. />
  4432. </Spin>
  4433. </div>
  4434. <div>
  4435. <span
  4436. style={{
  4437. marginLeft: "50px",
  4438. fontSize: "20px"
  4439. }}
  4440. >
  4441. 催款节点
  4442. </span>
  4443. {/* <span
  4444. style={{
  4445. display: "inline-block",
  4446. marginLeft: 10,
  4447. color: "red"
  4448. }}
  4449. >
  4450. 金额总计(万元): {this.state.totalCui}
  4451. </span> */}
  4452. </div>
  4453. <div className="clearfix">
  4454. <Spin spinning={this.state.loading}>
  4455. <Form layout="horizontal">
  4456. <Table
  4457. pagination={false}
  4458. columns={this.state.changeCuiList}
  4459. dataSource={this.state.cuiDataSource}
  4460. scroll={{ x: "max-content", y: 0 }}
  4461. bordered
  4462. size="small"
  4463. />
  4464. <Col
  4465. span={24}
  4466. offset={9}
  4467. style={{ marginTop: "15px" }}
  4468. ></Col>
  4469. </Form>
  4470. </Spin>
  4471. </div>
  4472. </div>
  4473. <div className="clearfix">
  4474. <FormItem
  4475. style={{ height: "auto" }}
  4476. labelCol={{ span: 4 }}
  4477. wrapperCol={{ span: 18 }}
  4478. label="变更原因"
  4479. >
  4480. <span>{this.state.detailChange.remarksC}</span>
  4481. </FormItem>
  4482. </div>
  4483. <div className="clearfix">
  4484. <FormItem
  4485. style={{ height: "auto" }}
  4486. labelCol={{ span: 4 }}
  4487. wrapperCol={{ span: 18 }}
  4488. label="备注"
  4489. >
  4490. <span>
  4491. {this.state.detailChange.startRemarks}
  4492. </span>
  4493. </FormItem>
  4494. </div>
  4495. {/* ---- */}
  4496. <div className="clearfix">
  4497. <FormItem
  4498. labelCol={{ span: 4 }}
  4499. wrapperCol={{ span: 18 }}
  4500. label="变更凭证"
  4501. >
  4502. <div>
  4503. <Upload
  4504. className="demandDetailShow-upload"
  4505. listType="picture-card"
  4506. fileList={
  4507. this.state.detailChange.voucherUrl
  4508. }
  4509. onPreview={file => {
  4510. this.setState({
  4511. previewImage: file.url || file.thumbUrl,
  4512. previewVisible: true
  4513. });
  4514. }}
  4515. />
  4516. <Modal
  4517. maskClosable={false}
  4518. footer={null}
  4519. visible={this.state.previewVisible}
  4520. onCancel={() => {
  4521. this.setState({
  4522. previewVisible: false
  4523. });
  4524. }}
  4525. >
  4526. <img
  4527. alt=""
  4528. style={{ width: "100%" }}
  4529. src={this.state.previewImage || ""}
  4530. />
  4531. </Modal>
  4532. </div>
  4533. </FormItem>
  4534. </div>
  4535. </div>
  4536. </TabPane>
  4537. ) : (
  4538. ""
  4539. )}
  4540. </Tabs>
  4541. )}
  4542. </div>
  4543. </Spin>
  4544. </Form>
  4545. </Modal>
  4546. <Modal
  4547. maskClosable={false}
  4548. visible={this.state.addnextVisible}
  4549. onOk={this.nextCancel}
  4550. onCancel={this.nextCancel}
  4551. width="800px"
  4552. title={this.state.addState ? "添加项目任务" : "项目任务详情"}
  4553. footer=""
  4554. className="admin-desc-content"
  4555. >
  4556. <Form
  4557. layout="horizontal"
  4558. onSubmit={this.nextSubmit}
  4559. // id="demand-form"
  4560. >
  4561. <Spin spinning={this.state.loading}>
  4562. {this.state.addState ? (
  4563. <div className="clearfix">
  4564. <FormItem
  4565. className="half-item"
  4566. {...formItemLayout}
  4567. label="服务名称"
  4568. >
  4569. <AutoComplete
  4570. className="certain-category-search"
  4571. dropdownClassName="certain-category-search-dropdown"
  4572. dropdownMatchSelectWidth={false}
  4573. dropdownStyle={{ width: 200 }}
  4574. style={{ width: "200px" }}
  4575. dataSource={options}
  4576. placeholder="输入服务名称"
  4577. value={this.state.commodityName}
  4578. onChange={this.httpChange}
  4579. filterOption={true}
  4580. onSelect={this.selectAuto}
  4581. >
  4582. <Input />
  4583. </AutoComplete>
  4584. <span className="mandatory">*</span>
  4585. </FormItem>
  4586. <FormItem
  4587. className="half-item"
  4588. {...formItemLayout}
  4589. label="服务数量"
  4590. >
  4591. <Input
  4592. placeholder="请输入服务数量"
  4593. value={this.state.commodityQuantity}
  4594. style={{ width: "200px" }}
  4595. onChange={e => {
  4596. this.setState({ commodityQuantity: e.target.value });
  4597. }}
  4598. ref="commodityQuantity"
  4599. />
  4600. <span className="mandatory">*</span>
  4601. </FormItem>
  4602. <FormItem
  4603. className="half-item"
  4604. {...formItemLayout}
  4605. label="实签价格(万元)"
  4606. >
  4607. <Input
  4608. placeholder="请输入实签价格"
  4609. value={this.state.commodityPrice}
  4610. style={{ width: "200px" }}
  4611. onChange={e => {
  4612. this.setState({ commodityPrice: e.target.value });
  4613. }}
  4614. ref="commodityPrice"
  4615. />
  4616. <span className="mandatory">*</span>
  4617. </FormItem>
  4618. <FormItem
  4619. className="half-item"
  4620. {...formItemLayout}
  4621. label="主要业务"
  4622. >
  4623. <Select
  4624. placeholder="选择是否为主要业务"
  4625. style={{ width: "200px" }}
  4626. value={this.state.main}
  4627. onChange={e => {
  4628. this.setState({ main: e });
  4629. }}
  4630. >
  4631. {boutique.map(function(item) {
  4632. return (
  4633. <Select.Option key={item.value}>
  4634. {item.key}
  4635. </Select.Option>
  4636. );
  4637. })}
  4638. </Select>
  4639. <span className="mandatory">*</span>
  4640. </FormItem>
  4641. <div className="clearfix">
  4642. <FormItem
  4643. labelCol={{ span: 4 }}
  4644. wrapperCol={{ span: 16 }}
  4645. label="服务说明"
  4646. >
  4647. <Input
  4648. type="textarea"
  4649. placeholder="请输入服务说明"
  4650. value={this.state.taskComment}
  4651. onChange={e => {
  4652. this.setState({ taskComment: e.target.value });
  4653. }}
  4654. />
  4655. </FormItem>
  4656. </div>
  4657. <FormItem
  4658. wrapperCol={{ span: 12, offset: 4 }}
  4659. className="half-middle"
  4660. >
  4661. <Button
  4662. className="submitSave"
  4663. type="primary"
  4664. htmlType="submit"
  4665. >
  4666. 保存
  4667. </Button>
  4668. <Button
  4669. className="submitSave"
  4670. type="ghost"
  4671. onClick={this.nextCancel}
  4672. >
  4673. 取消
  4674. </Button>
  4675. </FormItem>
  4676. </div>
  4677. ) : (
  4678. <div className="clearfix">
  4679. {this.state.processStatus == 0 ? (
  4680. <div className="clearfix">
  4681. <FormItem
  4682. className="half-item"
  4683. {...formItemLayout}
  4684. label="项目名称"
  4685. >
  4686. <span>{this.state.commodityName}</span>
  4687. </FormItem>
  4688. <FormItem
  4689. className="half-item"
  4690. {...formItemLayout}
  4691. label="项目数量"
  4692. >
  4693. <Input
  4694. placeholder="请输入数量"
  4695. value={this.state.commodityQuantity}
  4696. style={{ width: "200px" }}
  4697. onChange={e => {
  4698. this.setState({
  4699. commodityQuantity: e.target.value
  4700. });
  4701. }}
  4702. />
  4703. <span className="mandatory">*</span>
  4704. </FormItem>
  4705. <FormItem
  4706. className="half-item"
  4707. {...formItemLayout}
  4708. label="金额(万元)"
  4709. >
  4710. <Input
  4711. placeholder="请输入签单金额"
  4712. value={this.state.commodityPrice}
  4713. style={{ width: "200px" }}
  4714. onChange={e => {
  4715. this.setState({ commodityPrice: e.target.value });
  4716. }}
  4717. />
  4718. <span className="mandatory">*</span>
  4719. </FormItem>
  4720. <FormItem
  4721. className="half-item"
  4722. {...formItemLayout}
  4723. label="主要项目"
  4724. >
  4725. <Select
  4726. placeholder="选择是否为主要业务"
  4727. style={{ width: "200px" }}
  4728. value={this.state.main}
  4729. onChange={e => {
  4730. this.setState({ main: e });
  4731. }}
  4732. >
  4733. {boutique.map(function(item) {
  4734. return (
  4735. <Select.Option key={item.value}>
  4736. {item.key}
  4737. </Select.Option>
  4738. );
  4739. })}
  4740. </Select>
  4741. <span className="mandatory">*</span>
  4742. </FormItem>
  4743. <div className="clearfix">
  4744. <FormItem
  4745. labelCol={{ span: 4 }}
  4746. wrapperCol={{ span: 16 }}
  4747. label="服务说明"
  4748. >
  4749. <Input
  4750. type="textarea"
  4751. placeholder="请输入服务说明"
  4752. value={this.state.taskComment}
  4753. onChange={e => {
  4754. this.setState({ taskComment: e.target.value });
  4755. }}
  4756. />
  4757. </FormItem>
  4758. </div>
  4759. <FormItem
  4760. wrapperCol={{ span: 12, offset: 4 }}
  4761. className="half-middle"
  4762. >
  4763. <Button
  4764. className="submitSave"
  4765. type="primary"
  4766. onClick={this.tabRowSave}
  4767. >
  4768. 保存
  4769. </Button>
  4770. <Button
  4771. className="submitSave"
  4772. type="ghost"
  4773. onClick={this.nextCancel}
  4774. >
  4775. 取消
  4776. </Button>
  4777. </FormItem>
  4778. </div>
  4779. ) : (
  4780. <div className="clearfix">
  4781. <FormItem
  4782. className="half-item"
  4783. {...formItemLayout}
  4784. label="项目名称"
  4785. >
  4786. <span>{this.state.commodityName}</span>
  4787. </FormItem>
  4788. <FormItem
  4789. className="half-item"
  4790. {...formItemLayout}
  4791. label="项目数量"
  4792. >
  4793. <span>{this.state.commodityQuantity}</span>
  4794. </FormItem>
  4795. <FormItem
  4796. className="half-item"
  4797. {...formItemLayout}
  4798. label="金额(万元)"
  4799. >
  4800. <span>{this.state.commodityPrice}</span>
  4801. </FormItem>
  4802. <FormItem
  4803. className="half-item"
  4804. {...formItemLayout}
  4805. label="主要项目"
  4806. >
  4807. <span>{getboutique(this.state.main)}</span>
  4808. </FormItem>
  4809. <div className="clearfix">
  4810. <FormItem
  4811. labelCol={{ span: 4 }}
  4812. wrapperCol={{ span: 16 }}
  4813. label="服务说明"
  4814. >
  4815. <span>{this.state.taskComment}</span>
  4816. </FormItem>
  4817. </div>
  4818. </div>
  4819. )}
  4820. </div>
  4821. )}
  4822. </Spin>
  4823. </Form>
  4824. </Modal>
  4825. <Modal
  4826. maskClosable={false}
  4827. visible={this.state.changeVisible}
  4828. onOk={this.nextCancel}
  4829. onCancel={this.nextCancel}
  4830. width="800px"
  4831. title={"添加变更项目"}
  4832. footer=""
  4833. className="admin-desc-content"
  4834. >
  4835. <Form
  4836. layout="horizontal"
  4837. // id="demand-form"
  4838. >
  4839. <Spin spinning={this.state.loading}>
  4840. <div className="clearfix">
  4841. <FormItem
  4842. className="half-item"
  4843. {...formItemLayout}
  4844. label="服务名称"
  4845. >
  4846. <AutoComplete
  4847. className="certain-category-search"
  4848. dropdownClassName="certain-category-search-dropdown"
  4849. dropdownMatchSelectWidth={false}
  4850. dropdownStyle={{ width: 200 }}
  4851. style={{ width: "200px" }}
  4852. dataSource={options}
  4853. placeholder="输入服务名称"
  4854. value={this.state.commodityName}
  4855. onChange={this.httpChange}
  4856. filterOption={true}
  4857. onSelect={this.selectAuto}
  4858. >
  4859. <Input />
  4860. </AutoComplete>
  4861. <span className="mandatory">*</span>
  4862. </FormItem>
  4863. <FormItem
  4864. className="half-item"
  4865. {...formItemLayout}
  4866. label="服务数量"
  4867. >
  4868. <Input
  4869. placeholder="请输入服务数量"
  4870. value={this.state.commodityQuantity}
  4871. style={{ width: "200px" }}
  4872. onChange={e => {
  4873. this.setState({ commodityQuantity: e.target.value });
  4874. }}
  4875. ref="commodityQuantity"
  4876. />
  4877. <span className="mandatory">*</span>
  4878. </FormItem>
  4879. <FormItem
  4880. className="half-item"
  4881. {...formItemLayout}
  4882. label="实签价格(万元)"
  4883. >
  4884. <Input
  4885. placeholder="请输入实签价格"
  4886. value={this.state.commodityPrice}
  4887. style={{ width: "200px" }}
  4888. onChange={e => {
  4889. this.setState({ commodityPrice: e.target.value });
  4890. }}
  4891. ref="commodityPrice"
  4892. />
  4893. <span className="mandatory">*</span>
  4894. </FormItem>
  4895. <FormItem
  4896. className="half-item"
  4897. {...formItemLayout}
  4898. label="主要业务"
  4899. >
  4900. <Select
  4901. placeholder="选择是否为主要业务"
  4902. style={{ width: "200px" }}
  4903. value={this.state.main}
  4904. onChange={e => {
  4905. this.setState({ main: e });
  4906. }}
  4907. >
  4908. {boutique.map(function(item) {
  4909. return (
  4910. <Select.Option key={item.value}>
  4911. {item.key}
  4912. </Select.Option>
  4913. );
  4914. })}
  4915. </Select>
  4916. <span className="mandatory">*</span>
  4917. </FormItem>
  4918. <div className="clearfix">
  4919. <FormItem
  4920. labelCol={{ span: 4 }}
  4921. wrapperCol={{ span: 16 }}
  4922. label="服务说明"
  4923. >
  4924. <Input
  4925. type="textarea"
  4926. placeholder="请输入服务说明"
  4927. value={this.state.taskComment}
  4928. onChange={e => {
  4929. this.setState({ taskComment: e.target.value });
  4930. }}
  4931. />
  4932. </FormItem>
  4933. </div>
  4934. <FormItem
  4935. wrapperCol={{ span: 12, offset: 4 }}
  4936. className="half-middle"
  4937. >
  4938. <Button
  4939. className="submitSave"
  4940. type="primary"
  4941. onClick={this.changeProSubmit}
  4942. >
  4943. 保存
  4944. </Button>
  4945. <Button
  4946. className="submitSave"
  4947. type="ghost"
  4948. onClick={this.nextCancel}
  4949. >
  4950. 取消
  4951. </Button>
  4952. </FormItem>
  4953. </div>
  4954. </Spin>
  4955. </Form>
  4956. </Modal>
  4957. <Modal
  4958. maskClosable={false}
  4959. visible={this.state.lookVisible}
  4960. onOk={this.noCancel}
  4961. onCancel={this.noCancel}
  4962. width="800px"
  4963. title={"退单申请"}
  4964. footer=""
  4965. className="admin-desc-content"
  4966. >
  4967. <Form layout="horizontal">
  4968. <Spin spinning={this.state.loading}>
  4969. <div className="clearfix">
  4970. <FormItem
  4971. labelCol={{ span: 4 }}
  4972. wrapperCol={{ span: 16 }}
  4973. label="终止合同"
  4974. >
  4975. <Picture
  4976. fileList={e => {
  4977. this.setState({ contractUrl: e });
  4978. }}
  4979. pictureUrl={this.state.contractUrl}
  4980. visible={this.props.visible}
  4981. data={{
  4982. sign: "order_refund_file",
  4983. url: "/api/admin/newOrder/uploadRefundOrderFile",
  4984. number: 8
  4985. }}
  4986. />
  4987. </FormItem>
  4988. </div>
  4989. <div className="clearfix">
  4990. <FormItem
  4991. labelCol={{ span: 4 }}
  4992. wrapperCol={{ span: 16 }}
  4993. label="退单申请表"
  4994. >
  4995. <Picture
  4996. fileList={e => {
  4997. this.setState({ applicationUrl: e });
  4998. }}
  4999. pictureUrl={this.state.applicationUrl}
  5000. visible={this.props.visible}
  5001. data={{
  5002. sign: "order_refund_file",
  5003. url: "/api/admin/newOrder/uploadRefundOrderFile",
  5004. number: 8
  5005. }}
  5006. />
  5007. </FormItem>
  5008. </div>
  5009. <div className="clearfix">
  5010. <FormItem
  5011. labelCol={{ span: 4 }}
  5012. wrapperCol={{ span: 16 }}
  5013. label="退单理由"
  5014. >
  5015. <Input
  5016. type="textarea"
  5017. placeholder="请输入退单理由"
  5018. rows={4}
  5019. value={this.state.reason}
  5020. onChange={e => {
  5021. this.setState({ reason: e.target.value });
  5022. }}
  5023. />
  5024. </FormItem>
  5025. </div>
  5026. <div className="clearfix">
  5027. <Button
  5028. className="cancel"
  5029. type="primary"
  5030. onClick={this.tuidanOk}
  5031. style={{ marginLeft: "50px" }}
  5032. htmlType="submit"
  5033. >
  5034. 确定退单
  5035. </Button>
  5036. <Button
  5037. className="cancel"
  5038. type="ghost"
  5039. onClick={this.noCancel}
  5040. style={{ marginLeft: "50px" }}
  5041. >
  5042. 取消
  5043. </Button>
  5044. </div>
  5045. </Spin>
  5046. </Form>
  5047. </Modal>
  5048. <OrderRiZi
  5049. dataSourcerizhi={this.state.dataSourcerizhi}
  5050. closeOrderLog={this.closeOrderLog}
  5051. visible={this.state.rizhivisible}
  5052. loading={this.state.loading}
  5053. />
  5054. </div>
  5055. );
  5056. }
  5057. })
  5058. );
  5059. export default Form.create()(NewService);